Skip to content

feat(table): add justify for the filter controls - #2115

Merged
markdumay merged 1 commit into
mainfrom
fix/table-filter-justify
Aug 3, 2026
Merged

feat(table): add justify for the filter controls#2115
markdumay merged 1 commit into
mainfrom
fix/table-filter-justify

Conversation

@markdumay

@markdumay markdumay commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Problem

The table's filter bar hardcoded justify-content-start:

<div class="table-filter-controls d-flex justify-content-start mb-3">

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.html applies justify as align-items-* to the column as a whole — with a width set, that centers the column and leaves its contents flush left, while section-title.html separately centers the heading via mx-auto. The table half never received it.

Reported against the list block in a downstream site, whose justify: center produced exactly that mismatch.

Change

Three gaps had to close for the argument to reach the markup:

File Gap
data/structures/table.yml no justify argument existed, so there was no override to pass
layouts/_partials/assets/table.html hardcoded justify-content-start
layouts/_shortcodes/table.html forwards arguments one by one — without the new key, justify validates and is then silently dropped

The argument reuses the shared definition from mod-utils, so it inherits the start default and the start/end/center/between/around/evenly option set. Those map 1:1 onto justify-content-*. Only comment and release are overridden locally, which keeps type, options, and default intact.

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 start default reproduces the previous hardcoded value.

Verification

pnpm test passes (lint + template tests).

A fixture-filter-center case was added to exampleSite/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 rendered start.

Rendered output of exampleSite/content/en/table-demo.md after the fix:

class="table-filter-controls d-flex justify-content-start mb-3"    <- fixture-filter (unchanged)
class="table-filter-controls d-flex justify-content-center mb-3"   <- fixture-filter-center (new)
class="table-filter-controls d-flex justify-content-start mb-3"    <- fixture-filter-wrap (unchanged)

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 feat so this lands as a minor bump, matching how caption was added in v3.12.0 and the release: v3.18.0 annotation on the new argument.

gethinode/mod-blocks#192 forwards justify from the list block and depends on this release. InitArgs rejects 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

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

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for gethinode-demo ready!

Name Link
🔨 Latest commit d1a847c
🔍 Latest deploy log https://app.netlify.com/projects/gethinode-demo/deploys/6a704b91982c350008274832
😎 Deploy Preview https://deploy-preview-2115--gethinode-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@markdumay
markdumay merged commit 7796160 into main Aug 3, 2026
17 checks passed
@markdumay
markdumay deleted the fix/table-filter-justify branch August 3, 2026 08:19
@markdumay

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 3.18.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant