Skip to content

fix(stardust): remove Figma template binding and keep emphasis, tables and image side in reskin - #860

Draft
sanyasandal wants to merge 8 commits into
mainfrom
ssandal-adobe-ideal-barnacle
Draft

sanyasandal wants to merge 8 commits into
mainfrom
ssandal-adobe-ideal-barnacle

Conversation

@sanyasandal

@sanyasandal sanyasandal commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Removes the template binding added in #531 and fixes rendering defects found on a migrated page, generically.

Template binding removed. Pages bound to templates lost their structure: link lists, card images and section spacing broke. This reverts the template commits (reference/templates.md, figma/templates.mjs, figma-gate/page-match.mjs and their tests). The revert restores the earlier figma.geometry fallback. The page-sanity check stays.

Rendering fixes:

  • Emphasis and line breaks: capture-content now records marks (strong em sup sub) and br on stream nodes, and stream-render rebuilds them. Bold, superscript and forced line breaks now survive.
  • Data tables: capture-content records cell ({table,row,col,header?,w?}) and stream-render rebuilds a real <table>. w is the cell's width in % of its table; the first row keeps it, with table-layout: fixed, so the source's 50/50 or 33/33/33 columns survive. A table with no header cells and more than one row takes its first row as the header. New optional roles palette.tableHeaderBg and palette.tableStripeBg set the header and even-row fills.
  • Tables in a split: a data table in a split slot, and everything after it, renders full width below the image and its text (.split-below), as on the source page.
  • Lists are never cards: a run of bare list items is one list, so a list before a lone card no longer turns into card items.
  • Image side: capture-content records an image's side beside its text. A split puts the image on that side. --check refuses split when the source image is not beside its text (an image-top card).
  • Split alignment: the text in a split starts level with the image, and a closing button sits level with the image bottom. On mobile the image goes first. This matches both the source page and the Figma "Teaser / Text + Image" variants.
  • Lone card: a cards slot with no repeating run keeps its intro text and renders the last image and what follows it as one card.
  • Card image and width: a card's leading image fills the card and bleeds to its edges (the card padding negated per side), no longer inset and capped at 360px. One card defaults to a third of the row. On mobile, card padding is 24px unless a token sets it.
  • Hero overlay: new layout word overlay (with media-band). The text sits on the image under a palette.overlay scrim, with no panel box. --check requires media-band; render warns when palette.overlay is missing.
  • Heading sizes: new optional roles type.mobile.display|h2|h3|h4, emitted under 640px. curate fails when the kit names a heading text style (H2, Mobile/H2) that type.h2–h4 / type.mobile.h2–h4 don't map, curate or mark absent.
  • page-sanity: reports a stretched image.
  • Links: new optional roles palette.linkFg|linkHoverFg|focusRing set the inline link color, its hover color and a keyboard focus ring. On a dark band or an overlay, links keep the band's text color.
  • Section nav: a list whose every item is only an in-page #id link renders as a row of bold links (.page-nav), stacked on mobile.
  • Back to top: a #top link renders right-aligned and bold with an up arrow, in the link hover color.
  • Table cells: a row with fewer cells than the widest row is filled with empty cells, so every row keeps its borders. New optional roles type.table and layout.tableCellPadding set cell text and padding.
  • Split heading: in a split whose image follows only headings, the headings span the full width above the image and its text, as on the source page.
  • Small print: capture-content flags a paragraph or list item set below 90% of the body copy size as small (references, abbreviations, footnotes). The renderer sizes it with the new optional role type.small, or 0.75em.
  • Font fallback: figma-gate/type-css sets a role's font to the :root font stack that leads with that family (var(--heading-font-family)), so the donor's fallbacks apply. Before, a serif such as Lexia fell back to sans-serif.
  • Centred sections: capture-content records align: "center" on a section whose headings, paragraphs and list items are all centred. The renderer adds align-center: centred text and a centred narrow panel.
  • Text on an image: capture-content records, on an image with text over it, backdrop (bare when the text sits straight on the image, panel when a box behind the text paints), bleed (the image spans the viewport) and height. --check refuses media-band without overlay over a bare backdrop, so the text no longer gets a grey panel the source doesn't have.
  • Contained band image: a media-band image with bleed: false renders inside the panel at its source height (from 900px), not full-bleed. With overlay the scrim covers only that image.

New stream fields: marks, br, cell, side, small, backdrop, bleed, height, and section align (documented in content-model.md). No new scripts, hooks, MCP servers or network endpoints.

How I checked it

  • node plugins/stardust/skills/reskin/scripts/test/<name>.test.mjs for every reskin test: 42 of 42 pass.
  • New checks written first and seen failing: marks/br, tables, table shading, image side, split alignment, lone card, card image bleed, mobile headings, overlay, kit heading styles, stretched image.
  • Rendered the overlay and the table stripes in Chromium (Playwright) and read the computed styles: no panel box, white heading, rgba(63, 68, 68, 0.75) scrim, header and even-row fills as set.
  • Captured the real source page with capture-content (39 slots), rendered it with stream-render and compared screenshots with the source at 1440 and 375 px: the split teaser's table goes full width below with 50/50 columns, the 3-column tables keep 33/33/33, and the follow-up section is the paragraphs, one list, then one card a third wide with its image filling the top; the resources cards' images fill their tops too.
  • New checks for split-below, header rows, cell widths and list runs were written first and seen failing.
  • New checks for link states, section nav, back to top, table fill and cell tokens, split heading (render and canon skeleton) and small print (capture and render) were written first and seen failing.
  • Re-captured the source page and rendered it with the Figma kit's values (link #4f5555, hover #d0006f, focus #830051, small 12/20, table 14/21 with 16px padding). Read the computed styles at 1440 and 375 px: section nav in a row (a column on mobile), 5 back-to-top links in #d0006f aligned right, references at 12/20, every row of the 3-column table 3 cells wide, split headings above the image in 3 sections.
  • New checks for the font fallback, section align, image backdrop/bleed/height (capture), align-center, the bare-backdrop --check and the contained band image (render) were written first and seen failing.
  • Captured the source products page: the CTA slot records align: center, image backdrop: bare, bleed: false, height: 389; the hero image records bare, bleed: true. checkMapping refuses media-band for the CTA. Rendered it as media-band overlay at 1440 and 375 px: the image sits contained at 1200×389, the heading and button centred, with no panel box.
  • npm run validate: passed.
  • node scripts/check-release-configs.mjs: 0 broken.
  • npm run lint:stardust: passed (script-help, site-names, browser-front-door, manifests).
  • node scripts/check-skills.mjs --tokens plugins/stardust: reskin SKILL.md 4949 of 5000.
  • node plugins/stardust/evals/lint/prose-delta.mjs: -82 lines, -649 words across skill docs.
  • Tests outside reskin fail locally in skills this PR does not touch: deploy/da-media-upload, deploy/deploy-batch and dynamics/dynamics-plan because the checkout path contains a space, and replica/measure on an image rendition width (360 vs 400).

Checklist

  • The change is to one plugin, or to repository tooling
  • npm run validate passes
  • Paths, commands and skills that the change names exist
  • New scripts, hooks, MCP servers or network endpoints are called out above
  • The human label is set, if a person and not an agent wrote this

ssandal and others added 2 commits December 1, 2026 15:28
Reverts the template binding from #531 (figma/templates.mjs,
figma-gate/page-match.mjs, reference/templates.md and their tests).
Pages bound to a template lost link lists, card images and section
spacing. The figma.geometry fallback is restored; page-sanity stays.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… reskin

- capture-content: record marks (strong em sup sub), br, table cell and
  the side an image sits on beside its text.
- stream-render: rebuild marks, line breaks and data tables; table header
  and stripe fills (palette.tableHeaderBg|tableStripeBg); place a split
  image on its side and refuse split when the image is not beside its
  text; lone image-top card keeps its intro text; new `overlay` layout
  for media-band (text on image under palette.overlay); mobile heading
  sizes (type.mobile.*).
- figma rules: a kit heading text style must be mapped, curated or absent.
- page-sanity: report a stretched image.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@sanyasandal
sanyasandal requested a review from paolomoz as a code owner December 1, 2026 10:17
@sanyasandal
sanyasandal marked this pull request as draft December 1, 2026 10:18
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

claude: approved on 977c8ba

The PR changes only stardust. It reverts the Figma page-template binding added in #531, which deletes templates.md, figma/templates.mjs, figma-gate/page-match.mjs and their tests. It also adds reskin rendering fixes: inline marks and br, data tables with header and stripe fills, the side an image sits on in a split, a lone card, a media-band overlay hero, mobile heading sizes, a curate check for kit heading styles and a page-sanity check for stretched images.

Checks:

  • npm run validate and the release config check pass on both trees.
  • npm run lint:stardust passes: script-help, site-names, browser-front-door and the manifests are in step.
  • reskin SKILL.md is at 4949 of 5000 tokens and has an eval.
  • prose-delta is -83 lines.
  • Every reskin test passes except the browser checks in figma-gate.test and stream-render.test. Those fail because playwright is missing from this environment, and they fail the same way on the base.
  • No reference to the removed files, figma.page, template-binding.json or templateSection is left in the plugin.
  • The new render paths escape text and allowlist marks to strong, em, sup and sub. No new script, hook, MCP server or endpoint.

The PR changes how figma.geometry is handled: a fitting module that still misses now takes a hands-off fallback instead of a needs-owner hold. The PR body calls this out and reskin-ledger.test covers it.

Redundant lines: none. I asked ask-baseline about the new contract lines: the stream fields marks, br, cell and side, the overlay layout with the palette.overlay scrim, and the table and mobile heading roles. It didn't know any of them. 4 lines probed (content-model.md, mapping-json.md, mapping-brief.md, donor-sources.md), 0 redundant, 0 not probed. The SKILL.md line "structure is informational, never gating" is a project rule an outside model can't know.

Test drive: no eval run. The skill prose change is mostly a removal and the behaviour change lives in scripts that their unit tests cover. Manifests are unchanged, so installation isn't affected.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

codex: denied on 977c8ba

The new table renderer can shift values beneath the wrong headers when a source cell is empty, corrupting the table’s meaning. Validation, release checks, lint, 217 repository tests and installation in all four clients passed. The Claude reskin-content-fidelity eval loaded reskin, but both runs stopped at placeholder URLs. Baseline probing identified no fully redundant additions.

if (!cols.has(cell.col)) cols.set(cell.col, { th: false, nodes: [] });
const c = cols.get(cell.col); c.th ||= !!cell.header; c.nodes.push(n);
}
return `<table class="table">${[...rows.values()].map((cols) => `<tr>${[...cols.values()].map((c) => `<${c.th ? 'th' : 'td'}>${streamHtml(c.nodes, ctx)}</${c.th ? 'th' : 'td'}>`).join('')}</tr>`).join('')}</table>`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codex: Preserve empty cells when reconstructing rows. Capture emits no node for an empty cell, and iterating cols.values() discards gaps in cell.col. I reproduced a source table with headers Item / Retail / Wholesale and row Widget / [empty] / $10: the rendered row contains only two cells, placing the wholesale price under Retail. Preserve the source cell positions and table width, and add a capture-to-render regression test with empty cells. 📷 Wholesale price incorrectly displayed under Retail (table-empty-cell.png in findings-codex)

ssandal and others added 2 commits December 1, 2026 16:04
…t on mobile

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…hs, header rows, lists never cards

- A split's data table and everything after it render full width below the image and text (.split-below).
- capture-content records each cell's width as a percent of its table (cell.w); the renderer keeps it with table-layout: fixed.
- A table with no header cells and more than one row takes its first row as the header.
- findRepeat skips a run made only of list items, so a list before a lone card stays one list.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@sanyasandal sanyasandal changed the title fix(stardust): remove Figma template binding and keep emphasis, tables and image side in reskin fix(stardust): remove template binding; keep source tables, emphasis, image sides and card order in reskin Dec 1, 2026
@sanyasandal sanyasandal changed the title fix(stardust): remove template binding; keep source tables, emphasis, image sides and card order in reskin fix(stardust): remove Figma template binding and keep emphasis, tables and image side in reskin Dec 1, 2026
ssandal and others added 4 commits December 1, 2026 17:17
…es a third

The card image was inset by the card padding and capped at 360px high, and
a single card took half the width. The leading image now bleeds to the card
edges (the card padding negated per side), and one card defaults to 3
columns. On mobile the card padding drops to 24px when no token sets it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ding and small print

- Optional roles palette.linkFg|linkHoverFg|focusRing set link rest, hover and focus.
- A list of only in-page #id links renders as a row of bold links, stacked on mobile.
- A #top link renders right-aligned with an up arrow.
- Short table rows are filled to the widest row; type.table and layout.tableCellPadding set cells.
- In a split whose image follows only headings, the headings span above the image and text.
- capture-content flags small print (below 90% of body size); type.small sizes it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…t a panel, contained band image

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…; warn a card mapped outside cards

A gate fix could change a slot back to a mapping that --check had refused,
and the render and deploy went ahead, because neither ran checkMapping. Now
a render or --deploy-map of a page with a --check problem exits 1 and writes
nothing. Problems on other pages do not block it.

--check, render and --deploy-map also warn on stderr, without failing, when a
slot's last image sits above a sub-heading and copy (a card) and the slot's
layout is not cards. The deployed block follows the module, not the layout.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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