Repository navigation
fix(onboarding): let a failed Privacy save close the chapter without a choice - #37519
Conversation
…a choice The first-run Privacy chapter had no exit but forward, and forward is a config write. When that write keeps failing (a caller the gateway refuses, as a relay teammate is) the only way off the screen was Ask the agent. Once Keep on or Turn off fails to save, the chapter offers Close in the eyebrow row, and Escape does the same. Both hide it the way Ask the agent does: no choice is recorded, so it opens again at the next load. Before a failure, and when Turn off is held by a pin (Keep on still saves), nothing changes. The button reuses the existing app.close label, so no new string. Refs #37516
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The Close only appears after a write fails and records nothing, so it does not make the mandatory chapter skippable. Notes
[DESIGN-REVIEWED] c833e90 Description read[DESCRIPTION-READ] b58d8e62623567468f0e244bc8ec9484051f16a03779c1c6c545325844ad9548 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: the blind reader read the new X as "closes the window". They only hesitated over what closing does to their choice. Notes
[UX-REVIEWED] c833e90 Description read[DESCRIPTION-READ] 159fd10cc93d40e43e379f16c9a86bf42e79374018cc23ec96d2388f6753ff8f That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the fix adds one exit that records nothing, shown only after a save fails, and it is backed by #37516 and by tests that fail on the base. Notes
What this change shipsInventory (4 items) — 3 justifiedIntent: let a person stuck on the first-run Privacy chapter after a save fails get off it without recording a choice. This is a FIX. The patch file also carries about 80 unrelated files because the PR's base is stale (MCP body fields, the Electron companion, i18n). The merge commit against the base (
[FIRST-PRINCIPLES-REVIEWED] c833e90 Description read[DESCRIPTION-READ] 9588ec5c8b09dd959879ad3f197cba531941f37415a21c2ab82ceda2c46b909e That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: ApproveWhy: the decider estimates an 8% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. Adds a Close button (and Escape) to the first-run Privacy chapter, offered only after a failed save ('save' or 'unconfirmed' failure). It hides the chapter the same way Ask the agent does: privacyAcked stays false, markOnboarded is not called and the chapter comes back at the next load. There is still no Close before a failure, and none when Turn off is held by a pin. firstRun.tsx is the only caller, and the shell's headerAction slot renders in both host and standalone modes. The unit tests and the first-run host test cover the new behaviour, and CI and every review lane are green. No regressions or trust-boundary problems found. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved. On this head the review checked that Close and Escape appear only after a save or unconfirmed failure, and that a pinned Turn off still gets no Close. It also checked that Escape goes through a ref and skips IME composition, and that Close reuses the existing hide path in firstRun.tsx. That path writes no ack and does not call markOnboarded, so the chapter comes back at the next load and collection is never turned on without consent. Each new test fails when its branch is reverted, and the tests use no sleeps.
Done well: the integration test remounts the real first-run host to prove that Close records nothing.
Optional:
docs/system-specs/modules/metrics.mdstill says the Privacy chapter "offers no skip and no Escape" and that a failed write keeps it open. A follow-up could say that Close and Escape are offered once a save fails.- #37463 landed on main after this branch. It adds the offer-form failure kinds
onPartial,onLandedandkeepUnconfirmed, and the Close condition does not cover them. Writing the condition asfailure && failure.kind !== 'pinned'would cover those kinds and any future ones. - Keeping
onCloseseparate fromonAskAgentis fine as it is. It lets a caller offer one exit without the other.
Problem / Motivation
Goal: When the first-run Privacy chapter cannot save a choice, the person can close it instead of being stuck on it.
The Privacy chapter's only exits are Keep on and Turn off, and both are config writes. When they keep failing, the chapter shows "Your choice could not be saved" or "Turn off could not be finished" and the only way off the screen is Ask the agent, which opens a chat. #37516 is the case that hit it: a relay teammate whose writes the host refuses as non-owner.
Why it matters
A modal over the whole dashboard with no working exit leaves a person unable to use the product until they hand an error to the agent. #37517 stops the relay case from opening the chapter at all; this covers any other caller whose save keeps failing.
Not a goal
What changed (motivation → approach → change)
The chapter already has one way out that records nothing:
onAskAgenthides it and leavesprivacyAckedfalse, so it comes back next load. This adds the same hide asonClose, offered only after asaveorunconfirmedfailure (a failed Keep on, or a Turn off that failed before its read-back). It shows as a Close icon button in the chapter's eyebrow row (the shell's existingheaderActionslot), labelled with the existingapp.closestring, and the chapter's keydown handler sends Escape to it while it is offered. A pinned Turn off still leaves Keep on, which saves, so it offers no Close.firstRun.tsxwiresonCloseto the samesetShowPrivacy(false)as Ask the agent. A capture script for the screenshots below follows the repo'scapture-*.mjspattern.Backwards compatibility
Compatible:
onCloseis optional; without it, and before any failed save, the chapter behaves exactly as on main.Removes nothing: it adds an exit after a failure and keeps every existing one.
Tests
PrivacyChapter.test.tsx"a way out once a save failed": no Close and a dead Escape while a choice can still be saved; after a failed Keep on, Close callsonCloseand records nothing more; after a refused Turn off, Escape does the same; a pinned Turn off offers no Close.firstRun.dismiss.test.tsx"closing Privacy after a failed save": in the real first-run host, Close hides the chapter withoutmarkOnboarded, and a fresh mount derives it again.Proof: not provable -- frontend test (prove.py runs Python only)
Reverting
PrivacyChapter.tsxandfirstRun.tsxmakes three of the new cases fail (checked by hand); the two "no Close" cases pass either way by design. Locally: the 10 test files that reference the Privacy chapter or first run, plusApp.test.tsx, pass (242 tests);tsc --noEmit, eslint on the changed files,check-i18n-keysandcheck-i18n-stringsare clean. No new string, so no locale changes.Manual verification
Not run in a browser by hand; the capture below drives the real SPA through the failed save and Close.
Screenshots / video
Real SPA, every
/apicall answered from fixtures, the theme write refused with 403 as the owner gate refuses a teammate (website/scripts/capture-privacy-chapter-failed-save.mjs, which asserts each frame before writing it).Keep on was refused: the error shows and the new Close sits in the eyebrow row (there was no Close before the click).
After Close: the chapter is hidden and the dashboard is reachable
Related Issues
Part of #37516
Sibling sweep
Swept: git grep -n "onAskAgent|Escape is NOT wired|cannot be dismissed" -- website/src/components
Siblings: none -- the Privacy chapter is the only first-run chapter with no skip; Import and Customize already pass onSkipAll
Pattern harvest
Rule candidate: review-prompt
Pattern: a mandatory modal whose only exits are writes needs a no-record exit once a write has failed
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)