Skip to main content

Crate egui_pop_model

Crate egui_pop_model 

Source
Expand description

The logic of egui-pop applications, without egui (layer L1, see ADR 0001): tested fast and headless, and untouched by egui bumps.

  • ids: typed ids, one per namespace, serialized as strings;
  • diagnostics: what registration ignored or changed, said out loud;
  • registry: items tagged with their owner, removable by owner;
  • when: context clauses (listFocus && !textInputFocus);
  • clock: where “now” comes from, injected so tests fix it;
  • commands: every action named, run the same way from anywhere;
  • clipboard: the clipboard’s pure parts (ADR 0015): formats, items, slots, boundaries, the negotiation of a paste;
  • context: the context stack (places and modes, ADR 0012): its frames, its state, a pure apply and restore, its documents;
  • field: a field’s state (modified, required, invalid, disabled with a reason, read-only, pending);
  • fuzzy: fuzzy matching and ranking for search fields;
  • links: links’ pure parts (ADR 0017): a target parsed and classified, the request to open it, the policy deciding how and whether to confirm;
  • keymap: keys bound to commands in layers, resolved by focus depth, with removal, unbinding and a resolution trace;
  • menus: menus declared by id, their items commands;
  • pointer: pointer gesture profiles (the wheel, a pinch, the buttons per canvas kind) as keymap bindings, and the table canvases read;
  • mount: the mount contract (ADR 0013): what a component needs, what a host offers, the rules matching them, and docs/hosts.md written from them;
  • panels and layout: declared panels, a saved arrangement and its repair;
  • sections (deprecated): how a stack of collapsible sections shares a panel; moved to egui_stack::sections::plan;
  • admin: the administration app’s declarative form tree (manifests, value scopes, hooks);
  • values: the value store (descriptors, writes with origins, gestures, undo, listeners, settings);
  • doc: versioned documents and their migrations;
  • job_rows: the rows an application adds to the jobs list, its row sources, and the list’s filter by source and state;
  • jobs: the host’s background jobs, folded from its job.* events, each with an estimated overall fraction;
  • notice: notices, one message for people raised once (an error, a warning, a success), their bus points and a bounded store;
  • order: plugin ordering;
  • tab: the Tab order of a focus scope (reading order, indices, groups).

Re-exports§

pub use serde_json;

Modules§

admin
The administration app’s model (docs/design/admin-forms.md): a declarative form tree for everything an application shows that is not its work surface (settings, tools, tasks).
clipboard
The clipboard’s pure parts (ADR 0015): formats, items, slots, the boundaries content crosses, and the negotiation between what a copy offers and what a paste target accepts. No egui: the contract, its default owner and the commands are egui_pop_api::clipboard’s.
clock
Clocks: where “now” comes from, injected so tests can fix it.
commands
Commands: every action of the application, named. A menu, a key, the palette, an agent and a test all run the same command by its id, and each run says where it came from.
context
The context stack (ADR 0012): where the user is and how the application behaves right now, without egui.
diagnostics
Diagnostics (ADR 0003): what was ignored or changed during registration, with what happens instead. Each one is logged through the log facade and kept in a list tests and the debug bridge read.
doc
Persisted documents (ADR 0008): every document is a JSON object with a "version" (missing means 0) and a "kind". A Schema knows the current version and one migration per older one; loading migrates, then deserializes. No I/O here: the persistence driver of egui-pop-core reads and writes the text.
field
A field’s state, one model for every input (text fields, numbers, paths, sliders): whether it is modified, required, invalid, disabled (and why), read-only or pending.
fuzzy
Fuzzy matching for search fields (the command palette, the settings filter): the query’s characters in order in the text, not necessarily next to each other, scored so that matches at word starts, in runs and early in the text come first.
history
Undo histories, as the interface sees them (ADR 0014): the pure parts of the History contract.
ids
Typed ids (ADR 0002): one newtype per namespace, sharing one syntax, serialized as plain strings.
job_rows
Rows an application adds to the jobs list: its own row sources.
jobs
Jobs: the application’s background work, folded from the job events its host publishes on the pop.job.event point (ADR 0010), each typed by a JobEventKind. egui-pop never runs jobs and never polls for them: the host publishes, Jobs follows, and the views (bars, the status bar, the jobs centre) draw what it holds. The table names each kind by the label it is journaled under; the model reads the kind, never a name.
keymap
Keys bound to commands, resolved by the framework alone (ADR 0007).
layout
A workspace’s arrangement: which panels sit in which area, in which tabs and splits, which ones were detached into auxiliary windows and on which screen. Saved as the layout document, restored at start-up, repaired when it no longer matches the panels or the screens.
links
Links’ pure parts (ADR 0017): a target parsed and classified, the request to open it, and the one policy deciding how it opens and whether the user confirms first. No egui and no system call: the service, the openers, the widget and the confirmation are egui_pop_api::links’.
menus
Menus are declared, never drawn by whoever fills them: a menu is an id (app.main, panel.tab) to which the shell, a panel or a plugin contributes items. An item names a command (its title and keys come from the command and the keymap, so a menu never shows a key that does not work), a submenu, or a list the application fills when the menu opens (the themes, the recent files). Items sit in groups, separated when shown, and in an order within their group; a when clause hides or greys an item, a checked clause ticks it. A radio item (MenuItem::radio) is one choice of a group: its checked clause says whether it is the chosen one, shown with a dot instead of a tick.
mount
The mount contract (ADR 0013): a component says what it needs (Mountable), a host says what it offers (HostOffer), and check matches the two with eleven named rules (Rule).
notice
Notices: one message for people (an error, a warning, a success, a piece of information, a question), raised once and shown by whichever views an application’s policy picks.
order
Plugin ordering (ADR 0004): requirements first, then higher priority, then id, so the order is stable; typed errors for a missing requirement, a cycle or a duplicate id.
panels
Panels are declared, never hard-coded: a plugin or the shell says what a panel is and where it goes by default; the shell places it, saves where the user moved it, and offers its commands.
pointer
Pointer gesture profiles: what the wheel, a scroll, a pinch and the buttons do on each kind of canvas, as named presets of keymap bindings (docs/pointer-gestures.md).
registry
An owner-tagged registry: items by id, each with the owner that registered it, removable by owner in one call. Every registry of the model is built on it, so a plugin’s registrations go away with it (ADR 0004).
sectionsDeprecated
The arithmetic of a stack of collapsible sections: how heights share a panel, and what a drag on a boundary between two sections does.
selection
The selection’s item: a string id an application chooses, the same in every widget showing it, without egui or an application (ADR 0012). The application-wide selection that holds these items is egui_pop_api::selection; a widget used alone keys its own selection by them.
tab
The Tab order of a focus scope: reading order by default, explicit indices and groups when the layout’s order is wrong.
values
The value store: every value a widget, a setting or an agent edits lives here at a stable path (settings/theme, view/zoom), never in a widget.
when
when clauses: where a command applies or a key binds, over named context keys (in the manner of VS Code’s when clauses).

Functions§

keymap_schema
The keymap document’s schema.