feat(widgets): 4×5 grid, allowed block sizes and corner resize - #22
Merged
Merged
Conversation
- Geometry: 4 columns, 129px cells, 12px gap/padding, 16px block radius, max 5 editable rows; findFreeSpot/layoutsOverlap shared - Shared BLOCK_SIZES registry (legacy sizes doubled for now), snapToAllowedSize; server rejects unsupported sizes and layouts taller than 5 rows (migrated taller widgets stay editable if they don't grow) - Data migration: double every block layout, grid columns 4, recompute heights (widgets look the same) - Editor: corner resize with snapped preview, row-limit notice, 'Fit into 5 rows' for migrated widgets, draft cache v5, limit 8 blocks - New blocks default to 2x2 at the first free spot - Fix: FLIP animation lost in the SVG renderer switch; page shifting sideways on scrollIntoView (overflow-x: clip) - docs/design/grid-and-blocks.md: grid spec, variant matrix, plan tiers
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
The layout update schema still capped the list at 5, so the editor could not save a widget with more blocks. Also update the 5-block messages.
- Per-type renderers in shared/widget/blocks/ chosen by size family (tiny 1x1, strip 2-3x1, wide 4x1, card, large); the previous designs become the card variant - New layouts: 1x1, 2x1 and 4x1 for every data block, 4x2 for the GitHub profile and LeetCode; text fits itself to any size - Shared parts: BigStat, SegmentBar, Avatar, fitFontSize, wrapText; compact 'add a username' state for small blocks - BLOCK_SIZES gains compact sizes (legacy sizes kept for migrated widgets); text defaults to 2x1; new blocks fall back to smaller sizes when the default does not fit - Fix: layout updates were capped at 5 blocks - Tests render every block in every allowed size
4 tasks done
TheGeniusOfEternity
marked this pull request as ready for review
October 3, 2026 15:33
feat(widgets): size-aware block variants
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 2 of the grid refactor. Stacked on #21.
Summary
Grid (
shared/widget/geometry.ts): 4 columns × up to 5 editable rows, 129px cells, 12px gap and block padding, 16px block radius. 4×4 = 600×600, 4×5 = 600×741.Block sizes (
shared/widget/blockSizes.ts): each type declares its sizes. For now that's the old sizes doubled (2×2, 2×4, 4×2, 4×4), so blocks keep their current look; variants come in step 3.snapToAllowedSizedrives the editor.Server:
validateLayoutsrejects sizes the type doesn't support and layouts taller than 5 rows. Widgets migrated from the old grid that are already taller stay editable as long as a change doesn't make them taller.MAX_WIDGET_BLOCKS= 8.Migration
20261003145347_grid_4_columns(data only):grid.columns= 4;Verified on local data: all 8 widgets doubled exactly, heights match the formula. 5 of 8 ended up taller than 5 rows, because old widgets often stacked blocks in one column.
Editor:
Fixes:
scrollIntoView:.appShellusesoverflow-x: clip.Docs:
docs/design/grid-and-blocks.mdcovers the grid spec, the planned variant matrix and plan tiers (free 8 / paid 16 / special 20; only free is implemented).AGENTS.mdandCHANGELOG.mdupdated.Test plan
format:check,lint,typecheck,test(54 client + 69 server),build,typecheck:api