Skip to content

Keep answered questions out of the address bar and history (FE-01) - #3835

Merged
BigSimmo merged 4 commits into
mainfrom
claude/project-thread-ix3nml
Oct 26, 2026
Merged

BigSimmo merged 4 commits into
mainfrom
claude/project-thread-ix3nml

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Requested by Josh · project thread

What changes

Privacy audit FE-01. Owner decision Q11, 26 Oct 2026 ("Go ahead with all recommendations"), recorded in #3827.

  • A submitted Answer URL now reads /?mode=answer&ask=<random id>&run=1 instead of ?q=<question>&run=1. The question is kept in this tab's sessionStorage (capped at 30, in-memory fallback if storage is blocked), never in the address.
  • Refresh and Back in the same tab still show the answer without re-asking. A copied link, a new tab or a closed tab lands on the Answer home and sends nothing.
  • Stored questions are wiped at sign-out and account switch (device sweep prefix plus the account transition event), so the next person on a shared computer cannot resolve an earlier ask id.
  • Older links, bookmarks and server redirects that still carry q are rewritten on arrival (replaceState). Those first visits can still be in the browser's global history; every in-app path no longer creates one.
  • Only submitted Answer URLs change. Drafts and other modes (Documents, DSM, Medication and so on) keep q.

How

  • src/lib/answer-question-handoff.ts: stash, read, rewrite (privateAnswerHref) and resolve (resolveAnswerHandoffParams).
  • use-private-answer-url.ts: useAnswerSearchParams (resolves ask to q after hydration via useSyncExternalStore, so readers are unchanged), usePrivateAnswerRouter (push/replace rewrite answer hrefs), and the arrival rewrite.
  • Wired into the dashboard, the global search shell, cross-mode chips, the command surface, the post-answer replaceState, the refused-question address cleanup, the also-matches check and account-device-sweep.ts.

RAG impact: no retrieval behaviour change. Only client URL handling.

Checks

  • Full CI green on aee39d0a7, including Production UI (critical and three shards), Lighthouse budget, Build and unit coverage.
  • Locally: typecheck and lint clean. verify:cheap: 4 failures in cloud-platform-smoke and rag-plan-package-parity, identical on clean main in this container (environment).
  • New unit tests tests/answer-question-handoff.test.ts, including the sign-out wipe.
  • New Chromium journey in ui-smoke: older q link rewritten, follow-up never in the address, refresh and Back do not re-ask, copied link in a fresh browser sends nothing.

Order

Overlaps #3836 by two import lines in use-dashboard-search-execution.ts (and possibly one line in account-device-sweep.ts). Whichever merges second keeps both; the combined code was test-merged and passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lc51zEGdkbyyuYesESHTbn

A submitted Answer URL now carries a random id (?mode=answer&ask=<id>&run=1)
instead of the question. The question is kept in this tab's sessionStorage, so
refresh and Back still work, while a copied link, new tab or closed tab lands on
the Answer home without re-asking. Older links that still carry q are rewritten
on arrival. Drafts and other modes are unchanged.

Owner decision: Q11, 26 Oct 2026 (recorded in #3827).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lc51zEGdkbyyuYesESHTbn
@BigSimmo BigSimmo self-assigned this Oct 26, 2026
@supabase

supabase Bot commented Oct 26, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 90 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 52f02dd and aee39d0.

Files selected for processing: 11
  • src/components/ClinicalDashboard.tsx
  • src/components/clinical-dashboard/cross-mode-links.tsx
  • src/components/clinical-dashboard/global-search-shell.tsx
  • src/components/clinical-dashboard/universal-search-also-matches-state.ts
  • src/components/clinical-dashboard/universal-search-command-surface.tsx
  • src/components/clinical-dashboard/use-dashboard-search-execution.ts
  • src/components/clinical-dashboard/use-private-answer-url.ts
  • src/lib/account-device-sweep.ts
  • src/lib/answer-question-handoff.ts
  • tests/answer-question-handoff.test.ts
  • tests/ui-smoke.spec.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@gitar-bot

gitar-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Gitar is working

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

Gitar

@BigSimmo
BigSimmo marked this pull request as ready for review October 26, 2026 11:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T11:55:31.915700Z 3884a5a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3884a5accd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/answer-question-handoff.ts Resolved
The device sweep now removes clinical.answer-question.* keys, and the
in-memory copies are dropped on the account transition event, so a later
user on a shared device cannot resolve an earlier user's ask id.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lc51zEGdkbyyuYesESHTbn
@claude

claude Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

PR #3835 was updated after the trigger (3884a5a -> aee39d0). Push again or mention Claude to run on the latest version.

@BigSimmo
BigSimmo merged commit 01ca7b3 into main Oct 26, 2026
35 checks passed
@BigSimmo
BigSimmo deleted the claude/project-thread-ix3nml branch October 26, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants