Skip to content

Right-click context menus across the UI (0285) - #424

Merged
crs48 merged 11 commits into
mainfrom
claude/0285-right-click-context-menus-across-the-ui
Jul 9, 2026
Merged

Right-click context menus across the UI (0285)#424
crs48 merged 11 commits into
mainfrom
claude/0285-right-click-context-menus-across-the-ui

Conversation

@crs48

@crs48 crs48 commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Implements exploration 0285: a single, themed right-click menu system built on the already-installed-but-unused @base-ui/react/context-menu, rolled out across the app.

What landed

Foundation (@xnetjs/ui)

  • ContextMenu primitive (packages/ui/src/primitives/ContextMenu.tsx) — pointer-anchored, portaled, collision-flipping, keyboard + long-press, mirroring Menu.tsx's tokens and motion.
  • ActionMenu (packages/ui/src/composed/ActionMenu.tsx) — a declarative Action[] descriptor that renders into either a right-click menu or a click-anchored kebab dropdown, so both paths share one source of truth. Unit-tested + Storybook story.

Surfaces wired

  • Explorer rows — right-click + hover ⋯ kebab: Open, Rename (inline), Pin to Desk, Pin/Unpin sidebar, Move to workspace / folder (submenus), Delete (soft-delete → Trash). Backed by a new useNodeActions hook.
  • TableCell — migrated off its bespoke fixed-position overlay (manual open state / outside-click / Escape / inline SVGs / raw grays) onto the primitive. Same actions, now portaled + themed.
  • Channels & messages — channel/DM rows (Open, Mark as read, Archive) and messages (Copy, Reply, Edit/Delete for your own — wiring the previously-unused redactMessage).
  • Editor tabs — Close, Close others, Close to the right (pin-aware), Pin/Unpin, Open in split.
  • Card/row views — a shared RowContextMenu on List, Gallery, Timeline, Board cards + a task-row menu (Open, toggle done).

Verified

  • Typecheck green across @xnetjs/ui, @xnetjs/views, xnet-web.
  • Unit tests: ActionMenu descriptor filtering, TableCell right-click, plus existing explorer/comms/tabs/views suites all pass.
  • Live app: right-clicked an Explorer row (7 verbs render with theming/submenus/danger Delete), drove Rename end-to-end (persisted to the row via the change log), and confirmed the tab menu (Close/Close others/Close to the right/Pin/Open in split with the ⌘W hint).

Deferred (follow-ups)

  • PR4 Canvas — the node right-click menu is intentionally deferred: CanvasV3.tsx is a ~6k-line renderer under the view-drift tripwire (0276/0277), and wiring command-registry actions through it safely warrants its own change. A background task chip is flagged. This is why the exploration doc stays [_].
  • Grid — the spreadsheet view keeps its reducer/keymap model for now (distinct from the other card views).

No changeset: only private packages (@xnetjs/ui, @xnetjs/views) and the app changed (assert-coverage passes).

🤖 Generated with Claude Code

@crs48
crs48 temporarily deployed to pr-424 July 9, 2026 03:39 — with GitHub Actions Inactive
xNet Test and others added 10 commits July 8, 2026 20:40
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: xNet Test <test@xnet.dev>
…0285)

Wrap the already-installed @base-ui/react/context-menu module in a themed
ContextMenu primitive mirroring Menu.tsx, plus an ActionMenu composed layer
whose declarative Action[] descriptors render into either a right-click
context menu or a click-anchored kebab dropdown — one source of truth per
object type.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: xNet Test <test@xnet.dev>
…285)

Wrap ExplorerRow in the new ContextMenu and add a hover kebab, both mounting
a shared useNodeActions list lazily on open: Open, Rename (inline), Pin to
Desk, Pin/Unpin sidebar, Move to workspace/folder submenus, and Delete
(soft-delete to Trash). Replaces the individual hover move/pin buttons.

Signed-off-by: xNet Test <test@xnet.dev>
…ive (0285)

Replace the hand-rolled fixed-position overlay (manual open state, outside-click
and Escape listeners, non-portaled div, inline SVG icons, raw gray styling) with
the themed ContextMenu primitive: portaled, collision-flipping, keyboard- and
token-consistent. Same actions (copy/edit/clear/comment/delete row); lucide icons.

Signed-off-by: xNet Test <test@xnet.dev>
Channel/DM rows gain a right-click + kebab menu (Open, Mark as read via
markChannelRead, Archive via the channel archived flag — which useChannels
already hides). Messages gain a right-click menu (Copy text, Reply in thread,
Edit and Delete for your own — Delete wires the previously-unused redactMessage
service through ChannelChat -> ChannelMessageList -> MessageRow).

Signed-off-by: xNet Test <test@xnet.dev>
TabBar tabs gain a right-click menu: Close, Close others, Close to the right
(all pin-aware — pinned tabs are preserved), Pin/Unpin, and Open in split
(splitWith). Complements the existing middle-click-close and hover pin/close.

Signed-off-by: xNet Test <test@xnet.dev>
Add RowContextMenu, a small shared wrapper driven by the onRowClick/onDeleteRow
callbacks every view already receives, and wire it into the List, Gallery,
Timeline and Board card views (threading onDeleteRow through the board columns)
plus a task-row menu (Open, toggle done). Grid keeps its reducer/keymap-driven
model for now — a distinct follow-up.

Signed-off-by: xNet Test <test@xnet.dev>
Signed-off-by: xNet Test <test@xnet.dev>
Signed-off-by: xNet Test <test@xnet.dev>
@crs48
crs48 force-pushed the claude/0285-right-click-context-menus-across-the-ui branch from 62246b8 to 3ba61ef Compare July 9, 2026 03:40
@crs48
crs48 temporarily deployed to pr-424 July 9, 2026 03:41 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Preview removed for PR #424.

github-actions Bot added a commit that referenced this pull request Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🖼️ UI changes in this PR

Components

🆕 UI/Primitives/ContextMenu — From Descriptors

UI/Primitives/ContextMenu — From Descriptors

🆕 UI/Primitives/ContextMenu — Primitive

UI/Primitives/ContextMenu — Primitive

Screens

✏️ Home _(SSIM 0.905)_
before after diff
before after diff

Interactions

🎬 Open a channel and post a message

Open a channel and post a message

▶ Watch MP4

Auto-captured by CI · run. Informational — not a blocking check.

github-actions Bot added a commit that referenced this pull request Jul 9, 2026
@crs48
crs48 temporarily deployed to pr-424 July 9, 2026 03:47 — with GitHub Actions Inactive
github-actions Bot added a commit that referenced this pull request Jul 9, 2026
@crs48
crs48 merged commit 13e7665 into main Jul 9, 2026
15 checks passed
@crs48
crs48 deleted the claude/0285-right-click-context-menus-across-the-ui branch July 9, 2026 03:54
github-actions Bot added a commit that referenced this pull request Jul 9, 2026
github-actions Bot added a commit that referenced this pull request Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant