fix: keep design system select after template selection, fix some e2es - #4340
Conversation
This comment has been minimized.
This comment has been minimized.
|
Here's a visual recap of what changed: Open the full interactive recap |
There was a problem hiding this comment.
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.
| // 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; |
There was a problem hiding this comment.
🟡 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.
| 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); |
There was a problem hiding this comment.
🟡 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.

Design systems
Canvas
Designs list
Templates page
CI e2e suite