The passphrase used to be set as a side effect of adding the first
identity key, in the same dialog. Split it into a first-run "Set up your
vault" step, so the first key afterwards only *checks* the passphrase,
and make the three forms HIG action dialogs that stay open on error.
A passphrase with no keys is now representable: keys.json gains an
optional NIP-49 `verifier` (a fixed 32-byte constant, so it round-trips
through EncryptedSecretKey). has_vault() accepts it, set_passphrase
writes it (only while keyless — that is also the "forgot it" reset, which
loses nothing), unlock and verify_passphrase check it, and add_user_key
clears it once a key is stored, so a keyed vault is byte-for-byte the old
shape. change_passphrase re-encrypts it too. A malformed verifier is
dropped on load rather than quarantining the file. The version stays 1:
serde ignores the unknown field, so an older Regent reads a
verifier-only vault as empty and its next add drops the verifier —
accepted, no keys were lost.
Setup/Create/Import are now plain AdwDialog action dialogs: the action
starts insensitive and is re-evaluated on every keystroke, which also
marks the offending row with libadwaita's `.error` class, so a too-short
or mismatched passphrase can never be submitted (no error dialog at all).
Only an unknowable error — a wrong vault passphrase — is shown, as a
toast inside the dialog, which stays open and keeps the input. Return
submits, the first field takes initial focus, and closing wipes the
fields (L5). An AdwAlertDialog cannot do this: it always closes when a
response is activated.
The Identities window is 460 wide so its dialogs present as centered
floating cards instead of sheets docked to the bottom edge (libadwaita
switches below 450px), and the dialog footer is equal-width buttons like
an alert dialog's response area.
The plain `AdwDialog`s with the accept button in the header bar are not
wanted; restore the `AdwAlertDialog` versions of "Create an identity key" and
"Import an identity key".
The clipping they were meant to fix was the window height, not the dialog
style: the identities window is a fixed size and GTK never resizes a mapped
window, so its default has to fit the first-run empty state and the dialogs.
Keep the taller window (420x560); the width goes back to the original 420.
Reverts most of the previous commit.
The identities window is a fixed size and GTK never resizes a mapped window,
so its default has to fit the first-run empty state. At 420x480 it did not:
the `AdwStatusPage` overflowed (its buttons were cut off), and so did the
"Create an identity key" / "Import an identity key" dialogs, which are
presented as overlays inside the same window.
- Size the window 480x560. 480 wide also drops the empty state's description
from four lines to three.
- Rebuild create/import as plain `AdwDialog`s in the "Connect an app" shape: a
header bar with Cancel and the accept button over a scrolling body. An
`AdwAlertDialog`'s message area only *propagates* its natural height
(`adw-alert-dialog.c`), so a form taller than the window grows past it and is
clipped instead of scrolling. The new dialog's body scrolls and its buttons
stay pinned.
- Keep the dialog open when creating/importing fails, so a passphrase mismatch
can be corrected (the old alert closed before reporting the error).
Rename/export/remove stay `AdwAlertDialog`s: they are single-field or one-line
and fit.
640 was taller than the list ever needs, leaving a lot of dead space, and the
size is fixed besides — GTK never resizes a mapped window, so the window takes
whatever it had when it was first shown. 480 fits the empty state and a handful
of keys better; the page's own scroller handles a longer list.
The approval dialog set AdwDialog:content-width, which an AdwAlertDialog
ignores — it uses internal breakpoints, and a breakpoint-using AdwDialog has
no minimum size, so the dialog rendered 300px wide however large the request.
Pin it with a width-request instead (plain::alert_width), which the dialog
honours exactly.
With that working, drop the shared dialog width from 560 to 480 and shrink
the main window to 560x740 so both dialogs sit comfortably inside it.
The responder subscribes to kind:24133 events p-tagged to the device key,
decrypts (NIP-44, falling back to NIP-04), parses the request envelope by hand,
and answers NIP-44 encrypted, signed with the device key while events are signed
with the identity key.
The window is now a view switcher with a keys page and a signer page showing the
bunker:// connection string and its QR code. Every request is still answered
without asking; the UI banner says so until M4.
Adds build-aux/acceptance.sh, which covers the keyring round-trip, a nak
loopback against the responder, and the app starting the signer end to end.
KeyStore keeps one Secret Service item per key: the identity key (the nsec,
used only for signing) and a generated device key used for NIP-46 transport,
so the transport key can be rotated without touching the identity.
Includes NIP-49 export/import, zeroizing of in-memory copies, the tokio/main-loop
bridge that the relay work will reuse, and an ignored test that round-trips
everything against a real Secret Service.
Window, GSettings-backed config, Blueprint UI in a GResource, and the
packaging metadata (desktop entry, AppStream metainfo, schema, icons).
Built with gtk4-rs and libadwaita against the host toolchain; Meson drives
cargo and installs the GResource under $datadir/org.kosmos.raucao.Regent.