feat(ui): unify page context menus (click + right-click) behind one shared action list (CM-2)#164
Merged
Merged
Conversation
…st (CM-2)
The click "…" dropdown (NavContextMenu) and the right-click page-body menu now
render a single canonical PageMenuItems list, so a page offers an identical
action set either way. PageMenuItems gains a `surface` ('row' vs 'page') and
`menu` ('context' vs 'dropdown') so the sidebar/favorites/library rows keep the
exact compact set/order they had, while the current-page surfaces render the
full superset through whichever Radix menu family hosts them.
- Add ContextMenuCheckboxItem primitive (full-width toggle in right-click menu).
- NavContextMenu keeps its dropdown shell + "Page actions" aria-label signal.
- Present is now conditional on doc (non-database) pages; export stays gated on
registered exportKinds.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
…design review) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…gression) The unified page menu (CM-2) renders the full action superset from the "…" dropdown and the right-click page body — ~18 items — which runs past the fold on a normal viewport. DropdownMenuContent/ContextMenuContent used overflow-hidden with no max-height, so the lower items (notably "Move to trash") were painted off-screen and unclickable: Playwright reported the destructive item "visible, enabled and stable" yet "outside of the viewport", timing out delete.spec.ts. Bound both to --radix-*-content-available-height with overflow-y-auto (matching popover/select), so the menu scrolls within the viewport and every item stays reachable. Home-gating (pageScoped disabling) is untouched and still correct. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
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
CM-2 collapses every page action surface — the sidebar/favorites/library-tree rows, the click-triggered "…" dropdown, and right-clicking the page body — behind one canonical action list (
PageMenuItemsinPageContextMenu.tsx). Asurfaceprop selects the compactrowset vs. the fullpagesuperset; amenuprop selects the Radix family (right-click context menu vs. click dropdown). The click "…" dropdown and the right-click page body now render an identical action set, andNavContextMenuis reduced to a thin trigger over the shared list.This PR also folds in the pre-endorsed design-review fixes (Devon — CLEAR WITH NITS).
Before / After
Compact, diverged from the dropdown.
Full superset, one shared list. Note distinct Archive icon on "Trash" (view) vs. destructive red "Move to trash".
PageActionsClustertoolbar (which treats Home as non-actionable). Add subpage / Add database stay enabled.!id), inconsistent with the toolbar.Four items greyed; Add subpage/database still live.
Full superset ≈686px tall (see Operational note on finding #2).
Design-review fixes applied
disabled={!id}, so on Home (non-null id) they rendered enabled — inconsistent withPageActionsClustertreating Home as non-actionable. Changed all four todisabled={!pageScoped}(pageScoped = !!id && !isHome). Add subpage / Add database intentionally stay!id-only (adding children under Home is legitimate). —PageContextMenu.tsx:268,272,276,280Trash2; adjacent in the same surface, one navigational + one destructive = misclick risk. Thenav.trashview item now uses lucideArchive, visually distinct from the destructive redTrash2. —PageContextMenu.tsx(import +nav.trashitem)menu.viewOptionsi18n key across en/de/ja/zh (the old label header was dropped). Bumped the right-clickContextMenuContentwidthw-56 → w-60to match the dropdown (same longest labels — avoids wrapping). —PageContextMenu.tsx,i18n/messages/*.ts(Devon's deferred nit — "Settings / Trash-view feel app-level" — is a follow-up UX call, not in this PR.)
Testing
build:libs✅ ·ui typecheck✅ ·ui lint✅ ·ui vitest✅ (112 files / 1053 tests)aria-disabled="true"while Add subpage stays enabled, and that the after menu renders the full superset.Operational
pagesuperset menu is ≈686px tall. On a viewport ≥ ~700px it fits with room to spare; at an artificially short 680px viewport the tail clips by a few px (Radix does not cap the menu height). This is pre-existing behaviour of the "…" dropdown (same content) — CM-2 simply brings it to the right-click surface too; not introduced here. Flagging for the record; not blocking. The compactrow/before menu (≈380px) is unaffected.Footer: verify green (build:libs / ui typecheck / ui lint / ui vitest). Gate: design (Devon — CLEAR WITH NITS, applied).
🤖 Generated with Claude Code
https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w