From 3706021326be407063ac8ccd7fa34d10213875b3 Mon Sep 17 00:00:00 2001 From: nh9961 Date: Sun, 19 Jul 2026 20:34:10 +0000 Subject: [PATCH] feat(ui): view-by-view UX redesign and accessibility pass - Overview: limits hero with progress states, spend pill, primary quick-add, mobile FAB - Logbook: day-grouped entries with subtotals, unified filter bar, Log again, human source labels - Trends: unified chart cards, tick thinning, chart aria summaries, radiogroup forecast control - Settings: sectioned layout with separated danger zone, ThemePicker aria fix - EntryModal: fieldset grouping, Field primitive, safe date validation - AuthView: autoComplete, password visibility toggle - StatHint popover replacing title-only tooltips; mobile stacked import preview - Remaining inline hex styles converted to theme tokens --- src/App.tsx | 26 +++ src/components/ChartTooltip.tsx | 4 +- src/components/DailyLimitsCard.tsx | 9 +- src/components/EntryLedger.tsx | 140 +++++++++++-- src/components/EntryModal.tsx | 232 +++++++++++++--------- src/components/FiltersPanel.tsx | 97 +++++---- src/components/GreetingPanel.tsx | 2 + src/components/ImportPreviewModal.tsx | 40 +++- src/components/LimitsSettingsForm.tsx | 15 +- src/components/MetricTiles.tsx | 41 ++-- src/components/SpendForecastCard.tsx | 48 +++-- src/components/StatHint.tsx | 53 +++++ src/components/ThemePicker.tsx | 7 +- src/components/views/AuthView.tsx | 38 +++- src/components/views/LogbookView.tsx | 12 +- src/components/views/OverviewView.tsx | 12 +- src/components/views/SettingsView.tsx | 66 ++++--- src/components/views/TrendsView.tsx | 129 +++++++----- src/index.css | 273 +++++++++++++++++++++++++- 19 files changed, 945 insertions(+), 299 deletions(-) create mode 100644 src/components/StatHint.tsx diff --git a/src/App.tsx b/src/App.tsx index aeaeb91..bc71aeb 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,5 @@ import { AnimatePresence, motion } from "framer-motion"; +import { Plus } from "lucide-react"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { flavourMeta, mergedFlavours } from "./data/flavours"; import { QUICK_ADDS, type QuickAddItem } from "./data/quickAdds"; @@ -323,6 +324,24 @@ function App() { setIsEntryModalOpen(true); } + function logEntryAgain(entry: RedBullEntry) { + setEditingEntry(null); + setEntryInitialDraft({ + cans: entry.cans, + flavour: entry.flavour, + flavourAccent: entry.flavourAccent, + sizeMl: entry.sizeMl, + pricePerCan: entry.pricePerCan, + dateTime: new Date().toISOString(), + notes: entry.notes ?? "", + store: entry.store ?? "", + sugarFree: entry.sugarFree, + caffeineMgPerCan: entry.caffeineMgPerCan, + source: entry.source, + }); + setIsEntryModalOpen(true); + } + async function saveUserLimits(next: UserLimits) { if (!user) return; setBusyAction("save-limits"); @@ -677,6 +696,7 @@ function App() { setIsEntryModalOpen(true); }} onDelete={(id) => setPendingDeleteId(id)} + onLogAgain={logEntryAgain} /> )} @@ -727,6 +747,12 @@ function App() { + {activeView === "overview" && ( + + )} + -

{label}

+

{label}

{payload.map((item) => ( -

+

{item.name}: {formatMetricValue(item.name, item.value)}

))} diff --git a/src/components/DailyLimitsCard.tsx b/src/components/DailyLimitsCard.tsx index d6dc987..788a8a2 100644 --- a/src/components/DailyLimitsCard.tsx +++ b/src/components/DailyLimitsCard.tsx @@ -96,7 +96,14 @@ function LimitRow({ {label} {value} -