An approved chat client re-reads its whole message history on every launch, so refusing to remember a "yes" produced a prompt per message. That is prompt fatigue rather than a control: it trains the user to click through, and the prompts it trains them through include the ones that matter. "Always" now stores a `Permission::Method` for `nip04_decrypt` / `nip44_decrypt` exactly as it already did for encryption — per application and per method, so a NIP-44 grant never silently answers NIP-04. The dialog discloses the scope in an above-the-fold banner (every peer, and older messages fetchable from any relay), the Apps page lists the grant as a removable permission, every silent answer is recorded in the activity log, and the auto-approval rate limit still bounds a silent stream. The vault gate is unchanged: a granted decrypt on a locked vault still raises the unlock prompt, and headless still denies while locked. The grant is deliberately not peer-scoped: a NIP-17 gift wrap is signed by a fresh ephemeral key per message, so a peer-scoped rule would match only the inner seal and still prompt for every wrapper. The disclosure banners are warning-tinted. libadwaita tints an `AdwBanner` through its `--banner-color` variable, and its own `.warning` class changes nothing on a banner (it only recolours the foreground, which the banner's inner widget overrides) — so `style.css` maps the class to `--warning-bg-color` and rounds the corners.
52 lines
2.2 KiB
CSS
52 lines
2.2 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;
|
|
}
|
|
|
|
/* A warning banner. libadwaita tints an `AdwBanner`'s background by mixing
|
|
`--banner-color` (a neutral gray by default) into the window background, so
|
|
the semantic warning tint is one variable override — the same recipe
|
|
`GtkInfoBar` uses. libadwaita's own `.warning` class changes nothing here: it
|
|
only recolours the foreground, which the banner's inner widget overrides, and
|
|
the background comes from this variable. 6px keeps the banner a callout,
|
|
well inside the dialog's 18px sheet. */
|
|
banner.warning {
|
|
--banner-color: var(--warning-bg-color);
|
|
}
|
|
|
|
banner.warning > revealer > widget {
|
|
border-radius: 6px;
|
|
}
|