Skip to content

Scope the empty-column filter to columns nobody chose - #10

Merged
ibuilder merged 1 commit into
mainfrom
fix/column-filter-scope
Aug 9, 2026
Merged

Scope the empty-column filter to columns nobody chose#10
ibuilder merged 1 commit into
mainfrom
fix/column-filter-scope

Conversation

@ibuilder

@ibuilder ibuilder commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Reviewing the 2.0.5 diff turned up three defects, all in the column filter it introduced. Each was confirmed by rendering the shortcode, not by reading.

An explicit columns= list was filtered like any other

[procore_team columns="name,email_address"] rendered only Name. The column was named in the shortcode and removed with no header, no cell and no explanation. The filter's own docblock claimed the opposite — "A column an author asked for explicitly is always kept" — but nothing in the code distinguished an author's list from the registry defaults.

The filter now runs only over the default column set. A hand-written list is rendered verbatim, empty or not.

The filter could not do most of what it claimed

Format::cell() returns an em dash for a missing value in every format except email, so a test for an empty string could only ever match a suppressed email address — and exactly one column in the whole endpoint registry uses that format. Every other empty column survived as a full column of dashes, while the commit message ("a description or phone nobody has filled in"), CHANGELOG.md and readme.txt all described a feature that was not there.

The placeholder is now the named constant Format::PLACEHOLDER, and Format::is_blank() judges a cell by meaning rather than by length. [procore_rfis] against a project where no RFI has a due date now drops the column, as documented.

A column's fate depended on its neighbours

Because the never-render-an-empty-table fallback returned the unfiltered list, columns="email_address" kept the Email column while columns="name,email_address" dropped it. Same data, same setting, opposite outcome — adding a column to a working shortcode could silently remove a different one. Honouring explicit lists removes this at the root.

Tests

Three tests, one per defect. Each was run against the previous behaviour first and observed to fail before the fix was restored:

1) test_keeps_an_empty_column_the_author_asked_for
2) test_drops_a_default_column_no_record_populates
3) test_column_visibility_does_not_depend_on_other_columns
Tests: 106, Assertions: 399, Failures: 3.

Also

  • The 2.0.5 changelog and readme entries are corrected where they claimed behaviour that never shipped.
  • docs/shortcodes.md gains an Empty columns section stating what the filter does and where it stops.
  • .distignore excludes /vendor rather than /vendor/bin. Every dependency is dev-only and the release workflow was passing an extra --exclude=vendor to compensate, so anyone building from .distignore alone shipped the whole dev tree.

Verification

  • 106 tests, 401 assertions — pass
  • PHPCS WordPress-Extra + WordPress-Docs — clean across 52 files
  • Plugin Check against the staged distributable, all categories plus experimental checks at severity 1 — no errors, no warnings. Confirmed the checker was live by running it against the bundled Akismet and Hello Dolly, which it flags extensively.

🤖 Generated with Claude Code

Reviewing 2.0.5 turned up three defects, all in the column filter it added.

An explicit `columns=` list was filtered like any other. Asking for
`[procore_team columns="name,email_address"]` rendered only Name — the column
was requested by name and removed without a header, a cell or an explanation.
The filter now runs only over the default column set, which is the set the
author never chose; a hand-written list is rendered verbatim.

The filter could not do most of what it claimed. `Format::cell()` returns an
em dash for a missing value in every format except email, so testing for an
empty string only ever matched a suppressed email address. Every other empty
column survived as a full column of dashes, while the commit message, the
changelog and readme.txt all said otherwise. The placeholder is now a named
constant and `Format::is_blank()` judges a cell by meaning rather than length,
which makes the documented behaviour true.

A column's fate depended on its neighbours. The never-render-an-empty-table
fallback restored the whole list, so `columns="email_address"` kept the Email
column while `columns="name,email_address"` dropped it — same data, opposite
outcome, and adding a column to a working shortcode could silently remove a
different one. Honouring explicit lists removes the inconsistency at its root.

Three tests, one per defect; each was confirmed to fail against the previous
behaviour before the fix was restored. The 2.0.5 changelog entry is corrected
where it claimed something that never shipped, and `docs/shortcodes.md` now
documents what the filter does and where it stops.

Also excludes `/vendor` rather than `/vendor/bin` from `.distignore`. Every
dependency is dev-only, and the release workflow was passing an extra
`--exclude=vendor` to compensate — building from `.distignore` alone shipped
the entire dev tree.

Verified: 106 tests pass, PHPCS WordPress-Extra + WordPress-Docs clean across
52 files, and Plugin Check reports no errors or warnings on the staged
distributable with every category and experimental check enabled at severity 1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ibuilder
ibuilder merged commit 6d54ada into main Aug 9, 2026
13 checks passed
@ibuilder
ibuilder deleted the fix/column-filter-scope branch August 9, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant