Skip to content

Open message actions with a long press on touch screens in V2 - #1971

Merged
Paul Lizer (paullizer) merged 1 commit into
Developmentfrom
claude/touch-message-menu-7cc7c9
Nov 20, 2026
Merged

Paul Lizer (paullizer) merged 1 commit into
Developmentfrom
claude/touch-message-menu-7cc7c9

Conversation

@paullizer

Copy link
Copy Markdown
Contributor

Summary

In the V2 chat, a message's action row only appears on hover, so on a phone or tablet it never shows. Pressing and holding a message (or a generated image) for about half a second now opens the same actions in a bottom sheet. The hover row on desktop is unchanged, so nothing new is on screen until a message is held.

  • useLongPress.ts (new): touch-only press-and-hold (450 ms). It cancels on a move over 10 px, a scroll, a second finger or an early lift. Presses that start on links, buttons, fields, summary, pre/code and dialogs keep their own behaviour. It ignores events React bubbles up from the sheet's portal, and swallows the click some browsers send for the lift.
  • MessageActionSheet.tsx (new): the bottom sheet, which renders in a portal. It closes on a backdrop tap, Escape, or a downward swipe. Backdrop taps in the first 600 ms are ignored, so the lift that ends the press can't close it.
  • MessageActions.tsx: new onSheetDone prop. In the sheet, each IconButton becomes a labelled tile and the overflow menu's entries are listed in place, with Delete in red. Every entry closes the sheet after running except Save as prompt, where the sheet closes when the prompt editor does.
  • MessageList.tsx: one actionProps object feeds both the hover row and the sheet, so they can't drift apart. The long press is wired into MessageBubbleInner and ImageMessage.

Uploaded-file cards are not covered; their Open and Use as reference buttons are already visible.

Version 0.261.476. Feature doc: docs/explanation/features/V2_CHAT_MESSAGE_TOUCH_SHEET.md.

Test plan

  • tsc -b --noEmit and vite build pass
  • New functional_tests/test_v2_chat_message_touch_sheet.py passes. It covers touch-only detection, ignored targets, portal event isolation, reuse of MessageActions, the unchanged hover row, and dismissal.
  • test_v2_message_actions.py::test_plan_replay_uses_the_message_action_row updated for the shared actionProps and passes
  • The other functional tests that read MessageActions.tsx or MessageList.tsx give the same results as on unmodified Development. 20 failures there are not caused by this change.
  • Checked the real MessageList at phone size with simulated touch. A tap, a drag, a mouse press and a press on a code block don't open the sheet; a long press does. The lift doesn't close it. Message details opens the inspector and closes the sheet. A user message's sheet includes Edit, and the backdrop closes the sheet.
  • Try on a real iOS and Android device

🤖 Generated with Claude Code

V2 reveals a message's action row only on hover, which never happens on
a phone or tablet. Pressing and holding a message or generated image now
opens the same MessageActions in a bottom sheet: labelled tiles for the
quick actions and the overflow menu's entries listed beneath. The hover
row is unchanged.

The long press is touch only and gives way to scrolling, links, buttons,
fields and code. Events React bubbles up from the sheet's portal are
ignored, and the lift that ends the press cannot close the sheet.

Version 0.261.476.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paullizer
Paul Lizer (paullizer) merged commit 436f108 into Development Nov 20, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant