Restore archived bikes (#156) #323
No reviewers
Labels
No labels
accessibility
area:accounts
area:ai-evals
area:look
area:maps
area:platform
area:rides-progress
area:riding
area:today-plan-coach
area:ui-shell
bot:blocked
bot:failed
bot:pr
bot:waiting
bot:working
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
later
now
owner-check
parked
question
ready
session
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ckreidl/trainer!323
Loading…
Reference in a new issue
No description provided.
Delete branch "bot/issue-156"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Settings → Bikes now lists archived bikes with a Restore button.
restoreBikechecks ownership; a restored bike comes back non-default, or as the default when no bike is active. Help article and history updated.Settings → Bikes loads archived bikes with its own
getArchivedBikes;getOverview, which most pages load, is unchanged.Checked:
bun test, typecheck, lint, format, and the new flowbunx playwright test e2e/bikes.e2e.ts(archive the only bike, restore it, it is the default again).Closes #156
🤖 Generated with Claude Code
/review
No blocking findings. Ready to merge with a merge commit, once CI is green (I couldn't read check results: the token lacks access).
Checked:
restoreBikeis owner-scoped and only restores archived bikes (athlete-store.ts), and the server fn usesauthedand a uuid validator. Archive clearsisDefault, so restore setting it from the active count is consistent. The store test covers stranger, non-archived, beside-active and none-active. The help article and history row are updated. There is no schema change and no scope creep.Nits, optional:
src/server/athlete-store.ts(restoreBike): the count and update are not serialised, so two concurrent restores with no active bike could both become default. Very unlikely for a single-user action. If you want it closed, use a conditionalupdateManyor a row lock.src/routes/_app/settings/bikes.tsx(ArchivedBikeRow): it shows no power-meter indicator, unlikeBikeRow. Fine if intended.