Problem
The CSV field auto-mapper only recognises a header as the charge rate / kW column if it contains both "charge" and "rate" (case-insensitive). Real-world CSV exports use a wider range of names for this field and currently require the user to manually select the mapping.
Examples of headers that should auto-map to Charge Rate (kW)
| Header seen in the wild |
Rationale |
Power / power |
Generic electrical power term |
Power (kW) / Power_kW |
Explicitly unit-labelled |
kilowatts / Kilowatts |
Full word form |
kW / KW / kw |
Abbreviation only |
ChargeKW / charge_kw |
Compound without space |
ChargePower / charge_power |
Power variant |
Examples of headers that should auto-map to SoC
| Header seen in the wild |
Rationale |
SoC / soc |
Most accurate term |
Charge / charge |
Generally accurate |
% / percent |
Full word form |
Examples of headers that should auto-map to time
| Header seen in the wild |
Rationale |
Time / time |
Most accurate term |
Minutes / minutes |
Generally accurate |
Charging Time / charging_time |
Full word form |
mins / MIN |
Abbreviation only |
Proposed change
Extend the autoMapping heuristic in parseCSV / handleFileUpload in RunsView.jsx
The \bkw\b word-boundary regex prevents false matches like "skwer" while still matching "Power (kW)" (because "kw" appears as a token inside the parentheses).
Acceptance criteria
Problem
The CSV field auto-mapper only recognises a header as the charge rate / kW column if it contains both "charge" and "rate" (case-insensitive). Real-world CSV exports use a wider range of names for this field and currently require the user to manually select the mapping.
Examples of headers that should auto-map to Charge Rate (kW)
Power/powerPower (kW)/Power_kWkilowatts/KilowattskW/KW/kwChargeKW/charge_kwChargePower/charge_powerExamples of headers that should auto-map to SoC
SoC/socCharge/charge%/percentExamples of headers that should auto-map to time
Time/timeMinutes/minutesCharging Time/charging_timemins/MINProposed change
Extend the
autoMappingheuristic inparseCSV/handleFileUploadinRunsView.jsxThe
\bkw\bword-boundary regex prevents false matches like "skwer" while still matching "Power (kW)" (because "kw" appears as a token inside the parentheses).Acceptance criteria
Power→ auto-maps to kWPower (kW)→ auto-maps to kWkilowatts→ auto-maps to kWkWalone → auto-maps to kWChargeRate(existing behaviour) still maps correctlyVoltage,Amps) do not false-positive