Skip to content

Pop-out window renders wrong/duplicate charts for Spec Scatter & EPA Curves #128

@pluginpath-ops

Description

@pluginpath-ops

Bug — pop-out chart routing

src/components/PopoutView.jsx routes charts by chartMode but uses a catch-all branch that renders <ChargingView> for any mode it doesn't explicitly handle:

selectedVehicles.length > 0 && chartMode !== 'compare' && chartMode !== 'specs' && chartMode !== 'roadtrip'

Consequences:

  • Spec Scatter (chartMode === 'specscatter') falls through to the catch-all, so the pop-out shows the Charging chart instead of the scatter. PopoutView doesn't import SpecsScatterView at all.
  • EPA Curves (chartMode === 'epacurves') matches both the catch-all (→ ChargingView) and its own epacurves branch (→ EpaCurvesView), so two charts render at once.
  • Range survives only by luck — ChargingView internally delegates to RangeChartView when chartMode === 'range'.

Steps to reproduce

  1. Select vehicles, open the Charts tab.
  2. Go to Spec Scatter (or EPA Curves) and click ⧉ Open Chart in New Window.
  3. Spec Scatter: the pop-out shows the Charging line chart. EPA Curves: two charts render.

Expected

Each sub-tab's pop-out renders its own chart, once.

Suggested fix

Replace the catch-all in PopoutView with explicit per-mode handling:

  • Import + render SpecsScatterView for specscatter (mirror src/App.jsx, pass presentationMode).
  • Scope the ChargingView branch to the modes it actually handles (charging/range) so epacurves and specscatter don't fall into it.

SpecsScatterView already accepts a presentationMode prop (added in #127) that hides the help bubble in the pop-out.

Related housekeeping (lower priority, mostly cosmetic)

Inconsistencies across the 7 Charts sub-tabs, noted while adding the help bubbles (#127). Optional — listed for context, not all worth doing:

  • Zoom parity — only Charging and Road Trip have drag-to-zoom + Reset Zoom; Range & Efficiency, Charge Compare, EPA Curves, Spec Chart, Spec Scatter have none.
  • Button sets — Copy URL / Copy PNG present on most but not uniform; Reset Zoom only on Charging.
  • Structure — Specs views use .specs-chart-card (vs .card), no AxisScaleControls / Auto-Color toggle.

bar / line / scatter render differences are inherent and intentionally left as-is.

Context: follow-up to #127 (chart help bubbles).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions