Understood — you want full manual control over which column becomes the X-axis (not forced to a date). Let me make the row column freely selectable for any column type, with date formatting as an optional toggle.
First, the data processor needs to handle non-date row columns properly:
I'll make aggregateByRow accept a formatAsDate flag so non-date columns keep their raw values and sort naturally:
Now let me add the naturalSort helper function:
Now let me add the formatDatesAsDDMMM toggle to the context:
Now update the actions and reducer. The SET_ROW_COLUMN should carry the date flag and preserve value columns:
Now let me rewrite the ColumnMapper to remove forced auto-selection and give the user full manual control:
Now update the Dashboard to respect the date-format flag and only show date filters for date columns:
Now let me make the DateFilterPanel and summary card conditional on date mode:
Now let me update FilterPanel to respect the date-mode flag:
Build succeeded. The row column is now fully user-controlled.
✅ Row Column — Now Freely Selectable
🔓 Removed the Forced Auto-Selection
Previously a date column was auto-picked for you on arrival. That's gone — nothing is selected until you choose it.
- Any column works as the X-axis: Date, Region, Cell Name, Hour, Site ID, etc.
- Click again to deselect — clicking your currently-selected column toggles it off.
- "Clear" link in the section header resets the choice.
- Suggestion, not a rule — if a date column is detected, a dismissible 💡 hint bar appears saying "Suggested date column: X — click to use". You can ignore it entirely.
🏷️ Smart Column Badges
Every column in the list shows what it is, so you can decide:
Date badge (green) — contains parseable dates
- Selected column gets a detail card showing either
DATE DETECTED or TEXT / CATEGORY
🎚️ Optional DD-MMM Formatting
When you pick a date column, a toggle switch appears: "Format dates as DD-MMM & sort chronologically."
- ON (default) →
01-Jan, 15-Feb… sorted chronologically
- OFF → raw values preserved exactly as they appear in Excel
For non-date columns the toggle is hidden and values pass through untouched.
🔢 Natural Sorting for Non-Date Columns
aggregateByRow now takes a formatAsDate flag. When off, keys sort naturally — pure numbers sort numerically (1, 2, 10 not 1, 10, 2), and text sorts with embedded-number awareness so Cell 2 correctly precedes Cell 10.
👁️ Live X-Axis Preview
The preview chips now show the actual labels that will render — DD-MMM dates when formatting is on, or the raw values when it's off.
🧹 Other Fixes
- Changing the row column no longer wipes your selected metrics — it only removes the column now used as the X-axis.
- Date/column filters reset when you switch row columns (they belonged to the old column).
- The Date Filters panel (Year/Month/Day) only appears when the X-axis is actually a date in DD-MMM mode.
- The sidebar summary shows
DD-MMM or Raw so you always know the active format.
Files built: src/utils/dataProcessor.ts, src/context/AppContext.tsx, src/components/ColumnMapper.tsx, src/components/Dashboard.tsx, src/components/FilterPanel.tsx