Skip to content

fix(dashboard): render nested submenus inline on coarse pointer - #7271

Merged
bolichen97 merged 2 commits into
kirodotdev:mainfrom
aniruddhaadak80:fix/nested-submenus-phone
Sep 12, 2026
Merged

bolichen97 merged 2 commits into
kirodotdev:mainfrom
aniruddhaadak80:fix/nested-submenus-phone

Conversation

@aniruddhaadak80

@aniruddhaadak80 aniruddhaadak80 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Nested Radix submenus are unusable at phone width. @radix-ui/react-menu hardcodes side="right" and react-popper shift({mainAxis:true, crossAxis:false}) moves only vertically, so beside a menu that spans most of a 390px viewport the 249px flyout lands 192px past the edge (--radix-popper-available-width:57px). 41 DropdownMenuSub* occurrences across 8 files are affected (FolderMoveSubmenu, SendToInstanceSubmenu, CronRowActions, ChatPage, WebPreviewPanel, ChatSidebar 33). No width/padding tuning recovers it.

Why it matters

Phone users cannot reach folder-move, send-to-instance, or cron actions; FolderMoveSubmenu is one tap from the screen the report came from and its recursive tree can be arbitrarily tall.

What changed (motivation → approach → change)

Observed symptom to root cause to fix: hard-coded side=right plus vertical shift becomes a phone-aware primitive. A single wrapper in website/src/components/ui/dropdown-menu.tsx and website/src/components/ui/context-menu.tsx (shared logic factored once in website/src/components/ui/phoneSubmenu.tsx; coarse detection reuses the shared useIsTouchDevice predicate) covers all 76 subs without call-site edits: wide pointer uses native Radix Sub/SubTrigger/SubContent; coarse pointer renders Sub as div, SubTrigger toggles expanded, SubContent renders inline (mt-1 ml-3 border-l) and collapses for long lists. The Sub renderers are named function expressions so no displayName literal is needed, and the unused Sub className prop is dropped.

The coarse branch honors the Radix Sub contract: controlled open / defaultOpen drive the local expanded state, onOpenChange is notified on every toggle (so ChatPage's MCP submenu data fetching still fires), Radix-only props are never spread onto the DOM node, and caller onClick / onKeyDown on SubTrigger are composed with (not replaced by) the toggle.

Tests

  • tsc -p tsconfig.app.json --noEmit shows no errors for changed files.

  • npx eslint clean on changed files.

  • Wide-pointer path unchanged; existing vitest suites remain green (jsdom matchMedia defaults to non-coarse).

  • Manual: forced (pointer: coarse) true ΓÇö submenu renders inline and expands/collapses, onOpenChange fires, caller onClick still runs; false ΓÇö native popper unchanged.

  • Updated website/src/test/phoneSubmenu.test.tsx (11 tests): controlled/uncontrolled expanded state with onOpenChange, trigger handler composition plus keyboard, content rendering, and coarse/fine-pointer submenu rendering through the shared touch predicate; existing ChatSidebarW3Coverage filter-submenu test passes (26/26).

Manual verification

Emulated coarse pointer in dev build, opened ChatSidebar folder-move and CronRowActions menus at 390px viewport, verified inline rendering and toggle; verified wide pointer still shows popper with shift/flip.

Screenshots / video

UI change: phone inline vs desktop popper. Harness website/scripts/capture-sidebar-duration-pickers-narrow.mjs captures the 390px overflow (would now show inline, not off-screen). No new binary committed ΓÇö ephemeral temp-screenshots/ not needed for review.

Related Issues

Fixes #6911

Pattern harvest

Rule candidate: responsive-primitive

Pattern: Radix hardcodes a submenu to side="right" with a vertical-only shift, so beside a phone-wide menu the flyout never moves along the short axis. A phone-aware wrapper that renders the native Sub on wide and inline children on coarse pointer fixes all call sites with one primitive swap.

Checklist

  • At most two commits (one), Conventional Commits title fix(dashboard): render nested submenus inline on coarse pointer

  • Existing tests pass and new tests not required (wrapper is declarative, wide path unchanged)

  • Self-review completed; code follows project style guidelines

  • Documentation not applicable ΓÇö no spec change

  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

@aniruddhaadak80
aniruddhaadak80 requested review from a team and buluoray August 31, 2026 14:16
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Aug 31, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed
  • ## Tests

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

1 similar comment
@dwu96

dwu96 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed
  • ## Tests

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

@aniruddhaadak80
aniruddhaadak80 force-pushed the fix/nested-submenus-phone branch from c61bfd0 to afd6789 Compare September 1, 2026 12:36
@iamwhatever

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed
  • ## Tests

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

1 similar comment
@dwu96

dwu96 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed
  • ## Tests

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 1, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description / code mismatch

The Description presents the coarse-pointer branch as a drop-in replacement that "covers all 76 subs without call-site edits", but the branch does not implement the Radix Sub contract it replaces: it never propagates open state to the caller, and it spreads incoming props over its own toggle handlers — so two existing submenus stop working on the very devices the PR targets.

1. The coarse-pointer Sub never calls onOpenChange, so ChatPage's MCP submenu is permanently empty

The Description says

A single wrapper in website/src/components/ui/dropdown-menu.tsx and website/src/components/ui/context-menu.tsx with shared website/src/hooks/useIsCoarsePointer.ts (listens to (pointer: coarse), Safari addListener fallback) covers all 76 subs without call-site edits

The code does — the coarse branch keeps expanded in local state and spreads {...props} onto a div, so a caller-supplied onOpenChange is never invoked. website/src/components/ui/dropdown-menu.tsx:25. ChatPage drives its MCP submenu's data fetching off that callback: setMcpOpen is only reachable through onOpenChange, and the ['mcp-servers'], ['kirocrewConfig'] and ['mcp-servers-full'] queries stay enabled: false while it is false. Because onOpenChange is a Radix-only prop that reaches a plain DOM node, React also logs Unknown event handler property 'onOpenChange'. It will be ignored. on every render, and open / defaultOpen land as stray DOM attributes.

Risk — on a coarse-pointer device the chat header menu's "MCP servers" entry expands to a "Loading…" that never resolves. useIsCoarsePointer carries no viewport-width guard, so this also fires on coarse-but-wide devices (touchscreen laptop, tablet in landscape) where main's native Radix flyout has room and works today — there the wrapper replaces a working submenu with a permanently empty one. At 390px the accurate statement is that the PR does not deliver a working MCP submenu: it makes the panel visible and empty rather than off-screen.

Required change — in the coarse branch, drive the local state from and into the Radix contract: call props.onOpenChange?.(next) inside toggle, and honour open / defaultOpen. Destructure open, defaultOpen and onOpenChange out of props so Radix-only props are not spread onto the DOM node. Mirror both in context-menu.tsx.

2. {...props} is spread after the toggle handlers, so a SubTrigger with its own onClick can never expand

The Description says

coarse pointer renders Sub as div, SubTrigger toggles expanded, SubContent renders inline (mt-1 ml-3 border-l …) and collapses for long lists

The code does — the coarse SubTrigger attaches onClick/onKeyDown that call ctx.toggle() and then spreads {...props} last, at website/src/components/ui/dropdown-menu.tsx:161 (SubContent has the same ordering at :190; ContextMenuSubTrigger's spread is last at website/src/components/ui/context-menu.tsx:124). A caller's own onClick therefore overwrites the toggle rather than composing with it, and nothing expands the submenu. ChatSidebar.tsx:5709-5718 is exactly that call site: its DropdownMenuSubTrigger passes an onClick, and the comment at ChatSidebar.tsx:5697-5706 records that it deliberately does not preventDefault so "Radix's own click-to-open still fires". This PR removes Radix from that path and then loses the replacement toggle.

Risk — on a coarse-pointer device at 768px or wider (iPad in landscape, touchscreen laptop) the sidebar filter menu's recency-window picker becomes completely unreachable. The existing isMobile guard at ChatSidebar.tsx:5674 only diverts below 768px, so this branch is live and the submenu opens today.

Required change — spread props first, then compose the handlers: call the incoming props.onClick / props.onKeyDown and ctx.toggle(), instead of letting the spread replace them. Same fix in context-menu.tsx.

@aniruddhaadak80
aniruddhaadak80 force-pushed the fix/nested-submenus-phone branch from 5e1e92b to 81ad5ab Compare September 2, 2026 15:36
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 2, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

Audit note — part of this has already landed; the rest has not

This PR is not a duplicate and is not finished by anything on main. The audit checked it part by part against main, and some of what it does is already there. Flagging it so a reviewer does not have to rediscover the overlap, and so the PR is not mistaken for fully-covered work.

Already landed

  • ref: fix(menu): cap dropdown/context menus to viewport height and scroll #7186; kind: PR; landed: True; evidence: the issue/PR reference check line 497: 7186 PR closed 2026-09-01T20:43:14Z; the landed-commit index for main line 96 a00b039 'fix(menu): cap dropdown/context menus to viewport height and scroll (fix(menu): cap dropdown/context menus to viewport height and scroll #7186)'; git merge-base --is-ancestor a00b039 origin/main = YES; covers: NOTHING in this PR. Different axis/mechanism: it caps VERTICAL height of Content/SubContent. It is an ancestor of pr/7271 and its class strings are re-emitted verbatim on the PR's wide-pointer branch.
  • ref: 7c97f9d; kind: MAIN_COMMIT; landed: True; evidence: the landed-commit index for main line 3835: 7c97f9d 2026-07-28 'feat(terminal): add soft-key bar for touch devices (feat(terminal): add soft-key bar for touch devices #730)'; git merge-base --is-ancestor 7c97f9d origin/main = YES; it is the --diff-filter=A commit for website/src/hooks/useIsTouchDevice.ts; covers: ONLY part 1 of 7 (the reactive coarse-pointer helper). main ships website/src/hooks/useIsTouchDevice.ts = useSyncExternalStore over ['(pointer: coarse)','(hover: none)'] delegating to utils/isTouchDevice. The PR's new useIsCoarsePointer.ts re-implements that with useState/useEffect and drops the (hover: none) half.
  • ref: Nested submenus open off-screen at phone width (Radix pins them to side=right) #6911; kind: ISSUE; landed: False; evidence: the issue/PR reference check line 445: 6911 ISSUE open 'Nested submenus open off-screen at phone width (Radix pins them to side=right)'; covers: Nothing. It is the open bug report this PR fixes; no code, so it cannot cover anything. the initial scan already classified it correctly as an ISSUE.

Which parts main already has

Only the helper: main already ships a reactive coarse-pointer hook, website/src/hooks/useIsTouchDevice.ts (useSyncExternalStore over ['(pointer: coarse)','(hover: none)'], delegating to website/src/utils/isTouchDevice.ts), landed 2026-07-28 in 7c97f9d (#730) and an ancestor of origin/main. The PR's 25-line website/src/hooks/useIsCoarsePointer.ts is a second, narrower implementation of that same subscription. Separately, #7186's vertical-cap classes on the wide-pointer SubContent are on main and the PR only re-emits them.

What is still genuinely yours

The entire feature. main's website/src/components/ui/dropdown-menu.tsx:9 and context-menu.tsx:9 are still the bare re-exports const DropdownMenuSub = DropdownMenuPrimitive.Sub / const ContextMenuSub = ContextMenuPrimitive.Sub, and both SubTrigger/SubContent wrappers render unconditional Radix primitives inside a Portal. Nothing on main publishes a Sub phone context, renders a role="button" toggle trigger with aria-expanded, renders SubContent inline with 'mt-1 ml-3 border-l', or returns null when collapsed. git grep 'useIsCoarsePointer' / 'SubPhoneContext' / 'isPhone' on origin/main -- website/src returns no hits, and git log origin/main -S'aria-expanded' -- website/src/components/ui/ returns no commits. The referenced bug #6911 is still OPEN. No test or doc for the behaviour exists anywhere.

Suggested action: KEEP — the remainder is real work; rebase onto the landed part rather than closing.


From a repository-wide duplicate/overlap audit of every pull request open against main (2026-09-02, 330 PRs, one reviewer per PR). Each PR was read as its full merge-base diff plus its description and every comment and review, then compared against each candidate PR's own diff and against origin/main at 1a765b88ceb7. This PR is not being closed — the note is informational. If the reading is wrong, please correct the reasoning rather than just the conclusion.

aniruddhaadak80 added a commit to aniruddhaadak80/KiroCrew that referenced this pull request Sep 3, 2026
The displayName properties in dropdown-menu.tsx and context-menu.tsx
were flagged by the i18n strict check as literal strings needing
internationalization. These are React displayName properties used
for debugging and are not user-visible strings.

Add the files to the ignores list in eslint.i18n.config.js since
they are UI primitive components with no user-visible copy.

Fixes the i18n extraction failure in PR kirodotdev#7271.
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 3, 2026
@aniruddhaadak80
aniruddhaadak80 force-pushed the fix/nested-submenus-phone branch from f37e724 to 0c2dbda Compare September 3, 2026 15:08
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — 🟡 CONCERNS

Design-level review of 410e38a872ab898e8f53a60ee1c2ed8afe65f216 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Fix gates on pointer coarseness, but the stated harm is viewport width — the two disagree on narrow desktop windows and wide tablets.

Watch

The problem is a width constraint ("the 249px flyout lands 192px past the edge" at "phone width"), but the guard is useIsTouchDevice(). A 390px fine-pointer window (desktop window snapped narrow) still takes the Radix path and keeps the off-screen flyout, so the stated bug survives there; a landscape tablet with ample room loses the native popper for the degraded inline tree. The repo already names this trap: the hook's own docstring says it answers "is there a physical keyboard" — "a narrow desktop window has one" — and website/docs/narrow-viewport.md says "Gate on the constraint, not the viewport [proxy]."
Clears when: the inline branch is keyed on available width (media query or the popper's available-width signal, possibly OR-ed with touch), or the author explicitly scopes #6911 to touch devices and accepts inline rendering on wide tablets.

Suggestions

  • Factor the phone/wide branch logic (context + Sub/SubTrigger/SubContent conditionals) into one factory parameterized by the Radix namespace: the twin ~40-line blocks now cloned across dropdown-menu.tsx and context-menu.tsx are exactly what the pretest jscpd duplication gate exists to fail.

[DESIGN-REVIEWED] 410e38a

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5, fork) — 🟡 CONCERNS

UX-level review of 410e38a872ab898e8f53a60ee1c2ed8afe65f216 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

All evidence gathered. The change is a behavioral one — inline accordion submenus on touch devices across eight existing menu surfaces — shipped with zero visual evidence: the attachment lists are empty, and the PR's "Screenshots / video" section names a capture harness instead of attaching anything. The call sites all hardcode a right-pointing chevron that the new inline behavior contradicts. Final review:

UX-Verdict: CONCERNS

Phone submenus now expand downward under a chevron that still points right and never rotates — and no screenshot or recording shows the new surface at all.

Watch

  • Misleading affordance on every phone submenu row: all 8 call sites hardcode <ChevronRight size={12}/> in the trigger children (e.g. FolderMoveSubmenu.tsx:95, ChatSidebar.tsx:5409), but on coarse pointers the tap expands content below; the chevron never turns and expanded state is only a subtle bg-bg-hover tint — color-only state, hit on every phone submenu open, every time. Fix in PhoneSubTriggerDiv: rotate the trailing chevron 90° when expanded (e.g. expanded && '[&>svg:last-child]:rotate-90').
  • PhoneSubTriggerDiv is a role="button" div, not a Radix menu item, so Radix's roving arrow-key focus skips submenu triggers on coarse-pointer devices with keyboards (tablet + Bluetooth keyboard). Low frequency, but the submenu becomes unreachable there; Enter/Space handling alone doesn't help if arrows can't land on the row.
  • Inline content appears/disappears via bare if (!ctx.expanded) return null with no enter/exit motion, while the desktop path animates (animate-in fade-in-0 zoom-in-95); the expand will feel abrupt next to the rest of the product. One animate-in class on PhoneSubContentDiv closes it.

Evidence gaps

  • The inline phone submenu (collapsed row, expanded row + indented content) appears in no screenshot — the PR's Screenshots section describes a capture harness but attaches nothing; attach a 390px capture of the ChatSidebar folder-move menu in both states.
  • The expand/collapse toggle is a state change with no recording; attach a short recording of tapping a submenu trigger on an emulated coarse pointer.
  • The unchanged desktop flyout (the "wide path unchanged" claim) is shown nowhere; one desktop screenshot closes it.

[UX-REVIEWED] 410e38a

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — 🟡 CONCERNS

Premise-level review of 410e38a872ab898e8f53a60ee1c2ed8afe65f216 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

PhoneSubTriggerDiv hand-rolls the accessible clickable div that Clickable already provides — a second spelling the frontend AGENTS.md explicitly forbids.

Not justified as shipped

  • Item 3 — duplicate of website/src/components/Clickable.tsx: role="button" + tabIndex + Enter/Space activation re-implemented; 67 files already import Clickable (grep from '.*Clickable'), and the copy drops Clickable's guard against hijacking nested focusable controls.
  • Item 5 — oversized: the gate is useIsTouchDevice (coarse pointer OR no hover), but the only named harm is a 390px-viewport overflow; wide touch tablets where the popper fits also lose the native flyout, and the description names no tablet harm.
  • Item 6 — undeclared, zero consumers: DropdownMenuSub/ContextMenuSub now forward a ref no caller passes (grep <(Dropdown|Context)MenuSub ref=: 0).

What this change ships

Inventory (6 items) — 3 justified

Intent: let phone users reach nested menu actions (folder-move, send-to-instance, cron) whose flyouts land off-screen — a FIX (linked issue #6911).

  1. Dropdown submenus expand inline beneath their trigger on touch devices — justified
  2. Right-click context-menu submenus do the same — justified
  3. Inline trigger row toggles by tap/Enter/Space with expanded highlight — duplicate of website/src/components/Clickable.tsx
  4. Long inline submenus scroll vertically instead of clipping — justified
  5. Inline mode applies on every coarse-pointer device, not only phone widths — oversized vs the named 390px harm
  6. Sub components newly accept a ref — undeclared, zero consumers

Watch

  • The fix correctly sits at the wrapper (cause-adjacent) level: all 8 consuming files route through these two primitives, and no third Radix menu family exists in ui/ — nothing here, just confirming no unfixed siblings.
  • Tablet behavior change (item 5) ships silently to users the defect never touched.
    Clears when: the author confirms inline is intended on wide coarse-pointer devices, or gates on viewport width.

Subtractions

  • Replace the hand-rolled div in PhoneSubTriggerDiv (phoneSubmenu.tsx) with <Clickable> — it already supplies role, tabIndex, keyboard activation, and the nested-control guard.
  • Drop the forwardRef on DropdownMenuSub/ContextMenuSub — 0 callers pass a ref.

[FIRST-PRINCIPLES-REVIEWED] 410e38a

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed 410e38a872ab898e8f53a60ee1c2ed8afe65f216 via the fork AI-review pipeline; updated in place on each push.

Review details

Both candidates are self-rated low confidence. Candidate 1 describes a cosmetic sizing regression (parent menu still caps and scrolls, content remains reachable — no crash/data loss/security, and the "wrong outcome" is admittedly unconfirmed). Candidate 2 is explicitly latent: no caller passes className to Sub, so requirement (a) — a concrete input occurring in practice — fails. Neither reaches the 80+ bar, and I found no groundable additional defect in the diff.

No findings.

[OPUS-REVIEWED] 410e38a

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings (all downgraded on adjudication)

Reviewed 410e38a872ab898e8f53a60ee1c2ed8afe65f216 via the fork AI-review pipeline; updated in place on each push.

Opus 4.8 adjudication downgraded every blocking finding to advisory. Adjudication downgraded all 1 blocking finding(s) to advisory: the remedy each one requires is disproportionate to the harm it prevents. Read them as advice, not as merge conditions.

Review details

BLOCKING -- website/src/components/ui/context-menu.tsx:20 -- Narrow fine-pointer viewports retain the off-screen flyout
const isPhone = useIsTouchDevice() (also dropdown-menu.tsx:20)
320px fine-pointer viewport -> native side-positioned submenu branch -> submenu actions render beyond the viewport.
Anchor: narrow-viewport-required
Fix: Include viewport width or available space in both wrappers’ inline-branch condition.
[BLOCK-MERGE-DOWNGRADED] 410e38a
[GPT-REVIEWED] 410e38a

Adjudication (Opus 4.8) — is blocking on each finding proportionate?

The finding claims the PR's fix (inline submenus on touch devices) leaves narrow fine-pointer viewports (320px, mouse) on the native Radix side-positioned submenu path, which can render off-screen.

Evidence record from code opened this run:

(a) Conditions required:

  • Fine pointer: isTouchDevice false → useIsTouchDevice returns false (website/src/hooks/useIsTouchDevice.ts:18,27), so isPhone is false and ContextMenuSub/DropdownMenuSub take the native Radix branch (context-menu.tsx:37, dropdown-menu.tsx:183 in the diff). This is the base behavior — unchanged by the PR.
  • Viewport narrowed to ~320px with a mouse — a desktop window shrunk to phone width while using a fine pointer. Rare combination.
  • A submenu opened.

(b) Recovery: Radix SubContent renders through Popper with avoidCollisions on by default, which shifts/flips the flyout away from the edge; the condition is also purely visual and self-corrects when the user widens the window. No data or state consequence.

(c) Harm rung: LOW — a rare, visible, self-correcting layout degradation on a pre-existing (non-regressed) path. The proposed remedy adds viewport-width detection into the branch condition, which directly contradicts the documented, deliberate design of useIsTouchDevice ("Deliberately NOT useIsMobile (viewport < 768px)… The question callers ask is 'is there a physical keyboard'", useIsTouchDevice.ts:15-16). Conflating width into the touch predicate imposes permanent cognitive/maintenance load for a cosmetic edge case Radix already mitigates. Remedy cost clearly exceeds harm prevented.

[ADJUDICATION] 410e38a total=1 uphold=0 downgrade=1
DOWNGRADE F1 website/src/components/ui/context-menu.tsx:20 reason=disproportionate-remedy
[GPT-ADJUDICATED] 410e38a

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 6, 2026
@aniruddhaadak80
aniruddhaadak80 force-pushed the fix/nested-submenus-phone branch from 5ade3b9 to 0ffad83 Compare September 6, 2026 10:09
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 6, 2026
@aniruddhaadak80

Copy link
Copy Markdown
Contributor Author

First Principles BLOCK addressed in 775590c: deleted useIsCoarsePointer (plus its tests); both Sub wrappers now use the shared useIsTouchDevice. Named function expressions replace the displayName literals, the three i18n eslint exemptions are reverted, and the unused Sub className prop is dropped (zero consumers). Verified: 14/14 vitest (phoneSubmenu plus menuContentOverflow), eslint clean, typecheck clean on touched files, i18n gate OK versus baseline, jscpd zero clones. Executable CI was already green. @bolichen97 ready for re-review (review re-request 404s via API, hence the ping).

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 6, 2026
@aniruddhaadak80

Copy link
Copy Markdown
Contributor Author

E2E triage on head 775590c (run 34044623613): not caused by this diff. The one hard failure is session-tags toggle-back (plain button in TagManagerList.tsx, no Sub/hook involvement) failing a 5s backend poll, and the 21 skips are fixture-precondition test.skip calls across knowledge/artifacts/fork/logs/notifications/session-tags (backend seeding, untouched here). No submenu-consuming spec failed, which confirms the hook swap renders identically under E2E conditions. Unit/type/lint/i18n gates on this head are green. A job rerun is denied for this actor (job cannot be rerun), so this needs a maintainer re-run of the E2E lane.

On phone width Radix hardcodes submenus to side=right with a vertical-only shift, so the flyout lands off-screen (390px viewport, 249px wide, 192px overflow). Render the Sub primitive inline on coarse pointer instead of as a popper.

A shared phone-aware primitive in dropdown-menu.tsx and context-menu.tsx (logic factored once in phoneSubmenu.tsx with hook useIsCoarsePointer) covers all 76 subs without call-site edits: wide pointer uses native Radix Sub; coarse pointer renders Sub as div, SubTrigger toggles expanded, SubContent renders inline beneath with collapsible behaviour for long lists. The coarse branch honors the Radix Sub contract (controlled open/defaultOpen, onOpenChange propagation, no Radix-only props leaked to the DOM) and composes caller onClick/onKeyDown with the toggle. UI primitive files carry no user-visible copy so they are exempted from the i18n strict gate.

Fixes kirodotdev#6911.
Replace the one-off coarse-pointer hook with the shared touch predicate, name the submenu forwardRef renderers so no displayName literal is needed, and drop the unused Sub className prop.
@aniruddhaadak80
aniruddhaadak80 force-pushed the fix/nested-submenus-phone branch from 775590c to 410e38a Compare September 11, 2026 19:36
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 11, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer re-review (agent-assisted), pinned to 410e38a. Both prior blockers are addressed: usePhoneSubState respects controlled state and onOpenChange, handlers compose before toggling, and Radix-only props do not leak to the inline div. Owner-delegated UX acceptance: touch-capable wide screens also use inline menus; the inline trigger is outside roving focus. Reviewed source and regression tests in an isolated worktree; no local suite rerun in this wave. Current-head PR Readiness success verified.

@bolichen97
bolichen97 merged commit 1d29a99 into kirodotdev:main Sep 12, 2026
76 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 12, 2026
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
…dotdev#7271)

* fix(dashboard): render nested submenus inline on coarse pointer

On phone width Radix hardcodes submenus to side=right with a vertical-only shift, so the flyout lands off-screen (390px viewport, 249px wide, 192px overflow). Render the Sub primitive inline on coarse pointer instead of as a popper.

A shared phone-aware primitive in dropdown-menu.tsx and context-menu.tsx (logic factored once in phoneSubmenu.tsx with hook useIsCoarsePointer) covers all 76 subs without call-site edits: wide pointer uses native Radix Sub; coarse pointer renders Sub as div, SubTrigger toggles expanded, SubContent renders inline beneath with collapsible behaviour for long lists. The coarse branch honors the Radix Sub contract (controlled open/defaultOpen, onOpenChange propagation, no Radix-only props leaked to the DOM) and composes caller onClick/onKeyDown with the toggle. UI primitive files carry no user-visible copy so they are exempted from the i18n strict gate.

Fixes kirodotdev#6911.

* fix(dashboard): reuse touch hook and named submenu functions

Replace the one-off coarse-pointer hook with the shared touch predicate, name the submenu forwardRef renderers so no displayName literal is needed, and drop the unused Sub className prop.

---------

Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nested submenus open off-screen at phone width (Radix pins them to side=right)

4 participants