Skip to content

feat: add dot.trackWhileParked — dot follows the live point while scrolled back - #263

Merged
brandtnewlabs merged 2 commits into
brandtnewlabs:mainfrom
ianlapham:dot-track-parked
Aug 11, 2026
Merged

feat: add dot.trackWhileParked — dot follows the live point while scrolled back#263
brandtnewlabs merged 2 commits into
brandtnewlabs:mainfrom
ianlapham:dot-track-parked

Conversation

@ianlapham

Copy link
Copy Markdown
Contributor

What

  • Opt-in dot.trackWhileParked on LiveChart (default false): while scrolled back or overscrolled, the live dot tracks the true live point's x and keeps its heartbeat pulse, instead of pinning to the plot's right edge with the pulse suppressed.
  • The dot hides once the live point leaves the visible window; most visible with timeScroll.overscroll (drag into blank future space and the dot detaches from the edge, pulsing at the real last price). Time scroll demo gains a Dot tracks live point switch; guide + API docs updated.

Why the flag exempts the dot from hideLiveOnScrollBack

  • The default hide exists because the edge-pinned dot marks an off-screen price while parked; a tracking dot marks the honest live position, so hiding it would make the flag a no-op under the default timeScroll.
  • Only the dot is exempt — the badge and value line keep the default scroll-back hide, and the dot still self-hides once the live point leaves the window.

Why badge.followViewEdge wins

  • An edge-pinned followViewEdge dot must stay aligned with its badge, so the flag (tracking, pulse, and hide exemption) is ignored when both are set — documented in the JSDoc and guide.

Test plan

  • npm run verify green; coverage thresholds hold (branches 90, functions/lines/statements 95).
  • New tests: resolveDot defaults/overrides, useLiveDot parked x math (tracked position, out-of-window both sides, empty data, degenerate window/plot width, live-follow pin, followViewEdge precedence), DotOverlay pulse-while-parked render, LiveChart render for both flag states + precedence.
  • The pulse derived values are UI-thread worklets Jest's stub doesn't execute (same as the existing suppression tests) — exercised in the Expo demo app instead. The equivalent behavior has been running in production at FOMO for a few weeks.

🤖 Generated with Claude Code

@brandtnewlabs

Copy link
Copy Markdown
Owner

Resolved the merge blocker by merging current main and reconciling all Unreleased changelog entries. The source, tests, docs, and demos merged cleanly; no implementation defect was found in the PR.

Review and QA completed:

  • Public API JSDoc, API reference, time-scroll guide, changelog, and interactive example-app control are present.
  • npm run verify passed: typecheck, lint, 99 test suites; 1,522 tests passed and 5 skipped.
  • React Doctor: 96/100 with no issues.
  • iPhone 17 Pro agent-device QA verified tracked-dot positioning and pulse while overscrolled, followViewEdge precedence, and hiding once the live point leaves the visible window.

Fix commit: 88bdf3b. The refreshed branch is ready to merge once its new-head checks finish.

@brandtnewlabs
brandtnewlabs merged commit b71207e into brandtnewlabs:main Aug 11, 2026
3 checks passed
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