Repository navigation
Release 0.4.0: exact board size from tsquare's measureBoardLayout - #6
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
🟢 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.2and 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
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.
useBoard(behindWireframe,WireframeViewerand the playground) sized each board's image and placed the viewer's screen chips with tsquare'sboardLayout. 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
useBoardgets it frommeasureBoardLayout(new in tsquare 0.13.2), in parallel with the render. It measures notes as they're drawn.^0.13.2, sincemeasureBoardLayoutis 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
width/heightequal the SVG's own. The test also confirmsboardLayout's estimate is off for that board, and it fails without the change.To release after merging: tag
v0.4.0.🤖 Generated with Claude Code