Skip to content

Terminal chart: deferred follow-ups from PR #162 #163

Description

@that-github-user

Tracking three deferred items from the chart-unification review (PR #162). All low-priority — additive UX, not regressions.

1. Session VWAP per-bar curve (was `TODO(PR2)` in `TerminalChartCore.tsx:511`)

Currently renders `snapshot.vwap.session_vwap` as a flat horizontal line at the latest value. Should render the actual running VWAP trajectory (volume-weighted typical-price accumulation per RTH bar). The deleted desktop ECharts impl never rendered session VWAP at all (only anchored VWAPs), so this is a net-add, not a regression — but the flat line is misleading vs the existing AVWAP curves on the same chart.

Approach: reuse the existing `vwapWithBandsSeries` machinery in `chartHelpers.ts` (the same code path the AVWAP anchors use). The Web/Daily/RTH AVWAPs already do exactly this computation; session VWAP is the same pattern with a "session start" anchor (RTH open of current session, with overnight bars excluded).

2. Horizontal wheel-scroll pan

The custom `onWheel` handler in `TerminalChartCore.tsx` drops `ev.deltaX` and only consumes `ev.deltaY`. Mac trackpad users and horizontal-scroll-mouse users expect horizontal swipes to pan the timeline (TradingView and ECharts both support this).

Approach: in the same listener, when `Math.abs(ev.deltaX) > Math.abs(ev.deltaY)`, treat as pan — shift `range.from`/`range.to` by a fraction of the visible span and `setVisibleLogicalRange`. Additive to the existing zoom branch.

3. Raise minimum visible-span floor from 10 → 20 bars

`Math.max(10, span * factor)` in the zoom calc. 10 bars at 1m is ~10 minutes of candles — barely readable on a wide desktop monitor. 20 is closer to TradingView's effective practical floor.

Low-stakes; default 12h initial window means most users won't hit this without intent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions