Repository navigation
Conversation
Member
|
@WhyTan00 Please provide an example showing the situation before and after the fix. |
There was a problem hiding this comment.
🟡 Changes recommended
Quadrant positioning ignores measured bounds origins, leaving items with offset children off-center and potentially crossing quadrant boundaries; the coordinates need correction and an offset-child regression test.
1 open issue
What changed in this PR
This PR addresses the quadrant-sizing portion of #260, complementing the list-grid changes in #264. It replaces first-item sizing with per-item measurements without changing fixed-size cards or text overflow behavior.
Changes:
- Measures the first four items using their rendered orientations.
- Sizes default quadrants from maximum item dimensions and centers items individually, preserving explicit dimensions.
- Adds six regression cases covering sizing, centering, item limits, uniform spacing, and empty data.
| File | Description |
|---|---|
src/designs/structures/compare-quadrant.tsx |
Uses per-item measurements for quadrant sizing and placement. |
__tests__/unit/designs/structures/compare-quadrant.test.tsx |
Adds synthetic SVG regression coverage for quadrant layout behavior. |
Review effort: Balanced
Comment on lines
+231
to
+232
| x: (index % 2) * quadrantWidth + centerX - bounds.width / 2, | ||
| y: Math.floor(index / 2) * quadrantHeight + centerY - bounds.height / 2, |
This branch has not been deployed
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.

Summary
Quadrant layouts currently measure only the first item and use that size to position all four items. Different content or orientation-dependent item dimensions can overflow their quadrant or be centered incorrectly.
Measure the first four items with the same orientation props used for rendering, size default quadrants from their largest dimensions, and center each item using its own bounds. Explicit quadrant dimensions and empty-data behavior are preserved.
Related to #260 (quadrant layout portion). This complements #264, which changes list-grid. It does not address fixed-height item text, fixed-size cards, or pie-label collisions, so it should not close the broader issue.
Validation
The test fixture type annotations were corrected after the full suite, then test typecheck and lint were rerun. No generated build output or dependencies are included.
Implementation and regression tests assisted by OpenAI Codex.