Skip to content

feat(blocks): add row actions to tables and a menu element - #3483

Merged
ascorbic merged 2 commits into
emdash-cms:mainfrom
swissky:feat/blocks-table-row-actions
Sep 26, 2026
Merged

ascorbic merged 2 commits into
emdash-cms:mainfrom
swissky:feat/blocks-table-row-actions

Conversation

@swissky

@swissky swissky commented Sep 26, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Adds row actions to Block Kit tables, plus a new menu element.

Sandboxed plugins often list entries that each need an action, such as "translate this post", "open", or "retry". Today a table can only show text, badges, dates and relative times, so a plugin has to put its actions in a separate actions block. Those actions are cut off from their rows, and every choice needs its own button.

  • format: "element" table columns. Each row can hold a button, link, or menu under that column's key. An empty cell renders nothing. Validation accepts only those three element types in element cells and applies the same response policy used elsewhere, so a link's plugin-page target must still be one of the plugin's declared pages. Element columns are end-aligned.
  • menu element. A button that opens a Kumo DropdownMenu. Choosing an item dispatches { type: "block_action", action_id, value } with the item's value. Menus need at least one item, item values must be unique, and style is primary or secondary.
    • Menus work in actions blocks, section accessories, empty-state actions and table cells.
    • Like link, menus are rejected as form fields: menu is part of ActionElement but not Element.
  • elements.menu(actionId, label, items, { style }) builder and an exported MenuElement type.
  • The kitchen-sink /components page in marketplace-test gets a row menu, and the registry inventory test now requires a decision for every ActionElement type.
  • Docs (block-kit.mdx) and the creating-plugins skill reference cover the new column format and element.

Existing tables and elements are unchanged. The other headings in the screenshots are centred; #3480 fixes that separately.

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main.
  • I have added and reviewed the user-facing changeset (if this PR changes a published package)
  • New features link to an approved Discussion: https://github.com/emdash-cms/emdash/discussions/...
  • I have included screenshots below if this PR changes the UI

Translation: not applicable. Menu, item and column labels come from the plugin's Block Kit JSON, and the admin gets no new strings.

Discussion: there isn't one yet. I'm opening this as a concrete proposal, and I'm happy to move it to an Ideas Discussion or close it if the shape isn't right.

Targeted tests run: packages/blocks (164), plugin-test registry inventory (9), admin (2701), core plugins and editor extension (884). The docs build also passes.

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Cursor + Claude Opus 5.5

Screenshots / test output

The table has an Actions element column. Rows that still need translations have a "Translate" menu, and a complete row has an "Open" link:

Block Kit playground preview of a "Missing translations" table with an end-aligned Actions column containing Translate menu buttons and an Open link

With the menu open, choosing an item dispatches a block_action with that item's value:

The same table with the first row's Translate menu open, listing French, Italian, and All languages

@changeset-bot

changeset-bot Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d744d83

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

This PR includes changesets to release 12 packages
Name Type
@emdash-cms/blocks Minor
@emdash-cms/admin Minor
emdash Minor
@emdash-cms/plugin-test Patch
@emdash-cms/plugin-embeds Patch
@emdash-cms/cloudflare Minor
@emdash-cms/sandbox-workerd Patch
@emdash-cms/auth Minor
create-emdash Minor
@emdash-cms/gutenberg-to-portable-text Minor
@emdash-cms/x402 Minor
@emdash-cms/auth-atproto Patch

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

@github-actions

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 504 lines across 16 files. Large PRs are harder to review and more likely to be closed without review.

If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs.

See CONTRIBUTING.md for contribution guidelines.

@github-actions github-actions Bot added review/needs-review No maintainer or bot review yet cla: signed labels Sep 26, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@3483

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@3483

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@3483

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@3483

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@3483

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@3483

emdash

npm i https://pkg.pr.new/emdash@3483

create-emdash

npm i https://pkg.pr.new/create-emdash@3483

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@3483

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@3483

@emdash-cms/plugin-test

npm i https://pkg.pr.new/@emdash-cms/plugin-test@3483

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@3483

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@3483

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@3483

@emdash-cms/registry-loader

npm i https://pkg.pr.new/@emdash-cms/registry-loader@3483

@emdash-cms/registry-moderation

npm i https://pkg.pr.new/@emdash-cms/registry-moderation@3483

@emdash-cms/registry-verification

npm i https://pkg.pr.new/@emdash-cms/registry-verification@3483

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@3483

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@3483

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@3483

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@3483

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@3483

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@3483

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@3483

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@3483

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@3483

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@3483

commit: d744d83

@emdashbot emdashbot 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.

The code change is a focused, well-shaped addition: table columns can now render a button, link, or menu element per row, and a new menu element dispatches block_action with the chosen item value. The implementation follows existing conventions in @emdash-cms/blocks: validation reuses validateElement/policy, rendering reuses renderElement, the type hierarchy keeps menu out of form fields, tests cover element cells and validation edge cases, and the docs/changeset are consistent.

Static review did not find logic bugs, regressions, security issues, or AGENTS.md convention violations in the code itself (no new queries, no SQL interpolation, no leaked internals, no untranslated admin strings, RTL-safe text-end, no comment noise, changeset is useful).

The only real concern is process/approach: AGENTS.md requires a prior maintainer-approved Discussion for a feature, and this PR explicitly does not have one. The author acknowledges this and is presenting the PR as a concrete proposal. That is the maintainer's call to make before merge, not a code defect, but it is the right problem to flag first. If the maintainers approve the direction, the implementation appears solid and could land as-is.

(Automated/static review only — I did not run the test suite, linter, or build.)

@emdashbot emdashbot Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-review No maintainer or bot review yet labels Sep 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Overlapping PRs

This PR modifies files that are also changed by other open PRs:

This may cause merge conflicts or duplicated work. A maintainer will coordinate.

@ascorbic ascorbic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. Thanks

@emdashbot emdashbot Bot added review/approved Approved; no new commits since and removed review/awaiting-author Reviewed; waiting on the author to respond labels Sep 26, 2026
@swissky swissky added the ci:run Approve and re-run CI on the PR's latest commit label Sep 26, 2026
@github-actions github-actions Bot removed the ci:run Approve and re-run CI on the PR's latest commit label Sep 26, 2026
@ascorbic
ascorbic enabled auto-merge (squash) September 26, 2026 17:40
@ascorbic
ascorbic merged commit 2e943ff into emdash-cms:main Sep 26, 2026
38 checks passed
@emdashbot emdashbot Bot mentioned this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants