When a user is running OpenCode on their desktop but monitoring it from their phone, the current UX for handling input prompts (questions, permissions) has several friction points:
- Visibility: The user might not realize the session is blocked waiting for input if they are looking at the "changes" tab or if the prompt is scrolled out of view.
- Touch Targets: While some buttons use
size="large", the custom input textareas and option checkboxes can be hard to tap accurately on mobile. - Keyboard Obscuration: When typing a custom answer on mobile, the virtual keyboard often obscures the prompt context or the submit button.
- Context Switching: Switching between the "session" tab (to answer) and "changes" tab (to review what the agent did before asking) is cumbersome.
Focus on Visibility and Touch Ergonomics for the existing DockPrompt components (SessionQuestionDock and SessionPermissionDock).
When the session is blocked waiting for input, ensure this state is immediately obvious regardless of scroll position or active tab.
- Implementation: Add a sticky banner or floating action button (FAB) at the bottom of the screen (above the composer) on mobile when a prompt is active. Tapping it scrolls to the prompt or switches to the "session" tab if needed.
- Touched Files:
packages/app/src/pages/session.tsx(to add the global indicator based oncomposer.blocked())packages/app/src/pages/session/composer/session-composer-region.tsx(to position it relative to the composer)
Make the entire option row in SessionQuestionDock a larger, more forgiving touch target.
- Implementation: Increase padding on
[data-slot="question-option"]in mobile views. Ensure the custom input textarea expands properly and doesn't require precise tapping to focus. - Touched Files:
packages/ui/src/components/message-part.css(where[data-slot="question-option"]is styled)packages/app/src/pages/session/composer/session-question-dock.tsx
When a new prompt appears, automatically scroll it into view, especially on mobile where screen real estate is limited.
- Implementation: Enhance the
measureoronMountlogic inSessionQuestionDockandSessionPermissionDockto trigger a scroll-into-view if the component is rendered and the viewport is mobile-sized. - Touched Files:
packages/app/src/pages/session/composer/session-question-dock.tsxpackages/app/src/pages/session/composer/session-permission-dock.tsx
- Unit/Component Tests:
- Verify the "Blocked" indicator renders when
composer.blocked()is true. - Verify click handlers on the indicator correctly update the active tab and scroll position.
- Verify the "Blocked" indicator renders when
- E2E Tests (Playwright):
- Create a test simulating a mobile viewport (
isMobile: truein Playwright config). - Trigger a permission prompt.
- Verify the sticky indicator appears.
- Click the indicator and verify the prompt is visible.
- Interact with the larger touch targets.
- Create a test simulating a mobile viewport (
- Start the backend (
bun run --conditions=browser ./src/index.ts serve --port 4096) and frontend (bun dev -- --port 4444). - Open
http://localhost:4444in a desktop browser. - Use Chrome DevTools Device Toolbar (F12 -> Ctrl+Shift+M) to simulate a mobile device (e.g., iPhone 14 Pro).
- Start a session and trigger a command that requires permission (e.g.,
bash ls). - Verify:
- The new sticky "Blocked" indicator appears.
- Tapping it scrolls the permission dock into view.
- The "Allow" / "Deny" buttons are easily tappable.
- Trigger a question prompt (e.g., using a test script or specific agent interaction).
- Verify:
- The options have adequate padding for touch.
- Selecting a custom input option focuses the textarea without the virtual keyboard hiding the context (simulate keyboard by resizing viewport height).