uploads: locked-storage file picks unlock inline instead of dead-ending (#56)

All three paths (upload video pick, upload thumbnail pick, edit "Replace
file") now route through the shared signer gate — silent kept-unlocked
restore, else ONE passphrase prompt — then unlock storage and continue the
same pick. Cancel/bad-passphrase abort quietly; a refused thumbnail pick
restores the picker. Unlock glue extracted to uploadModalStorageUnlock.js
(file-size budget); ensureSigner threaded via initUploadModal/initEditModal.

Tests: tests/upload-edit-storage-unlock-gate.test.mjs (12).

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
thePR0M3TH3ANandClaude Fable 5 committed 2026-07-03 21:01:20 -04:00
1 parent 7ead34378e
commit e32298cc89
7 files changed
+496 -43

No files matched your search

+6
View File
@@ -61,6 +61,12 @@ export function initUploadModal({
app.profileController.show("storage");
}
},
// Shared signer gate (#56): restores a kept-unlocked key silently or shows
// one passphrase prompt so the file pickers can unlock storage inline.
ensureSigner: (options) =>
typeof app?.ensureEncryptionCapableSigner === "function"
? app.ensureEncryptionCapableSigner(options)
: null,
// Open the login modal's unlock-saved-key (passphrase) flow when a persisted
// nsec session is locked after a reload.
onRequestUnlock: () => {