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.
37 lines
1.5 KiB
CSS
37 lines
1.5 KiB
CSS
/* Regent — stylesheet.
|
|
Everything should be achievable with libadwaita's built-in styles; add rules
|
|
here only when there is no standard class for what is needed. */
|
|
|
|
/* Requests that are waiting for the user's decision. */
|
|
.request-pending {
|
|
font-weight: 700;
|
|
}
|
|
|
|
/* A key is a value, not chrome: it reads better in the monospace font, and
|
|
equal-length cuts then render at equal widths.
|
|
|
|
Deliberately not libadwaita's `.monospace`: that class also switches to the
|
|
*code size* (`--monospace-font-size`), and on an `AdwActionRow` it applies to
|
|
the whole row, so the field name ("Public key") would turn monospace too.
|
|
These rules take the family and a value's normal weight, never the size.
|
|
|
|
`label.key-value` is for widgets we build ourselves; the two descendant
|
|
selectors reach the subtitle of an `AdwActionRow` (`.key-value` on the row)
|
|
and of an `AdwExpanderRow` (whose header sits one `box > list > row.header`
|
|
deeper). Both mirror the selectors libadwaita itself uses for
|
|
`row.property.monospace`.
|
|
|
|
`font-weight: normal` is for the one place a value sits inside a *button*: a
|
|
switcher row's name is a button's text, so libadwaita bolds it (700) and that
|
|
is wanted — the key or NIP-05 under it is a value and must not join in. */
|
|
label.key-value {
|
|
font-family: var(--monospace-font-family);
|
|
font-weight: normal;
|
|
}
|
|
|
|
.key-value > box.header > box.title > .subtitle,
|
|
.key-value.expander > box > list > row.header > box.header > box.title > .subtitle {
|
|
font-family: var(--monospace-font-family);
|
|
font-weight: normal;
|
|
}
|