Skip to content

feat(app): Mobile Touch Optimization#18766

Closed
noahbentusi wants to merge 98 commits into
anomalyco:devfrom
noahbentusi:yjh/dev
Closed

feat(app): Mobile Touch Optimization#18766
noahbentusi wants to merge 98 commits into
anomalyco:devfrom
noahbentusi:yjh/dev

Conversation

@noahbentusi

Copy link
Copy Markdown

Summary

This PR optimizes the OpenCode App for mobile/touch devices while preserving the existing desktop experience. It addresses 5 key pain points for mobile users:

  1. Toolbar Overflow - Hidden toolbar buttons are now accessible via an overflow menu on narrow screens
  2. Mobile Panel Fullscreen - Side panels (file tree, review) display fullscreen on mobile instead of split view
  3. Selection Comment - Touch and mouse users can select code and add comments via a floating "+" button
  4. Long-Press File Menu - Touch users can long-press files to add them to the conversation context
  5. Markdown Render Toggle - Markdown files can switch between rendered and source views

Changes

Feature Description
Toolbar Overflow Menu Adds "⋯" menu when width < 768px, containing: Search, Review, File Tree, Open App
Back to Chat Button Adds navigation button on mobile toolbar (first position) to return to chat view
Mobile Panel Fullscreen File tree and review panels become fullscreen overlays on mobile
File View in Panel Opening files from mobile file tree shows content in fullscreen panel
Selection Toolbar Floating "+" button appears near selected text for adding comments
Long-Press Context Menu Long-press/right-click on file items shows "Add to conversation" option
Markdown Toggle Toggle button to switch between rendered and source views for .md files

Files Changed

Path Change
packages/app/src/components/session/toolbar-overflow-menu.tsx New overflow menu component
packages/app/src/components/session/session-header.tsx Mobile toolbar integration
packages/app/src/pages/session/mobile-fullscreen-panel.tsx New fullscreen panel for mobile
packages/app/src/pages/session/file-tabs.tsx Markdown toggle + selection toolbar
packages/app/src/components/file-tree.tsx Context menu for file items
packages/app/src/hooks/use-long-press.ts New hook for long-press detection
packages/app/src/context/layout.tsx Mobile panel state management
packages/ui/src/components/selection-toolbar.tsx Selection toolbar component
packages/app/src/i18n/en.ts English translations
packages/app/src/i18n/zh.ts Chinese translations

Testing

All features tested on mobile viewport (720×1920):

  • ✅ Overflow menu shows hidden toolbar options
  • ✅ Back to chat button returns to chat view
  • ✅ File tree panel opens fullscreen
  • ✅ Clicking file shows content in panel
  • ✅ Selecting code shows "+" button
  • ✅ Clicking "+" opens comment dialog
  • ✅ Long-press/right-click on file shows context menu
  • ✅ Desktop mode (>768px) unaffected

Screenshots

Mobile toolbar with overflow menu and back button visible. File tree in fullscreen mode with file content displayed.

Commits

dd33d456e docs: add mobile touch optimization design spec
d6cc8e394 feat(app): add toolbar overflow menu for mobile responsiveness
4443fca5b feat(app): add mobile fullscreen panel layout for review and file tree
33a425b65 fix(app): address code quality issues in mobile fullscreen panel
c57dbfb03 fix(app): keep mobile panel open when opening files from file tree
10f0bd5dd feat(ui): add touch selection toolbar for comments on mobile
2356ebe3a fix(ui): fix touch selection toolbar to use line selection
700184ab6 feat(app): add long-press context menu to file tree
e280e5e9b feat(app): add markdown render/source toggle
998a79414 fix(app): fix tabs context error in markdown toggle
b8a18c27d feat(app): add 'Back to chat' button to overflow menu
425ffb323 fix(file-tree): use ContextMenu instead of DropdownMenu
9ebdf5635 fix(app): move 'Back to chat' button from overflow menu to toolbar
ab87b60c3 fix(app): move 'Back to chat' button to first position in toolbar
fba58b528 refactor(ui): simplify selection comment to work for both mouse and touch

thdxr and others added 30 commits February 7, 2026 16:44
Add a toggleable auto-accept mode that automatically accepts all incoming
permission requests with a 'once' reply. This is useful for users who want
to streamline their workflow when they trust the agent's actions.

Changes:
- Add permission_auto_accept keybind (default: shift+tab) to config
- Remove default for agent_cycle_reverse (was shift+tab)
- Add auto-accept logic in sync.tsx to auto-reply when enabled
- Add command bar action to toggle auto-accept mode (copy: "Toggle autoaccept permissions")
- Add visual indicator showing 'auto-accept' when active
- Store auto-accept state in KV for persistence across sessions
…rtcut support

Rename 'Toggle autoaccept permissions' to 'Toggle permissions' for clarity
and move the command to the Agent category for better discoverability.
Add permission_auto_accept_toggle keybind to enable keyboard shortcut
toggling of auto-accept mode for permission requests.
…orkflow interruptions while still requiring confirmation for bash commands
…t and message rendering

When the client clock is ahead of the server, user message IDs (generated
client-side) sort after assistant message IDs (generated server-side).
This broke the prompt loop exit check and the UI message pairing logic.

- Extract shouldExitLoop() into a pure function that uses parentID matching
  instead of relying on ID ordering
- Extract findAssistantMessages() with forward+backward scan to handle
  messages sorted out of expected order due to clock skew
- Remove debug console.log statements added during investigation
- Add tests for both extracted functions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t-loop-exit

# Conflicts:
#	packages/ui/src/components/session-turn.tsx
…t-loop-exit

# Conflicts:
#	packages/ui/src/components/session-turn.tsx
…lers

Use Node's createServer for MCP OAuth callback and Codex plugin OAuth
servers instead of Bun.serve, making them work under Node.js.
Use npm-install:${pkg} instead of a global npm-install lock so
concurrent installs of different packages can run in parallel.
When the lockfile exists but .bin is empty or absent, add() would
read the lockfile via loadVirtual() and return early without calling
reify(). Delete the lockfile before calling add() so it proceeds
with a full install.
Replace tsx dependency with explicit 'node' invocation for the
compiled ESLint server. Remove all BUN_BE_BUN env var references
which are no longer needed after the Bun-to-Node migration.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
noahbentusi and others added 23 commits March 23, 2026 17:02
- Add mobilePanel state to layout context for tracking active panel
- Create MobileFullscreenPanel component for mobile fullscreen overlays
- Connect overflow menu items to mobile panel switching
- Panels display as fixed fullscreen overlays on mobile (< 768px)
- Remove unused Icon import
- Remove unused 'session' panel type
- Extract shared panel content rendering to useFileTreePanel hook
On touch devices, show a '+' button near selected text that allows
adding comments. This replaces the hover behavior used on desktop.

- Create TouchSelectionToolbar component in @opencode-ai/ui
- Add useTouchSelection hook to detect text selection on touch devices
- Integrate with file-tabs.tsx to show toolbar on touch devices
- Disable hover utility on touch devices (hover: none)
- Replace DropdownMenu with ContextMenu for file context menu
- Left-click now correctly opens files (original behavior)
- Context menu only appears on right-click (desktop) or long-press (touch)
- Remove unused useLongPress hook and createSignal
- Simplify component by using native ContextMenu behavior
…dering for prompt loop exit and message rendering
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my comprehensive search, I found potential related PRs (not counting PR #18766 itself):

Potentially Related PRs:

  1. fix(app): open inline comments directly on touch devices (PR fix(app): open inline comments directly on touch devices #18529)

  2. feat(app): add preview and source view options for markdown files in file tabs (PR feat(app): add preview and source view options for markdown files in file tabs #13704)

  3. fix(app): comprehensive mobile UX improvements (PR fix(app): comprehensive mobile UX improvements #7989)

    • Addresses mobile UX improvements, which is related to the overall mobile touch optimization theme

However, none of these appear to be direct duplicates. PR #18766 seems to be a comprehensive mobile optimization effort that may complement or supersede some previous efforts, but the search results indicate this is a distinct PR addressing multiple unified mobile/touch improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants