feat(timeline): add zoom preservation to timeline series#4498
feat(timeline): add zoom preservation to timeline series#4498GordonSmith merged 1 commit intohpcc-systems:mainfrom
Conversation
exposes a boolean property that when set allows the gantt chart to maintain its current zoom level instead of zooming to fit all items on update Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a preserveZoom boolean property to the ReactGantt timeline component that, when enabled, maintains the current zoom level and viewport position when data is updated, instead of automatically zooming to fit all items.
Key changes:
- Adds zoom state tracking that captures the visible time range during zoom operations
- Implements conditional zoom restoration logic in the update cycle that respects the new property
- Exposes the property through the ReactAxisGanttSeries wrapper via property proxy
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/timeline/src/ReactGantt.ts | Implements preserveZoom property with zoom state tracking in zoomed() and restoration logic in update() |
| packages/timeline/src/ReactAxisGanttSeries.ts | Adds publishProxy for preserveZoom to expose the property through the series wrapper |
The implementation is solid with good handling of edge cases (checking for finite values, clamping to valid ranges, preventing divide-by-zero). The code follows the established property-driven API pattern used throughout the framework. No critical issues were identified, and the changes are well-integrated with the existing zoom infrastructure.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
exposes a boolean property that when set allows the gantt chart to maintain its current zoom level instead of zooming to fit all items on update
Checklist:
Testing: