Skip to content

fix: editor grid placement, block settings validation and public API issues - #17

Merged
TheGeniusOfEternity merged 1 commit into
mainfrom
fix/editor-and-public-bugs
Sep 29, 2026
Merged

TheGeniusOfEternity merged 1 commit into
mainfrom
fix/editor-and-public-bugs

Conversation

@TheGeniusOfEternity

Copy link
Copy Markdown
Owner

Summary

Editor grid (reported bug). Resizing a block used findPlacement, which on any collision moved the block to the first free cell scanning down column 0 — e.g. growing the top-right block to 1×2 threw it under the left column. Now:

  • the resized/dropped block stays where the user put it (shifted left only if it becomes too wide);
  • other blocks are repacked with vertical compaction around it, so neighbours move down and gaps close when a block shrinks;
  • dropping onto a block of the same size swaps the two;
  • every block that moves animates (FLIP), not just the edited one.

Block settings. Clearing a text block or typing an out-of-range language count made autosave fail with a raw zod message. Empty text is now valid (renderers show the default text, as the editor already did), the language count is a 3–8 select, text/username inputs have length limits.

Other fixes

  • Legacy blocks without a stored layout are stacked by order instead of all landing on row 0.
  • GitHub languages use exact per-language byte counts across all public repos via GraphQL when GITHUB_TOKEN is set (was: each repo's whole size credited to its primary language, first 100 repos only). REST approximation remains without a token.
  • Public SVG images get their own 1200/15 min limit: README views come through GitHub's camo proxy from a few shared IPs.
  • The public widget API no longer returns the owner's userId.
  • Removed unused width/height from widget create/update schemas.

Test plan

  • Browser, 2×2 grid: resize B to 1×2 and back, A to 2×1 and back, B to 2×2 and back; drag C onto B swaps them
  • Live GraphQL languages for real users; missing user shows "GitHub profile not found"
  • New tests: placement/compaction/swap (client), GraphQL pagination + missing user + no-token fallback, empty text accepted, userId hidden, SVG vs JSON limits (server)
  • format:check, lint, typecheck, test (36 client + 34 server), build, typecheck:api

…issues

- Resizing keeps the block in place, repacks neighbours with vertical
  compaction; dropping onto a same-size block swaps them; all moved
  blocks animate (was: jump to the first free cell in column 0)
- Allow empty text blocks, language count as a 3-8 select, length
  limits on text and username inputs
- Stack legacy blocks without a layout by order instead of row 0
- Exact GitHub language bytes via GraphQL when GITHUB_TOKEN is set
- Separate, higher rate limit for public SVG images (camo proxy)
- Hide userId from the public widget payload
- Drop unused width/height from widget create/update
@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
widgecode Ignored Ignored Preview Sep 28, 2026 9:16pm UTC

@TheGeniusOfEternity
TheGeniusOfEternity merged commit 08f020f into main Sep 29, 2026
3 checks passed
@TheGeniusOfEternity
TheGeniusOfEternity deleted the fix/editor-and-public-bugs branch September 29, 2026 19:15
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