From 1aa1f5a0caabc45f21769bca5fc3c5fa243e8a78 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Sat, 22 Aug 2026 14:24:09 -0400 Subject: [PATCH] docs(web): attach the footer doc blocks to the functions they describe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No behavior change. Adding `filePermissionsSentence` in decc673a inserted it directly under `footerMessage`'s doc block, which left two block comments stacked and each attached to the wrong function: `footerMessage` was undocumented, and its "why not `secretStorageLabel`" rationale read as though it were about the permissions helper, which it is not. Moves that block back above `footerMessage`, and drops the inline comment inside it that now duplicated the new helper's doc — and had gone stale besides, since it still described two permission states rather than three. Caught by @mcp-inspector-v2-f1 on a read of the pushed commit. Signed-off-by: cliffhall --- .../SecretStorageFooter.tsx | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/clients/web/src/components/elements/SecretStorageFooter/SecretStorageFooter.tsx b/clients/web/src/components/elements/SecretStorageFooter/SecretStorageFooter.tsx index 800e697e..901ddf2b 100644 --- a/clients/web/src/components/elements/SecretStorageFooter/SecretStorageFooter.tsx +++ b/clients/web/src/components/elements/SecretStorageFooter/SecretStorageFooter.tsx @@ -117,16 +117,6 @@ const ICON_SIZE = 14; /** Octal mode, as `stat` would print it (`0644`). */ const formatMode = (mode: number): string => mode.toString(8).padStart(4, "0"); -/** - * The visible statement, per store. - * - * Deliberately not built from `secretStorageLabel` for the file case: that - * label is parenthetical ("File (unencrypted)") because the startup banner - * appends " at " to it, and the footer wants a sentence instead. The - * two surfaces have different shapes, so each phrases its own; the *tone* - * and the underlying facts still come from the shared helpers, which is - * what keeps them from disagreeing about anything that matters. - */ /** * How the band describes the file's permissions. * @@ -149,6 +139,16 @@ function filePermissionsSentence(info: SecretStorageInfo): string { return "Owner-only permissions."; } +/** + * The visible statement, per store. + * + * Deliberately not built from `secretStorageLabel` for the file case: that + * label is parenthetical ("File (unencrypted)") because the startup banner + * appends " at " to it, and the footer wants a sentence instead. The + * two surfaces have different shapes, so each phrases its own; the *tone* + * and the underlying facts still come from the shared helpers, which is + * what keeps them from disagreeing about anything that matters. + */ function footerMessage(info: SecretStorageInfo): string { if (info.kind === "keyring") return secretStorageLabel(info); if (info.kind === "memory") { @@ -160,11 +160,6 @@ function footerMessage(info: SecretStorageInfo): string { : secretStorageLabel(info); } const encryption = info.plaintext ? "Plaintext" : "Encrypted"; - // "Owner-only permissions." is a claim of fact, so it is only made when the - // mode was actually verified as 0600. `looseMode` is set precisely when it - // is something else and could not be tightened, and saying "owner-only" - // there would be the footer asserting the opposite of what is true — the - // one failure this whole band exists to prevent. const permissions = filePermissionsSentence(info); return `${encryption} file. ${permissions}`; }