Skip to content

Conversation

@jeclrsg
Copy link
Contributor

@jeclrsg jeclrsg commented Dec 17, 2025

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:

  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit message includes a "fixes" reference if appropriate.
    • The commit is signed.
  • The change has been fully tested:
    • I have viewed all related gallery items
    • I have viewed all related dermatology items
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised new issues to address them separately

Testing:

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>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jeclrsg jeclrsg requested a review from GordonSmith December 17, 2025 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants