Repository navigation
fix(blocks): align table column headings with their content - #3480
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: bbba2d7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
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 |
Contributor
There was a problem hiding this comment.
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 puttingtext-starton<th>only, so this change is consistent with existing practice. TableColumnhas 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
thcentering, 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.
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-test
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/registry-loader
@emdash-cms/registry-moderation
@emdash-cms/registry-verification
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
10 of 19 tasks
Merged
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 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-startclass sits on<table>, but browsers give<th>a defaulttext-align: centerthat the inherited value does not override.This adds
text-startto 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
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runmessages.pochanges except in translation PRs — a workflow extracts catalogs on merge tomain.Tests: no automated test added. The unit tests run in jsdom, which does not apply the browser's default
thcentering, 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: computedtext-alignof everythwascenterbefore andstartafter; withdir="rtl"the headings sit at the right edge.@emdash-cms/blockstests pass (157/157). i18n and Discussion items are not applicable (no strings, bug fix).AI-generated code disclosure
Screenshots / test output
Before: the "Title", "Status", and "Updated" headings are centered over their columns.
After: the headings start at the same edge as the cell content.