Open where the doctor is, keyboard shortcuts, quiet motion and one offline line

Merged
BI
1mo ago
+1573-29

User description

🤖 Generated with Claude Code

https://claude.ai/code/session_01Mws6schjKQbpCQqQzPMKSL

Summary

Before: the installed app always opened on Clinical Answer; the desktop Work rail had no way back to Clinical; "/" and Ctrl K did not work on the Psychiatry and Medicines homes and there was no shortcuts list; tabs swapped instantly; the offline notice did not say how old the page was.

After:

  • Opening the app (or a fresh tab on a bare "/") goes to the last Work or Clinical page used on this device, or to My Day when a real roster shift is on now. A reload, Back, a "/" with a query, an in-app arrival or a set Default landing view keep today's behaviour, and it gives up as soon as the doctor taps or types.
  • The desktop and tablet Work rail has a Clinical button, matching My Day on the Clinical rail.
  • "/" and Ctrl K work on the Psychiatry and Medicines homes; "?" opens a short Keyboard shortcuts list on Clinical pages, also linked from Work Help. Pointer screens only, never while typing.
  • Tab content fades in over 150 ms and a tapped Work row releases its highlight softly. All off under reduced motion. The Clinical composer is never faded.
  • The offline notice reads "Offline, showing what was saved at HH:MM" (Perth time, the last time the page was opened online), the same card in Work and Clinical. On Call's saved-copy banner uses the same wording.

How: last-page memory is a bare path on the device only. The manifest and its start address are unchanged; the decision happens on the device and uses a replace navigation. public/sw.js is untouched.

Areas touched: App experience, Personal practice, Design system (plus 15 files not yet placed in any area)

Verification

  • eslint on changed files: clean. Typecheck: pass. Prettier: formatted. check:design-system-contract: pass.
  • npm run test:focused: 23 files, 347 tests passed.
  • Screenshots before and after: Work rail at 768 and 1440, shortcuts list, offline line in Work and Clinical at 320, 390 and 1440, cold open.
  • Full browser suite (including Firefox, Safari and phone) to be run on this draft by a manual browser-matrix dispatch.

Risk and rollout

  • No clinical wording, crisis lines, ranking, migration or service worker change.
  • On a cold open, Clinical can show for up to about 2.5 seconds before the move to the remembered page.
  • My Day's own offline card and the Clinical dashboard's offline drawer still show alongside the new line; reconciling them is a follow-up.
  • Rollback: revert this PR.

Notes

Site-wide recommendations 1, 5, 9 and 10 (12 Oct 2026). Offline copies of On Call numbers and crisis lines need a service worker change and are not in this PR.

Generated by Claude Code


Summary by cubic

Opens a cold start where the doctor left off instead of always on Clinical Answer: a bare / in a fresh tab or the installed app goes to the last Work or Clinical page used on this device, or to My Day while a real rostered shift runs. The Work rail gains a Clinical button, / and Ctrl K reach a page's own search box, ? opens a keyboard shortcuts list on a computer, tab content fades in quietly, and the offline notice names when the saved copy was taken.

  • Only a cold open of a bare / moves: reloads, Back, in-app arrivals, any query or hash, a tab already used, and a set Default landing view keep today's behaviour. Only bare page paths are remembered (never token, setup, or search-result pages), and the move gives up the moment the doctor taps or types — the roster probe is deferred so the home page stays within its download budget.
  • The Clinical rail button always returns to Clinical even if the last mode was a Work one; fades touch only tab and Work content, never the composer, and switch off under reduced motion. The offline line names the work-clock time only for the page on screen when the signal dropped — the Clinical home and any page opened offline or switched by query after the loss say "saved earlier", and a failed first load of the wording helper is retried when the signal returns.

CodeAnt-AI Description

Resume the last-used page and make navigation and offline status clearer.

What Changed

  • A fresh launch or new tab opened at the home address returns to the last Clinical or Work page used on this device, or opens My Day during an active shift. Query links, reloads, in-app navigation, and an explicitly chosen default keep their existing behavior; interacting with the page cancels the redirect.
  • Desktop and tablet Work navigation now has a Clinical link that returns to the last Clinical mode.
  • On computers, / and Ctrl/Command+K focus an available search box, and ? opens the shortcut list on Clinical pages. The list is also available from Work Help.
  • Page and tab content fades in briefly, and pressed Work-row highlights fade out gently. Reduced-motion settings disable these effects.
  • Offline notices show when the current page was last opened online; On Call notices show when its saved copy was taken. Older copies include the date, and failed refreshes are distinguished from lost connectivity.

Impact

✅ Fewer steps back to the last-used page
✅ Faster keyboard search on Clinical pages
✅ Clearer age of offline copies and refresh failures

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.