Journeys on the web app¶
The family web app opens on Home, which lists three everyday pages and More; More lists four others; Photos and videos and Memories have dialogs. A Loved One's work often crosses them, or leaves the site entirely: they start a reminder, go to Photos and videos, open Add a photo or video, then go to ChatGPT or the Photos app for the picture and come back. On an iPhone, Safari may reload the page while they are away.
This page describes how the app carries work across those steps without
losing it (since October 21, 2026). The code is apps/web/src/journey.ts
(where you are), apps/web/src/drafts.tsx (what is unsaved), and the shell
in apps/web/src/app.tsx.
The pages¶
Home the first page; "Whose memories" is chosen here
├─ Reminder
├─ Schedule
├─ Photos and videos
│ └─ Find a photo a line on Photos and videos, while a memory waits for one
└─ More
├─ Memories
├─ Quiz
├─ Connect a phone
└─ Backup
Since November 12, 2026 (Thomas's choice: one job on each page, and less on it). From November 5 to 12 the seven pages were buttons in the header, four rows of them on a phone, with Reminder first; before that they were a row of buttons under Whose memories. A11y notes has the reasons.
- Home (
apps/web/src/home-section.tsx) is headed with the person's name, "Tom's phone", and lists Reminder, Schedule, Photos and videos, and More as rows. Each row is one link, its name, with one line under it as its description: the reminder the phone shows ("None typed." without one), the next appointment ("Nothing coming up."), "Add a photo or video", and More's four names. The two lines about the phone come from the same rule the Reminder and Schedule pages use (phoneNowinapps/web/src/phone-now.ts,upcomingAppointments). - More lists Memories, Quiz, Connect a phone, and Backup the same way.
- Every other page has links back above its heading: Home, or Home and
More.
PARENTinjourney.tssays which page lists which, andtrailgives the links. - The links are real links (
PageLink,apps/web/src/page-link.tsx): each has the page's address, so a new tab can open it. A plain click goes through the app, which changes the address without a reload and asks about unsaved work first. - One landmark, named "Sections", holds the way around: Home's rows, and elsewhere the links back.
- "Whose memories" is on Home only, and only for an account with more than one person. Every other page names the person in its heading.
- Focus moves to the new page's heading after a link, Back, or Forward, since the link that was pressed is gone with its page. Not on the first load, and not under a dialog the address opened.
- The browser's title names the page: "Schedule · Silver".
A new page goes in TABS, LABELS, and PARENT in journey.ts, and in
the switch in app.tsx, which does not compile without it.
The journeys¶
| Journey | Steps | What crosses the steps |
|---|---|---|
| J1. Sign in | Sign-in page, then Home | The session token and the last person, in localStorage |
| J2. Move between pages | Home to a page and back, More to its pages; Back and Forward | The page, in the address |
| J3. Leave and come back | Add a photo, write its words, go to another app, return (maybe reloaded) | The page and open dialog (address); the words (draft) |
| J4. Switch person | On Home, "Whose memories" from one person to another | Nothing: each page starts fresh for each person |
| J5. Leave with unsaved work | Leave a page, sign out, or reload with a form typed in | A draft, and a question before leaving |
| J6. Save once | Any Save, Add, Put back, Rename, Remove | One request per press, however fast the presses |
Where you are: the address¶
The page and the open dialog are in the address. It says tab because the
pages were tabs when the address was first written, and the word stays so
that those addresses still land:
/: Home, the first page, has notab./?tab=photos: the Photos and videos page./?tab=more: More./?tab=find-photo: Find a photo./?tab=photos&open=add: the Add a photo or video dialog is open./?tab=photos&open=media-<id>: an upload's Edit dialog, a photo's or a video's./?tab=memories&open=memory-<id>: a memory's Edit dialog.
Until October 21, 2026, Photos and Videos were two tabs, each holding the
memories with that kind of picture beside the uploads. An address from then
still lands: ?tab=videos opens Photos and videos, and a memory's Edit
(?tab=photos&open=memory-<id> or ?tab=videos&open=memory-<id>) opens on
Memories.
Until November 12, 2026, Reminder was the first tab and had no tab of its
own; /?tab=reminder is its address now, and every other page kept its
name. A bookmark of the plain address opens Home.
Each page change is a new step in the browser's history, so Back and Forward move between pages. Opening or closing a dialog replaces the current step instead of adding one. A reload, or Safari restoring the page, opens the same page with the same dialog.
Only values from fixed lists are read (readPlace). An unknown page opens
Home. A dialog is read only on its own page: add or media- on Photos
and videos, memory- on Memories, each id up to 80 letters, digits,
dashes, and underscores. The address never sends the app anywhere else; there is no
back= or return link to follow.
The address follows a dialog the moment Cancel, Close, or Save is pressed,
not only when the dialog's close event arrives, since a browser fires that
event a moment later.
What is unsaved: drafts and the leave question¶
Drafts. Every form keeps what is typed as a draft in sessionStorage,
under senior-health-draft:<bank id>:<form>. That storage lasts for the
browser tab, including a reload or Safari restoring the page, and is gone
when the tab closes. The forms are:
- Reminder.
- The appointment form (with the appointment being changed) and the doctor form.
- Add a memory, a memory's Edit words, and its Replace picture.
- Add a photo or video, and an upload's Edit.
- Add a question, and the story pasted into Build questions from a story.
A draft that comes back shows "What you typed before you left is back. It is not saved yet." with Discard it. A form with a draft opens again on its own (the appointment form, the Doctors list with its form, and Add a question, which are closed otherwise), without taking focus, except a modal dialog: there the Add button reads "Add a photo or video: continue your draft" until it is opened. Saving, Cancel, and Discard it throw the draft away. A draft equal to what is saved is no draft. A form still loading what is saved (the Reminder) neither writes nor throws away its draft until it knows.
A browser cannot keep a chosen file, so a photo, video, or headshot is chosen again. The draft note says so.
The leave question. While a form differs from what is saved, a file is chosen, a backup is being made, or a restore is running, the app asks before it leaves:
Not saved yet: the reminder. What you typed stays in this browser, so it is back when you return. Leave anyway?
It asks on a page change, Back or Forward, and Sign out
("Signing out throws it away. Sign out anyway?"). A switch of person is
made on Home, which holds no form, so the question comes on the way there.
A reload or a closed browser tab
gets the browser's own warning (beforeunload). Safari on an iPhone often
skips that warning; the draft is what protects the work there.
Signing out throws every draft away, so a shared computer keeps nothing of the last person's. A session that ends by itself (a 401) keeps them, and says so, so signing in again brings them back.
Dialogs hold on Escape while saving. The Add and Edit dialogs, and a memory's Edit words and Replace picture, ignore Escape while their save is running, so an upload is never cut off halfway with its form thrown away.
Each page, for each person¶
Every page starts fresh when the person or the page changes. Before this, a page kept the previous person's state:
- Connect a phone showed the previous person's code under the new name.
- Schedule's "Save changes" could send the previous person's appointment id.
- Backup could run a restore planned for the previous person.
A message from a page already left is not shown on the next one. A save that finishes after the family moved on still saves and clears its draft, but its "Saved" does not appear under another page's heading. A failed save leaves its draft for the return. A 401 from any page still signs out.
Connect a phone keeps its code for the visit until it expires, so leaving the page and coming back shows the same code. A new code would cancel the old one.
Saving once¶
These presses could send a write twice, and now send one:
- Adding a doctor whose headshot fails. The doctor was added and the form stayed on "Add doctor", so trying again added them a second time. Now the form changes that doctor once it is added, and trying again sends only the headshot.
- Put back, a quiz set's Save name and Delete, a question's Remove, and the story builder's Rename are disabled while they run.
- Save changes in an upload's Edit dialog is disabled while it saves, and the form ignores a second Enter.
- Leaving Backup mid-restore stops the restore after the step it is on. Before, it kept writing, and reading the file again ran a second restore beside it. Restoring the same file again adds what is still missing.
Tests¶
apps/web/tests/journey.test.ts: the address, including addresses the app did not make (//evil.example,javascript:,media-../../banks) and ones from when the pages were tabs; which page lists which, and the way back from each.apps/web/tests/home-section.test.tsx: Home's rows and what each says about the phone, and More's.apps/web/tests/app.test.tsx: Home first, the links back, focus on the new page's heading, the title, a link opened in a new tab, and the picker on Home only.apps/web/tests/drafts.test.tsx: drafts, the note, and the question's wording.apps/web/tests/journeys.test.tsx: the journeys through the whole app: the page in the address, Back, the question and its answers, drafts per person, signing out, a session that ends, a fresh page per person, and no late messages.- The section tests cover each form's draft and the single saves (doctor, Put back, Save changes, Escape during an upload, Backup stopping).
e2e/tests/test_web_journey.py: a browser walks J1, J2, J3, J5, and J6 in one run, with a real reload. It answers every Worker request itself and records each write: one POST for the photo, one PUT for the reminder. It ends on Home, which says the reminder just saved.
Tests go from page to page by a link's name and check a page by its
heading (visit and onPage in apps/web/tests/helpers.ts, go and
expect_page in e2e/tests/shell.py), never by where the links sit, so
they hold when the way around changes shape again.
Pinned on purpose: the existing tests render sections directly, where no address or leave question applies, so they keep testing each section as before.
Not covered yet¶
- Safari on a real iPhone. The reload in the browser test stands in for Safari restoring the page after a trip to ChatGPT. The real trip has not been tried on a phone.
- No setting turns this off. The old behavior (losing the work) is not worth keeping, so there is no switch. Tests render sections on their own to test them without the shell.
- Drafts on another device. A draft lives in one browser tab. Work started on a phone is not on the computer.