Repository navigation
Open message actions with a long press on touch screens in V2 - #1971
Merged
Paul Lizer (paullizer) merged 1 commit intoNov 20, 2026
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/codeand 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: newonSheetDoneprop. In the sheet, eachIconButtonbecomes 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: oneactionPropsobject feeds both the hover row and the sheet, so they can't drift apart. The long press is wired intoMessageBubbleInnerandImageMessage.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 --noEmitandvite buildpassfunctional_tests/test_v2_chat_message_touch_sheet.pypasses. It covers touch-only detection, ignored targets, portal event isolation, reuse ofMessageActions, the unchanged hover row, and dismissal.test_v2_message_actions.py::test_plan_replay_uses_the_message_action_rowupdated for the sharedactionPropsand passesMessageActions.tsxorMessageList.tsxgive the same results as on unmodifiedDevelopment. 20 failures there are not caused by this change.MessageListat 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.🤖 Generated with Claude Code