docs(web): attach the footer doc blocks to the functions they describe
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 <cliff@futurescale.com>
This commit is contained in:
parent
decc673a5d
commit
1aa1f5a0ca
1 changed files with 10 additions and 15 deletions
|
|
@ -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 <path>" 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 <path>" 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}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue