Repository navigation
UN-4315 [FEAT] Add the v1 overlays: Drawer, Popover, HoverCard and Tooltip (P1-T08) - #2522
kirtimanmishrazipstack wants to merge 10 commits into
Conversation
The dim layer, header with close button, footer action bar, Escape and outside-click rules, and focus return that the drawer and the dialogs (UN-4316) share. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oltip The right-hand drawer (480 or 640, sections, action bar), popover, hover card and tooltip, built on Radix and the shared overlay parts, with a gallery, markup snapshot, accessibility scan and READMEs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
titleSize "page" (default) or "section" for confirm dialogs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kirtimanmishrazipstack
left a comment
There was a problem hiding this comment.
Standardized review (unstract review-deep v2.3.9): INITIAL, head 8efcef576
Verdict: REQUEST CHANGES
Summary: Critical: 0 · High: 2 · Medium: 6 · Low: 5 · Lenses run: 19/19
Overlay suite: 51/51 pass (vitest scoped to components/ui/overlay). The pinned biome check 2.3.13 (check-only) on the changed files: exit 0. Findings marked VERIFIED were reproduced with throwaway tests in a scratch copy; nothing in the branch was changed.
Findings (inline):
- [High] A toast raised while a drawer is open is hidden under it; Escape closes the hidden toast.
- [High] Focus drops to
<body>after a drawer opened from a submenu or context-menu item closes. - [Medium] A busy popover still closes on a trigger click.
- [Medium] The toast-click guard is never reached by a real toast; its test uses a fake one.
- [Medium] The gallery's loading and error drawer entries render the loaded body.
- [Medium] Drawer's own return-focus wiring is untested.
- [Medium]
useReturnFocus(open)forces each overlay to keep private open state; UN-4316 already forked it. - [Medium] Exported prop types accept
asChild,forceMountand an emptytitle. - [Low] Doc overclaims.
- [Low] A Tooltip provider per tooltip turns off skip-delay.
- [Low]
Tooltipdrops props from anasChildparent. - [Low] Two prop-forwarding paths are untested.
- [Low] Hover-delay tests tie the fake clock to wall time.
Lens checklist
- Spec & intent: See findings #2, #3, #5
- Architectural fit & precedent: See findings #7, #10
- Correctness & edge cases: See findings #1, #2, #3, #4, #11
- Security: Clean (no endpoint, no HTML sink, tooltip content is text only)
- Data integrity & migrations: N/A (no data write, schema or migration)
- Concurrency: Clean
- API & contract compatibility: See findings #8 (consumer searched: the UN-4316 dialogs worktree imports the shared parts; no other consumers)
- Reliability & resilience: N/A (no external call, timeout, retry or queue)
- Performance & cost: Clean
- Observability: N/A (no log, metric or error-reporting path)
- Operational safety: Clean (no page uses the components yet)
- LLM/agent-specific: N/A
- Testing: See findings #4, #5, #6, #12, #13
- Dependencies & build: Clean (no manifest change)
- Code quality: Clean (pinned
biome checkandcheck-v1pass) - Doc & comment accuracy: See findings #2, #3, #4, #9
- Cross-document rule consistency: Clean (branch current with base; every repo-wide restatement of these rules agrees)
- On-prem deployment experience: N/A (no chart, values file, on-prem path or doc)
- Scaling & workload lifecycle: N/A
Not checked
- Real-browser paint and hit-testing for #1 and #4. Page order, stacking classes and Escape were checked in happy-dom.
- The global coverage threshold. Only the overlay folder's suite ran.
Open questions for the author
- Should toasts always sit above, and stay clickable over, an open drawer or dialog? The fix for #1 and #4 depends on it.
- Is a drawer meant to open from
RowContextMenu, submenu items or a popover button? If not, should the README list them as cases where focus is not returned? - Will list-page rows be focusable?
README.md:36-38says focus goes "back to that row", which holds only for a row that takes focus.
Assumptions
- The Toaster stays mounted once at the v1 root into
#v1-portal, ahead of any drawer.
Toasts sit above drawers and dialogs; focus returns through submenus and popovers; the drawer passes its open state straight to Radix; content and title props reject values that break; Tooltip forwards a parent's props; the gallery's loading and error drawers show their own bodies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When one overlay closes and the next opens in the same task, keep the first opener and ignore the late close, so focus goes back to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Answers to the review summary and Sonar (the thread fixes are in 13bd958):
|
kirtimanmishrazipstack
left a comment
There was a problem hiding this comment.
Standardized review (unstract review-deep v2.3.9): FOLLOWUP, head 1aaea3a5c
Verdict: REQUEST CHANGES
Summary: Critical: 0 · High: 2 · Medium: 2 · Low: 4 · Lenses run: 19/19
The counts are what is still open after this round: new findings 1-5, plus what is left of prior #2 (High), #9 (Low) and #12 (Low).
Prior context fetched: followup-fetch.sh exit 0. Since-boundary: 8efcef576 (the INITIAL review). Commits reviewed since: 13bd95816, 377e48b24, 1aaea3a5c.
Scope change: YES. Focus return was redesigned: the opener is now resolved at open time by walking menu and popover layers. 377e48b also adds new close-and-reopen behaviour. Re-scanned the 15 files changed since 8efcef576 under all 19 lenses.
Overlay suite: 61/61 pass (vitest on components/ui/overlay; no outside service needed). Pinned biome check 2.3.13, check-only, on the 14 changed source files: exit 0. The fixes were checked by mutation in a scratch copy; the branch was not changed.
Prior findings status
-
#1 [High] A toast raised while a drawer is open was hidden under it →
RESOLVED. The viewport isui:z-60(feedback/Toaster.tsx:137), pinned byDrawer.test.tsx:189; the Escape order is tested at:197-204. The z-60 change opens a different gap: new finding 2. -
#2 [High] Focus dropped to
<body>after a drawer opened from a submenu or context-menu item →PARTIALLY RESOLVED. Fixed for Radix DropdownMenu and submenu items and for an uncontrolled popover that closes itself (testsparts.test.tsx:268,:296fail against the old hook). Still open: the chain is read in a layout effect, after the commit. Any opener whose layer closes in the same commit that opens the drawer leaves nothing to return to, and focus lands on<body>. Sites:- a controlled
Popoverwhose button runssetOpen(false); setDrawerOpen(true), because Radix drops the trigger'saria-controlsin that commit (react-popoverdist L92); - a
SearchMenurow (menu/SearchMenu.tsx:77-81, a controlled popover that does the same); - a
CommandPaletterow (menu/CommandPalette.tsx:76-80, a dialog with no trigger); - chained confirms built from two overlay instances.
README.md:41-44and:106-108promise a return in these cases. With three or more sites the fix is structural, for example recording the focused element onfocusinbefore the open. Or narrow the README to the openers that work. VERIFIED by probes in happy-dom (searchmenu,palette,controlled-popoverall end on<body>). - a controlled
-
#3 [Medium] A busy popover still closed on a trigger click →
RESOLVED(docs narrowed:README.md:61-62,Popover.tsx:44). -
#4 [Medium] The toast-click guard was unreachable →
RESOLVED(the guard is gone; Radix wraps the toast viewport inDismissableLayer.Branch). -
#5 [Medium] The gallery's loading and error entries rendered the loaded body →
RESOLVED(overlay.gallery.tsx:85; the snapshot now holds both states). -
#6 [Medium] Drawer return-focus wiring was untested →
RESOLVED(Drawer.test.tsx:157fails withuseReturnFocus(false)). -
#7 [Medium]
useReturnFocus(open)forced private open state →RESOLVED(Drawer.tsx:52-66passes straight to Radix;useOpenStateis gone). The hook change in 377e48b introduced new finding 1. -
#8 [Medium] Exported prop types accepted
asChild,forceMountand an emptytitle→RESOLVED(Popover.tsx:36-46,HoverCard.tsx:34-37,title: string; the@ts-expect-errorlines were confirmed against the un-Omitted types). The HoverCard test gap is in new finding 5. -
#9 [Low] Doc overclaims →
PARTIALLY RESOLVED. Still open:README.md:3-4says "the parts every overlay shares", against:93-94; andREADME.md:97-100leaves outOverlayHeader'sclassName, sov1/README.md:150"lists every prop" still does not hold. -
#10 [Low] A Tooltip provider per tooltip turns off skip-delay →
WAIVED. I accept the author's reasoning here: the approved plan chose it,README.md:88documents it, and an app-root provider belongs with UN-4274. #2522 (comment) -
#11 [Low]
Tooltipdropped props from anasChildparent →RESOLVED(Tooltip.tsx:39spreads the rest, includingref). The ref half is not pinned by a test: new finding 5. -
#12 [Low] Two prop-forwarding paths untested →
PARTIALLY RESOLVED. The Escape half is pinned (Popover.test.tsx:107). A caller'sonInteractOutsideis still untested: removing it atPopover.tsx:69, orown.onInteractOutside?.()atparts.tsx:140, leaves 61/61 green. -
#13 [Low] Hover-delay tests tied the fake clock to wall time →
RESOLVED(HoverCard.test.tsx:45,Tooltip.test.tsx:42).
New findings (inline)
- [High] A controlled drawer removed from the page while open returns focus to
<body>(regression from 377e48b). - [Medium] A toast already showing when a drawer opens paints above it but takes no clicks; a click passes through to the drawer.
- [Medium] The toast-in-drawer test switches off the only check behind its "clickable" claim.
- [Low] "Two exceptions" leaves out an opener that takes no focus on click.
- [Low] Four test names or comments claim more than the test pins.
Lens checklist
- Spec & intent: See findings #1, prior #2 (the README promises focus return in cases that land on
<body>). No PR-title convention is stated in a tracked repo file, so the title item does not apply. - Architectural fit & precedent: Clean (prior #7 fixed; the UN-4316 dialog reuses the shared hook instead of forking it)
- Correctness & edge cases: See findings #1, #2, prior #2
- Security: Clean (no endpoint, HTML sink, storage or network call; tooltip content is text only)
- Data integrity & migrations: N/A (no data write, schema or migration)
- Concurrency: See findings #1 (the late-close guard's timing assumption misreads an unmount)
- API & contract compatibility: See findings #1 (consumer searched: UN-4316
dialog/Dialog.tsx:173callsuseReturnFocus(state.open), whose signature is unchanged; no other in-repo consumer) - Reliability & resilience: N/A (no external call, timeout, retry or queue)
- Performance & cost: Clean
- Observability: N/A (no log, metric or error-reporting path)
- Operational safety: Clean (no page uses the components yet)
- LLM/agent-specific: N/A (no model, prompt or agent path)
- Testing: See findings #3, #5, prior #12
- Dependencies & build: Clean (no manifest or lockfile change)
- Code quality: Clean (pinned
biome check2.3.13 check-only exit 0 on the changed files) - Doc & comment accuracy: See findings #4, #5, prior #2, prior #9
- Cross-document rule consistency: Clean (branch current with
origin/main; the merge-result sweep's hits outside the overlay folder are in this diff and agree) - On-prem deployment experience: N/A (no chart, values file, on-prem path or doc)
- Scaling & workload lifecycle: N/A (no worker, autoscaling or lifecycle config)
Lenses 4-8, 11, 12, 14, 15, 17-19 were assessed by the orchestrator; the rest came from the dispatched agents and were re-checked here.
Security deep-dive: not triggered (no attack-surface trigger in the diff). Boundary sweep: not triggered (no outbound client, endpoint, log line or error path).
Not checked
- Real-browser paint, hit-testing and Safari focus-on-click for finding 2, finding 4 and the prior #2 residual. All probes ran in happy-dom.
- The global v1 coverage threshold. Only the overlay folder's suite ran.
Open questions for the author
- While a drawer is open, Radix marks the toast region
aria-hiddenand the focus trap pulls F8 focus back, so a Retry or Undo on a toast raised from a drawer is mouse-only. Is that acceptable, or should drawer flows avoid toast actions? - When a drawer action removes the opener (for example, deletes the row that opened it), focus lands on
<body>. Should the hook take a fallback target, or should the README list it?
Assumptions
- The Toaster stays mounted once at the v1 root into
#v1-portal, ahead of any drawer. - UN-4316's chained confirms reuse one dialog instance (
ConfirmHost.tsx:23), so the two-instance case affects only overlays built some other way.
Focus return falls back to the page control that last had focus and survives an overlay unmounting while open; an older toast over a drawer no longer passes clicks through; tests pin the outside-click handler, the tooltip ref and both omitted content props. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Answers to the follow-up review's open questions (the thread fixes are in 8b2467b):
|
Alert dialogs count as overlay layers, so a confirm's button is never taken for the page control, and a removed control never replaces a live opener. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge; the previous notification-layer issue is fixed.
|
v0 pins every Radix popper wrapper at z-index 1500, so the toast list moves from z-60 to z-1600 to stay above every overlay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Frontend Lint Report (Biome)✅ All checks passed! No linting or formatting issues found. |
|
Unstract test resultsPer-group results
Critical paths
|



What
Why
How
frontend/src/v1/components/ui/overlay/, built on Radix.returnFocus.ts): when a drawer or dialog closes, focus goes back to what opened it. If that sat in a menu, submenu or popover that has closed, focus goes to the control that opened that, and failing that to the page control that last had focus. This covers search-menu and command-palette rows and confirms chained one after another.Dialog.Overlay, which is what locks page scroll, and draws its own dim layer, so the page behind keeps scrolling.parts.tsx): the dim layer, the header (withtitleSizefor confirms), the action bar, and the Escape and outside-click rules (a filled search box clears first; nothing closes while busy).feedback/Toaster.tsx: the toast list moves from z-50 to z-1600, above every overlay (v0 pins Radix popper wrappers at 1500), and takes clicks while it holds a toast, so a click on an older toast never reaches the drawer under it.Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)
Database Migrations
Env Config
Relevant Docs
Related Issues or PRs
Dependencies Versions
Notes on Testing
test:v1withNODE_OPTIONS=--no-experimental-webstorage.For the designer:
Screenshots
Taken in Brave, light theme unless named.
Checklist
I have read and understood the Contribution Guidelines.
🤖 Generated with Claude Code