Skip to content

Table listings: honor fields/field-display-names/field-links (bd-listing-table-fields-peg1w3b3) - #480

Merged
cscheid merged 3 commits into
mainfrom
bugfix/bd-listing-table-fields-peg1w3b3
Aug 9, 2026
Merged

Table listings: honor fields/field-display-names/field-links (bd-listing-table-fields-peg1w3b3)#480
cscheid merged 3 commits into
mainfrom
bugfix/bd-listing-table-fields-peg1w3b3

Conversation

@cscheid

@cscheid cscheid commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

The built-in table listing templates hardcoded | Title | Date | Author |, ignoring fields: and field-display-names: and emitting a Q-12-10 undefined-variable warning per listing for items lacking date/author (real-world hit: Posit Connect docs how-to/index.md).

The doctemplate language is logic-less, so dynamic columns come from Rust: the binding now pre-renders listing.table-header and a per-item table-row markdown string (additive L8 binding keys), and the table templates shrink to interpolating them.

Q1-parity semantics, per the design session recorded in claude-notes/plans/2026-08-09-listing-table-fields.md:

  • Headers: built-in default display-name map (Title, Date, Author, …, image → " ") overlaid with field-display-names; unknown fields fall back to the raw field name.
  • Cells: curated fields from the item struct; unknown fields via literal-then-dotted-path extra lookup; arrays join ", "; imageimage-html; missing values → empty cell (no more Q-12-10).
  • field-links: new config surface (was parsed but unused), table default [title, filename]; typed Option so an explicit field-links: [] genuinely unlinks.
  • Defaulted field sets (no author fields:) are presence-filtered against the items — items with no authors ⇒ no Author column — and default order is Q1's Date | Title | Author.
  • Cell values are pipe-escaped / newline-flattened (markdown pipe-table limitation, accepted in design).

Latent bug also fixed

The doctemplate resolver chomps a partial's final newline (Pandoc removeFinalNl parity), so the old $items:item-table()$ merged every item into a single table row for any table listing with ≥2 items. The listing template now iterates with $for(items)$ $it:item-table()$ $endfor$; both e2e tests assert row structure.

Verification

  • TDD: 27 new tests (config/binding/transform/e2e), written first and verified failing; 11179 workspace tests pass; zero snapshot changes; full cargo xtask verify (incl. WASM leg) green.
  • Real-binary e2e on the committed repro (claude-notes/plans/listing-table-fields-investigation/repro/): single <th>How To</th>, one <tr> per item, linked titles, zero warnings. Also verified on docs/errors/index.qmd (itself a type: table listing).
  • wasm-quarto-hub-client/Cargo.lock diff is the 0.13→0.14 workspace version bumps finally reaching the standalone lockfile (refreshes only when the WASM leg builds).

Follow-ups filed

  • bd-bl1e00r6 — interactive table parity (sort-ui anchors, table-hover onclick, list.js field classes).
  • bd-0t4e07jk — bare top-level frontmatter keys as listing fields (Q1 exposes all metadata; Q2 requires listing-item.extra: opt-in — design decision pending).

🤖 Generated with Claude Code

cscheid and others added 3 commits August 9, 2026 15:58
…ields/field-display-names

Plan skeleton + committed minimal repro (2-item table listing with
fields: [title] and field-display-names). Reproduced at HEAD: output
still renders Title|Date|Author with a Q-12-10 undefined-variable
warning. Verdict: ready to design — mechanism choice (pre-rendered
binding keys vs generated template source) pending user alignment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mechanism A (pre-rendered binding keys table-header/table-row), Q1-parity
display names and cell rules (field-links, dotted-path extra lookup,
presence-filtered default fields), pipe-escaping in cells. Interactive
parity (sort-ui/hover/list.js classes) split to bd-bl1e00r6.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ing-table-fields-peg1w3b3)

The built-in table listing templates hardcoded Title|Date|Author,
ignoring fields:/field-display-names: and emitting Q-12-10
undefined-variable warnings for items lacking date/author. The
binding now pre-renders listing.table-header and per-item table-row
markdown from the listing config (Q1 parity: default display-name
map with author overlay and raw-name fallback, field-links with
table default [title, filename], dotted-path extra lookup, arrays
joined ', ', image -> image-html, missing values -> empty cell,
pipe/newline escaping); the templates shrink to interpolating those
keys. Defaulted (non-explicit) field sets are presence-filtered
against the items, and default column order is Q1's Date|Title|Author.

Also fixes a latent row-merging bug: the doctemplate resolver chomps
a partial's final newline, so the old $items:item-table()$ merged
every item into a single table row; the listing template now iterates
with $for(items)$ $it:item-table()$ $endfor$.

New binding keys (additive to the L8 contract): listing.table-header,
listing.field-links, item table-row. New config: field-links defaults
(Option so explicit [] unlinks), fields_explicit flag.

No snapshot changes. Full cargo xtask verify green. Follow-ups:
bd-bl1e00r6 (interactive table parity), bd-0t4e07jk (bare-frontmatter
listing fields).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@posit-snyk-bot

posit-snyk-bot commented Aug 9, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cscheid
cscheid merged commit ec8a35f into main Aug 9, 2026
8 checks passed
@cscheid
cscheid deleted the bugfix/bd-listing-table-fields-peg1w3b3 branch August 9, 2026 22:27
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.

2 participants