Skip to content

Conversation

@SlicedSilver
Copy link
Contributor

Updated the time scale's fitContent logic to include the user-defined rightOffset in the visible range when rightOffsetPixels is not set. Address a regression introduced in 5.0.9. Fixes #1988

Type of PR: bugfix

PR checklist:

Overview of change:
Updated the time scale's fitContent logic to include the user-defined rightOffset in the visible range when rightOffsetPixels is not set. Address a regression introduced in 5.0.9 and restores old behaviour.

Updated the time scale's fitContent logic to include the user-defined rightOffset in the visible range when rightOffsetPixels is not set. Address a regression introduced in 5.0.9. Fixes #1988
@SlicedSilver SlicedSilver self-assigned this Oct 9, 2025
@SlicedSilver SlicedSilver requested a review from Copilot October 9, 2025 13:08
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 pull request fixes a regression in the time scale's fitContent method to properly respect the rightOffset option when rightOffsetPixels is not set. The fix restores behavior that was broken in version 5.0.9.

  • Updated the fitContent logic in time-scale.ts to include user-defined rightOffset in visible range calculations
  • Added comprehensive test coverage for both rightOffset and rightOffsetPixels scenarios with fixRightEdge

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/model/time-scale.ts Fixed fitContent method to include rightOffset when rightOffsetPixels is not set
tests/e2e/graphics/test-cases/time-scale/right-offset-fit-content-with-fixrightedge.js Added test case for rightOffset behavior with fitContent
tests/e2e/graphics/test-cases/time-scale/right-offset-pixels-fit-content-with-fixrightedge.js Added test case for rightOffsetPixels behavior with fitContent

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

size-limit report 📦

Path Size
ESM 48.41 KB (+0.02% 🔺)
ESM createChart 40.16 KB (-0.07% 🔽)
ESM createChartEx 38.94 KB (+0.16% 🔺)
ESM createYieldCurveChart 40.44 KB (+0.08% 🔺)
ESM createOptionsChart 39.1 KB (+0.03% 🔺)
Standalone-ESM 49.94 KB (+0.07% 🔺)
Standalone 49.85 KB (+0.11% 🔺)
Plugin: Text Watermark 1.9 KB (0%)
Plugin: Image Watermark 1.72 KB (0%)
Plugin: Series Markers 4.32 KB (0%)
Series: LineSeries 2.66 KB (0%)
Series: BaselineSeries 3.3 KB (0%)
Series: AreaSeries 3.23 KB (0%)
Series: BarSeries 2.22 KB (0%)
Series: CandlestickSeries 2.52 KB (0%)
Series: HistogramSeries 2.31 KB (0%)
Plugin: UpDownMarkersPrimitive 2.42 KB (0%)

@SlicedSilver SlicedSilver marked this pull request as ready for review December 12, 2025 16:25
@SlicedSilver SlicedSilver merged commit 91aa145 into master Dec 12, 2025
28 of 33 checks passed
@SlicedSilver SlicedSilver deleted the fix-rightOffset-fitContent-bug branch December 12, 2025 16:27
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.

rightOffset and fitContent are breaking in v5.0.9

2 participants