fix(Camera): infinite range [YTFRONT-6029] - #146
Merged
Merged
Conversation
Reviewer's GuideCamera zoom limits are now configurable in milliseconds, defaulting to a 5-second minimum and unrestricted zoom-out, with directional handling that avoids collapsing externally wider ranges. Documentation, regression tests, and a Storybook demonstration cover the new behavior. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
|
Preview is ready. |
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/TimelineController.ts" line_range="100-114" />
<code_context>
...interactions,
});
+const getZoomDomain = (
+ domain: number,
+ factor: number,
+ minRange: number,
+ maxRange?: number,
+) => {
+ const nextDomain = domain * factor;
+
+ if (factor < 1) {
+ return domain <= minRange ? domain : Math.max(nextDomain, minRange);
+ }
+
+ if (maxRange === undefined) return nextDomain;
+
+ return domain >= maxRange ? domain : Math.min(nextDomain, maxRange);
+};
+
</code_context>
<issue_to_address>
**issue (bug_risk):** The zoom limits are applied independently, so a configuration with `minRange` greater than `maxRange` produces ranges that violate one of the configured limits: zoom-in clamps to `minRange`, while zoom-out clamps to `maxRange`. The public configuration type accepts this invalid combination without validation.
**Triggers:** When callers configure `minRange` greater than `maxRange`.
**Suggested fix:** Validate that both ranges are positive and `minRange <= maxRange`, or normalize/reject the configuration before handling wheel events.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: src/TimelineController.ts:114
SimbiozizV
force-pushed
the
YTFRONT-6029_2
branch
from
September 15, 2026 22:04
5c6ba7e to
68bcfa9
Compare
SimbiozizV
force-pushed
the
YTFRONT-6029_2
branch
from
September 16, 2026 09:29
5055b9f to
223ac70
Compare
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 by Sourcery
Enhance camera interactions and canvas rendering with bounded, configurable zoom, synchronized range updates, typography token support, and event hover cursors.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests:
Chores: