fix: zoom should be wrt the current scrubbers#178
fix: zoom should be wrt the current scrubbers#178tibisabau wants to merge 2 commits intotrykimu:mainfrom
Conversation
Bumps the npm_and_yarn group with 1 update in the / directory: [ajv](https://github.com/ajv-validator/ajv). Updates `ajv` from 6.12.6 to 6.14.0 - [Release notes](https://github.com/ajv-validator/ajv/releases) - [Commits](ajv-validator/ajv@v6.12.6...v6.14.0) --- updated-dependencies: - dependency-name: ajv dependency-version: 6.14.0 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the user experience of the timeline's zoom feature by making it relative to the current playhead position. Previously, zooming always occurred from the left edge, which could be disorienting. Now, the timeline zooms in and out around the user's current focus, providing a more natural and intuitive interaction. This change improves usability without introducing any breaking changes. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly implements zooming relative to the ruler position, which provides a more intuitive user experience. The changes in useTimeline.ts, home.tsx, and llm-handler.ts are consistent and well-implemented. I've identified an opportunity to refactor the zoom handling logic in useTimeline.ts to reduce code duplication, which would improve maintainability.
Summary
Fixed zoom functionality to zoom relative to the current ruler position instead of from the left edge of the timeline. This provides a more intuitive zoom experience where the playhead stays centered during zoom operations.
Changes
handleZoomIn,handleZoomOut, andhandleZoomResetinuseTimeline.tsto accept an optionalcenterPxparameter representing the zoom center pointhome.tsxto pass the currentrulerPositionPxas the zoom centercenterPxparameter for consistencyThe zoom now uses the formula:
newLeft = scrubber.left * zoomRatio + centerPx * (1 - zoomRatio), which ensures the timeline zooms toward/away from the ruler position rather than always from the left edge.Testing
Screenshots / Recordings (if UI)
N/A
Related Issues
Closes #104
Breaking Changes
None. The zoom functions now accept an optional parameter with a default value of 0, maintaining backward compatibility.
Deployment Notes
None required.
The code in this pull request was generated by GitHub Copilot with the Claude Sonnet 4.5 model.