Commit Graph
100 Commits
Author SHA1 Message Date
raucao 3cb7cb617f Release signing: GPG for the tag and tarball, SSH for the commit
Corrects the signing scheme. The release itself — the annotated tag and a
detached signature over the tarball — is GPG-signed; the release commit is
SSH-signed. Because the GPG key lives on a laptop and the build runs on the
build host, the single script becomes three stages split across two machines:

  prepare <ver>  build host: bump, build, meson dist, SSH-signed commit
  sign    <ver>  laptop:     GPG-sign the tarball and the tag
  publish <ver>  laptop:     Gitea release, AUR, Nostr

The GPG key never touches the build host, and only dist/ travels: the laptop
pulls it over SSH. The two signing formats are set per git command
(-c gpg.format=ssh|openpgp), so neither depends on a machine's global config.

- release.sh: prepare/sign/publish subcommands; SSH commit, GPG tag + detached
  tarball signature; REGENT_SSH_SIGNING_KEY / REGENT_GPG_KEY; a release.env
  handoff that pins the tagged commit; optional dist/ pull.
- AUR regent: the .asc in source and validpgpkeys pinned to _fingerprint.
- .ngit/release.yaml: the .asc and an exported public key, replacing the SSH
  .sig and allowed_signers.
- README, doc/dev/releasing.md, AGENTS.md updated for the split.
2026-11-30 00:28:52 +04:00
raucao ba3d07d7d7 Move the release docs into doc/dev/releasing.md
The release process is a maintainer's job, not part of local development, so it
gets its own document. development.md now just points at it (and the README's
documentation list gains an entry).
2026-11-30 00:08:54 +04:00
raucao 07a7976711 Add the release tooling (Gitea + AUR + Nostr)
build-aux/release.sh cuts a release from main: it bumps the version in
meson.build/Cargo.toml/Cargo.lock, generates the AppStream release entry from
CHANGELOG.md, builds and signs the distribution tarball, tags it, and publishes
to Gitea (gt release create), the AUR, and Nostr (ngit release publish). Every
outward-facing step is skippable (--no-push/--no-release/--no-aur/--no-nostr),
so a build can be prepared and reviewed before it goes anywhere.

Signing is SSH-only (git's gpg.format=ssh): an annotated tag plus an
ssh-keygen -Y sign detached signature over the tarball. That lets the key stay
on a laptop — run the script under ssh -A and the forwarded agent signs, so the
key material never lands on the build host.

Also:
- CHANGELOG.md: the single source of release notes (Keep a Changelog).
- build-aux/gen-metainfo-releases.py: generates the metainfo <releases> block
  from it, translating the version dialect (1.0.0-beta.1 -> 1.0.0~beta.1, with
  type=development) and exposing --notes for the release notes text.
- build-aux/aur/{regent,regent-git}: the AUR recipes (release tarball and VCS).
- build-aux/regent-dev: the working-tree package, renamed from regent-git to
  make room for the AUR regent-git; deploy-dev.sh --pkg builds this one.
- .ngit/release.yaml: the NIP-82 release manifest (Blossom mirror at
  blossom.kosmos.org), replacing the hand-rolled NIP-94/30063/32267 plan.
- Docs: README (install + verify), doc/dev/development.md (Releasing),
  AGENTS.md (Releases).

This adds tooling only: it cuts no tag and publishes nothing.
2026-11-29 23:57:07 +04:00
raucao 0d9aaad3da Note the canonical Gitea repo and its Nostr mirror
The repo is announced on Nostr now (NIP-34, through `ngit`), so the notes say
which side is which: `origin` is Gitea and every branch tracks it, Gitea is
advertised in the announcement as both the homepage and a clone URL, and pushing
a branch to Nostr is the separate `git push nostr` that also copies the git data
to the GRASP hosts. Also records the two repo relays (repo events go nowhere
else), and the `ngit init` trap that renames the Gitea remote to `gitea-kosmos`
and points `origin` at Nostr. The header no longer calls the repo private — it
isn't.
2026-11-29 23:32:37 +04:00
raucao 1b981212fb Merge pull request 'Add a trademark policy for the name and logo' (#6) from chore/license into main
Reviewed-on: #6
2026-11-29 19:21:42 +00:00
raucao 3b12bc6a9c Add a trademark policy for the name and logo
The code stays Unlicense (public domain); this is additive. A copyright
license grants no rights to a name or logo — the Unlicense is silent on
trademarks, so those were never given away, and a name is not copyrightable
at all. The one gap was the artwork: the icon SVGs sat inside a public-domain
repo with no notice of their own, so anyone could read the dedication as
covering them.

TRADEMARK.md (based on the Model Trademark Guidelines) claims the word
"Regent", the app and symbolic icons and the application id; it permits
nominative use and unmodified redistribution, and requires a fork to pick its
own name and icon. No registration is claimed — "™", not "®". The icons stay
under the Unlicense; the policy only governs using them as a mark.

README, the About dialog and the AGENTS.md hard rule now state the split.
2026-11-29 23:18:45 +04:00
raucao 03656db08c Re-fetch a profile on demand, and let an equal kind-0 fill in new fields
An identity with a valid NIP-05 address never showed it, however often the
profile was re-fetched. `put_metadata` only stored a *strictly* newer kind-0, so
`nip05` — a field added to `Profile` after the cached entries were written — was
refused along with the very event that carries it. The same comparison meant
`fetched_at` never advanced for an unchanged profile, so `needs_refresh` stayed
true and every start re-fetched it again.

The writer now answers two questions separately. Do we *have* this version? A
newer or equal `created_at` says yes: the clock moves and the answer counts.
Whose *content* does the entry hold? A newer version replaces it; an equal one is
the same version re-fetched, which is what backfills a field added later. Two
versions in the same second are settled by the lower event id — NIP-01's rule for
replaceable events — in the merge map and in the cache (`kind0_id`), so a relay
serving only one of them cannot make what we hold flip; an entry written before
that id was kept adopts the next equal-`created_at` answer. An older version is
still refused, which is the point of the watermark. `put_relay_list` stays strict
deliberately: its attempt clock moves on every call, so nothing can be stranded
there — and if a kind-10002-derived field is ever added, it has to become `>=` at
the same time.

The NIP-05 parser takes the email-ish local part now (`. _ % + -`, any case), as
clients in the wild use; it only reaches a percent-encoded query parameter. The
domain half stays strict, because that is what becomes the outbound request.

On top of that, the identities list can re-fetch one profile on demand: "Re-fetch
profile" (`AppState::refetch_profile`) loosens the 7-day discovery TTL, the 1-day
directory-fallback backoff and the 1-day NIP-05 backoff for that key, and a
per-key claim (`profile_fetch_in_flight`, claimed by automatic refreshes too, held
with a self-healing bound and released by comparing the stamp this call wrote)
keeps repeated clicks from opening parallel rounds. It cannot make anything worse:
the cached name, picture, relay list and watermarks are untouched, a profile is
stored only when it is newer than `kind0_at`, and an address can only be
*un*-verified by a definitive non-match.

The fetch reports what it found — `FetchOutcome::{Updated,UpToDate,NotFound}`,
decided by comparing what the app shows before and after — and the menu answers
with it ("Profile updated" / "Profile is up to date" / "No profile found"),
dismissing the "checking" toast rather than outranking it: libadwaita shows one
toast at a time, and a high-priority one only pushes the previous toast back into
the queue, where it would return stale.
2026-11-29 23:05:58 +04:00
raucao 681e112803 Merge pull request 'Rewrite the README and split out the docs' (#5) from doc/readme into main
Reviewed-on: #5
2026-11-29 18:59:18 +00:00
raucao e9f587c43a Require REGENT_BUILD_HOST instead of defaulting to a specific machine
The wrapper fell back to one hard-coded build host when the variable was
unset, so it silently only worked on that one machine. It now exits with a
clear message pointing at the variable, and the dev doc marks it required
(REGENT_REPO_PATH keeps its `~/src/regent` default).
2026-11-29 22:55:26 +04:00
raucao 9484c56665 Generalize the deploy instructions in the dev doc
The "Testing on another machine" section hard-coded the build host (`nuc-zt`)
and repo path (`~/src/regent`), so it read as notes for one particular setup.
It is now "Deploying to another machine": the two scripts are described
generically, the copy-paste uses `BUILD_HOST` / `PATH/TO/regent` placeholders,
and the `REGENT_BUILD_HOST` and `REGENT_REPO_PATH` overrides are documented
(with the old values noted as their defaults). `--emit` joins the on-host
list, and the narrative is build-host/test-machine rather than naming specific
machines.
2026-11-29 22:49:12 +04:00
raucao 680229138d Rewrite the README in Marco's style and split out the docs
The README mixed a short introduction with the build steps, the nightly
build, headless mode, CLI pairing and the two-machine deploy workflow, all
in one file. It now opens with the app icon and a prose description, then
Status, Installation (build from source for now, AUR planned), Repositories
& Contributions (Gitea and ngit), Documentation, License and Contact — the
shape Marco's README uses.

The build, test, validation and dev-deploy material moves to
doc/dev/development.md, and headless mode plus `regent --pair` to
doc/advanced.md, both linked from the README.

The description is also more accurate: Regent runs on GNOME and other Linux
desktops (not GNOME only), requests covered by an "Allow always" permission
are answered without a prompt (so not *every* request is shown), and several
keys can be held and used in parallel.
2026-11-29 22:40:21 +04:00
raucao ca7ba5d8d7 Show identity keys in one style, and verify NIP-05 before showing it
Every key in the app is now the same kind of thing: `plain::key` /
`.key-value` renders it in the monospace font at the size the label already
has, as a fixed `head…tail` cut, so a column of them lines up. Deliberately
not libadwaita's `.monospace`, which also switches to the code size and, on an
`AdwActionRow`, takes the field name with it. The identities list shows the
name over the key alone (it used to be "Profile · npub" on one line, where a
long profile name ate the key's tail), and the switcher keeps its own shorter
npub cut and renders it at `.caption`: a key is never body-sized there, and the
row's bold *name* stays the loudest thing in it.

The switcher's second line prefers a NIP-05 address — but only one the domain
has confirmed for exactly this key, because a kind-0's `nip05` is
self-declared and that line is where an identity is identified.
`store::nip05` parses the address strictly (it becomes an HTTPS request, so a
sloppy parse would be an SSRF), asks
`https://<domain>/.well-known/nostr.json?name=<local>` through the icons'
hardened fetch — now split into `fetch_https(url, Content)`, the app's single
HTTP path — and shows the address only while `nip05_ok == nip05`. A
re-declared or forged address is unverified again immediately, a slow answer
for a changed one is dropped, and a failed check costs a day.

Names are no longer invented: no "Identity 3" and no "Imported 1". The create
dialog starts empty, import carries a Name field that is prefilled from a
cached profile as soon as the pasted string decodes to a key, and an empty
field stores no label at all. A discovered profile name trumps the label for
display (`identity_label`), which is what happens for a key imported before
its profile was known — the label itself is never overwritten.
2026-11-29 16:33:53 +04:00
raucao 549829b0c0 Fetch real identity profiles and avatars through directory relays
An identity showed initials and often no name, while a client application's
icon was fetched, cached and rendered. Two reasons: profiles were fetched only
from Regent's configured relays — a members-only NIP-46 relay with no profiles
— and `Filter::limit(0)` caps the *stored* events a relay answers with to zero,
so that fetch received nothing at all even where profiles existed.

Discovery now goes through a measured directory set (directory.yabu.me,
purplepag.es, profiles.nostr1.com; `PROFILE_RELAYS`, overridable with
`REGENT_PROFILE_RELAYS`, else `REGENT_RELAYS` so an overridden run stays
offline). One REQ per author per relay: purplepag.es silently under-returns a
multi-author filter (8 of 20 keys batched, 15 of 20 per author), and its union
with the others is the same 15/20, so more relays buy availability, not
coverage. Three EOSE-capped waves on one ephemeral client — the identity's
kind-10002 and profile from the directory, then kind-0 from its own
write/unmarked relays, then the directory again if those served nothing — feed
one newest-wins map per kind. A relay is connected only when a wave will use it,
so a warm outbox opens no socket to the directory at all.

`profiles.json` keeps the outbox and its clocks: `write_relays` with the
kind-10002's `created_at` as a watermark, a 7-day TTL on discovery *attempts*
(so an identity that publishes no 10002 is re-discovered weekly, not on every
start), and a 1-day backoff on the directory fallback (a missing profile never
advances `fetched_at`, so `needs_refresh` stays true). A far-future `created_at`
is refused, so a relay cannot pin a watermark out of reach.

The picture is cached and rendered like a client icon: same hardened
`IconStore`, same 0600 files, decoded on the main loop. Identity avatars are
*not* behind `load-app-icons` — that switch is about a not-yet-trusted client's
URL — so the icon gc's live set grows to clients plus vault identities,
`forget_textures` clears the one-shot hydration claims it used to leave behind,
and removing a key forgets its avatar immediately. The switcher, the identities
list, the Connect dialog and the approval dialog's "Signing as" field draw it;
the Apps page's row stays text-only (that avatar was dropped deliberately in
d4bb9d5).

The gossip path in nostr-sdk was considered and rejected: its store is
in-process, it builds one filter per relay with the whole author set, and it
needs the same directory set anyway. Gitea issue #1.
2026-11-29 14:47:00 +04:00
raucao a9d51db400 Sort the app list by approval time, newest first
list_for now orders an identity's apps by approved_at descending, so the
Apps page shows the app just paired at the top instead of wherever it
landed in apps.json. Whole-second timestamps tie, so the stable sort is
reversed to keep the later pairing first among equals; entries written
before approved_at existed carry 0 and sink to the bottom.

apps.json still stores insertion order — this is a view rule, and every
consumer of list_for (the Apps page, Forget all, the Connect dialog's
count, the identities window's revocation list) wants the same order.
2026-11-28 21:06:49 +04:00
raucao d4bb9d5978 Drop the identity avatar from the app's "Signing as" row
The per-app detail row in the Apps page no longer carries an identity avatar.
The approval dialog and the Connect dialog keep theirs; the expanded details
row is back to plain text.
2026-11-28 16:35:51 +04:00
raucao 1cc2dd1319 Let the user name an app that declares no metadata
A client that sends no metadata — the bunker direction often sends none —
leaves only an npub, and there was no way to name it.

Add `App.label`, the user's own name, kept separate from the client's `name`:
`approve` rebuilds the entry on every pairing, so a label stored in `name`
would be lost the next time a metadata-less client reconnects. `display_name()`
prefers the label, and `AppRegistry::client()` returns it, so the approval
dialog and the activity log show what the user calls the app; a declared name
that differs stays visible as a "Declared name" row.

The "wants to connect" dialog asks for a name, right under "Application", when
the client declared none. The answer to a prompt becomes
`Answer { decision, name }` so the name reaches the responder's `approve`
(headless `--pair` passes none). `approve` preserves an existing label when the
dialog collected none.

The Apps page gets a per-app `view-more` menu — Rename… and Revoke — replacing
the visible Revoke suffix, and a rename dialog.
2026-11-28 16:29:11 +04:00
raucao 35fd7614ad Draw the signing identity's avatar like a client app's
The approval dialog showed a client avatar on the "Application" field but no
identity avatar on "Signing as", and the Connect dialog's and the Apps page's
"Signing as" rows had none either.

Add `plain::avatar`/`plain::set_avatar` — initials of the name, or libadwaita's
glyph when there is none, with a cached image when there is one — and use it for
the client fields and the identity fields alike, so the identity's
avatar/placeholder is drawn exactly like a client application's. The Connect
dialog keeps its avatar widget and repoints it on refresh, since the row is
built once.

Identities have no cached image yet (fetching kind-0 pictures is a later
change), so they show initials for now; the texture lookup is already in place.
2026-11-28 15:59:22 +04:00
raucao 0d98a53fce Raise the identities window instead of an "is ready" notification
GNOME Shell's focus-stealing prevention shows a "<app> is ready" notification
instead of raising an already-mapped window that has no valid activation token;
only a window mapped for the first time is focused in the default `smart`
mode. That is why it only happened after adding the first identity: on first
run the identities window *is* the app and is already mapped, and once a key is
added the next "Manage identities" re-presents it.

Make the identities window transient for the main window while that is
visible, so it is focused together with its parent. With no visible main window
(first run, last key removed) it stays a standalone window, as before.
2026-11-28 15:34:00 +04:00
raucao fca9851d8f Go back to the alert-style add/import dialogs, in a taller window
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.
2026-11-28 15:18:58 +04:00
raucao ab09201a2e Fit the identities window and its add/import dialogs
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.
2026-11-28 15:01:12 +04:00
raucao a8dd45b890 Keep the nostrconnect:// handler on the stable build
With both builds installed, both desktop files claimed
`x-scheme-handler/nostrconnect`, and the nightly deploy left the default
unset — so which app opened a link was decided by GIO's handler order, and
the nightly (whose vault has its own, often empty, identity) could end up
receiving links it could not pair.

The nightly desktop file no longer declares the scheme: system
integrations belong to the installed release. The nightly still accepts a
`nostrconnect://` argument (`HANDLES_OPEN`) and pairs through "Connect an
app…", it is just never the default handler.

GIO keeps honouring a `mimeapps.list` default even after the desktop file
stops claiming the scheme (verified), so `regent-deploy` also hands a stale
nightly association back by dropping the entry, leaving the stable build as
the only remaining handler.

Fix the second half too: a link-opened pairing presents no "Connect an app"
dialog, so `ConnectDialog::report_error` was parenting its alert to that
never-presented dialog (`self.window()` is `None`), and any failure — a bad
URI, or a build with no identity key — was silent. It now falls back to
`Windows::visible_parent()`, like every other pointer route.
2026-11-28 14:24:34 +04:00
raucao 5ff4d5d0f0 Add a nightly .Devel build profile and icon
A `-Dprofile=development` build is a separate application identity: the app
id carries a `.Devel` suffix, and the desktop file, AppStream id, icon,
GSettings schema id/path, GResource bundle name, D-Bus name and data
directories all follow, with a `regent-devel` binary so it installs beside
the stable one instead of replacing it. The Rust side switches `APP_ID` on
a cargo `devel` feature (a feature, not an env var, so the shared cargo
target dir cannot return a binary built for the other profile); the
metadata files become `.in` templates configured from `app_id`.

The nightly uses the banded nightly app icon and libadwaita's striped
`devel` header bar. The dev deploy selects it with
`REGENT_PROFILE=development`; the release `--pkg` build stays stable, and a
nightly install leaves the `nostrconnect://` scheme handler to the stable
build.

Two Meson details this depends on: the GResource prefix is fixed by
`resources.gresource.xml` (not the resource id) and is shared by both
profiles, and `gnome.compile_schemas()` scans the source directory, so the
generated schema is compiled by a `glib-compile-schemas` target instead.
2026-11-28 13:44:44 +04:00
raucao c71f110f6f Run in the background, with a status icon and autostart
Closing the main window now asks whether to keep Regent running in the
background or to quit, and remembers the choice (reversible in
Preferences). A backgrounded Regent still answers requests: the approval
drain presents the hidden window for a prompt and hides it again once the
whole request is answered, so the application that asked regains focus.
The two-window invariant becomes "the main window is presentable exactly
when the responder can serve prompts". With no key, or a stopped signer,
closing still quits.

A StatusNotifierItem (ksni) adds Show/Hide Regent, Preferences and Quit;
it is menu-only on activate, because GNOME's AppIndicator extension waits
out the double-click interval whenever an Activate method exists. A new
"Background" preference group carries the close action, the icon toggle
and start-at-login, which registers with org.freedesktop.portal.Background
(so GNOME lists the app under Background Apps) and starts it with
--background.

Also: dialogs parent to the visible window rather than the primary one, a
signer start-failure dialog is suppressed while the window is hidden, and
the Requests group moves to the bottom of Preferences.
2026-11-28 12:42:18 +04:00
raucao 767046b159 Simplify the app-icon preference wording
Drop the "Appearance" group description and shorten the switch byline to
"Fetch and show app icons when pairing".
2026-11-26 23:13:49 +04:00
raucao eee77b9f76 Label metadata-less clients by their key and preview icons at consent
Connecting noStrudel by pasting Regent's bunker:// code showed "(unnamed)" and
no icon. noStrudel (through applesauce-signers) only sends client metadata in
the client-initiated direction: fromBunkerURI is called without metadata, so its
connect request is [remote, secret, perms] and there is no metadata for Regent to
read. That direction cannot be fixed here, but it should not render as broken.

- The approval dialog and the Apps row fall back to the shortened npub and build
  the AdwAvatar with show_initials(false) instead of feeding the
  "(unnamed)"/"Unnamed application" placeholder into the initials, which showed
  as "(" / "U".
- parse_client_uri and client_info treat empty name/url/image (and perms) as
  absent. Clients that always emit name=&url=&image=&perms= used to store
  url: Some(""), which rendered an empty byline instead of the npub fallback.
- The approval dialog now fetches the client's declared icon before approval,
  but only when load-app-icons is on. AppState::preview_icon is memory-only: no
  disk cache is written for an unapproved app, so a denial leaves nothing behind.
  This turns M11's blanket no-fetch-before-consent rule into a user setting.

Adds tests for empty query and connect metadata values.
2026-11-26 22:57:47 +04:00
raucao 468d918bd3 Show app icons from NIP-46 metadata
Applications declare a name, URL and image in their pairing metadata; Regent
already stored the image but never rendered it. It now fetches, caches and
shows it as a 32px avatar on the Apps page and beside "Application" in the
approval dialog, with a "Load app icons" preference to turn fetching off.

The URL is attacker-controlled, so the new src/store/icons.rs is mostly a
security boundary: https only (plus inline data: URLs that never leave the
process), every resolved address must be public (loopback, private, link-local,
CGNAT, reserved, multicast and IPv6 ULA/mapped-v4 are refused, fail-closed on a
mixed answer), the validated addresses are pinned with a client per fetch
(resolve_to_addrs is baked in at build time, so a shared client could not carry
the pin), redirects are re-validated and re-pinned hop by hop, the body is
capped at 1 MiB, and only PNG/JPEG/GIF/WebP pass — by magic bytes, so an SVG is
rejected before it can reach the decoder. A `.url` sidecar records the URL last
attempted, so a failed icon is never retried on every change ping; the cache
lives in the XDG cache dir, keyed by the client key and mode 0600.

No fetch happens before consent: the approval dialog shows initials for a first
pairing and the cached icon only for an app the user already approved. The name
stays the identifier; the icon is decoration, never the sole identifier.

Adds reqwest (rustls-tls, no default features), base64, and tokio's net feature.
2026-11-26 22:39:13 +04:00
raucao f65d179392 Add an About dialog
A proper AdwAboutDialog, reached from "About Regent" in the primary menu:
the app name and icon, the version, the author, a short description, the
Unlicense and a "Report an Issue" link, plus Source Code and a Nostr
(njump) link on the details page.

The author's credit row links to the same njump profile, and is titled
"Made by" rather than libadwaita's hardcoded "Code by" for the developers
list. The primary menu gains a divider before its configuration group.

The About dialog holds no state, so unlike Preferences and "Connect an
app" it is built per activation rather than kept around. The acceptance
test now drives app.about twice.
2026-11-26 21:25:54 +04:00
raucao 592837145b Open Regent for nostrconnect:// links
Register the scheme (x-scheme-handler/nostrconnect) in the desktop file, with
`Exec=regent %u`, so a clicked link is offered to Regent; `regent-deploy` sets
it as the default with `xdg-mime`, asking first if another app already handles
it.

The GUI claims G_APPLICATION_HANDLES_OPEN and pairs straight from a link's URI
over the main window, reusing the "Connect an app" flow (begin_pairing now takes
the widget to parent the approval dialog to). One trap: `run_with_args` passes
the slice as argv verbatim, so a lone URI became argv[0] — the program name —
and GApplication saw no file; it now prepends "regent".

The acceptance test checks that GIO resolves the scheme to Regent. The click
itself is desktop behaviour and is left to a real session.
2026-11-26 20:25:57 +04:00
raucao 8224d09f20 Confirm a copy with a toast and close the row menu
Copying the public key from a row's menu left the popover open and gave no sign
that anything happened. A plain GtkPopover full of buttons does not close when
one is clicked — only menu items do — so close it after any action, and confirm
the copy with an AdwToast "Copied to clipboard" (libadwaita's own wording for a
copy).

The Connect dialog's connection-string copy button gets the same toast. Each
view gains an AdwToastOverlay to raise it, wrapped around its content.
2026-11-26 18:33:43 +04:00
raucao 2299966237 Give the identities window a sensible fixed height
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.
2026-11-26 18:06:29 +04:00
raucao 3985f0710d Drop account selection from the identities window
The window offered a "Use for new pairings" menu item, a "Selected" badge and a
group description about new pairings. Choosing the current identity is the
header switcher's job, not this window's, and the selection machinery took
space and attention in a dialog that is only about managing keys now.

Remove the menu item, the badge and the description; drop the now-unused
`current` argument and `current_identity()` lookup; and stop listening for
registry changes, since that listener only existed to refresh the badge.
2026-11-26 18:06:24 +04:00
raucao a8bbee1eb5 Show only the key's name and drop the selection highlight
The approval dialog's "Signing as" field showed the key's name over its npub.
The npub is long and rarely read, so it now rides along as the name's tooltip;
the identities window still offers "Copy public key".

The values were rendered with selectable labels, and a selectable GtkLabel
selects its whole text the moment it takes focus — and a dialog focuses its
first focusable widget on open. So the first value (the identity name) opened
with a selection highlight behind it, drawn grey because focus had already
moved on to a response button. Make plain::label non-selectable: the values are
for reading. Measured under Broadway, the first selectable label reported
selection=(True,0,5); a non-selectable one reports none.

plain::label is used only by the approval dialog and the content preview, so
nothing else changes. The AGENTS.md convention note is updated with it.
2026-11-26 17:24:18 +04:00
raucao 6077a1fbc9 Align content and tag values in a table
Each field row was an independent box whose title label only set a minimum
width (width_chars 12), so a key longer than twelve characters — "Lightning
address", a long JSON key — gave that row a wider title column and pushed its
value to the right. Measured under Broadway, values sat at x=120 except the
long-key row at x=136.

Render the structured views as a two-column GtkGrid instead: titles in column
0, values in column 1, so column 0 is sized to the widest title and every value
starts at the same x. Applied to the inline content card, the preview's
formatted page, nested objects/arrays, and the Tags card. The title stays
capped at 20 characters so a long key wraps rather than squeezing the value,
and plain::field_title is now shared with the standalone field rows.
2026-11-26 16:19:45 +04:00
raucao a7f2a2f6e6 Show the event kind with the payload and name more kinds
The kind was collapsed under Details, but it is part of what is being signed,
so it now sits with the payload — right after Application, before the content
and tags. Details keeps the client key and declared URL.

kind::name covered only nine kinds, so a relay list (10002) read as "event".
Fill it out with the well-known kinds (the NIP-51 lists, NIP-17/59 messaging,
NIP-28 channels, zaps, labels, calendar, community, …), keeping the names short
and lowercase. Unknown kinds still read "event".
2026-11-26 16:05:28 +04:00
raucao cd03e239ef Keep raw field order and show tags as a group
Two review fixes for the content view:

- Fields now follow the order the client sent them, not alphabetical order.
  serde_json's default map is a BTreeMap, so map.iter() — which both the inline
  rows and the preview's formatted page use — walked the keys sorted. Enabling
  preserve_order makes it an IndexMap, so a kind-0 profile keeps "about" after
  the name keys, exactly as in the raw JSON. It is a global flag; the crate's
  other serde_json uses are order-insensitive (typed structs for apps.json and
  keys.json; tests compare parsed values) and the full suite still passes.

- Tags get a group of their own instead of one flattened, truncated summary
  string. Request::Sign carries them structurally as Vec<TagView> (bounded),
  and the dialog renders a "Tags" card: a count and, when the list is longer
  than the inline cap, a "View all tags" button opening the full list in a
  dialog like the content preview. Each tag is one row, its name beside its
  full value(s), WordChar-wrapped rather than cut off.
2026-11-26 15:48:11 +04:00
raucao 97a27fa518 Show tags above the fold and fill the content preview
Four fixes from review of the content rendering:

- Tags move out of the collapsed Details expander to just below the content.
  For a follow list or a relay list the tags are the payload, so hiding them
  behind Details was wrong. Request::Sign.tags is now Option<String>, so the
  row is left out when there are none instead of showing "No tags".
- Empty content hides the Content group entirely rather than showing a note;
  the kind-aware content_note goes with it.
- The shared plain label now fills its allocation. It was start-aligned, so
  wrapped lines stopped at the label's natural width and never spanned the
  dialog; measured under Broadway, the preview text now fills the 480 px
  content area. The preview pages also get padding so the content is not
  flush against the edges.
- Kind 0 collapses synonymous keys (name / display_name / displayName /
  username) into one row when their values agree; differing values are all
  kept, so a discrepancy stays visible. The preview's Formatted page never
  collapses and Original keeps the raw JSON. name and display_name also get
  distinct labels now (NIP-24), so they cannot read as one duplicated field.
2026-11-26 15:23:46 +04:00
raucao ab41b29669 Render event content readably in the approval dialog
A sign_event's content was shown as one plain label, so a JSON payload (kind 0
profile metadata, NIP-78 app data, …) appeared as raw, unformatted JSON. Show
it as labelled key/value rows instead — kind-aware labels for kind 0, a generic
dictionary otherwise — capped, with a "+N more fields" row rather than silently
dropping anything.

A structured view is lossy (key order, duplicate keys, whitespace), so the
content stays one click away in a "View full content" preview: a plain
AdwDialog (not the alert dialog, which is not resizable) with Formatted and
Original pages, closed on the same absolute deadline as the approval itself so
it cannot outlive the request. List kinds whose payload is in the tags (kind 3,
10002) get a note pointing at Details instead of an empty card.

Request::Sign now carries the bounded full content rather than a 280-char
preview, and the plain label/field helpers move to ui::plain so both dialogs
share them. meson.build lists the new source file.
2026-11-26 14:58:29 +04:00
raucao bf737880be Inset the serif R in the app icon
Give the letter R depth with a clipped inset shadow instead of a flat fill.
2026-11-26 13:47:13 +04:00
raucao 5429418b48 Cut npub rows instead of Pango's middle ellipsis
Pango pads an ellipsized line to fill its target width by widening the
ellipsis glyph, so ELLIPSIZE_MIDDLE leaves a gap between the … and the tail
on a space-less token like an npub. Cut head…tail ourselves instead
(plain::shorten_npub / shorten_uri) and keep the row's own end ellipsis as
a backstop. The full value rides along as a plain tooltip, and the approval
dialog's "Signing as" npub is no longer selectable — a shortened label would
only copy the cut.
2026-11-26 13:35:10 +04:00
raucao 5b5edfd6f4 Elide the npubs in the approval dialog
The "Signing as" identity field and the Details "Peer" row were the last two
npubs still wrapping instead of eliding in the middle. The identity field is
a stacked name/npub pair rather than a row, so it needed the label's own
ellipsize set; a wrapping label reports the full npub width, so the ellipsis
also keeps the dialog at 480 instead of being pushed wider.
2026-11-26 12:38:19 +04:00
raucao 6b40ceb854 Elide npub bylines in the middle
A long npub was either shown in full (wrapping to a second line) or pre-cut
with plain::shorten, a fixed character count that still end-ellipsizes as the
width changes. Give every npub row the bunker URI's treatment instead: one
line, ellipsized in the middle, which adapts to the width. This covers the
identities list, the Apps details (including the expander byline, via a new
plain::middle_ellipsis_text for non-ActionRows), "Signing as" in the Connect
dialog, and the approval dialog's client key.

It also fixes the Connect dialog clipping its content: the scroller sizes
itself to the content's natural height measured at the *unwrapped* width, so
the wrapping npub made it ~13px taller than the dialog, pushing the bottom
below the fold. A single-line npub removes the discrepancy.
2026-11-26 12:30:35 +04:00
raucao e2785afa37 Widen the approval dialog and narrow the rest
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.
2026-11-26 12:12:32 +04:00
raucao e0eec2df63 Make the preferences lock row a toggle
Preferences could lock the vault but not open it, so a locked user had no
way to change the passphrase without leaving the dialog. The row now
mirrors the header lock button: unlocked it offers "Lock", locked it
offers "Unlock…" through the same present_unlock dialog every other route
uses, and it is inert until a key exists. The state-to-labels mapping is a
pure helper with its own tests.
2026-11-26 11:56:47 +04:00
raucao 8800ccf1c4 Simplify the dialogs and move the signer to Preferences
The approval dialog and the "Connect an app" dialog now share one width
(plain::DIALOG_WIDTH, 560) and put the decision first: the payload is a
bounded, scrollable card above the fold, and the verifiable-but-secondary
fields (client key, declared URL, kind number, raw tags, method, peer) live
in a collapsed Details expander. The "cannot be trusted" warning is shown
on the pair screen only, where trust is actually decided.

The Connect dialog loses the signer group: its run state is not what that
dialog is for. Start/Stop moves to Preferences, and "Show Regent's code"
starts the signer when expanded, so removing the button leaves no dead end.
"Pair" stays insensitive until the entry has a code.

The Apps list byline shows the host the application declares instead of the
shortened npub, with the full key and URL in the row's details. A declared
URL is display data the client controls, so only the host is shown.

The Connect dialog follows its content size, so revealing the QR code grows
the dialog instead of hiding it below the fold. That property ignores
content-width, so the width is pinned on the child instead.
2026-11-26 00:11:49 +04:00
raucao 5643249423 Elide the connection string in the middle
set_subtitle_lines(1) also sets the subtitle label's ellipsize to END, and
the row exposes no setter for the mode, so a long bunker:// string was cut
at the end. Pre-shortening only moved the threshold, because a character
count cannot follow the font or the window width.

plain::middle_ellipsis finds the subtitle label in the row's widget tree
and sets MIDDLE; set_subtitle does not reset it. The row then keeps the
head and the secret tail and drops the middle at whatever width it gets.
2026-11-25 20:24:22 +04:00
raucao 487be47d48 Replace the placeholder app icons with the designed seal
The violet seal with the ivory serif R replaces the crown placeholders, and
the symbolic is the scalloped seal with the R cut out (fill #2E3436, so GTK
recolours it).

The seal is a round emblem, so it is sized to the Adwaita app-icon
template's circle keyline (Ø119 on the 128 canvas) rather than the square
one it was drawn at; it renders to ~119px centred on (64,64), matching the
padding of a normal round GNOME icon.
2026-11-25 18:45:28 +04:00
raucao 0cd00f719c Make the signer toggle a small button, not a pill
The Start/Stop button sat in the Connect dialog as a large pill. It is now
a small button matching the Connect suffix on the Apps page: flat while
running, and the filled suggested-action blue while stopped.

flat and suggested-action cannot be combined: libadwaita's flat rule
resets the background, leaving the white accent foreground on the window
background, so the button rendered invisible but still clickable. The
two classes are now swapped per state instead.
2026-11-25 17:59:41 +04:00
raucao fdc29a3b9f Show the signing identity as a name over its npub
Everywhere the identity was rendered as "Signing as" + "{name} ({npub})",
the name now sits on the Signing as line and the npub drops beneath it,
without parentheses. The name is what the user recognises, so it leads.

The approval dialog stacks the two plain labels in the value column; the
Connect dialog and the Apps page use an AdwActionRow's title and subtitle.
No colour or size changes: the npub keeps the text style it already had.
2026-11-25 17:37:22 +04:00
raucao 015c312098 Close the Connect dialog onto the app list after a pairing
The post-pairing "Client paired" dialog was a redundant confirmation: the
app is already in the Apps list by then, so drop it and just show that list.

The bunker-URI direction needed more than that: the client connects from
outside, so the dialog has no code path in it at all. Snapshot the current
identity's app count on present() and close when the registry grows past it
— the same change ping record() sends — then bring Apps forward with a new
Windows::show_apps(), which the registry reaches through a weak reference.
2026-11-25 17:16:59 +04:00
raucao 64b36b1ccb Move the header controls to the left
Put the hamburger menu first, then the identity switcher, then the vault's
lock button, all packed into the start box. Nothing packs into the end box
anymore, so the right side of the bar is empty and the Apps/Activity title
stays centred.
2026-11-25 16:35:38 +04:00