refactor(widgets): render widgets with one shared SVG renderer - #21
Merged
Merged
Conversation
- Split server/src/shared/widget into svgPrimitives, BlockContent, canvasParts and the WidgetCanvas export composition - Client WidgetSurface places the shared CanvasBackground and a BlockShell per block (separate SVGs positioned by canvasBoxes); WidgetCanvas and the skeleton are thin wrappers; the HTML canvas and its CSS are removed - Editor blocks are DOM overlays (drag, size, remove, selection) around the shared block SVG; drop cells sit in a layer over the grid area - Loading state is an SVG skeleton shared with the export
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
4 tasks done
tsc-alias pulled in braces@3.0.3 (via chokidar and globby), which has a high-severity advisory with no patched release (GHSA-vfj7-8cjw-p6xm), so npm audit --audit-level=high failed CI on every branch. - server/scripts/resolve-aliases.mjs rewrites @server/* and @shared/* imports in dist to relative paths (tested) - npm audit fix for brace-expansion and ip-address
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 1 of the grid refactor (4×5 grid + size-aware blocks). No visual change intended.
Why
Every block was implemented twice: as HTML/CSS (editor, public page, iframe) and as SVG (export). Size-specific block variants would double that again. Now there is one implementation.
What changed
server/src/shared/widget/split into:svgPrimitives.tsx: text, rows, truncationBlockContent.tsx: per-type drawing, skeleton / error / preview statescanvasParts.tsx:CanvasBackground,BlockShell,CanvasEmptyState,canvasBoxesWidgetCanvas.tsx: the/image.svgcomposition, same output as beforeWidgetSurfacerenders the same parts in the browser: the background and each block as separate<svg>s positioned bycanvasBoxes, with per-instance SVG ids.WidgetCanvasand the skeleton are now thin wrappers. Removed the HTML canvas, its CSS andcanvasStyle.ts.AGENTS.md,add-block-typeandwidget-render-parityskills updated for the single renderer.Test plan
image.svgare identicalformat:check,lint,typecheck,test(51 client + 62 server),build,typecheck:api