VIEW-3: re-fit camera on significant viewport resize (stale-size saved camera)#108
Merged
Conversation
…ze saved camera The per-graph saved camera was restored even after the window was resized/rotated, leaving the graph mis-framed for the new size. Now: - the saved camera is stamped with the viewport size (w/h); on restore, a >20% size mismatch is treated as stale → fresh fit instead of the old transform. - a ResizeObserver on the graph container re-frames on a >20% size change (debounced 250ms), covering window resize / rotate / panel toggle. (Window 'resize' alone didn't fire in headless tests; the observer is reliable and also catches layout-driven size changes.) Test: camera.spec "re-frames the graph after a significant viewport resize" (pan off-screen → shrink window → graph re-framed). 5/5 camera tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🧪 Comprehensive Test Suite
Full-stack smoke gate runs in the CI workflow. |
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 per-graph saved camera was restored even after the window was resized/rotated → graph mis-framed for the new size (audit exposed it across resolutions).
ResizeObserveron the graph container re-frames on a >20% size change (debounced), covering resize/rotate/panel-toggle. (The windowresizeevent didn't fire in headless tests; the observer is reliable and also catches layout-driven size changes.)Test:
camera.spec"re-frames after a significant viewport resize" — pan off-screen → shrink window → re-framed. 5/5 camera tests pass. Typecheck clean.🤖 Generated with Claude Code