Skip to content

fix(web): snapshot tooltips open at once from adjacent actions - #45182

Closed
only21mil wants to merge 3 commits into
pingdotgg:mainfrom
only21mil:fix/web-snapshot-tooltip-shared-group
Closed

only21mil wants to merge 3 commits into
pingdotgg:mainfrom
only21mil:fix/web-snapshot-tooltip-shared-group

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

Moving from Draw on image to Copy snapshot or No accessibility data leaves the old tooltip lingering while the snapshot button waits a fresh delay. Both stayed on <Tooltip> after #42671.

Change

Switch SnapShotCopyButton and SnapShotContentsButton in SnapShotAttachmentDetails.tsx to <SharedTooltipTrigger>, drop unused Tooltip imports, and keep <PopoverTrigger> forwarding and disabled={copied}. Add a browser test in ExpandedImageDialog.browser.test.tsx.

Scope

Bug fix (missing shared hover timing on snapshot buttons); oversight from #42671, no issue needed.

Verification

An AI agent ran each check below.

Setup: Ubuntu 26.04.1 LTS (Linux 7.0.0-44-generic), dark, 1024×640, isolated data + Replay (dev); Chromium 156.0.8078.4, debugging-port pointer.

Steps: hover Draw on image → Copy snapshot → No accessibility data (clip + 50 ms still); popover & copy on head.

Clean git merge-tree --write-tree onto upstream/main 5873a7a7.

Before (9bd6a895) After (8bd0e81a)
Web: Draw on image lingers at 50 ms.
Web: Draw on image lingers at 50 ms.
Web: shared Copy snapshot tooltip open at 50 ms.
Web: shared Copy snapshot tooltip open at 50 ms.

Links

Not shown

  • Electron shell (wraps apps/web; checked in Chromium).
  • Mobile (no hover tooltips).
  • OS HID input (debugging port).
  • Repo-wide suite/build (CI-owned; check:changed & chat/ passed).
Automated checks and base/head UI observations (9bd6a89 vs 8bd0e81)

Failing-first browser test on unpatched base (9bd6a895, committed ExpandedImageDialog.browser.test.tsx run against unpatched SnapShotAttachmentDetails.tsx; fails when moving from Draw on image to Copy snapshot because SnapShotCopyButton uses standalone <Tooltip> and waits a full hover delay while "Draw on image" lingers):

 FAIL  |@t3tools/web (browser) (chromium)| src/components/chat/ExpandedImageDialog.browser.test.tsx > ExpandedImageDialog > shares hover tooltip timing across snapshot contents, Draw on image, and Copy snapshot
VitestBrowserElementError: Cannot find element with locator: getByText('Copy snapshot')

ARIA tree:
- dialog "Expanded image preview":
  - heading "Expanded image preview" [level=2]
  - button "Close image preview"
  - region "shot.png, zoomable image":
    - img "shot.png"
  - text: 100% zoom shot.png
  - button "No accessibility data"
  - button "Draw on image"
  - button "Copy snapshot"
- text: Draw on image

 ❯ src/components/chat/ExpandedImageDialog.browser.test.tsx:393:46
    391|       await userEvent.hover(copyButton);
    392|       await act(() => vi.advanceTimersByTime(1));
    393|       expect(page.getByText("Copy snapshot").element()).toBeVisible();
       |                                              ^
    394|       expect(page.getByText("Draw on image").query()).toBeNull();

Trace:
  step         locator                                                         start  duration  location
  toBeVisible  locator('div').getByRole('button', { name: 'Draw on image' })   +65ms       2ms  apps/web/src/components/chat/ExpandedImageDialog.browser.test.tsx:383:18
  hover        locator('div').getByRole('button', { name: 'Draw on image' })   +68ms      81ms  apps/web/src/components/chat/ExpandedImageDialog.browser.test.tsx:387:23
  hover        locator('div').getByRole('button', { name: 'Copy snapshot' })  +151ms      53ms  apps/web/src/components/chat/ExpandedImageDialog.browser.test.tsx:391:23

 Test Files  1 failed (1)
      Tests  1 failed | 12 skipped (13)

Owning test folder after fix (apps/web/src/components/chat/ on 8bd0e81a):

Test Files  132 passed (132)
     Tests  978 passed (978)

vp run check:changed 9bd6a89561e21b9db98c19e8de36728af45262fb:

check:changed summary
  pass  format  0.6s
  pass  lint  1.1s
  pass  knip 1/2  11.0s
  pass  knip 2/2  18.9s
  pass  typecheck (2 packages)  2.2s
  pass  test (1 files)  12.9s
  pass  react compiler (1 files)  6.3s

Real-app Chromium observations (9bd6a895 vs 8bd0e81a, 1024×640, dark theme):

  • Hover-to-open latency in continuous video pass (no screenshot overhead):
    • Draw on image → Copy snapshot: 812 ms on base 9bd6a895 (web-before-draw-to-copy-delay.mp4, 5.32 s) vs 41 ms on head 8bd0e81a (web-after-draw-to-copy-instant.mp4, 4.92 s).
    • Copy snapshot → No accessibility data: 821 ms on base 9bd6a895 vs 37 ms on head 8bd0e81a.
  • Matching 50 ms still & 200 ms DOM readback: on base 9bd6a895, "Draw on image" stayed open at 50 ms (opacity: 1, data-open) on both Copy snapshot and No accessibility data, and at 200 ms no tooltip was open ([]); on head 8bd0e81a, the single shared tooltip already showed "Copy snapshot" (opacity: 1, data-open) at 50 ms and 200 ms and "No accessibility data" at 50 ms with "Draw on image" gone immediately.
  • Head 8bd0e81a popover & copied checks: clicking No accessibility data dismissed its tooltip ([]), opened the Accessibility data popover (web-after-contents-popover.png), and closed cleanly with no stuck tooltip ([]); clicking Copy snapshot disabled the button (true) and dismissed its tooltip ([]).

Generated with Gemini 4 Neon in T3 Code Nightly

Switch SnapShotCopyButton and SnapShotContentsButton in SnapShotAttachmentDetails.tsx from standalone Base UI Tooltip wrappers to SharedTooltipTrigger so moving across adjacent controls in ExpandedImageDialog and ComposerAttachmentStrip switches the shared tooltip immediately without waiting a fresh hover delay.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 28, 2026
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The snapshot copy and contents controls now use shared tooltip triggers. A browser test checks tooltip timing when users hover over Draw, Copy snapshot, and accessibility-data actions.

Changes: Snapshot control tooltips

Layer / File(s) Summary
Shared tooltip behavior for snapshot controls
apps/web/src/components/chat/SnapShotAttachmentDetails.tsx, apps/web/src/components/chat/ExpandedImageDialog.browser.test.tsx
The copy and contents controls use SharedTooltipTrigger with their existing labels and placement. The browser test checks that Draw’s tooltip appears after 600 ms and that hovering over adjacent actions displays their tooltips after 1 ms while hiding the previous tooltip.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: iamshadmantaqi

Merge Risk: Minimal · up to a0fda

This change makes adjacent snapshot action tooltips swap immediately instead of leaving the old tooltip visible during the hover delay. It is a small, UI-only change with a regression test, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: snapshot tooltips in the web app now open at once when the pointer moves between adjacent actions. The changeset switches SnapShotCopyButton and SnapShotContentsButton…
Description check Passed The description follows the repository template closely. It has Problem, Change, Scope, and Verification sections. The Problem section states the expected and actual behavior. The Change section names…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: snapshot tooltips in the web app now open at once when the pointer moves between adjacent actions. The changeset switches SnapShotCopyButton and SnapShotContentsButton to SharedTooltipTrigger and adds a browser test for shared hover timing. The title follows the conventional commit form and is 62 characters long.

Full details: Description check

Explanation

The description follows the repository template closely. It has Problem, Change, Scope, and Verification sections. The Problem section states the expected and actual behavior. The Change section names the affected components and the new browser test. The Scope section gives a bug-fix rationale and says no issue is needed. The Verification section gives focused tests, a before/after comparison with screenshots and clips, and a list of items not checked. The description links the related PRs #42671 and #45097 and gives a model/harness attribution as the template requests.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8bd0e81 and a0fda48.

Files selected for processing: 1

  • apps/web/src/components/chat/ExpandedImageDialog.browser.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 28, 2026
juliusmarminge and others added 2 commits November 28, 2026 23:04
The popover, keyboard-focus and disabled-while-copied steps re-tested
SharedTooltipTrigger itself, not this change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

The automated pipeline stopped on this pull request and will not merge it:

the proof could not be captured: the agent ran past its 120 minutes

It stays open for a person to finish or close.

@juliusmarminge juliusmarminge added takeover:blocked Takeover blocked; reason in the PR body and removed takeover:in-progress A takeover lead is working on this PR labels Nov 29, 2026
@only21mil only21mil closed this Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). takeover:blocked Takeover blocked; reason in the PR body vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants