A shared plan file can no longer take the app down
Importing a plan whose exercise ids this build doesn't know — a
hand-edited file, an export from a build with a different dataset — put
those ids straight into a routine. The routine editor skipped them
silently (you could neither see nor delete them), and starting the
routine reached for ex.n on undefined: white screen, no tab bar, no way
back. The running workout is persisted, so it came back on every reload.
Three layers, so this class of bug can't reach the screen again:
· parsePlan() drops ids that resolve to neither the library nor a
custom exercise carried in the same file, and the import sheet says
how many were left out.
· exOr() renders an unresolvable id as a placeholder, so the routine
editor shows it (and lets you remove it) instead of hiding it, and
the workout view survives one.
· an ErrorBoundary around the routes: it keeps the tab bar alive,
offers a reload, and can discard a running workout that can't be
drawn. It is keyed on the route, so switching tabs clears it.
Turning the schedule switch on now really replaces Mon–Sun, as the
switch has always claimed. It only wrote the days the shared plan filled,
so days it left empty kept your own routine and you silently ended up
training a mix of two plans.
Also here, because they sit in the same lines: the tags that carry a unit
or a whole sentence opt out of the capitalise rule ("Best: 85 Kg", "Last
Time You Hit All Reps"), and the workout header's "best" now includes the
working weight you confirmed, so it agrees with the sheet that asked for
it.
This commit is contained in:
1 parent
c8a68e37e1
commit
3d5b00cecd
8 files changed
+126
-36
No files matched your search
+19
-14
@@ -9,6 +9,7 @@ import { setNav } from './lib/nav.js'
|
||||
import { startFlow } from './sheets.jsx'
|
||||
import Icon from './components/Icon.jsx'
|
||||
import TabBar from './components/TabBar.jsx'
|
||||
import ErrorBoundary from './components/ErrorBoundary.jsx'
|
||||
import Modals from './components/Modals.jsx'
|
||||
import Toast from './components/Toast.jsx'
|
||||
import RestTimer from './components/RestTimer.jsx'
|
||||
@@ -57,21 +58,25 @@ function Shell() {
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* keyed on the route: a view that throws is contained, and switching tabs
|
||||
re-mounts the boundary, so the tab bar is always a way out */}
|
||||
<div id="app" className="vfade" key={loc.pathname}>
|
||||
{!authed ? <Login /> : (
|
||||
<Routes>
|
||||
<Route path="/home" element={<Home />} />
|
||||
<Route path="/plan" element={<Plan />} />
|
||||
<Route path="/plan/r/:id" element={<RoutineEdit />} />
|
||||
<Route path="/workout" element={<Workout />} />
|
||||
<Route path="/stats" element={<Stats />} />
|
||||
<Route path="/history" element={<History />} />
|
||||
<Route path="/library" element={<Library />} />
|
||||
<Route path="/settings" element={<Settings />} />
|
||||
<Route path="/admin" element={user?.admin ? <Admin /> : <Navigate to="/home" replace />} />
|
||||
<Route path="*" element={<Navigate to="/home" replace />} />
|
||||
</Routes>
|
||||
)}
|
||||
<ErrorBoundary>
|
||||
{!authed ? <Login /> : (
|
||||
<Routes>
|
||||
<Route path="/home" element={<Home />} />
|
||||
<Route path="/plan" element={<Plan />} />
|
||||
<Route path="/plan/r/:id" element={<RoutineEdit />} />
|
||||
<Route path="/workout" element={<Workout />} />
|
||||
<Route path="/stats" element={<Stats />} />
|
||||
<Route path="/history" element={<History />} />
|
||||
<Route path="/library" element={<Library />} />
|
||||
<Route path="/settings" element={<Settings />} />
|
||||
<Route path="/admin" element={user?.admin ? <Admin /> : <Navigate to="/home" replace />} />
|
||||
<Route path="*" element={<Navigate to="/home" replace />} />
|
||||
</Routes>
|
||||
)}
|
||||
</ErrorBoundary>
|
||||
</div>
|
||||
<TabBar onStart={startFlow} />
|
||||
<RestTimer />
|
||||
|
||||
Reference in new issue
Block a user