GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||
GeezerVison is showing github.com — feat(app): add a touch dock to the mobile composer by Hona · Pull Request #61773 · anomalyco/opencode Conversation
|
| Before | After |
|---|---|
![]() |
![]() |
![]() |
![]() |
Every state on an iPhone-sized WebKit viewport:
(hover: none) and (pointer: coarse), so phones and tablets get the dock at any width. A narrow desktop window with a mouse keeps the desktop toolbar and Enter to send.+ attach, / commands, @ context, ! shell, then the primary action. Every target is at least 44px, and taps keep the editor focused so the keyboard stays up.composer-touch-bar-mount slot below main, and the composer portals the dock into it. The dock pads itself for the home indicator, so main drops its safe-area padding while it is docked. Without a slot (stories), the dock renders under the composer.insertParagraph, which wrapped the next line in a <div> that the parser joined without a newline. beforeinput now converts it to the insertLineBreak that Shift+Enter produces, so the editor stays one flat run of text, mentions and <br>s.compositionend, so isComposing is false. Its keyCode 229 now keeps that Enter from sending on any device.flowchart LR
K[keydown Enter] --> T{touch?}
T -- "no" --> D[desktop: send, Mod+Enter alternate]
T -- "yes, Cmd/Ctrl held" --> P[primary action]
T -- "yes, plain" --> B[beforeinput insertParagraph]
B --> L[execCommand insertLineBreak]
Dock[dock button] --> P
onBeforeInput={(event) => { if (event.inputType !== "insertParagraph") return event.preventDefault() document.execCommand("insertLineBreak") }}
composer-touch.stories.tsx mounts the real composer in every state behind a native picker, for checking on a device.<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none"> <style> .dock { animation: rise 3s ease-in-out infinite; } @keyframes rise { 0%, 15% { transform: translateY(26px); opacity: 0 } 35%, 85% { transform: none; opacity: 1 } 100% { transform: translateY(26px); opacity: 0 } } @media (prefers-reduced-motion: reduce) { .dock { animation: none } } </style> <rect x="16" y="6" width="208" height="30" rx="8" stroke="currentColor" stroke-opacity=".35"/> <rect x="26" y="15" width="96" height="4" rx="2" fill="currentColor" fill-opacity=".5"/> <rect x="26" y="24" width="44" height="4" rx="2" fill="currentColor" fill-opacity=".25"/> <g class="dock"> <line x1="0" y1="44.5" x2="240" y2="44.5" stroke="currentColor" stroke-opacity=".25"/> <text x="16" y="62" font-family="ui-monospace,monospace" font-size="11" fill="currentColor" fill-opacity=".5">+ / @ !</text> <rect x="128" y="50" width="44" height="18" rx="6" stroke="currentColor" stroke-opacity=".4"/> <text x="135" y="63" font-family="system-ui,sans-serif" font-size="10" fill="currentColor" fill-opacity=".8">Queue</text> <rect x="178" y="50" width="48" height="18" rx="6" fill="currentColor" fill-opacity=".85"/> <text x="185" y="63" font-family="system-ui,sans-serif" font-size="10" fill="currentColor" fill-opacity="1" style="mix-blend-mode:difference">Steer ↑</text> </g> </svg>
Added by the opencode bot (AI-generated).
Fixes #55549
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I found no blocking problems. I ran it in an emulated touch phone (390×844, hasTouch, isMobile). On the base branch, Return sends the first line. With this PR, Return adds a line and the dock's Send button sends the prompt with both lines. The new composer and session-queue touch tests, the IME test and mobile-composer-submit-focus.spec.ts pass. bun run typecheck doesn't run here (bun check isn't available on this bun version), but typecheck:tsc passes for packages/app.
Public API: unchanged. This only changes the app UI.
One concern, in an inline comment: where the dock goes when the mobile titlebar is set to the bottom.
Fixes #55549
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| <CollapsedSidebarToggle /> | ||
| </div> | ||
| {/* On touch devices the active composer moves its actions here: the bottom edge, or the top of the keyboard. */} | ||
| <div data-slot="composer-touch-bar-mount" class="shrink-0" /> |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
With mobileTitlebarPosition: "bottom", the titlebar is order-last, so this slot renders above it. The dock ends up between the session panel and the titlebar, and the titlebar sits between the dock and the keyboard. Both also pad for the home indicator, so with the keyboard closed the inset is added twice. I confirmed the placement with that setting on a 390px touch viewport. Could the dock either go below the titlebar or skip its own safe-area padding when the titlebar is at the bottom?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in f3fbf4e. The slot is now order-last after the titlebar, so the dock stays on the bottom edge (the top of the keyboard) below a bottom titlebar. While docked, the dock pads for the home indicator and sets --shell-safe-area-bottom: 0px, which main and the bottom titlebar now read, so the inset is no longer added twice. mobile-composer-submit-focus.spec.ts asserts the placement with the bottom titlebar and fails on the previous order.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
f3fbf4e fixes the issue I raised.
composer-touch-bar-mount is order-last now. The bottom titlebar is also order-last, but it comes earlier in the DOM, so the dock ends up on the bottom edge, below the titlebar.main's padding-bottom, the bottom titlebar's padding-bottom and its inner pb-[max(0px, 8px - inset)] all read --shell-safe-area-bottom now. When the dock is docked it sets that variable to 0px, so the titlebar drops to 28px of content plus 8px padding, and only the dock pads for the home indicator.What I ran: mobile-composer-submit-focus.spec.ts on chromium at pr/head, in a throwaway worktree. All 4 tests passed. The first cold run failed once on the 390px LTR desktop-pointer case, then passed on the rerun, so it looks like dev-server warmup. With order-last removed from the slot, the touch test fails as you said: the dock's y is 750, expected ≥ 843. Headless Chromium reports a safe-area inset of 0, so the inset was checked only by reading the code, not on a device.
A remaining gap with the top titlebar (also present in 06ddead): --shell-bottom-inset in shell.tsx:221-223 still reads the raw safe area, as max(0px, 8px - inset). On a notched iPhone with the dock docked, main's padding is now 0 and that value also comes out to 0. The session panel's bottom border then sits directly against the dock with no gap. Making it read --shell-safe-area-bottom restores the 8px:
- : "max(0px, calc(8px - var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))))", + : "max(0px, calc(8px - var(--shell-safe-area-bottom, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))))",
I didn't change anything in repo/, and I removed the temporary worktree.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The earlier point about the bottom titlebar is fixed. The dock's mount is now order-last, below a bottom titlebar, and the titlebar stops padding for the home indicator while the dock is mounted. I checked this on a 390px touch viewport with the titlebar at the bottom: the dock now sits below the titlebar. mobile-composer-submit-focus.spec.ts (with its new placement check) and the touch and IME tests in the composer and session-queue specs pass. typecheck:tsc passes for packages/app.
Public API: unchanged. I found nothing new worth raising.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
After updating to v2.3.0, I can no longer send messages using my phone’s on-screen Enter/Return key in the web UI. I now have to tap the webpage’s Send button, which interrupts my usual typing flow. I understand the motivation to fix inconsistent iOS Return behavior, but could you add an “Enter to send” preference so users can restore the previous behavior? Enter-to-send was working well for me before this update. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
web: on mobile, Enter submits the prompt and no newline can be inserted
There was an error while loading. Please reload this page.