Skip to content

feat(dashboard): right-click context menus on all rows and cards with per-entry actions - #4210

Merged
simplesagar merged 9 commits into
mainfrom
feat/table-row-context-menus
Jul 16, 2026
Merged

feat(dashboard): right-click context menus on all rows and cards with per-entry actions#4210
simplesagar merged 9 commits into
mainfrom
feat/table-row-context-menus

Conversation

@simplesagar

@simplesagar simplesagar commented Jul 14, 2026

Copy link
Copy Markdown
Member

What

Every table row, card, and list entry whose "⋯" kebab menu offers per-entry actions now offers the same actions on right-click, finishing the initiative started by CardContextMenu (source/environment/prompt/assistant cards) and the hand-wired session rows.

New shared component: TableRowContextMenu — the asChild sibling of CardContextMenu for <tr>/row elements, fed by the same Action[] as the visible kebab, no-op when empty. Both now share ActionContextMenuContent.

Wired surfaces:

  • DotTable rows: sources table; remote identity provider tabs (MCP servers, sessions, OAuth clients)
  • moonshine tables via the new renderRow prop: deployments, exclusions, policy center, shadow MCP inventory, team members (hand-wired mirror incl. separator + per-item RBAC gating)
  • Other rows: roles (CSS-grid), tool list, source tools, chat logs
  • Cards: org home project cards/rows, plugin cards

Refactors along the way: raw dropdown kebabs now render from a single Action[] (visuals unchanged); useSourceToolActions/useProjectActions/useDeploymentActions hooks extracted so both menus share one source of truth; ContextMenuSeparator added to the primitive.

Deliberately out of scope: Triggers (no per-row menu exists), Sources grid cards (already done), Team invites (visible buttons, not hidden options).

Dependency

⚠️ The five moonshine-table pages use the new Table/Table.Body renderRow prop from speakeasy-api/moonshine#354. CI stays red on this draft until that PR merges + releases and @speakeasy-api/moonshine is bumped here. Everything was verified locally against the built moonshine branch.

Verification

  • pnpm -F dashboard type-check: clean (against local moonshine build)
  • pnpm -F dashboard test: 711/711
  • pnpm -F dashboard lint (oxfmt + no-barrels + oxlint type-aware + tsc): clean
  • pnpm -F dashboard build: passes

Design spec and implementation plans are committed under docs/superpowers/.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Mpze1EupifNgKSkWRZ8BZc


Summary by cubic

Adds right‑click context menus to all rows, cards, and list items that already have a kebab (⋯) menu. The same per‑entry actions now show on right‑click with shared components, consistent RBAC/disabled states, and better accessibility.

  • New Features

    • New TableRowContextMenu (no‑op when empty) and shared ActionContextMenuContent + ContextMenuSeparator; Action now supports description and separatorBefore.
    • Unified action builders power both kebab and context menus across: sources; MCP servers/sessions/clients; deployments, exclusions, policy center, shadow MCP inventory, team members; roles, tool list, source tools, chat logs; org project and plugin cards. Shadow MCP actions moved to shadowMCPInventoryActionItems.ts.
    • Moonshine tables use Table/Table.Body renderRow with onRowClick; added tests for menu mapping/selection; docs include a demo GIF.
    • Bumped @speakeasy-api/moonshine to 1.44.0 for renderRow.
  • Bug Fixes

    • Addressed review feedback: Shadow MCP action set is additive again; deployments prevent redeploy double‑submit via shared mutation key; roles use one roleActions() for both menus; team menu avoids stray separators; exclusions forward action.disabled; plugin card dropdown and context menu share one action list; sources rows use link href/ariaLabel; AnnotationToggle exposes its description via aria-describedby; removed dead SourceToolActions.
    • Restored pnpm-lock.yaml overrides/patches to resolve lockfile mismatch and added a changeset for dashboard.

Written for commit d710ab4. Summary will update on new commits.

Review in cubic

simplesagar and others added 4 commits July 14, 2026 14:35
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mpze1EupifNgKSkWRZ8BZc
… per-entry actions

Every table row, card, and list entry whose kebab (⋯) menu offers actions
now offers the same actions on right-click, extending the pattern already
used by source/environment/prompt/assistant cards and session rows.

- DotTable rows: sources table, remote identity provider tabs (MCP
  servers, sessions, OAuth clients)
- moonshine tables (via the new Table renderRow prop): deployments,
  exclusions, policy center, shadow MCP inventory, team members
- CSS-grid/list rows: roles, tool list, source tools, chat logs
- Cards: org home project cards/rows, plugin cards

Rows build one Action[] shared by the visible kebab and the context menu;
complex menus (team member management) mirror item-for-item with the same
RBAC gating. Adds ContextMenuSeparator to the context-menu primitive.

Requires @speakeasy-api/moonshine with Table renderRow
(speakeasy-api/moonshine#354); bump the dependency once released.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mpze1EupifNgKSkWRZ8BZc
@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d710ab4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
dashboard Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@simplesagar
simplesagar marked this pull request as ready for review July 15, 2026 00:15
@simplesagar
simplesagar requested review from a team as code owners July 15, 2026 00:15
@simplesagar simplesagar added the preview Spawn a preview environment label Jul 15, 2026
@speakeasybot

speakeasybot commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

🚀 Preview Environment (PR #4210)

Preview URL: https://pr-4210.dev.getgram.ai

Component Status Details Updated (UTC)
✅ Database Ready Created and validated 2026-07-16 21:41:27.
✅ Images Available Container images ready 2026-07-16 21:41:13.

Gram Preview Bot

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 27 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread client/dashboard/src/pages/sources/AnnotationToggle.tsx
Comment thread client/dashboard/src/pages/access/RolesTab.tsx
Comment thread client/dashboard/src/components/shadow-mcp/ShadowMCPInventoryTable.tsx Outdated
Comment thread client/dashboard/src/pages/deployments/Deployments.tsx
Comment thread client/dashboard/src/components/sources/SourceTableRow.tsx Outdated
Comment thread client/dashboard/src/pages/team/Team.tsx Outdated
Comment thread client/dashboard/src/pages/security/ExclusionsTab.tsx
Comment thread docs/superpowers/plans/2026-07-14-dashboard-row-context-menus.md Outdated
Comment thread client/dashboard/src/pages/sources/SourceToolsTab.tsx
Comment thread client/dashboard/src/pages/sources/useSourceToolActions.tsx
simplesagar and others added 2 commits July 14, 2026 17:31
Re-applied shadow MCP context-menu wiring on top of the inventory
refactor (#4064/#4065): shared Action[] builder moved to
shadowMCPInventoryActionItems.ts, dropdown and row context menu both
render from it; renderRow composes with the new onRowClick detail-page
navigation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mpze1EupifNgKSkWRZ8BZc
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mpze1EupifNgKSkWRZ8BZc
@simplesagar

Copy link
Copy Markdown
Member Author

Demo

Right-click context menus demo

Recorded against the local stack on this branch. What it shows:

  1. Sources page → switch to table view → right-click a source row → context menu with View / Update / Deployment / Delete (matching the row's ⋯ menu, destructive styling on Delete)
  2. Right-click a second row — per-row actions vary with the asset type
  3. Deployments page → right-click the active deployment row → Retry Deployment

- shadow MCP: action set is additive again — a server with both a pending
  request and an allow rule offers Review Request AND Edit/Delete Rule
  (early-return regression)
- deployments: both menus observe pending redeploys across hook instances
  via the shared mutation key, preventing double-submit
- roles: one roleActions() builder feeds the kebab and the context menu
- team: context-menu separator can no longer render orphaned
- exclusions: dropdown forwards action.disabled
- plugin card: install dropdown and context menu build from one Action[]
  (new description/separatorBefore metadata on the shared Action type)
- sources rows: DotRow href/ariaLabel instead of onClick (native link
  semantics), actions cell lifted above the link overlay
- AnnotationToggle: switch exposes its description via aria-describedby
- removed dead SourceToolActions component; clarified plan-doc scope note

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mpze1EupifNgKSkWRZ8BZc
@simplesagar

Copy link
Copy Markdown
Member Author

Addressed the cubic review in a6dbb97:

Fixed (11 of 14):

  • Shadow MCP action regression — the set is additive again; servers with a pending request and an allow rule get Review Request + Edit/Delete Rule
  • Deployments — both menus observe pending redeploys across hook instances via mutationKeyRedeployDeployment + useMutationState, closing the double-submit window
  • Roles — single roleActions() builder feeds kebab and context menu
  • Team — context-menu separator gated on items actually rendered above it
  • Exclusions — dropdown forwards action.disabled
  • Plugin card (3 findings) — one Action[] drives both menus; the shared Action type gained description and separatorBefore, so the context menu now shows the "Requires marketplace setup" subtext and the separator
  • Sources rows — DotRow href/ariaLabel instead of onClick (native open-in-new-tab/copy-link), actions cell lifted above the overlay
  • AnnotationToggle — description exposed via aria-describedby
  • Dead SourceToolActions component removed; plan-doc scope note clarified

Not addressed (3), deliberately:

  • Plugin card as a real <Link> — pre-existing navigation pattern on DotCard, worth its own change
  • Read-only source pages allocating the edit hook per row — real but minor; the hook is cheap and a conditional child adds structure for little gain
  • useSourceToolActions duplicating ToolRow's edit dialogs — pre-existing duplication; consolidating the tool editor is a larger refactor than this PR should carry

Verified: dashboard lint (oxfmt + oxlint + tsc) clean, 718/718 tests.

The conflict-resolution reinstall dropped the workspace overrides and
patchedDependencies blocks from pnpm-lock.yaml (ERR_PNPM_LOCKFILE_CONFIG_MISMATCH
in CI); regenerated from main's lockfile with only the moonshine 1.44.0 bump.
Adds the changeset required for feat PRs touching dashboard and formats the
superpowers docs per hk.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mpze1EupifNgKSkWRZ8BZc

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 16 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread docs/superpowers/plans/2026-07-14-moonshine-render-row.md
@simplesagar
simplesagar enabled auto-merge July 16, 2026 17:42
@simplesagar
simplesagar added this pull request to the merge queue Jul 16, 2026
Merged via the queue into main with commit d32a5ed Jul 16, 2026
41 checks passed
@simplesagar
simplesagar deleted the feat/table-row-context-menus branch July 16, 2026 21:33
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

preview Spawn a preview environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants