This repository was archived by the owner on Jul 31, 2026. It is now read-only.
feat(Table): add renderRow prop to wrap data rows - #354
Merged
Conversation
RowContainer now forwards refs and extra tr props so the row element can back composition patterns like Radix ContextMenuTrigger asChild. 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
Re-applied renderRow on top of upstream sorting support and the prettier-to-oxfmt migration. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mpze1EupifNgKSkWRZ8BZc
alx-xo
approved these changes
Jul 15, 2026
There was a problem hiding this comment.
1 issue found across 3 files
Confidence score: 4/5
- In
src/components/Table/index.test.tsx,renderRowis missing coverage for expandable and grouped row paths that the PR says are supported, so a regression in row structure/behavior could slip through and only show up at runtime for those table variants — add targeted tests for expandable-row wrapping and grouped-row rendering before (or immediately after) merge to de-risk this.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/components/Table/index.test.tsx">
<violation number="1" location="src/components/Table/index.test.tsx:203">
P2: Consider adding test coverage for `renderRow` with expandable rows and grouped rows. The PR description lists both as supported paths — expandable rows wrap only the `<tr>` (not the expanded panel) and grouped rows apply `renderRow` to each row inside the group — but the current tests only cover plain data rows. Adding a quick test for each would confirm the wrapping boundary and prevent regressions.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| expect(screen.getByText("go")).toBeTruthy(); | ||
| }); | ||
|
|
||
| it("wraps every data row and forwards extra props onto the <tr>", () => { |
There was a problem hiding this comment.
P2: Consider adding test coverage for renderRow with expandable rows and grouped rows. The PR description lists both as supported paths — expandable rows wrap only the <tr> (not the expanded panel) and grouped rows apply renderRow to each row inside the group — but the current tests only cover plain data rows. Adding a quick test for each would confirm the wrapping boundary and prevent regressions.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/components/Table/index.test.tsx, line 203:
<comment>Consider adding test coverage for `renderRow` with expandable rows and grouped rows. The PR description lists both as supported paths — expandable rows wrap only the `<tr>` (not the expanded panel) and grouped rows apply `renderRow` to each row inside the group — but the current tests only cover plain data rows. Adding a quick test for each would confirm the wrapping boundary and prevent regressions.</comment>
<file context>
@@ -191,3 +192,52 @@ describe("Table sortable headers", () => {
+ expect(screen.getByText("go")).toBeTruthy();
+ });
+
+ it("wraps every data row and forwards extra props onto the <tr>", () => {
+ const onContextMenu = vi.fn((e: React.MouseEvent) => e.preventDefault());
+ render(
</file context>
Thegreatsura
pushed a commit
to Thegreatsura/gram
that referenced
this pull request
Jul 17, 2026
… per-entry actions (speakeasy-api#4210) ## 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.com/claude-code) https://claude.ai/code/session_01Mpze1EupifNgKSkWRZ8BZc <!-- This is an auto-generated description by cubic. --> --- ## 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. <sup>Written for commit d710ab4. Summary will update on new commits.</sup> <a href="https://cubic.dev/pr/speakeasy-api/gram/pull/4210?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. --> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
Adds a
renderRowprop toTable(andTable.Body):(row, rowElement) => ReactNode. The internalRowContainernow forwards refs and extra<tr>props, so the row element can back composition patterns like RadixContextMenuTrigger asChild.<tr>only, not the expanded panel), and grouped rows.Why
The Gram dashboard is adding right-click context menus to all table rows with per-row actions (companion PR in speakeasy-api/gram). Moonshine's Table owns the
<tr>, so consumers had no way to attach a context-menu trigger per row.Testing
src/components/Table/index.test.tsx: wrapper runs per row, extra props (onContextMenu,data-testid) land on the<tr>,onRowClickstill works when wrapped.WithRenderRowstory.pnpm type-check,pnpm lint,pnpm test(50/50),pnpm buildall pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01Mpze1EupifNgKSkWRZ8BZc
Summary by cubic
Adds a new
renderRowprop toTableso consumers can wrap each<tr>(e.g., per‑row context menus) without changing behavior when unused. Works with sortable headers, expandable rows, and grouped rows.renderRow: (row, rowElement) => ReactNodeonTableandTable.Body.<tr>), and grouped rows; compatible with sorting.RowContainerforwards refs and additional<tr>props;onRowClickremains supported when wrapped.Written for commit f740151. Summary will update on new commits.