feat(table): add justify for the filter controls - #2115
Merged
Conversation
The filter bar hardcoded `justify-content-start`, so a caller that centered a table's section — `justify: center` on the list block, for instance — got a centered heading above a flush-left button group, with no argument available to correct it. Add `justify` to the table structure and apply it to the controls. It reuses the shared argument from mod-utils, whose `start` default preserves the current alignment for every existing caller. Only the filter row is positioned; the table itself still spans its container. The shortcode forwards arguments one by one, so it needs the new key too — without it, `justify` validates and is then silently dropped. Typed as a feature, matching how `caption` was added in v3.12.0: a new public argument is a minor bump, which is the v3.18.0 the structure's `release:` annotation records. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for gethinode-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Collaborator
Author
|
🎉 This PR is included in version 3.18.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Problem
The table's filter bar hardcoded
justify-content-start:A caller that centers a table's section therefore gets a centered heading above a flush-left button group, with no argument available to correct it.
utilities/section.htmlappliesjustifyasalign-items-*to the column as a whole — with awidthset, that centers the column and leaves its contents flush left, whilesection-title.htmlseparately centers the heading viamx-auto. The table half never received it.Reported against the
listblock in a downstream site, whosejustify: centerproduced exactly that mismatch.Change
Three gaps had to close for the argument to reach the markup:
data/structures/table.ymljustifyargument existed, so there was no override to passlayouts/_partials/assets/table.htmljustify-content-startlayouts/_shortcodes/table.htmljustifyvalidates and is then silently droppedThe argument reuses the shared definition from mod-utils, so it inherits the
startdefault and thestart/end/center/between/around/evenlyoption set. Those map 1:1 ontojustify-content-*. Onlycommentandreleaseare overridden locally, which keepstype,options, anddefaultintact.Only the filter row is positioned. The table itself spans the full width of its container either way.
Compatibility
None for existing callers: the shared
startdefault reproduces the previous hardcoded value.Verification
pnpm testpasses (lint + template tests).A
fixture-filter-centercase was added toexampleSite/content/en/table-demo.md. It was written before the fix and failed with[table] unsupported argument 'justify'— which is how the dropped-shortcode-argument gap surfaced, since the build went green while the markup still renderedstart.Rendered output of
exampleSite/content/en/table-demo.mdafter the fix:Also verified end-to-end in a downstream site by patching its vendored copy: the reported page renders
justify-content-center.Release coordination
Typed as
featso this lands as a minor bump, matching howcaptionwas added in v3.12.0 and therelease: v3.18.0annotation on the new argument.gethinode/mod-blocks#192 forwards
justifyfrom thelistblock and depends on this release.InitArgsrejects an unknown key regardless of its value, so until mod-blocks' exampleSite bumps to v3.18.0 that change breaks every list block. Merge and release this first.🤖 Generated with Claude Code