Resume the last garden on this device #97

Closed
opened 2026-07-22 04:35:51 +00:00 by steve · 0 comments
Owner

Part of #96.

Problem. / always redirects to /gardens (router.tsx L66–72). A phone user who lives in one garden has to open the list and tap in every single time. Nothing remembers where they were.

Do.

  • On entering a garden editor, record its id per-device in localStorage (pansy:last-garden), mirroring the existing localStorage niceties (lib/seedTray.ts, PlantPicker recents) — swallow failures, it's a convenience.
  • Change the / route: if a last-garden id is stored, redirect to /gardens/$id; else /gardens. Guard against a stale/deleted garden — a 404/ErrNotFound on load must fall back to the list, not trap the user on a broken screen (clear the stored id on that failure).
  • Always keep an obvious way back to the full list (this pairs with the mobile shell / editor back affordance in #96's shell issue — a "← Gardens" / all-gardens control).

Acceptance.

  • Reopening the app on a device that was last in garden N lands in garden N.
  • A stored id that no longer loads falls back to /gardens and clears itself.
  • A fresh device (no stored id) still lands on /gardens.

Small, self-contained, no backend change. Good first issue in the epic.

Part of #96. **Problem.** `/` always redirects to `/gardens` (`router.tsx` L66–72). A phone user who lives in one garden has to open the list and tap in every single time. Nothing remembers where they were. **Do.** - On entering a garden editor, record its id per-device in `localStorage` (`pansy:last-garden`), mirroring the existing localStorage niceties (`lib/seedTray.ts`, PlantPicker recents) — swallow failures, it's a convenience. - Change the `/` route: if a last-garden id is stored, redirect to `/gardens/$id`; else `/gardens`. Guard against a stale/deleted garden — a 404/`ErrNotFound` on load must fall back to the list, not trap the user on a broken screen (clear the stored id on that failure). - Always keep an obvious way back to the full list (this pairs with the mobile shell / editor back affordance in #96's shell issue — a "← Gardens" / all-gardens control). **Acceptance.** - Reopening the app on a device that was last in garden N lands in garden N. - A stored id that no longer loads falls back to `/gardens` and clears itself. - A fresh device (no stored id) still lands on `/gardens`. Small, self-contained, no backend change. Good first issue in the epic.
steve added the frontendpolish labels 2026-07-22 04:35:51 +00:00
steve closed this issue 2026-07-22 04:54:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: steve/pansy#97