Skip to content

Fix candle width after line mode timeframe switch - #274

Open
brandtnewlabs wants to merge 1 commit into
mainfrom
agent/fix-candle-width-timeframe-switch
Open

Fix candle width after line mode timeframe switch#274
brandtnewlabs wants to merge 1 commit into
mainfrom
agent/fix-candle-width-timeframe-switch

Conversation

@brandtnewlabs

@brandtnewlabs brandtnewlabs commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Fixes #273.

What changed

  • keep the candle-width frame callback started for every non-static LiveChart, independent of its mount-time mode
  • guard width interpolation at runtime so line mode stays idle while preserving the latest candleWidth target
  • add regressions for a chart mounted as a line, updated to a new timeframe, and then switched to candles
  • document the fix in the Unreleased changelog

Root cause

useFrameCallback seeds its active state from autostart only on the initial render. Gating autostart with isCandle therefore left the callback permanently inactive when a chart mounted in line mode, so its displayed candle width stayed pinned to the initial value.

Before / after

The matching iOS Simulator recordings use this sequence: 1D · LINE1M · LINE1M · CANDLE.

Before

issue-273-before.mp4

After

issue-273-after.mp4

Validation

  • npm run verify — typecheck, lint, 103 Jest suites / 1,576 passing tests
  • npx react-doctor@latest --verbose --diff — 100/100, no issues
  • iOS Simulator reproduction on iPhone 17 Pro / iOS 26.5

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.

4.17.0 Candle width update issue when switching timeframes

1 participant