fix(startup): lead the damaged-store screen with the repair, not retry

A reporter on #1732 ran three successive builds against a preference store of
10336 bytes, every one of them zero, and reported each as "still failing". The
gate classified it correctly every time and the consented repair would have
cleared it in-process, but nothing on the failure screen said so: Retry was
first, styled `FilledButton`, and autofocused, while `Repair storage` sat beside
it as a tonal afterthought. Retry re-reads the same document, so for a
corrupt-store failure it is an action that cannot succeed however many times it
is pressed — and it was the one the screen recommended.

Repair now takes the primary styling, the focus node and first position whenever
it is offered, and the body text says plainly that retrying will not help.
Retry keeps its place for every other failure, where a locked database or a
denied directory really can change between attempts.

The consent dialog was also promising an outcome it could not always deliver.
Servers and profiles survive a repair only because their tokens are ciphertext
in the database and the key that decrypts them lives in the store, so a store
the key cannot be read out of signs the user out of everything — exactly the
all-zero case. `PrefsRecovery.previewSalvage` reads the damaged file without
touching it, and the dialog now names the real cost from that. The retained copy is
labelled as holding credentials unless the bytes prove otherwise: what the
salvage recovered says nothing about what the file still contains, because a
store truncated mid-value keeps most of a vault key in plaintext while the
salvage pattern — which needs the value's closing quote — matches nothing at
all. Only an all-zero file drops the warning, so the one case that cries wolf
is the one that provably holds no secret.

`describe()` finally carries whether a repair was on offer. That line is the
difference between a report a maintainer can act on and two days of guessing
whether the button was even on screen.

close #1732
This commit is contained in:
edde746
2026-08-02 04:37:29 +02:00
parent 2cb2c3eb95
commit 957711a650
33 changed files with 472 additions and 76 deletions
+4 -1
View File
@@ -986,6 +986,7 @@
"startup": {
"failedTitle": "",
"failedBody": "",
"failedBodyRepairable": "",
"phaseLabel": "",
"showDetails": "",
"hideDetails": "",
@@ -996,7 +997,9 @@
"repairTitle": "",
"repairBodyCommon": "",
"repairBodyOneCredential": "",
"repairBodySessionsAtRisk": "",
"repairBodySignInsKept": "",
"repairBodySignInsLost": "",
"repairBodySessionsUncertain": "",
"repairConfirm": "",
"repairSucceeded": "",
"repairNeedsRestart": "",