Files
regent/data/AGENTS.md
raucao 6676cec9b5 ui: name the common event kinds from a data table
Move the kind names out of src/ui/kind.rs into data/event-kinds.tsv — one
kind per line, with the standard that defines it — and cover the whole NIPs
table plus the NIP-82 draft, Blossom and git kinds: around 230 kinds instead
of 80. The module embeds the file with include_str! and parses it once; a
malformed, duplicated or overlapping row panics and fails the tests. The file
is an input of the Meson cargo target, so editing it triggers a rebuild.

Render the kind as a sentence-cased name with the number alongside: the
approval dialog shows `Kind: Reaction (7)`, an Apps permission row
`Sign kind 7 (Reaction)`, and an activity entry
`Reaction (kind 7) — allowed silently`.
2026-12-01 16:35:09 +04:00

3.4 KiB

Regent — build metadata and UI resources (data/)

The .desktop, metainfo and GSettings templates, the app icons, the Blueprint sources under data/resources/ui/, and the event-kind table.

The event-kind table (event-kinds.tsv)

data/event-kinds.tsv is the single source of truth for the human names the UI puts on event kinds (src/ui/kind.rs embeds it with include_str!). Naming a new kind — or correcting a name — is a data edit, not a code edit. One kind per line, tab-separated: kind <TAB> name <TAB> spec. kind is a u16 or an inclusive A-B range; name is the sentence-cased display string (rendered Repository state (30618) in the approval dialog, Sign kind 30618 (Repository state) in the Apps row, Repository state (kind 30618) in the Activity row); spec names the standard that defines the kind and is documentary only (the UI does not show it — it is there so provenance is in the repo). Blank lines and # comments are ignored.

kind.rs parses the table once and panics on a malformed, duplicated or overlapping row, so the kind::tests::the_table_is_well_formed test is the guard: run cargo test after editing. The file is not installed — it is compiled into the binary — but it is listed in the cargo_build input: list in the root meson.build, so an edit triggers a rebuild (the "every source file must be an input" rule applies to include_str!ed data too).

Blueprint / Meson traps

  1. In Blueprint, property assignments end with ;, child objects do not. A widget inside a slot (e.g. [top] Adw.HeaderBar header_bar {}) must not have a trailing semicolon, or you get error: Unexpected tokens.
  2. Meson forbids a path segment in a custom_target's output, and batch-compile OUTPUT SOURCEDIR FILES… preserves paths relative to SOURCEDIR — so the tempting output: 'ui/window.ui' fails outright ("Output … must not contain a path segment"), and the output: '.' workaround makes the directory a target output, which then looks stale on every build and makes ninja fail to clean it (remove(…): Directory not empty) whenever the set of files changes. Compile one file per target instead (blueprint-compiler compile --output @OUTPUT@ @INPUT@), so each .ui is a real file output; the resource paths are then the plain file names (/org/kosmos/raucao/Regent/window.ui).
  3. The app aborts at startup with Settings schema … is not installed unless dev runs set GSETTINGS_SCHEMA_DIR=_build/data (see the run recipes in README.md).

Validation commands

appstreamcli validate --no-net _build/data/org.kosmos.raucao.Regent.metainfo.xml
desktop-file-validate _build/data/org.kosmos.raucao.Regent.desktop
glib-compile-schemas --strict --dry-run _build/data/

These are the generated files (the sources are .in templates configured from app_id at meson setup); for a nightly build substitute the .Devel names. --no-net is deliberate: the project URLs point at a private Gitea repo, so the URL-reachability check fails for everyone except logged-in maintainers. desktop-file-validate prints one hint about the Security category that we accept.

Dev runs need the schema and resource from the build tree, otherwise the app aborts with Settings schema 'org.kosmos.raucao.Regent' is not installed:

GSETTINGS_SCHEMA_DIR=_build/data REGENT_GRESOURCE=… ./_build/regent