Repository navigation
fix(web): a long press on an agent pill keeps its menu open on touch - #1050
Merged
Merged
Conversation
On a touch screen, a long press on an agent pill in the model menu opened its menu, and lifting the finger closed it again, so there was no way to rename or remove an agent on a phone. The menu comes up under the finger that is still holding the pill. When the finger lifts, the browser follows it with a mouse press at that spot, which now lands outside the menu, and the menu took it for a tap elsewhere. The pill now cancels that close while the holding finger is down and for 400ms after it lifts. Later taps outside still close the menu. A new press on the open menu ends the hold, so a slow tap on Rename or Remove is still not timed as another hold on the pill. The new browser test drives real touches through the devtools protocol: faked pointer events don't send the mouse press that follows a lifted finger, which is how this passed before.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
The test drove real touches through the devtools protocol, which puts the whole test browser in touch mode for a while. On the PR's CI run a hover test in another file (MessagesTimeline, "exposes a branch action on completed assistant messages") failed a minute later in the same shard. It passes locally in the same tab right after this test, so the link is not proven, but that test has not failed in other recent runs. The test now dispatches the same sequence itself: touch pointer events on the held element, then the mouse press and click on whatever is under the finger by then. It still fails on the old code and leaves the browser's input mode alone.
This branch was previously deployed
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.
Follow-up to #1048. On a touch screen, a long press on an agent pill in the model menu opened its menu, and lifting the finger closed it again. A phone had no way to rename or remove an agent.
The menu comes up under the finger that is still holding the pill. When the finger lifts, the browser follows it with a mouse press at that spot. That press now lands outside the menu, and the menu took it for a tap elsewhere.
The pill now cancels that close while the holding finger is down and for 400ms after it lifts. Later taps outside still close the menu. A new press on the open menu ends the hold, so a slow tap on Rename or Remove is still not timed as another hold on the pill.
The new browser test replays what a phone sends in the phone drawer: touch pointer events on the held element, then the mouse press and click on whatever is under the finger by then. It checks that a long press opens the menu and it stays open, a tap outside closes only the menu, and a slow tap on Rename opens the focused name box. It fails on main. The behavior was also checked once by hand with real touches through the devtools protocol.
The first version of the test used those real touches. On its CI run a hover test in another file failed in the same shard, so the test no longer puts the browser in touch mode. The link is not proven.
Not checked on a real phone. Known and left alone: a menu opened by touch, then Escape on a hardware keyboard, closes the drawer too.