Skip to content

Release 0.4.0: exact board size from tsquare's measureBoardLayout - #6

Merged
individual11 merged 1 commit into
mainfrom
measured-layout
Oct 27, 2026
Merged

individual11 merged 1 commit into
mainfrom
measured-layout

Conversation

@individual11

Copy link
Copy Markdown
Member

useBoard (behind Wireframe, WireframeViewer and the playground) sized each board's image and placed the viewer's screen chips with tsquare's boardLayout. That's a synchronous estimate, and on boards where a note wraps differently than its length suggests (tsquare-js/tsquare#44) it's a line or more off. The image was then scaled into a slightly wrong box, and the chips zoomed to the wrong place.

Change

  • The layout: useBoard gets it from measureBoardLayout (new in tsquare 0.13.2), in parallel with the render. It measures notes as they're drawn.
  • The tsquare range is ^0.13.2, since measureBoardLayout is new there. That drops 0.12, so this is 0.4.0. Boards also get tsquare's renderer fixes from 0.12.3 to 0.13.2.

Checked

  • New test: on a board with a notes-only grid row, the image's width/height equal the SVG's own. The test also confirms boardLayout's estimate is off for that board, and it fails without the change.
  • Typecheck, build and all 23 tests pass.

To release after merging: tag v0.4.0.

🤖 Generated with Claude Code

useBoard sized the image and placed the viewer's screen chips with
boardLayout, an estimate that's off on boards where a note wraps
differently than its length suggests (tsquare-js/tsquare#44). It now uses
measureBoardLayout, so it needs tsquare ^0.13.2. Test: a notes-only grid
row, where the image's size must equal the SVG's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused layout change, regression coverage, and release metadata are consistent, with no unresolved blocking issues identified.

No open issues 🎉

What changed in this PR

This PR prepares version 0.4.0 and replaces estimated board dimensions with tsquare’s measured layout, keeping wireframe images and viewer screen chips aligned with the rendered SVG.

Changes:

  • Measures board layout alongside SVG rendering.
  • Adds a regression test for image dimensions when notes wrap differently than estimated.
  • Requires tsquare ^0.13.2 and updates release metadata and documentation.
File Description
test/​react.test.tsx Adds regression coverage for exact image dimensions with wrapped notes.
src/​use-board.ts Uses measureBoardLayout in parallel with SVG rendering.
package.json Bumps the release to 0.4.0 and requires tsquare ^0.13.2.
package-lock.json Synchronizes release metadata and locks tsquare to 0.13.2.
CHANGELOG.md Documents the layout correction and new minimum dependency version.

Review effort: Balanced

@individual11
individual11 merged commit 52fe0ff into main Oct 27, 2026
4 checks passed
@individual11
individual11 deleted the measured-layout branch October 27, 2026 16:17
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