fix(routes/index): scale the adapter graph to its container - #1108
Open
sukvvon wants to merge 8 commits into
Open
fix(routes/index): scale the adapter graph to its container#1108sukvvon wants to merge 8 commits into
sukvvon wants to merge 8 commits into
Conversation
📝 WalkthroughWalkthrough
ChangesResponsive graph layout
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tanstack-com | 4d4fd51 | Commit Preview URL Branch Preview URL |
Aug 05 2026, 02:11 AM |
sukvvon
marked this pull request as ready for review
August 5, 2026 01:55
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/routes/index.tsx`:
- Line 621: Update the graph transform scale calculation at the visible
transform declaration to use an 80px viewport offset instead of 64px, and lower
the clamp minimum from 0.8 to 0.75. Preserve the existing maximum scale and
overall responsive scaling behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
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.
The Framework Agnostic diagram on the landing page overflows its card on phones — the React and Solid nodes sit flush against the edges and read as clipped.
Cause
The node coordinates are hard-coded against a 320×128 grid, so the whole graph is scaled as a unit.
scale-[1.35]exists to fill the 460px slot that only appears atlg(PrinciplePanelisw-full lg:w-[460px]), but the scale applied at every width.At 375px the graph renders 432px wide inside a 295px slot — 137px of overflow.
Fix
Derive the scale from the wrapper's own width via a container query:
100cqw / 320pxis the slot width ÷ the graph's authored width. The 1.35 cap is main's existing value, so anything at or abovelgis untouched.Measuring the slot directly avoids restating the ancestors' padding — an intermediate revision computed
100vw - 64pxand was wrong, becausepx-4contributes 32px (16 per side), not 16. Anything that re-derives the slot arithmetically has to be kept in sync with two separate padding declarations;cqwcannot drift.Measured
Slot widths are read from the DOM. Below
lgthe graph fills its slot exactly; the 0.75 floor is reached right at 320px, so nothing narrower is left unhandled.Notes
styleover a Tailwind class —scale-[clamp(…)]does not compile; the element rendered withtransform: none. The same component already setstransforminline for the flow dots, andadapterGraphStyle()/adapterGraphPointStyle()are inline-style helpers, so this fits the file./ 320px, not/ 320— dividing a length by a unitless number is rejected by the CSS parser; it has to be length ÷ length to yield a scalar.ref={rootRef}stays on the scaled element, not the new wrapper, so Pause offscreen homepage adapter motion #1093's in-view observer keeps watching the same box it did before.Verification
Layout at each width above: scale, rendered width, and node bounds read from the DOM and compared against the slot — locally and on the deployed preview.
#1093's motion was confirmed by comparing successive screenshots (the node highlight advances
React → Vue → Solid, and the flow dots sit at different points in each frame). Worth noting for anyone re-checking this: sampling element positions from injected JS reports the animation as frozen regardless of whether it is running, so screenshots are the only reliable check here.Summary by CodeRabbit