Skip to content

fix(blocks): align table column headings with their content - #3480

Merged
ascorbic merged 1 commit into
emdash-cms:mainfrom
swissky:fix/blocks-table-header-align
Sep 26, 2026
Merged

ascorbic merged 1 commit into
emdash-cms:mainfrom
swissky:fix/blocks-table-header-align

Conversation

@swissky

@swissky swissky commented Sep 26, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Block Kit table headings render centered, while the cells below them are start-aligned, so each heading floats in the middle of its column. The text-start class sits on <table>, but browsers give <th> a default text-align: center that the inherited value does not override.

This adds text-start to the <th> itself. Headings in plugin admin pages, dashboard widgets, and content editor panels now line up with their column; in RTL admin languages they align to the right.

No linked issue; found while building a plugin status page.

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

Tests: no automated test added. The unit tests run in jsdom, which does not apply the browser's default th centering, so the only possible unit test would assert the class name back, which can't catch a real regression. Reproduced and verified in the Block Kit playground in Chromium instead: computed text-align of every th was center before and start after; with dir="rtl" the headings sit at the right edge. @emdash-cms/blocks tests pass (157/157). i18n and Discussion items are not applicable (no strings, bug fix).

AI-generated code disclosure

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

Screenshots / test output

Before: the "Title", "Status", and "Updated" headings are centered over their columns.

Block Kit playground table before the fix, with the Title heading centered above left-aligned post titles

After: the headings start at the same edge as the cell content.

Block Kit playground table after the fix, with the Title, Status, and Updated headings aligned with the left edge of their columns

@changeset-bot

changeset-bot Bot commented Sep 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bbba2d7

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 Patch
@emdash-cms/admin Patch
emdash Patch
@emdash-cms/plugin-test Patch
@emdash-cms/plugin-embeds Patch
@emdash-cms/cloudflare Patch
@emdash-cms/sandbox-workerd Patch
@emdash-cms/auth Patch
create-emdash Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
@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 github-actions Bot added review/needs-review No maintainer or bot review yet cla: signed size/XS labels Sep 26, 2026

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

This is the right fix for the right problem, implemented in the idiomatic way for EmDash. Browser default styles give <th> a text-align: center that overrides the text-start inherited from the <table>; adding text-start directly to the header cell corrects the visual mismatch while remaining RTL-safe (text-start / start edge, not text-left / physical left).

I checked:

  • The changed component is rendered through BlockRenderer, which the admin uses for plugin admin pages, dashboard widgets, and content editor panels — so the changeset’s audience and scope are accurate.
  • The codebase’s own admin tables (e.g. ContentList.tsx) use the same convention of putting text-start on <th> only, so this change is consistent with existing practice.
  • TableColumn has no alignment property, so all columns are expected to be start-aligned; the fix matches the component’s design.
  • The changeset is well-written: patch bump, present-tense "Fixes", names the public surface and affected contexts, and notes RTL behavior.
  • No user-facing strings were added or changed, so the i18n checklist item is correctly marked n/a.
  • No automated test was added, but the PR description gives a clear rationale (jsdom does not apply the UA th centering, so a class-name assertion would be tautological) and reports browser-level verification in Chromium and RTL. That matches the testing guidance for a purely presentational browser-default regression.

Clean, minimal, and ready to merge.

@emdashbot emdashbot Bot added review/approved Approved; no new commits since and removed review/needs-review No maintainer or bot review yet 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@3480

@emdash-cms/auth

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

@emdash-cms/auth-atproto

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

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

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

emdash

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

create-emdash

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

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

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

@emdash-cms/plugin-cli

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

@emdash-cms/plugin-test

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

@emdash-cms/plugin-types

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

@emdash-cms/registry-client

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

@emdash-cms/registry-lexicons

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

@emdash-cms/registry-loader

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

@emdash-cms/registry-moderation

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

@emdash-cms/registry-verification

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

@emdash-cms/sandbox-workerd

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-field-kit

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: bbba2d7

@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 merged commit f2f9119 into emdash-cms:main Sep 26, 2026
48 of 53 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

Labels

cla: signed review/approved Approved; no new commits since size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants