Skip to content

fix: keep design system select after template selection, fix some e2es - #4340

Merged
sidmohanty11 merged 3 commits into
mainfrom
preserve-design-system
Sep 7, 2026
Merged

fix: keep design system select after template selection, fix some e2es#4340
sidmohanty11 merged 3 commits into
mainfrom
preserve-design-system

Conversation

@sidmohanty11

@sidmohanty11 sidmohanty11 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Design systems

  • Fixed "No design system" not sticking — picking it was read as "nothing chosen yet", so the picker snapped straight back to your default or the first usable system, and generations kept using it.
  • Fixed the design system picker disappearing after you apply a template — it was tied to the empty-design start row, so filling the design took the control away with it.

Canvas

  • Fixed the canvas flipping to white the moment you draw your first shape — Chrome paints an opaque base behind an iframe whose colour scheme disagrees with the editor's, so the transparent board document composited over white instead of the canvas.
  • Fixed the canvas colour going stale — the board layer snapshotted the theme variable into JS during render; it now reads the live variable, so there's one canvas colour instead of two that could disagree.
  • Fixed the Canvas swatch reading NONE — it was fed the stored value, so an unset canvas looked like "no colour"; it now shows the colour the canvas is actually painted with.
  • Fixed text drawn on the canvas always being white, unreadable on a light canvas — it now takes its colour from the surface it lands on.

Designs list

  • Fixed the "…" menu being invisible in light mode — a fixed dark chip with a theme-following icon; it's now one scrim that reads on any thumbnail, matching the checkbox beside it.
  • Fixed the grid stranding a single card on the last row — the New Design card shares the grid, so a full page was 13 tiles.

Templates page

  • Fixed "template" being repeated everywhere — dropped the page title that duplicated the nav item, its description, and the section description.

CI e2e suite

  • Fixed a real race in the primitive-drawing test — it read the server file immediately after drawing, before autosave landed; the wait now lives in the helper.
  • Fixed a font-metric-dependent auto-layout drag — the drop point sat 12px past a button's edge, which escaped the row on Linux and reordered out of it.
  • Fixed a sidebar test asserting a pixel width that really measured whether the seed design had persisted frame geometry.

@netlify

This comment has been minimized.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Here's a visual recap of what changed:

Visual recap

Open the full interactive recap

builder-io-integration[bot]

This comment was marked as outdated.

builder-io-integration[bot]

This comment was marked as outdated.

@builder-io-integration builder-io-integration Bot left a comment

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.

Builder reviewed your changes and found 2 potential issues 🟡

Review Details

Incremental Code Review Summary

The latest PR head addresses both previously open canvas findings: direct board text insertion now ignores the unpainted board document body, and board render styling replaces stale scheme-specific injected CSS instead of trusting the marker alone. I resolved both prior review threads after verifying those fixes in the diff.

The design-system picker fix also correctly preserves an explicit null while the composer is open. However, the latest changes expose two new state/layout regressions. The design-list page size is reduced globally even though the extra New Design tile only appears on the first page, and the composer still clears its local selection when the prompt closes, so the explicit no-system choice does not survive reopening.

Key Findings

  • 🟡 MEDIUM — Pages after the first now fetch/render 11 cards without the extra New Design tile, leaving an incomplete final row and contradicting the grid-filling behavior.
  • 🟡 MEDIUM — Closing the composer resets the explicit no-design-system choice, so reopening it can resolve the workspace default again.

Three parallel code-review agents found no security or material performance concerns. Focused unit suites passed in the agent checks. Browser verification was attempted, but Chrome automation tools remain unavailable.

Risk assessment: Standard, because the changes affect editor UI state, rendering, pagination, and tests.

🧪 Browser testing: Attempted after review but unavailable — no Chrome automation tools were exposed in this session.

Comment on lines +115 to +117
// The New Design card shares the grid, so a full page is pageSize + 1 tiles;
// 12 is what divides evenly into every breakpoint's column count.
const DESIGN_PAGE_SIZE = 11;

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.

🟡 Keep later design-list pages aligned to the grid

DESIGN_PAGE_SIZE is reduced to 11 so the first page's 11 designs plus the New Design tile make 12 tiles, but that tile is only rendered on the first page. Subsequent pages therefore contain 11 cards and still end with a stranded card in the existing 3- or 4-column grids. Keep later API pages at a grid-aligned size or handle the first-page tile separately without reducing every page.

Additional Info
New issue found by 1 of 3 parallel code-review agents; confirmed against the first-page-only New Design tile behavior.

Fix in Builder

Comment on lines +15760 to +15764
const handleComposerDesignSystem = useCallback(
(designSystemId: string | null) => {
setPromptDesignSystemId(designSystemId ?? undefined);
// null is the user picking "No design system"; only undefined means
// nothing has been chosen yet, which re-resolves the default.
setPromptDesignSystemId(designSystemId);

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.

🟡 Preserve the explicit no-system choice across composer reopen

The handler now correctly stores null, but closing the prompt still resets promptDesignSystemId to undefined. Reopening the composer therefore re-runs the default resolver when the design has no linked system, so “No design system” only appears to stick until the composer closes. Preserve the intentional no-system state across close/reopen, or distinguish it from an untouched design when restoring the selection.

Additional Info
New issue found by 1 of 3 parallel code-review agents; distinct from the resolved null-to-undefined handler issue.

Fix in Builder

@sidmohanty11
sidmohanty11 merged commit 51b1e3c into main Sep 7, 2026
44 checks passed
@sidmohanty11
sidmohanty11 deleted the preserve-design-system branch September 7, 2026 12:28
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