egui-pop documentation
egui-pop is an application framework and component library for egui: themable, accessible, drivable by agents, easy to debug.
Status: 0.2.0 (2026-10-21), on egui 0.36. Design tokens (YAML, compiled at build time) and themes; visual kits, every themable component drawn from data per state and tone; plugins that own what they register, commands declared once, layered keymaps resolved by focus, zones and blocks, overlays, a value store with undo, a host contract, persistence, a debug bridge and a test kit; the paved road’s components; the workbench (the window’s own frame, scale per window, panels in areas, strips, auxiliary windows, arrangements), devtools; every feature’s moments reachable as steps (ADR 0011).
These pages are online, with search, at https://quazardous.github.io/egui-pop/docs/, beside the gallery, which runs in the browser, and the API documentation of every crate with every feature on.
Guides
- Your first application: a small application in eight steps, from a window to its tests, following the path a real application took; the application template is its end state.
- Getting started: the application template, a plugin application, the command palette and the paved road.
- Using parts without App: what a plain egui or eframe application uses alone (tokens, the theme, kits, components, the viewport, views, editors), its entry point, and what needs the framework.
- Themes: picking and adjusting a theme, every built-in theme.
- Visual kits: what components look like, as data per state
and drawing handlers, compiled when the theme is installed; and
kits as packages: a kit folder,
kit!,AppBuilder::kit, user kits. - Design tokens: the token format, resolution, densities, accents, contrast checks, writing a theme.
- The theme editor: a theme’s tokens edited live by role, colour pickers, contrast readouts (AA, AAA), undo, export and import as a token file, steps and agent commands; the survey behind it.
- Plugins, commands and steps: what a plugin registers, commands and the host, zones and blocks, hooks, steps.
- State or event: what to use: how a plugin shares data (the value store, commands, steps, the context stack, services), the per-frame trap, one example done both ways.
- Linked panels: a selection in one view driving a preview in another panel, what each view says of its selection, panels moved, closed or detached, slow previews.
- Late values and latest-wins loads: a cell for a value that arrives late, in four states, keeping its size; a slow load following a selection where the latest asked wins.
- The context stack: places (a drill-down and its breadcrumb) and modes (global states and their chips) owned by the kernel and projected by the interface, kernel state and view state, how a plugin reacts.
- History: undo histories owned by the kernel, which one
Ctrl+Z undoes, the “Go there” toast, the history panel and the
agents’
history.*. - The shared selection: one selection and one hovered
item for the whole application, shared by the tree, the list and the
application’s widgets; back and forward through past selections, and
the agents’
selection.*. - The clipboard: typed items kept by the owner,
readable fallbacks on the system clipboard, a paste negotiated with
its target, types, transforms and sanitisers declared by plugins,
the Edit commands and the agents’
clipboard.*. - Links: one service opens every link through one policy
and the
link.openstep, with a replaceable opener; the link widget, the confirmation, trust per host, local files and Reveal, egui’s own hyperlinks routed through it, the agents’links.openandlinks.check, and the lint. - The status bar and the context stack (decided, built): the breadcrumb and mode chips in the status bar, status items that follow the context, one saved state.
- The status bar: status items at the bar’s start or end, what gives way on a narrow window, live states (busy, error and warning counts), a popover per item, and rich hover cards shared with other widgets.
- Toolbars: a menu’s items drawn as a row or a column of command buttons, icons from the commands, on and greyed states, the tools that do not fit in More tools.
- The workbench: panels in areas with placement rules, auxiliary windows, arrangements, strips and indicators, the window’s own frame, scale and the interface zoom, the keymap at run time, hooks around the shell.
- Hosts and components: what can live where (panels, palettes, auxiliary windows, dialogs, overlays, the status bar), and why a combination is not supported.
- The native runner, reads and waiting: the event loop egui-pop owns around eframe, the read kernel (keyed, never waiting, stale while revalidating), waiting on the application.
- The hook kernel: typed hook points, ordered
listeners,
alterandcollect, an error boundary per listener; without egui. - The image viewport: tiles from a source the application implements; wide gamut and HDR.
- Image tools: a histogram with clipping markers and a drag handed back, a curve editor (an application’s spline, the targeted adjustment), colour wheels, a zoom control and a navigator, their steps.
- Node graph editor: an application’s graph of typed
ports on egui’s
Scene, edits handed back as requests and run as steps, an overview and a detail view with inline sliders, a minimap, the keyboard and screen reader paths, agent commands, a reference model kept in a YAML file that round-trips; the survey behind it. - Pointer gestures and profiles: what the wheel, a pinch and each button do on the image, the node graph and sliders, as six profiles (Document, darktable, Photoshop, Lightroom Classic, Blender / node editors, Trackpad) of keymap bindings the shortcuts editor changes, and a widget taking the secondary button for itself.
- Cursors and the loupe: tool cursors drawn at the
window’s scale, a brush outline that follows the zoom, the
cursor.resolvestep, a GPU loupe on the displayed pixels; the survey behind them. - Choosing files: the system’s chooser off the interface
thread, the in-app picker (keyboard, typed paths, places, filters),
the
file.chooseandfile.chosensteps. - Sliders: darktable-style sliders (soft and hard range,
typed expressions, fine and coarse, reset, a quad button), logarithmic,
gradient tracks, range sliders, the
slider.changestep. - Compact controls: a choice in a compact cell, a menu row, the scrub field and the input cell, for dense rows.
- Inputs, field states and Tab order: the decorated input (placeholder, icons, prefix and suffix, a clear button, attached and split buttons, a dropdown), the field states every input shows (modified, required, invalid, disabled with a reason, read-only, pending), Tab order per focus scope and F6 between regions; the survey behind them.
- The tree: a live tree over a lazy, asynchronous source, edits at any time, selection, keyboard, drag and drop, rename, steps.
- List items and property rows: one dense row for lists, trees and panels (an icon, a label, weak trailing text, action buttons on hover, indent guides, an arrow, a drag handle), its own row height token, and property rows with their names aligned.
- Lists and tables: a list and a data table, virtualised, sorting and widths in the value store, cells drawn by the application, steps; a text log on the data table (levels, filters, the tail followed, a time cursor).
- Charts: time series, scatters and bars on egui_plot, in
the kit’s colours and the categorical palette, an accessible summary,
a time cursor, the
plotscollector. - Video: a local video file played in place, with full, compact or no controls, looping and muted previews, driven by agents.
- Timeline: a ruler of time over seconds, frames and timecode, or bars and beats: a playhead to scrub, a range that loops, markers and cue points, snapping, the J/K/L transport keys, each change a step of the history, driven by agents.
- Thumbnails: a thumbnail from an image the application supplies, a placeholder colour until it is there, a virtualised grid.
- The photo library: a virtualised thumbnail grid and a filmstrip over thumbnails supplied asynchronously, ratings, colour labels, flags and stacks, the culling keys, a comparison, tag chips and input, a search field with filter chips, steps and agent commands; the survey behind them.
- Rating stars: how photo applications rate (empty stars, the preview under the pointer, changing and clearing a rating, the keys, read-only display) and the one widget egui-pop draws ratings with, its kit components.
- Text and code editors: a text editor and a code editor, virtualised, search and replace, a gutter of markers, folding, highlighting behind a trait (syntect, tree-sitter), code assist providers, steps and agent commands; a terminal over a pseudo-terminal or a log console, its keys and focus rules; the survey behind them.
- Notices: a message in sentences inside a page (a
Note): its severity’s symbol, wrapped and selectable text, folded details, Copy, announced to screen readers. - Micro-indicators: dots and LEDs, count badges, activity pips, flags, swatches and icons by state, drawn by the kit, passive (their meaning in their host’s name) or buttons, inline or on a widget’s corner, a pulse still under reduced motion, their states for agents.
- Collapsible sections: sections stacked in a panel, each a band (disclosure mark, title, count) over its own scrolling body, folded, resized at the line between two and remembered; drawn by the kit; the classic apps compared and the crates surveyed.
- Overlays, placement, layers and header bands: the overlay stack’s rules, placing a floating element, layer ranks, the band a movable surface is dragged by.
- Dialogs and the settings window: confirm, form, choose, info and custom dialogs; the settings window and the pages plugins add to it.
- F6 regions: F6 between a window’s parts, where it lands, what blocks it.
- Accessibility: names for custom widgets, the announcer, the checks.
- Containment: fault boundaries and the paint guard: a panel that panics stays in its rectangle; a window never stays empty without a word.
- Jobs and progress: the host’s background jobs folded
from its journal, each with an estimated overall percentage, their
commands, the
jobs.estimatestep, a fake host for tests. - Translations: Fluent catalogues, the language setting, numbers, dates and plurals, the lookup step, extracting and checking keys.
- Platform services, each an opt-in plugin of
egui-pop-platform: a single instance and deep links, notifications, the tray icon, global shortcuts, logs and crash reports, the folders an application writes to, the focus mode read in-process, the system’s text scaling. - Tips: a tip of the day and contextual hints, registered by plugins, translated, dismissed for good through the settings.
- About the application: Help > About application, the
application’s name, version, licences, authors and links, its version
info to copy,
about.readfor agents. - Debugging: the debug bridge and devtools.
- Agents and the debug bridge: how an agent reaches an application (in process, or over the opt-in agent socket), discovering and running commands, reading state, the replies’ shapes, what is refused, and the known gaps.
- The agent socket:
egui-pop-agent, the bridge as JSON-RPC 2.0 over a private Unix socket or a Windows named pipe (describe,snapshot,call,wait), off unless the application turns it on, read-only unless it offers more. - Driving the gallery with egui-mcp: the gallery’s
opt-in
inspectionfeature, theegui_inspectionendpoint it opens (loopback, no authentication) and Rerun’segui-mcpon it: the tree, clicks by label, screenshots, waits; it bypasses the grants and the input lock, so development builds only. - Extensions: the known extensions in three tiers
(official, community, featured), the entry format, how to get listed
and the checks an entry passes; the extension template
(
templates/extension). - UI index: what to use for a need (a search field, an empty state, a section title), generated from the crates’ API.
- The gallery: the catalogue application and its options.
- A Rerun-like viewer: an example application with the Rerun viewer’s look and layout (a kit from Rerun’s design tokens, a blueprint, a viewport of four views, a selection panel, a time panel), and the gaps it found in egui-pop, ranked.
Reference
- Packaging: desktop files, AppStream, Flatpak, icons, the Windows manifest and installers, the macOS bundle, and what each platform service needs from the package.
- Scenarios: tests written as RON data, replayed headless with invariants checked after every step.
- Testing: how egui-pop is tested.
- Threading: what egui allows on which thread, egui-pop’s threads, the kernel on its own thread, delegated displays.
- Threading survey: how darktable, vkdt, GIMP, Krita, Blender and others split work between threads, and the patterns that fit egui-pop.
- File dialogs survey: how the system dialogs, Blender, darktable, Lightroom and file managers lay out, preview, search and save, and the changes ranked for egui-pop’s in-app picker.
- Keyboard survey: how far the keyboard alone gets in egui-pop and Helios against VS Code, JetBrains, Blender, darktable, Lightroom, GIMP, Qt, GTK and WAI-ARIA, the changes ranked, and egui-pop’s walk (Helios’s is still owed).
- Scrolling survey: how desktops and applications show scroll bars and treat the wheel, a recommended default (bars visible at rest) and the changes ranked for egui-pop.
- Knob interaction study: how DAWs, plug-ins, photo tools and web libraries drive knobs (drag mode, travel, fine, wheel, reset, typing), why egui-pop’s knob is hard to control, and the recommended drag-mode API.
- Web survey: what breaks or differs in the web build (keys the browser keeps, platform services, storage, rendering, accessibility, every gallery page), ranked by how much it gets in the way of reporting a bug from the web gallery, with follow-ups.
- Video survey: what egui-pop’s applications need from video, the native players compared (GStreamer, libmpv, FFmpeg, the platforms’, the egui crates), whether YouTube and other hosts can play inside and under which terms, and the follow-ups ranked.
- API stability: what each release promises.
- Outside review, November 2026: an outside review’s concerns checked against 0.11, with the follow-ups.
- Changesets and releases: the changeset each change adds, commit subjects, the checks, and how a release is made.
- How quality is held: AI-assisted development, the checks every change passes before it merges, and what they do not cover.
- Governance: who decides, decisions as ADRs and requests for comments, what breaks an extension, deprecation windows.
- Upstream workarounds: what egui-pop compensates for in its dependencies, and how a limit is handled.
- eframe and egui-pop: what eframe gives, what egui-pop adds and works around, and how egui-pop extends eframe rather than replacing it.
- egui_stack directions: how egui_stack, the continuation of egui_dock, could fit egui-pop (theming, drop veto, keyboard, accessibility, windows, layout state, sections and toolbars, ideas from egui_tiles), ranked, with the first changes to land.
- Architecture decisions: one page per decision.
- Advanced widgets: a survey of advanced widgets and how egui-pop gets them.
- Micro-indicators, the design: the note behind the indicator module (accepted, with the owner’s decisions and where the visual kits changed them): the survey, the places of use, what waits for the mount contract and the icon registry.
- Icons: an inventory: every place an icon serves in egui-pop and in an application such as Helios (command icons and object-kind icons, the rule, size, states and accessibility of each, what exists and the gap), the platforms’ conventions for menu icons, and the registry and menu gutter (decided 2026-10-22).
- Pointer gestures, a study: how applications use the wheel, the buttons and the modifiers on canvases (darktable in detail), the gesture profiles, and the decisions taken.
- One file browser, many views: the proposed file browser shared by every file dialog and an import window, its view-mode, file-source and thumbnail-provider contracts, and a survey of file managers’ and photo tools’ views.
- Administration as forms, a design: the accepted framework, its first slice built (the Settings app), for an application’s whole non-image side (settings, tools, import, export, backups, health, plugins, jobs) as one full-page app with two navigation axes: a declarative form tree contributed by manifests, a closed set of bricks, standalone task surfaces and a wizard kit, with a survey and Helios’s information architecture.
- Moving a floating panel vs docking it: how other applications tell a move from a dock, the modifier per platform, today’s drags, and the decision (a plain drag moves, Ctrl docks, a mode the application and the user can change).
- Fonts: font families from the theme at four weights, the size scale and the text size seeded from the system’s (built), and the design for the rest.
- CREDO.md: the principles.
The crates
| Crate | Layer | What it holds |
|---|---|---|
egui-pop-tokens | L0 | DTCG token files: parser, resolver, themes, densities, accents, contrast checks. No egui. |
egui-pop-win32 | L0 | The window frame’s Windows layer: subclasses a window to answer WM_NCHITTEST (Snap Layouts, Aero Snap). No egui; unsafe in one module. |
egui-pop-winit | L0 | The runner’s winit layer: a winit window id as the window’s raw handles (Win32, X11, Wayland), checked per system. No egui; unsafe in one module. |
egui-pop-wayland | L0 | The image viewport’s Wayland layer: a subsurface under a window, tagged through wp_color_management_v1, and the compositor’s preferred image description. No egui; unsafe in one module. |
egui-pop-model | L1 | The logic without egui: typed ids, diagnostics, when clauses, commands, keymap (layers, chords, focus depth, traces), menus, panels, layouts, the value store, versioned documents, plugin ordering. |
egui-pop-core | L2 | The egui layer: theme, focus scopes, key dispatcher, overlay stack, placement, accessibility, strings, icons, persistence, fault boundaries, value binding, the debug bridge. |
egui-pop-api | L3 | The application API (its own semver): Plugin, Ctx, AppBuilder over eframe or headless, zones and blocks, hooks, services, stories. |
egui-pop-viewport | L3 | A generic image viewport (zoom in physical pixels, tiles from an asynchronous source, a display-transform hook, overlays with handles, before/after, a pixel readout), thumbnails, a histogram with clipping markers and a drag, a curve editor, colour wheels, a zoom control and a navigator (feature viewport of the facade). |
egui-pop-test | L4 | Test kit: harnesses, “every interactive node has a name”, accessibility tree dump. |
egui-pop-i18n | L4 | Translations as a plugin: Fluent catalogues, fallback chains, the language setting, locale formatting, the i18n.resolve step, the key extractor and checks (feature i18n of the facade). |
egui-pop-platform | L4 | Platform services as opt-in plugins: a single instance and deep links, notifications, a tray icon, global shortcuts, logs and crash reports, the focus mode (feature platform of the facade). |
egui-pop-imaging | L4 | The image tools in an application: each finished change of the histogram’s drag, the curve editor, the colour wheels, the zoom control and the navigator runs as a step (feature imaging of the facade). |
egui-pop-views | L4 | Data views: a live tree over a lazy, asynchronous source, a list and a data table (on egui_table), virtualised, keyboard-driven, every moment a step (feature views of the facade). |
egui-pop | L5 | The crate to depend on: re-exports the layers, egui, and a prelude. |
egui-pop-gallery | app | The catalogue, itself a plugin application (not published). |
Layers only depend downwards; a test reading cargo metadata keeps it so
(ADR 0001).
Code in these pages
The Rust blocks of the README and of the getting started, themes,
plugins, state or event, workbench, viewport, files, tree, lists and tables,
translations, platform services, packaging, debugging and
micro-indicators pages are
compiled and run as doctests by crates/consumer-smoke, against the
egui-pop crate only, as a user depends on it: cargo test -p consumer-smoke --doc.
Your first application
From an empty crate to an application with a command, panels, a setting, a theme of its own, undo, an agent surface and tests, in eight short steps. You do not need to know egui-pop to follow it, only Rust and a little egui.
The steps follow the path a real application took: Helios, a photo editor built on egui-pop. The code here is general; each step ends with where Helios goes further, a link to the file of Helios doing the same thing at full size.
The application built here is a colour swatch: a square whose hue and size are two parameters. Its end state is the application template:
cargo generate --git https://github.com/quazardous/egui-pop templates/app
cd my-app && cargo run
Every block on this page is compiled and run with egui-pop’s guides
(cargo test -p consumer-smoke --doc), and the template is built and
tested by the same CI, so neither falls behind the API.
1. A window
An application is an App, built by App::builder() from plugins.
DefaultPlugins is the paved road: the command palette, dialogs,
toasts, the settings window, the window’s place and saved layouts.
persist_in_config keeps the settings, the layout and the window’s
place between runs, in the user’s configuration folder
(~/.config/swatch on Linux, %APPDATA%\swatch on Windows); persist
names any other folder.
use egui_pop::eframe;
use egui_pop::prelude::*;
fn main() -> eframe::Result {
App::builder()
.name("Swatch")
.plugins(DefaultPlugins)
.persist_in_config("swatch")
.run_native("Swatch", eframe::NativeOptions::default())
}
cargo add egui-pop serde_json is all it needs. Tests (and the rest of
this page) build the same application headless, on a context of their
own, with .build(&egui::Context::default()) instead of run_native.
Where Helios goes further. Its
main.rs
sets the window’s options (its own frame, a minimum size, the GPU
device opened while the window comes up) and finishes setting up on the
window’s context with run_native_with; its
shell.rs
lists every plugin it adds to DefaultPlugins, each with a comment.
2. A command, its key and its menu entry
Everything an application adds goes through a plugin: an id and a
connect method registering through Ctx. A command is declared once,
with a CommandSpec; its key binding, its menu entry, its palette
entry and its agent surface all come from it.
use egui_pop::api::app::MENU_EDIT;
use egui_pop::egui;
use egui_pop::prelude::*;
const RESET: CommandId = CommandId::from_static("swatch.reset");
struct Swatch;
impl Plugin for Swatch {
fn id(&self) -> PluginId {
PluginId::from_static("swatch")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.command(
CommandSpec::new(RESET, "Reset the swatch", "Swatch")
.key("Ctrl+Shift+R")
.menu(MENU_EDIT, "5_swatch", 0),
|_call| Ok(serde_json::Value::Null),
)?;
Ok(())
}
}
let mut app = App::builder().plugins(DefaultPlugins).plugin(Swatch)
.build(&egui::Context::default()).unwrap();
// The palette (Ctrl+Shift+P or F1) finds it from a few letters.
let found = app.handle().palette_search("reset sw");
assert_eq!(found[0].label, "Swatch: Reset the swatch");
// The key, the menu, the palette and code run the same thing.
let out = app.run(&RESET, serde_json::Value::Null, Origin::User);
assert_eq!(out.now(), Some(Ok(serde_json::Value::Null)));
Whatever a plugin registers is its own and goes away when it is
disconnected. The settings window’s Keyboard shortcuts page rebinds the
key; a when clause (.when("...")) says when the command applies.
More in Plugins, commands and steps.
Where Helios goes further. Its commands run in its own kernel, not
in closures: it declares them without a handler (Ctx::declare) in
plugins.rs,
and gives egui-pop a host that runs them
(host.rs,
AppBuilder::host).
3. Panels in the workbench
A panel has an id, a title and a default area: the centre, the start or
end side bar, or the bottom. The workbench places it there; the user
drags it elsewhere, splits, tabs, closes or detaches it, and the layout
is saved with the settings (persist) and repaired at the next start.
use egui_pop::egui;
use egui_pop::model::panels::{Area, PanelSpec};
use egui_pop::prelude::*;
const VIEW: PanelId = PanelId::from_static("swatch.view");
const PARAMETERS: PanelId = PanelId::from_static("swatch.parameters");
struct Swatch;
impl Plugin for Swatch {
fn id(&self) -> PluginId {
PluginId::from_static("swatch")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.panel(PanelSpec::new(VIEW, "Swatch", Area::Center), |ui, _app| {
ui.heading("The swatch");
})?;
let parameters = PanelSpec::new(PARAMETERS, "Parameters", Area::EndSide);
ctx.panel(parameters, |ui, _app| {
ui.label("Its parameters");
})?;
Ok(())
}
}
let app = App::builder().plugins(DefaultPlugins).plugin(Swatch)
.build(&egui::Context::default()).unwrap();
let layout = app.handle().layout();
assert_eq!(layout.area_of(&VIEW), Some(Area::Center));
assert_eq!(layout.area_of(&PARAMETERS), Some(Area::EndSide));
A panel’s body is egui code: anything egui draws works there. The
closure gets the AppHandle, to read state and run commands
(app.run(RESET, args), queued for the next frame). PanelSpec also
takes sizes, the areas a panel may go to (only_in), whether it
detaches into a window of its own, and whether it starts closed.
AppBuilder::layout gives a starting layout other than “every panel in
its area”. More in The workbench.
Where Helios goes further.
workbench.rs
declares a dozen panels with their rules and offers its layouts as
arrangements (Ctx::arrangement) the user switches between.
4. A setting
A setting is a value with a descriptor: its type, label, range and
default. Ctx::setting puts it in the settings window (Ctrl+,),
under the plugin’s title, with a reset and a search; it is saved with
the rest. The application reads it with AppHandle::setting wherever
it needs it: here, while drawing. It lives in the value store at
settings/<id> (SettingId::path).
use egui_pop::egui;
use egui_pop::model::values::{Change, Set, Value};
use egui_pop::prelude::*;
const SHOW_CODE: SettingId = SettingId::from_static("swatch.show_code");
struct Swatch;
impl Plugin for Swatch {
fn id(&self) -> PluginId {
PluginId::from_static("swatch")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
let show = Descriptor::bool("Show the colour's code", true)
.description("Writes the colour's hexadecimal code under the swatch.");
ctx.setting(SHOW_CODE, show)?;
Ok(())
}
}
let app = App::builder().plugins(DefaultPlugins).plugin(Swatch)
.build(&egui::Context::default()).unwrap();
let handle = app.handle();
// In a panel: `app.setting::<bool>(&SHOW_CODE)`.
assert_eq!(handle.setting::<bool>(&SHOW_CODE), Some(true));
// The settings window writes it as the user does here.
let off = Set::new(&SHOW_CODE.path(), Change::To(Value::Bool(false)), Origin::User);
egui_pop::core::lock(&handle.store()).set(off).unwrap();
assert_eq!(handle.setting::<bool>(&SHOW_CODE), Some(false));
A page laid out by hand, in place of the generated one, is a
Ctx::settings_page (Plugins).
Where Helios goes further.
display.rs
declares a setting that changes what the window asks of the screen,
and theme_editor.rs
mounts a whole page in the settings window.
5. A theme, then a kit of your own
Pick a built-in theme by name (pop-dark, pop-light,
pop-high-contrast, gruvbox-dark, catppuccin-mocha and
more); its light or dark counterpart
follows the system’s preference, and the View menu toggles it. To look
like your product, add a kit: a token file over a built-in theme,
changing only what differs. Custom painting reads the theme’s tokens,
never literal colours, so it follows every theme.
use egui_pop::egui;
use egui_pop::prelude::*;
use egui_pop::tokens::kit::{self, KitData};
// A built-in theme...
let _builder = App::builder().theme(ThemeSpec::new("gruvbox-dark"));
// ...or a kit: a blue accent and underlined tabs over pop-dark.
let ours = KitData::from_text("swatch", r#"
$extends: "pop-dark"
accent:
$type: "color"
default: {$value: "{blue.9}"}
tab:
shape: {$type: "string", $value: "underline"}
"#);
assert!(kit::check(&ours).is_empty(), "{:?}", kit::check(&ours));
let ctx = egui::Context::default();
let _app = App::builder().kit(ours).theme(ThemeSpec::new("swatch"))
.build(&ctx).unwrap();
// While drawing: the theme's colours and sizes.
let tokens = Tokens::of(&ctx);
let _frame = egui::Stroke::new(1.0, tokens.border.strong);
The template keeps its kit in a folder, kit/kit.yaml, built into the
binary with egui_pop::tokens::kit!("../kit"), and checks it in a
test. More in Themes, Kits as packages
and Design tokens.
Where Helios goes further.
theme.rs
ships five themes as token files
(themes/)
extending egui-pop’s, and adds tokens of its own (the neutral grey
behind a photo) with a fallback for themes that lack them.
6. Undo
egui-pop’s undo is the application’s history; Ctrl+Z, the Edit menu
and the History panel route to it. Without a history of its own, the
application’s state lives in the value store: each change is an
undo step with a label and an origin. Declare the values the plugin
owns (Ctx::value), and write the changes of one action in a group
(Call::group): one step, named, written as the command’s caller,
undone together; an error puts every write back.
use egui_pop::api::app::CMD_UNDO;
use egui_pop::egui;
use egui_pop::model::values::{Change, Value};
use egui_pop::prelude::*;
const HUE: &str = "swatch/hue";
const RESET: CommandId = CommandId::from_static("swatch.reset");
struct Swatch;
impl Plugin for Swatch {
fn id(&self) -> PluginId { PluginId::from_static("swatch") }
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
// In `connect`: the value, owned by the plugin.
ctx.value(HUE, Descriptor::float("Hue", 0.0, 360.0, 200.0).unit("°"))?;
ctx.command(CommandSpec::new(RESET, "Reset the swatch", "Swatch"), |call| {
// Every write in the group is one step, with the caller's origin.
call.group("Reset the swatch", |g| {
g.set(HUE, Change::Reset)?;
Ok(serde_json::Value::Null)
})
})?;
Ok(())
}
}
let mut app = App::builder().plugins(DefaultPlugins).plugin(Swatch)
.build(&egui::Context::default()).unwrap();
let handle = app.handle().clone();
// Outside a command (a panel, a test), a group names its origin.
handle.group(&Origin::User, "Warm the swatch", |g| g.set(HUE, Change::To(Value::Float(30.0))))
.unwrap();
app.run(&RESET, serde_json::Value::Null, Origin::User);
assert_eq!(handle.value::<f64>(HUE), Some(200.0));
app.run(&CMD_UNDO, serde_json::Value::Null, Origin::User); // Ctrl+Z
assert_eq!(handle.value::<f64>(HUE), Some(30.0));
The group goes through the host, so an application keeping its own
history (as Helios does, below) gets it too. In a panel, a widget bound
to the value writes it the same way, one step per drag:
param::bound(ui, &app.store(), HUE) draws the slider, check box or
field the value’s descriptor calls for (egui_pop::core::param). HistoryPlugin (egui_pop::api::history_view)
adds the History panel: every step, a click to go back to one,
snapshots. More in History and
State or event.
Where Helios goes further. Its kernel keeps the history (each
image’s edits, saved as versions);
history.rs
shows it to egui-pop through the History contract, with the hover
preview, and
edit_snapshots.rs
adds named snapshots.
7. The agent bridge
Every command is offered to agents unless it says otherwise: an agent
(a test, a script, an assistant behind a transport you write) holds the
App, reads what it offers as JSON and runs commands as
Origin::Agent. Describe a command’s arguments with an example; keep a
command off that surface with .no_agent(); declare one that destroys
or discards what cannot easily be had back with .destructive(), and
the agent socket asks the user before an agent runs it; the whole
bridge can be read-only or off (AppBuilder::debug_bridge).
use egui_pop::egui;
use egui_pop::prelude::*;
use serde_json::json;
struct Swatch;
impl Plugin for Swatch {
fn id(&self) -> PluginId {
PluginId::from_static("swatch")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
let set = CommandSpec::new(CommandId::from_static("swatch.set"), "Set the swatch", "Swatch")
.description("Sets the hue (`hue`, 0 to 360).")
.args(json!({ "hue": 30.0 }))
.hidden(); // out of the palette, still offered to agents
ctx.command(set, |call| Ok(json!({ "hue": call.args["hue"], "by": call.origin })))?;
Ok(())
}
}
let mut app = App::builder().plugins(DefaultPlugins).plugin(Swatch)
.build(&egui::Context::default()).unwrap();
// What the bridge holds (collectors, actions), and every collector's state.
assert!(app.handle().debug_describe().as_array().is_some_and(|c| !c.is_empty()));
let snapshot = app.handle().debug_snapshot();
let commands = snapshot["commands"]["commands"].as_array().unwrap();
let set = commands.iter().find(|c| c["id"] == "swatch.set").unwrap();
assert_eq!((&set["agent"], &set["args"]), (&json!(true), &json!({ "hue": 30.0 })));
// Run it as an agent: the run, and every step it writes, is the agent's.
let f = app.debug_call("commands", "run", &json!({ "id": "swatch.set", "args": { "hue": 90.0 } }));
assert!(f.ok, "{}", f.message);
let agent = json!({ "kind": "agent", "id": "debug-bridge" });
assert_eq!(f.data, json!({ "hue": 90.0, "by": agent }));
// As the history and the journal name it.
assert_eq!(Origin::Agent("debug-bridge".into()).to_string(), "agent:debug-bridge");
The History panel names the steps an agent made (“Set the swatch (agent:debug-bridge)”), and a before-hook on a step may refuse what an agent asks for. What the bridge can and cannot do, and its trust model, are in Agents and the debug bridge.
Where Helios goes further. Agents drive Helios’s kernel, not only
its window: an MCP server
(mcp.rs)
maps tools onto the same commands scripts use, and the window’s host
(host.rs)
carries each origin into the kernel and back.
8. Tests
egui-pop’s test kit (egui-pop-test) builds the whole application in
an egui_kittest
harness, headless: widgets are found by role and label, keys are
pressed for real, and checks catch a key bound twice, a widget without
a name, or a write to a value nobody declared. Add them as
dev-dependencies: cargo add --dev egui_kittest egui-pop-test.
use egui_kittest::kittest::Queryable as _;
use egui_pop::api::app::MENU_EDIT;
use egui_pop::egui;
use egui_pop::model::panels::{Area, PanelSpec};
use egui_pop::prelude::*;
const RESET: CommandId = CommandId::from_static("swatch.reset");
struct Swatch;
impl Plugin for Swatch {
fn id(&self) -> PluginId { PluginId::from_static("swatch") }
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
let spec = CommandSpec::new(RESET, "Reset the swatch", "Swatch").key("Ctrl+Shift+R").menu(MENU_EDIT, "5_swatch", 0);
ctx.command(spec, |_| Ok(serde_json::Value::Null))?;
let view = PanelSpec::new(PanelId::from_static("swatch.view"), "Swatch", Area::Center);
ctx.panel(view, |ui, app| if ui.button("Reset").clicked() { app.run(RESET, serde_json::Value::Null); })?;
Ok(())
}
}
let builder = App::builder().plugins(DefaultPlugins).plugin(Swatch);
let mut h = egui_pop_test::app(builder, egui::vec2(800.0, 500.0));
h.run();
h.get_by_label("Reset").click();
h.run();
h.key_press_modifiers(egui::Modifiers::COMMAND | egui::Modifiers::SHIFT, egui::Key::R);
h.run();
let runs = h.state().handle().history();
assert_eq!(runs.iter().filter(|r| r.id == RESET).count(), 2, "the button and the key");
egui_pop_test::assert_keymap_clean(h.state());
egui_pop_test::assert_all_named(&h);
A picture of the window is a snapshot test. It renders with wgpu
(egui-pop-test’s wgpu feature, egui_kittest’s wgpu and
snapshot), writes the picture with UPDATE_SNAPSHOTS=1 cargo test,
and compares with it afterwards, within the tolerances of a
kittest.toml next to the manifest:
#[test]
fn the_window_looks_as_it_did() {
// `None` (the reason printed) where pictures are not compared.
let Some(mut h) = egui_pop_test::app_snapshot(builder(), egui::vec2(900.0, 560.0)) else {
return;
};
h.run();
h.snapshot("swatch"); // tests/snapshots/swatch.png
}
Pictures are compared on lavapipe, Mesa’s software Vulkan, which
draws them the same everywhere (CI included); a GPU draws edges a
little differently. app_snapshot skips with a message where no
adapter opens or the adapter is a GPU; install lavapipe
(mesa-vulkan-drivers) to compare locally, or set
EGUI_POP_SNAPSHOT_ANY_GPU=1 to compare on your GPU.
The template’s src/tests.rs has both, and the agent’s run of step 7.
More in Testing.
Where Helios goes further. Its
tests/
drive the whole shell headless, one binary per feature (layouts, keys,
the palette, detached panels, history), and
snapshot.rs
takes pictures of a named widget, a panel or the window, headless or
from a real window.
Lints
An inherent method of egui’s Ui always wins over a trait method of
the same name, so a call to it never reaches egui-pop. The UiPop
methods take names egui does not use (ui.strong_text(..), not
ui.strong(..), which is egui’s own bold-coloured label), and a
clippy.toml beside the manifest (the templates have it) warns on the
egui calls egui-pop answers by role:
disallowed-methods = [
{ path = "egui::Ui::strong", reason = "use `ui.strong_text(..)` (`UiPop`)" },
]
What next
The template (templates/app) is these eight steps in one crate, with
a README.md saying where each one is. From there:
- Getting started: what
DefaultPluginsbrings, and laying out by role; - Plugins, commands and steps: steps others may veto, replace or follow; zones and blocks;
- Hosts and components: an application with a kernel of its own, as Helios;
- Translations, Jobs and progress, Choosing files: what a real tool needs next;
- The gallery: every component, running.
Getting started
How to start an egui-pop application, and what a plugin application looks like.
Start an application
A cargo-generate
template makes a new application: a plugin with two panels, a setting,
a command for people and one for agents, undo, a kit of its own and its
tests, over DefaultPlugins.
cargo generate --git https://github.com/quazardous/egui-pop templates/app
It is the end state of Your first application, which
builds it step by step. The minimal example (cargo run -p egui-pop --example minimal) is smaller still: one plugin with a panel, a
setting and a command.
To add egui-pop to an existing crate instead:
cargo add egui-pop
cargo add egui-pop --features viewport # with the image viewport
A plugin application
Everything an application adds goes through a plugin. A plugin registers
through Ctx; whatever it registers is removed when it is disconnected.
A command is declared once: its key binding, menu entry, palette entry
and agent surface are derived from it.
use egui_pop::api::app::MENU_VIEW;
use egui_pop::egui;
use egui_pop::prelude::*;
struct Counter;
const COUNT: SettingId = SettingId::from_static("counter.count");
impl Plugin for Counter {
fn id(&self) -> PluginId {
PluginId::from_static("counter")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.setting(COUNT, Descriptor::int("Count", 0, 100, 0))?;
ctx.command(
CommandSpec::new(CommandId::from_static("counter.add"), "Add one", "Counter")
.key("Ctrl+Up")
.menu(MENU_VIEW, "5_counter", 0),
|call| {
let store = call.app.store();
let mut store = store.lock().unwrap();
let set = egui_pop::model::values::Set::new(
"settings/counter.count",
egui_pop::model::values::Change::Step(1),
call.origin.clone(),
);
store.set(set).map(|a| a.value.to_json()).map_err(|e| e.to_string())
},
)?;
ctx.block(
zones::MAIN,
Block::add(BlockId::from_static("counter.view"), 0, |ui, app| {
let store = app.store();
let n: i64 = egui_pop::core::binding::read(&store, "settings/counter.count").unwrap_or(0);
ui.heading(format!("Count: {n}"));
if ui.button("Add one").clicked() {
app.run(CommandId::from_static("counter.add"), serde_json::Value::Null);
}
}),
);
Ok(())
}
}
// Headless, as in tests; `.run_native("Counter", options)` opens a window.
let ctx = egui::Context::default();
let mut app = App::builder().plugin(Counter).build(&ctx).unwrap();
assert!(app.handle().diagnostics().is_empty());
let out = app.run(&CommandId::from_static("counter.add"), serde_json::Value::Null, Origin::User);
// Run by the default host, in-process: the result is there now.
assert_eq!(out.now(), Some(Ok(serde_json::json!(1))));
Plugins can also change what other plugins drew (zones and blocks) and take part in each step of a feature’s life: see Plugins, commands and steps.
The command palette
Every command is in the palette (Ctrl+Shift+P or F1, a plugin in
DefaultPlugins), ranked by a fuzzy match with the recent ones first,
with the keys the keymap really binds; a command taking arguments asks
for them:
The paved road
The components of the paved road, each a plugin in DefaultPlugins:
dialogs (here a form from value descriptors), toasts with actions, the
settings window with its shortcuts editor, and the parameter widgets:
| Dialogs | Toasts (pop-light) |
|---|---|
| Settings | Shortcuts |
|---|---|
Laying out by role
An application’s own layout code says what a piece of text is and why
there is space, not which size or how many points: the UiPop helpers
on egui’s Ui (in the prelude) draw from the theme’s text roles,
spacing by intent and kit (design tokens).
use egui_pop::egui;
use egui_pop::prelude::*;
fn export_panel(ui: &mut egui::Ui) {
ui.section_title("Export");
ui.muted("Writes a copy next to the original.");
ui.space_role(Space::Group);
ui.card(Tone::Neutral, |ui| {
ui.label("IMG_0001.raw");
ui.meta("24 MB, 12 October");
});
ui.space_role(Space::Section);
ui.horizontal(|ui| {
if ui.button_tone(Tone::Accent, "Export").clicked() {
// ...
}
if ui.button_tone(Tone::Danger, "Delete").clicked() {
// ...
}
});
}
let ctx = egui::Context::default();
egui_pop::theme::install(&ctx, &ThemeSpec::new("pop-dark"));
let mut out = ctx.run_ui(Default::default(), export_panel);
out.textures_delta.clear();
| Helper | Draws |
|---|---|
section_title, muted, meta, text_role(TextRole, ..) | a label in a text role (text-role.*); role_text gives the RichText for other widgets |
space_role(Space) | space.inline, group, section or page (egui’s add_space takes points) |
card(Tone, ..) | the kit’s card, by tone |
button_tone(Tone, ..) | egui’s button in a tone of the kit’s button |
scoped(Stock, Tone, ..) | egui’s own widgets (a button on or off, a text field in a tone) drawn from a kit component in a scope (kits) |
combo_box(combo, ..) | egui’s combo box with its box from the kit’s combo-box |
scroll_area(area, ..) | egui’s scroll area with its bars’ colours from the kit’s scroll-bar (their width, margin, placement and visibility come with the theme, in every scroll area) |
row(Row, ..), grid(Grid, ..) | cells on tracks, on one text baseline, Space apart (below) |
flow(Flow, ..) | whole cells left to right, wrapping to the next line those that do not fit (below) |
Rows and grids
ui.row places one line of cells and ui.grid lines of cells on shared
tracks, with types from egui_pop::core::ui. A track is sized by its
content (Track::CONTENT), a share of what is left (Track::fr), a share
of the container (Track::percent) or lines of body text (Track::em),
each with a Length minimum and maximum; there are no points. Cells sit
on one text baseline by default, whatever their text sizes and widget
padding; gaps are Space intents only.
use egui_pop::core::ui::{Align, Grid, Length, Row, Track};
use egui_pop::egui;
use egui_pop::prelude::*;
fn details(ui: &mut egui::Ui, name: &mut String) {
// A field between 8 and 24 em taking what is left, beside its title
// and a button, on one baseline.
let field = Track::fr(1.0).min(Length::Em(8.0)).max(Length::Em(24.0));
ui.row(Row::new([Track::CONTENT, field, Track::CONTENT]), |r| {
r.cell(|ui| ui.section_title("Name"));
r.cell(|ui| ui.text_edit_singleline(name));
r.cell(|ui| ui.button("Rename"));
});
// Headers as wide as the widest, values beside them; headers over
// values below 30 em.
let grid = Grid::new("details", [Track::CONTENT, Track::fr(1.0)])
.fold_below(Length::Em(30.0));
ui.grid(grid, |g| {
g.header("Kind");
g.cell(|ui| ui.label("Raw image"));
g.header("Size");
g.cell(|ui| ui.label("24 MB"));
});
// A button bar: as wide as the widest, at the end.
let bar = Row::new([Track::CONTENT; 2]).justify(Align::End).equal_widths();
ui.row(bar, |r| {
r.cell(|ui| ui.button("Cancel"));
r.cell(|ui| ui.button_tone(Tone::Accent, "Export"));
});
}
let ctx = egui::Context::default();
egui_pop::theme::install(&ctx, &ThemeSpec::new("pop-dark"));
let mut name = String::from("IMG_0001.raw");
let mut out = ctx.run_ui(Default::default(), |ui| details(ui, &mut name));
out.textures_delta.clear();
Cells are placed from the sizes and baselines they had on the previous
pass; when those change, the layout asks egui for one more pass, as
egui’s own Grid does, so nothing is measured twice at rest. The
gallery’s roles page shows them.
ui.flow places whole cells left to right and moves a cell that does not
fit to the next line, whole: a bar of actions in a narrow panel keeps each
button on one line. egui’s horizontal_wrapped wraps only widgets placed
directly in it, never a child Ui (a toned button, an add_enabled_ui
scope); a flow wraps any cell, from the size it had on the previous pass.
use egui_pop::core::ui::Flow;
use egui_pop::egui;
use egui_pop::prelude::*;
fn actions(ui: &mut egui::Ui, can_delete: bool) {
ui.flow(Flow::new(), |f| {
f.cell(|ui| ui.button_tone(Tone::Accent, "Save as template"));
f.cell(|ui| ui.add_enabled_ui(can_delete, |ui| ui.button_tone(Tone::Danger, "Delete")));
f.cell(|ui| ui.button("Export"));
});
}
let ctx = egui::Context::default();
egui_pop::theme::install(&ctx, &ThemeSpec::new("pop-dark"));
let mut out = ctx.run_ui(Default::default(), |ui| actions(ui, false));
out.textures_delta.clear();
Next
- Themes and design tokens: the look.
- The image viewport: showing an image the application computes.
- Debugging: what every registry says about itself.
- The gallery: every component, running.
Using parts without App
egui-pop is a framework, but most of it is a library first: the design
tokens, the theme, the visual kits and most components are plain egui
code that works in any egui or eframe application, with no App,
AppBuilder, Ctx or plugin. This page says what works alone, its
entry point, and what needs the framework and why.
Every example below is compiled and run as a test against the
egui-pop crate (cargo test -p consumer-smoke --doc), most of them
drawing one frame in a bare egui::Context.
What works alone
| Part | Crate (facade feature) | Entry point without App |
|---|---|---|
| Design tokens, themes, contrast, colour ramps | egui-pop-tokens (no egui) | Themes::default().resolve(&ThemeSpec) |
| The theme in egui’s style | egui-pop-core | theme::install(&ctx, &spec); theme::style(&tokens, &base); ScopedTheme |
| Visual kits | egui-pop-tokens, egui-pop-core | Themes::add_kit, KitSource::register, theme::install_with |
Layout by role (UiPop), egui’s widgets drawn by the kit | egui-pop-core | the UiPop trait on egui::Ui; core::widgets |
| Sliders, inputs, sections, indicators, progress, icons, hover cards, placeholders, thumbnails, fault boundaries | egui-pop-core | each widget’s new(..), then ui.add or .show(ui) |
| Value binding and the value store | egui-pop-core, egui-pop-model | binding::edit, Binding::{plain, bound, watch}, values::Store |
| Persistence | egui-pop-core | persist::Persist::new(dir) |
Logic without egui: fuzzy matching, keymap, when clauses, documents | egui-pop-model | each module’s types |
| Image viewport, histogram, curves, colour wheels, zoom control, navigator, node graph | egui-pop-viewport (viewport) | Viewport::new(..).show(ui, ..); each tool’s new(..).show(ui); gpu::install for the GPU path |
| Tree, list, data table | egui-pop-views (views) | TreeView, ListView, DataTable with their states |
| Text and code editors, terminal | egui-pop-editors (editors) | TextSurface, CodeEditor, Terminal over an EditorState or TerminalState |
| Translations | egui-pop-i18n (i18n) | an I18n installed with i18n::install(&ctx, &i18n): t(ctx, ..), tr! and egui-pop’s own text |
| Platform readers | egui-pop-platform (platform-*) | text_scale::read, focus::read, wheel_lines::read, dirs, window::raise |
| A single instance | egui-pop-platform (platform-instance) | instance::single, then Launches::set_waker and Launches::take each frame |
| Orthogonal wire routing | ortho-router (no egui) | its own crate |
| Slot layout: plain boxes packed in standard slot sizes | egui-pop-fit (no egui), egui_pop::fit | layout, layout_grouped, Element, Group |
| Hook points: ordered listeners, alter and collect, an error boundary | egui-pop-hooks (no egui) | Kernel::new(), listen, alter, collect, points |
| The test kit’s checks on any harness | egui-pop-test (dev-dependency) | themed, assert_all_named, a11y_tree |
Each component above that has a .app(&AppHandle) option works without
it: with an application its moments run as
steps and its keys come from the keymap (rebindable);
without one, it reports what happened in its output and binds its own
default keys.
The lightest set
The facade always brings the application layer (egui-pop-api). An
application that only wants a data view or an editor depends on the
component crate with its default features off: its api feature (the
.app(..) and .shared(..) options, the steps’ plugins such as
ViewsPlugin, EditorsPlugin or TerminalPlugin) is then left out, and
the crate builds on egui-pop-core, egui-pop-model and
egui-pop-tokens only.
[dependencies]
egui-pop-views = { version = "0.10", default-features = false }
# Highlighting stays a choice: add `features = ["syntect"]`.
egui-pop-editors = { version = "0.10", default-features = false }
Each crate’s documentation has an example drawn this way. CI keeps it
so: tools/check-light-deps.sh fails when either crate, without its
default features, depends on egui-pop-api or eframe, or holds more
crates than recorded in tools/light-deps.txt. The viewer (markdown,
html, video, webview) is the links service’s way inside and turns
api back on.
The tokens, without egui
egui-pop-tokens has no egui dependency: resolve a theme, read its
colours and sizes, check a contrast, for a renderer of your own or a
style sheet.
use egui_pop::tokens::{ThemeSpec, Themes, contrast};
let tokens = Themes::default().resolve(&ThemeSpec::new("catppuccin-mocha").accent("blue"));
assert!(tokens.problems().is_empty());
let text = tokens.color("text.default").unwrap();
let panel = tokens.color("surface.panel").unwrap();
assert!(contrast::contrast_ratio(text, panel) >= 4.5);
let radius = tokens.dimension("radius.widget");
assert!(radius.is_some());
A theme in a plain eframe application
theme::install resolves a theme, writes it into egui’s style (both
egui’s dark and light styles, fonts, icon sizes, the kit) and makes the
typed tokens readable from the context. Call it once at start-up, and
again when the user picks another theme, between frames.
use egui_pop::eframe;
use egui_pop::egui;
use egui_pop::theme::{self, Density, ThemeSpec, Tokens};
struct MyApp;
impl eframe::App for MyApp {
fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
// egui's widgets follow the theme; custom painting reads the tokens.
let tokens = Tokens::of(ui.ctx());
ui.colored_label(tokens.status.success, "Saved");
let _ = ui.button("A themed button");
}
}
fn main() -> eframe::Result {
eframe::run_native(
"Themed",
eframe::NativeOptions::default(),
Box::new(|cc| {
theme::install(&cc.egui_ctx, &ThemeSpec::new("pop-light").density(Density::Compact));
Ok(Box::new(MyApp))
}),
)
}
To keep control of egui’s style yourself, theme::style builds a
Style from tokens without installing anything; ScopedTheme draws one
part of the interface in another theme.
use egui_pop::egui;
use egui_pop::theme::{self, ScopedTheme, ThemeSpec, Tokens};
use egui_pop::tokens::Themes;
let ctx = egui::Context::default();
let tokens = Tokens::new(Themes::default().resolve(&ThemeSpec::new("nord")));
let style = theme::style(&tokens, &ctx.global_style());
ctx.set_global_style(style);
// A light inspector inside a dark window.
let light = ScopedTheme::new(&ctx, Tokens::new(Themes::default().resolve(&ThemeSpec::new("pop-light"))));
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| {
light.show(ui, |ui| {
assert!(!Tokens::of(ui.ctx()).dark_mode());
ui.label("Inspector");
});
});
out.textures_delta.clear();
A visual kit
AppBuilder::kit does three things, each callable alone: add the kit’s
theme to the themes you resolve, register its faces and handlers in the
context, install the theme.
use egui_pop::core::kit::{Kit, KitSource};
use egui_pop::egui;
use egui_pop::theme::{self, ThemeSpec};
use egui_pop::tokens::Themes;
use egui_pop::tokens::kit::KitData;
let kit = KitData::from_text(
"underline",
r#"
tab:
shape: {$type: "string", $value: "underline"}
"#,
);
let ctx = egui::Context::default();
let mut themes = Themes::default();
themes.add_kit(&kit);
KitSource::new(kit).register(&ctx);
theme::install_with(&ctx, &themes, &ThemeSpec::new("underline"));
assert_eq!(Kit::of(&ctx).tab.shape, "underline");
Layout by role and egui’s widgets
The UiPop helpers (getting started)
and the kit’s drawing of egui’s check box, radio button and selectable
row (egui_pop::core::widgets) need only an installed theme; without
one they use pop-dark.
use egui_pop::core::widgets::{self, ToggleChip};
use egui_pop::egui;
use egui_pop::prelude::{Space, Tone, UiPop};
fn panel(ui: &mut egui::Ui, raw: &mut bool, flagged: &mut bool) {
ui.section_title("Filters");
ui.muted("Shown in the grid.");
ui.space_role(Space::Group);
widgets::checkbox(ui, raw, "Raw files only");
ui.add(ToggleChip::new(flagged, "Flagged"));
if ui.button_tone(Tone::Accent, "Apply").clicked() { /* ... */ }
}
let ctx = egui::Context::default();
let (mut raw, mut flagged) = (true, false);
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| panel(ui, &mut raw, &mut flagged));
out.textures_delta.clear();
Core components
Sliders, inputs, sections, indicators, progress, icons, hover cards and
placeholders are egui widgets: build, add, read the response. A slider’s
on_change takes a plain closure (with an application,
api::sliders::hook runs each change as the slider.change step).
use egui_pop::core::hover_card::{Card, HoverCard};
use egui_pop::core::icon::Icon;
use egui_pop::core::indicator::{Indicator, Led};
use egui_pop::core::input::Input;
use egui_pop::core::placeholder::EmptyState;
use egui_pop::core::progress::ProgressBar;
use egui_pop::core::sections::{Section, Sections};
use egui_pop::core::slider::{Slider, Verdict};
use egui_pop::egui;
struct Panel {
exposure: f64,
name: String,
photos: Vec<String>,
}
fn panel(ui: &mut egui::Ui, p: &mut Panel) {
Sections::new("develop").show(ui, |stack| {
stack.section(Section::new("basic", "Basic"), |ui| {
ui.add(
Slider::new(&mut p.exposure, "Exposure", -3.0..=4.0)
.unit("EV")
.default(0.0)
// Refuse the far end of the range.
.on_change(|c| if c.to > 3.5 { Verdict::Redirect(3.5) } else { Verdict::Go }),
);
Input::text(&mut p.name, "Export name").placeholder("File name").clearable(true).show(ui);
});
stack.section(Section::new("photos", "Photos").count(p.photos.len() as u64), |ui| {
if p.photos.is_empty() {
EmptyState::new(Icon::Folder, "No photo").text("Import a folder.").show(ui);
}
});
});
ui.add(ProgressBar::counts(340, 1204).label("Importing photos"));
let led = ui.add(Indicator::led(Led::On).id("link").tooltip("The render node's link"));
HoverCard::new("link-card").show(ui, &led, &Card::new().text("Connected").row("Latency", "3 ms"));
}
let ctx = egui::Context::default();
let mut p = Panel { exposure: 0.0, name: String::new(), photos: Vec::new() };
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| panel(ui, &mut p));
out.textures_delta.clear();
A thumbnail grid and a fault boundary (an error card instead of a panic taking the window down) are plain functions too:
use egui_pop::core::fault;
use egui_pop::core::thumbnail::ThumbnailGrid;
use egui_pop::egui;
fn grid(ui: &mut egui::Ui, names: &[&str]) {
fault::boundary(ui, "grid", "The grid", |ui| {
ThumbnailGrid::new(names.len(), egui::vec2(96.0, 96.0)).show(ui, |ui, i| {
ui.label(names[i]);
});
});
}
let ctx = egui::Context::default();
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| grid(ui, &["a.jpg", "b.jpg"]));
out.textures_delta.clear();
A value store, without the application
The value store (egui-pop-model) and the bindings (egui-pop-core)
work on their own: a widget bound to a store writes with an origin, a
drag is one undo step, listeners are told
(ADR 0009).
use std::sync::{Arc, Mutex};
use egui_pop::core::binding::{self, Binding};
use egui_pop::egui;
use egui_pop::model::ids::OwnerId;
use egui_pop::model::values::{Descriptor, Store};
let store = Arc::new(Mutex::new(Store::new()));
store
.lock()
.unwrap()
.declare(&OwnerId::FRAMEWORK, "view/zoom", Descriptor::float("Zoom", 0.1, 8.0, 1.0))
.unwrap();
let ctx = egui::Context::default();
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| {
binding::edit(ui, Binding::bound(&store, "view/zoom"), |ui, v: &mut f64| {
ui.add(egui::Slider::new(v, 0.1..=8.0))
});
});
out.textures_delta.clear();
assert_eq!(binding::read::<f64>(&store, "view/zoom"), Some(1.0));
The rest of egui-pop-model is logic without egui: fuzzy matching
(fuzzy::rank), the keymap and its resolution trace, when clauses,
versioned documents.
use egui_pop::model::fuzzy;
let items = ["Export as JPEG", "Open folder", "Export settings"];
let ranked = fuzzy::rank(&items, "exp", |s| s.to_string());
assert_eq!(ranked.len(), 2);
The image viewport and the image tools
With the viewport feature. The viewport draws tiles from a source you
implement (the image viewport); in an eframe application
on wgpu, gpu::install turns its GPU path on (the viewport’s
examples/viewer.rs is a whole eframe application without App).
use egui_pop::egui;
use egui_pop::viewport::source::{Pixels, Tile, TileRequest, TileSink, TileSource};
use egui_pop::viewport::{View, Viewport, ViewportState};
struct Grey(TileSink);
impl TileSource for Grey {
fn size(&self) -> Option<[u32; 2]> { Some([600, 400]) }
fn request(&self, requests: Vec<TileRequest>) {
for r in requests {
let n = r.size[0] as usize * r.size[1] as usize;
self.0.deliver(Tile::answer(&r, Pixels::Scene(vec![0.18; n * 4])));
}
}
}
// In eframe's creation closure, on wgpu:
// egui_pop::viewport::gpu::install(&cc.egui_ctx, cc.wgpu_render_state.as_ref().unwrap());
let mut state = ViewportState::new();
let source = Grey(state.sink());
let mut view = View::fit();
let ctx = egui::Context::default();
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| {
Viewport::new("main").source(&source).show(ui, &mut state, &mut view);
});
out.textures_delta.clear();
The histogram, the curve editor, the colour wheels, the zoom control,
the navigator and the node graph are widgets of the same crate; their
on_change takes a plain closure. The imaging crate only turns their
changes into steps of an application.
use egui_pop::egui;
use egui_pop::viewport::change::Verdict;
use egui_pop::viewport::curve::CurveEditor;
use egui_pop::viewport::histogram::{Channel, Histogram};
use egui_pop::viewport::wheel::{ColorWheel, WheelValue};
fn tools(ui: &mut egui::Ui, bins: &[f32], points: &mut Vec<[f32; 2]>, lift: &mut WheelValue) {
Histogram::new([Channel::new("Luma", bins, egui::Color32::GRAY)]).show(ui);
CurveEditor::new(points, "Tone curve")
// At most eight points.
.on_change(|c| if c.to.len() > 8 { Verdict::Veto } else { Verdict::Allow })
.show(ui);
ColorWheel::offset(lift, "Lift").size(120.0).show(ui);
}
let ctx = egui::Context::default();
let bins = vec![0.5; 64];
let mut points = vec![[0.0, 0.0], [1.0, 1.0]];
let mut lift = WheelValue::default();
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| tools(ui, &bins, &mut points, &mut lift));
out.textures_delta.clear();
The tree, the list and the data table
With the views feature. Without .app(..) they report selection,
activation and edits in their output; the table keeps its sort and
widths in its TableState (.store(..) keeps them in a value store
instead). The tree and table pages have more.
use egui_pop::egui;
use egui_pop::views::table::{Column, DataTable, TableRows, TableState};
use egui_pop::views::tree::{Node, Sink, TreeSource, TreeState, TreeView};
struct Folders;
impl TreeSource<String> for Folders {
fn load(&self, _parent: Option<&String>, sink: Sink<String>) {
sink.deliver(vec![Node::leaf("a".into(), "a.txt"), Node::leaf("b".into(), "b.txt")]);
}
}
struct Files(Vec<(u64, String)>);
impl TableRows<u64> for Files {
fn len(&self) -> usize { self.0.len() }
fn key(&self, row: usize) -> u64 { self.0[row].0 }
fn label(&self, row: usize) -> String { self.0[row].1.clone() }
fn cell(&mut self, ui: &mut egui::Ui, row: usize, _column: usize, _selected: bool) {
ui.label(&self.0[row].1);
}
}
let ctx = egui::Context::default();
let mut tree = TreeState::<String>::new();
let mut table = TableState::new();
let mut files = Files(vec![(1, "a.txt".into()), (2, "b.txt".into())]);
let columns = [Column::new("name", "Name")];
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| {
TreeView::new("folders").label("Folders").show(ui, &mut tree, &Folders);
let out = DataTable::new("files", &columns).label("Files").show(ui, &mut table, &mut files);
if out.sorted { /* sort `files` by `table.sort()` */ }
});
out.textures_delta.clear();
The text and code editors, the terminal
With the editors feature. The EditorState is a handle shared with
the application; without .app(..) the editors bind their own default
keys (Ctrl+F, Ctrl+Z, Ctrl+S…) and report changes and saves in their
output (text and code editors). A terminal shows a
Console (logs, ANSI colours) or a program in a pseudo-terminal
(editors-pty).
use egui_pop::editors::terminal::Console;
use egui_pop::editors::{CodeEditor, EditorState, Signal, Terminal, TerminalState};
use egui_pop::egui;
let code = EditorState::new("main.rs", "fn main() {}\n").language("rs");
let console = Console::new();
console.line("\x1b[32mbuild finished\x1b[0m");
let log = TerminalState::new("log", console);
let ctx = egui::Context::default();
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| {
let out = CodeEditor::new().label("main.rs").height(200.0).show(ui, &code);
for s in out.signals {
if let Signal::Saved { .. } = s { /* write `code.text()` */ }
}
Terminal::new().label("Build log").show(ui, &log);
});
out.textures_delta.clear();
Translations
With the i18n feature. An I18n holds Fluent catalogues and looks
text up on its own; installed as the context’s strings provider, it
translates egui-pop’s own text (field states, error cards, the editors’
find bar…). i18n::install puts it in an egui context: t(ctx, ..),
text(ctx, ..) and tr! read it, and egui-pop’s own text is
translated through its strings provider.
use egui_pop::egui;
use egui_pop::i18n::{I18n, args, install, t, tr};
let i18n = I18n::with_egui_pop("fr");
i18n.add("fr", "hello = Bonjour, { $name } !\n").unwrap();
let ctx = egui::Context::default();
install(&ctx, &i18n);
assert_eq!(t(&ctx, "hello", &args![name = "Ada"]), "Bonjour, Ada !");
assert_eq!(tr!("hello", name = "Ada"), "Bonjour, Ada !");
let said = egui_pop::core::strings::lookup(&ctx, "egui-pop-field-modified-saved", "Modified since saved");
assert_eq!(said, "Modifié depuis l’enregistrement");
The I18n is shared: the application switches the language with
i18n.set_locale(..), seen at the next lookup. The language setting
and the locale.changed signal are I18nPlugin’s.
Platform readers
With a platform-* feature. The services are plugins, but what they
read from the system is a function:
use egui_pop::platform::{dirs, focus, text_scale, wheel_lines};
let scale = text_scale::read(); // the desktop's text scaling, 1.0 when unknown
assert!(scale.factor > 0.0);
let _mode = focus::read().mode; // click to focus, or focus follows the pointer
assert!(wheel_lines::read() >= 1);
let _logs = dirs::log_dir("org.example.app");
A single instance
With the platform-instance feature. instance::single at the top of
main makes a later launch hand its arguments to the running one; the
running one takes them in its frame, woken when one arrives:
use egui_pop::eframe;
use egui_pop::egui;
use egui_pop::platform::instance::{self, Launches, Single};
struct Viewer {
launches: Launches,
}
impl eframe::App for Viewer {
fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
for launch in self.launches.take() {
egui_pop::platform::window::raise(ui.ctx());
// open what `launch.args` names, from `launch.cwd`
let _ = launch;
}
}
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
let first = match instance::single("org.example.Viewer")? {
Single::Handed => return Ok(()), // the running instance took over
Single::First(first) => first,
};
let launches = first.launches();
eframe::run_native(
"Viewer",
eframe::NativeOptions::default(),
Box::new(move |cc| {
// A launch handed over repaints the window.
launches.set_waker(Some(cc.egui_ctx.clone()));
Ok(Box::new(Viewer { launches }))
}),
)?;
Ok(())
}
InstancePlugin adds the instance.second_launch and deeplink.open
steps and the scheme’s links on top: those need the application.
Without eframe
The facade’s default features include eframe. An application on another integration (bevy_egui, egui-winit with its own renderer) turns them off and keeps the rest:
egui-pop = { version = "0.2", default-features = false, features = ["phosphor", "bundled-fonts"] }
What needs the application
These parts are the framework itself: they read registries that only
an App builds (commands, menus, the keymap, settings, panels, steps),
or they are plugins.
| Part | Why it needs App |
|---|---|
| Commands, the keymap at run time, menus, toolbars, the command palette | all read the command registry and the keymap a plugin fills through Ctx |
| Dialogs, toasts, the settings window and shortcuts editor, tips, About | plugins drawing in the application’s overlay and settings |
| Zones and blocks, the workbench, arrangements, the window’s own frame, the status bar, strips | the application lays the window out |
Steps and hooks (before, replace, after), .app(..) on a component, egui-pop-imaging | steps are the application’s (ADR 0011); without it a component reports in its output |
| The host, history, the clipboard, links, jobs, the context stack, choosing files | services behind the host and the application’s store |
| The debug bridge’s commands and devtools | they describe and drive the application’s registries |
I18nPlugin and the language setting | a plugin with a setting; without it the application calls I18n::set_locale |
| Platform services: notifications, the tray, global shortcuts, logs, crash reports | plugins routing to commands and steps |
| A single instance’s steps and deep links | InstancePlugin runs them as steps and commands; without it the application takes the launches (above) |
Themes
How to pick a theme, adjust it, and read it when painting. How tokens are written, resolved and checked is in Design tokens.
A theme
use egui_pop::egui;
use egui_pop::theme::{self, Density, ThemeSpec, Tokens};
fn setup(ctx: &egui::Context) {
let tokens = theme::install(
ctx,
&ThemeSpec::new("pop-dark").density(Density::Compact).accent("blue"),
);
for problem in tokens.resolved().problems() {
eprintln!("theme: {problem}");
}
}
fn draw(ui: &mut egui::Ui) {
// egui's widgets follow the theme; custom painting reads the tokens.
let tokens = Tokens::of(ui.ctx());
ui.colored_label(tokens.status.success, "Saved");
}
setup(&egui::Context::default());
In an application, give the spec to AppBuilder::theme; the theme
service (AppHandle::theme) switches it while running, installed before
the next frame:
use egui_pop::egui;
use egui_pop::prelude::*;
let app = App::builder()
.theme(ThemeSpec::new("pop-light").reduced_motion(true))
.build(&egui::Context::default())
.unwrap();
app.handle().theme().set(ThemeSpec::new("gruvbox-dark").accent("amber"));
Light and dark together
A theme may name its counterpart, the other variant of it, light or
dark: its token file says so at the root
($extensions: {"org.egui-pop.variant-of": "pop-dark"}, on one side or
both), or the spec does (ThemeSpec::pair(dark, light),
ThemeSpec::counterpart). The spec’s density, accent, reduced motion
and overrides apply to both, unless the counterpart has overrides of
its own (ThemeSpec::counterpart_overrides, set one by one with
ThemeSpec::counterpart_override): a pair edited variant by variant,
as the theme editor does. Every built-in theme with a light and a
dark version is paired with it; pop-high-contrast is alone.
install then installs both: each in its own egui style (dark or
light), with its own kit, and Tokens::of and Kit::of give the ones
of egui’s theme of the moment, read at draw time. The theme named first
is shown, as for a theme alone; theme::set_preference (or egui’s own
ctx.set_theme) switches to the other, or follows the system’s light
or dark mode, without installing anything again:
use egui_pop::egui;
use egui_pop::theme::{self, ThemeSpec, Tokens};
let ctx = egui::Context::default();
let dark = theme::install(&ctx, &ThemeSpec::new("gruvbox-dark"));
assert!(theme::is_paired(&ctx));
theme::set_preference(&ctx, egui::ThemePreference::Light);
assert_eq!(Tokens::of(&ctx).resolved().spec().base, "gruvbox-light");
assert_ne!(Tokens::of(&ctx).surface.panel, dark.surface.panel);
// Follows the system; the theme named first when it says nothing.
theme::set_preference(&ctx, egui::ThemePreference::System);
// Any two themes, or one alone (its mode is then forced).
theme::install(&ctx, &ThemeSpec::pair("pop-high-contrast", "github-light"));
theme::install(&ctx, &ThemeSpec::new("pop-dark").alone());
assert!(!theme::is_paired(&ctx));
A theme alone keeps today’s behaviour: both of egui’s styles are its,
and its mode is forced whatever is asked. A widget reading Tokens::of
or Kit::of while drawing follows a switch; anything keeping what it
drew from them across frames keys on the kit’s address
(Arc::as_ptr(&Kit::of(ctx))) or on the colours themselves. Fonts and
icon sizes come from the theme named first.
In an application, the theme service keeps the preference, the
appearance.theme_preference setting (system, light, dark; in
the settings’ Appearance section): ThemeService::preference,
set_preference, shown (the theme drawn) and toggle, the
view.theme.toggle_light_dark command (View menu). Picking a theme
(ThemeService::pick) shows it: when the preference would show its
counterpart, the preference becomes the picked theme’s mode. Without a
counterpart, the preference changes nothing.
A theme in one part of a window
theme::ScopedTheme draws a theme in a child Ui without installing
it: egui’s style for it, and Tokens::of and Kit::of giving its
tokens and kit while it draws, so egui-pop’s widgets and custom painting
follow it too. The rest of the window keeps the installed theme. The
theme editor’s preview uses it; so can a themed island, or a theme
picker’s thumbnails.
use egui_pop::egui;
use egui_pop::theme::{ScopedTheme, ThemeSpec, Themes, Tokens};
// Built once and kept: compiling the kit has a cost.
fn island(ctx: &egui::Context) -> ScopedTheme {
ScopedTheme::new(ctx, Tokens::new(Themes::default().resolve(&ThemeSpec::new("pop-light"))))
}
fn draw(ui: &mut egui::Ui, light: &ScopedTheme) {
light.show(ui, |ui| {
ui.label("Drawn in pop-light");
let _ = Tokens::of(ui.ctx()); // pop-light's
});
}
let _ = (island, draw);
Scopes nest, and the previous one comes back when show returns, even
after a panic.
Popups follow the scope. egui builds the Ui of a popup, a tooltip,
a menu or a window from the context’s style, not from the Ui that
opened it. So while a scope draws, the context’s style is the scoped
theme’s too, and it is put back when the scope ends. A combo box’s list,
a tooltip, a context menu, a menu, a popover, a hover card or a kit
picker opened inside the scope is drawn in the scoped theme, whether it
comes from egui or from egui-pop. A popup that is drawn later, outside
the scope, records the scope it was opened in (menus::popup_at does)
and is drawn in ScopedTheme::within, which applies the theme to the
context without a Ui:
use egui_pop::egui;
use egui_pop::theme::ScopedTheme;
// Opened inside a scope, drawn at the end of the frame.
struct Later {
scope: Option<ScopedTheme>,
}
fn open(ctx: &egui::Context) -> Later {
Later { scope: ScopedTheme::current(ctx) }
}
fn draw(ctx: &egui::Context, later: &Later, show: fn()) {
match &later.scope {
Some(scope) => scope.within(ctx, show),
None => show(),
}
}
let _ = (open, draw);
What stays the installed theme’s: fonts (egui’s font definitions are
global and rebuilding them rebuilds the atlas), egui’s light or dark
mode (ctx.theme()), and what is drawn outside the scope. Install
themes between frames: a change to the context’s style made while a
scope draws is undone when the scope ends.
What can be chosen
- Themes:
pop-dark,pop-lightandpop-high-contrast, and twelve editor-inspired ones (GitHub, Catppuccin, One, Solarized and Gruvbox families, light and dark, and GitHub’s high-contrast pair; sources and licences in NOTICE). - Densities:
comfortableandcompact. - Accents:
gold,blue,green,amberandred, a theme’s own scales, or any colour:ThemeSpec::accent_color(seed)generates the accent’s scale from it, for light and dark (Design tokens). In an application, theappearance.accent_colorsetting does the same (ThemeService::set_accent_color), for both variants of a pair. - Reduced motion.
- Any token, overridden by its path (
override_token).
See Design tokens for the order a theme is resolved in and how to write a theme of your own, and the theme editor to edit one live and export it.
Every built-in theme is shown at full size below.
The built-in themes
Each one as the gallery’s overview page shows it, at full size (a 1280x800 window, one pixel per point); click an image to open it alone.
pop-dark
pop-light
pop-high-contrast
github-light
github-dark
github-light-high-contrast
github-dark-high-contrast
catppuccin-latte
catppuccin-mocha
one-light
one-dark-pro
solarized-light
solarized-dark
gruvbox-light
gruvbox-dark
The images are refreshed with the others (cargo xtask screenshots, see
the README).
Example kits
Not built in, and not in any published crate: kit folders an
application adds with AppBuilder::kit (kits as packages).
examples/kits/rerun-like, “Rerun-like Dark” and its counterpart “Rerun-like Light” in one kit: the Rerun viewer’s look, from the token values of itsre_uicrate (Rerun Technologies AB, MIT OR Apache-2.0; not affiliated with or endorsed by Rerun; see NOTICE). The Rerun-like viewer uses it, and lists which tokens came from where.
Visual kits
Status: design not decided, first component built (2026-10-18). Discussion and plan: the “Visual kits” issue on egui-pop’s tracker.
A kit is what egui-pop’s components look like: data from the theme and drawing handlers in code. A theme today gives colours, sizes and fonts; a kit also gives shapes: underlined or boxed tabs, a title at the start of the title bar, a field drawn as a line.
Principles
These are the maintainer’s (2026-10-18).
- No overhead. A kit is set when the application starts, or in a dedicated step when the user picks or customises one, never in the normal life of the application. Drawing never resolves anything.
- One homogeneous vocabulary, for maintenance: every component is described with the same words, and every drawing handler has the same shape.
- The default kit is a kit. egui-pop’s own look goes through the same path as any other kit. Nothing is drawn outside a kit.
- A kit is easy to add to an application.
- A kit is not only data: it can provide drawing handlers in code.
Behaviour and appearance
| egui-pop (the widget) | the kit | |
|---|---|---|
| Interaction, focus, keyboard, accessibility | ✓ | |
State (rest, hover, active, focus, selected, disabled) | computes it | receives it |
| Layout | asks the kit for sizes | measures |
| Drawing | paints | |
| A hit area that is not a rectangle | uses it | provides it (optional) |
This is Qt’s QStyle split. egui-pop exposes primitives (one per part it draws through a kit); the kit fills them.
Vocabulary
A token is always component.state.term, or component.term for what
does not change with the state.
| Term | Per state | Meaning |
|---|---|---|
fill | ✓ | the box’s fill |
border-color, border-width | ✓ | its border (widths snap to whole physical pixels) |
radius | ✓ | its corner radius (the handler decides which corners) |
text | ✓ | its label’s colour |
indicator-color, indicator-size | ✓ | a bar on one side of the box (none at size 0) |
shape | the name of the handler that draws the component | |
based-on | the component this one is based on: it receives every token of it it does not give (below) | |
padding-x | between the label and the sides | |
height | the component’s height, when it has a fixed one | |
indicator-side | top, bottom, left or right | |
ring-color, ring-width, ring-offset | ✓ | the focus ring, usually given by focus only: an outline ring-offset points outside the box (inside when negative), following its corners; none at width 0 |
padding-y | between the content and the part’s top and bottom edges | |
opacity | how much the part hides what is behind it, 0 to 1 (a backdrop; the box handler’s fill) | |
buttons-side | on title-bar: end or start, where the window buttons go, close outermost | |
buttons-hover | on title-bar: own or group, whether the three buttons are hovered together | |
corners | on window: round, small or square, the corners asked of the system (Windows 11 only) | |
offset | how far the part sits from the edge it is drawn on, towards the outside (a side area’s grip) | |
offset-x | on tooltip at the pointer: how far right of the pointer it starts, offset being how far below | |
align | where the label goes: start, centre (on the part’s centre, moved into its room when it does not fit) or end | |
width | the component’s width, when it has a fixed one | |
font-size | the size of its text, in points (an alias of a font.* size); the widget’s own size when not given | |
margin | on scroll-bar: between the bar and its scroll area’s edge | |
placement | on tooltip: widget or pointer; on scroll-bar: over the content (floating, the content runs under it) or beside it (taking room) | |
visibility | on scroll-bar: always (at rest too, at full width), at rest too but thin and quiet, on hover of the scroll area, or while it scrolls | |
width-rest, opacity-rest, room, min-length | on scroll-bar: the bar at rest under rest, the room kept for it, the thumb at its shortest | |
track-fill | on scroll-bar: the track behind the thumb (transparent: none) | |
shadow-offset-x, shadow-offset-y, shadow-blur, shadow-spread, shadow-color | the shadow the part casts (egui’s Shadow; none when not given): usually aliases of a shadow.* group; on side-area, cast while it lies over the centre, shadow-offset-x towards the centre |
States are always the same six. rest gives every term (the contract
requires it); each other state gives only what differs. A part in several
states (a selected tab under the pointer) takes rest, then selected,
hover, focus, active, disabled, in that order, a later one
winning.
A state restyles, it never moves. A state changes how a part is
painted (its fill, its border’s colour and width, its radius, its
ring, its shadow), never its layout: the content’s inset keeps room for
the widest border any state gives (Component::border_room), so a part
with no border at rest has one there all the same, present but
invisible, and its text stays in place when the pointer comes. Borders
may be as wide, as bright and as different between states as a kit
likes; only the layout is the same in every state. A test walks every
component of every built-in theme and example kit, at rest and in each
state, and checks that its content does not move.
Components based on another
A component that is a kind of another names it: based-on, a string.
command-button:
based-on: {$type: "string", $value: "button"}
focus:
border-color: {$type: "color", $value: "{focus.ring}"}
When the theme is resolved (at install, never while drawing), the
component receives every token of its base it does not give itself, as
an alias of the base’s (command-button.hover.fill is
"{button.hover.fill}"): every state, every tone, the component terms
and the shape. Its own tokens then apply over them, as focus above.
A kit restyling the base restyles every component based on it, through
any term, unless that component gives the term itself; so does an
override of the base.
- One base, chains allowed:
find-bar-buttonmay be based onicon-button, itself based on another. A base is completed before what is based on it, whatever the order of the files. - A cycle is a problem (
Error::BasedOnCycle, reported at install and bykit::check): each component of the circle keeps its own tokens only. So is a base no token names (Error::UnknownBase). - The handler follows: the
shapeis inherited like any term, and a handler registered for the base under that name draws the component too, unless one is registered for the component itself. A component giving its ownshapekeeps it. - Tones follow: the base’s tones are inherited; a tone the component gives replaces the base’s term by term.
- Only
based-oncrosses the component tier. Any other component token aliases a system token (a test checks the default kit): an alias of one term of another component would cascade one term only. - The contract still lists every token a based component must end with; the theme giving the base gives them.
Handlers
Every component’s handler has one shape (egui_pop_core::kit::Primitive):
trait Primitive<D>: Send + Sync {
fn measure(&self, data: &D, label: Vec2) -> Vec2;
fn paint(&self, cx: &KitCx<'_>, data: &D, part: &Part<'_>);
fn hit(&self, data: &D, rect: Rect, pos: Pos2) -> bool { rect.contains(pos) }
}
Part is the rectangle, the room the label may take (less than the
rectangle when the widget puts things on it: a title bar’s items), the
state and the label (laid out without a colour; the handler gives the
state’s text). A part is painted box first (paint), then the widget’s
own content, then the label (paint_label, which by default places it
with align, kit::paint_label). KitCx is the painter and
the pixels per point. A shape a theme names is a handler registered under
that name: egui-pop ships some, an application adds its own with
kit::register_tab_shape before installing a theme that names them.
Tones
Some components show a tone, which is not an interaction state:
accent, info, success, warning, danger, muted, record
(kit::Tone, the same names everywhere; Neutral is the component’s
own box). It is egui-pop’s one tone: progress, status bar items
(strips::Tone), library badges (library::Tone) and micro-indicators
take it. record (recording) aliases danger by default, so that a kit
can tell a recording from an error; the default kit gives it wherever a
component gives danger (status indicators, spinners, progress rings,
pills, micro-indicators). A
token is component.tone.<tone>.<term> (every state) or
component.tone.<tone>.<state>.<term>, giving only what differs. The
defaults alias the status tokens. A box is merged as rest, the tone,
then each state followed by the tone’s own patch for that state: a state
wins over a tone for what it gives, unless the tone gives that state
too. A tone a component does not give draws its own box. At install, a
component whose tokens give tones gets a table of 7 × 32 boxes; others
get none. The tone travels in State (State::toned), so handlers and
Part are unchanged; Component::style_toned(tone, state) reads one
box. Colours-only components (rings, spinners, status indicators) keep
their geometry in code and read their colours from the kit.
Frames
Component::frame(state, ppp) gives a state’s box as an egui Frame
(fill, border snapped to whole physical pixels, radius,
padding-x/padding-y as inner margin), and
Component::show(ui, state, shadow, add) lays content out in it, then
paints the state’s ring. With the shipped card handler egui draws the
box (no extra cost); another handler paints once the content is laid
out, its shapes moved under the content (one allocation per part and
frame). Shadows are egui’s (Visuals), whose window_shadow and
popup_shadow come from the shadow.window and shadow.popup tokens
(egui’s own values by default): the dialog, popover, palette and assist
frames, and egui’s menus, take them from there.
Bridges to egui
Where egui still draws a widget, the kit reaches it through one of these
adapters. Each is the one bridge for what it covers, and what it cannot
carry is reported in Kit::problems (logged at install) rather than
dropped in silence. Replacing one means an egui-pop-drawn widget.
theme::visuals_with. The kit becomes egui’sVisualsat install:button’s rest, hover, active and selected are egui’s inactive, hovered, active and open widget states, for every egui widget;field‘s rest fill is text fields’ background. Lost, and reported: an indicator or a ring onbutton, afieldoutline or text colour differing from the button’s (egui shares one set of states).- egui’s own checkbox, radio, selectable label and combo box. An
application calling egui’s directly still gets them through
Visualsonly (they followbutton); egui-pop’s own widgets draw them through the kit. A combo box’s box stays egui’s drawing: it followsbutton, orcombo-boxin a scope (below); its arrow is the kit’s. - A scope (
Kit::scope,UiPop::scoped). For a few of egui’s widgets, one kit component’s states become egui’s visuals inside aui.scope, compiled with the kit: a combo box’s box, a button shown on or off, a button in a tone, a text field in a tone (below). menu-itemthroughComponent::paint_under. egui lays the item out, takes its clicks and draws its label with a transparent frame; the kit paints the box into a slot reserved under it.command-button,command-palette-rowandempty-stateare painted the same way.scroll-barthrough egui’sScrollStyle. Itswidth,width-rest,opacity-rest,room,min-length,margin,placement,visibilityand whether it has a track are written into egui’s style with the theme, so every scroll area follows them, an application’s own included; its thumb’s colours and corners, which egui takes from the widget states, are the kit’s in aScrollBarscope (below). The user’sappearance.scroll_barsdecides overvisibilityandplacement.side-area. egui draws the separator line, with its non-interactive stroke:border-width0 hides it; another width than the button’s, or a colour other thanborder.default, is reported. Under the pointer and while dragged it takes egui’s hovered and active widget strokes, unless the kit givesside-area.hover.border-*orside-area.active.border-*(Side areas, under Built so far). The guide shown while a drag would fold the area keeps egui_stack’s guide stroke (LayoutStyle::snap_guide, egui’s selection colour) unless the kit givesside-area.fold.border-*.
Two parts of the token tree are outside the grid on purpose:
windowis read byWindowKit, not bycomponents!: the window is not a part egui-pop paints but a request to the system (itscorners), its resize edges (window.grip) and the line around it (window.rest.border-*).- The component tokens outside kits (
viewport.*,histogram.*,curve.*,wheel.*,navigator.*,cursor.*,loupe.*,graph.*,editor.*,syntax.*,terminal.*, andpalette.*: the magnet, the group gap, the resize limits and grip) are colours and sizes of content drawn in code, not boxes in states: they keep their flat names.
Kits as packages
A kit ships as a folder: kit.yaml (a DTCG token file with a manifest
under $extensions."org.egui-pop.kit", YAML or JSON), more *.tokens.yaml, faces
under fonts/ and a LICENSE. It is read at run time
(KitData::load) or embedded (kit!), checked by kit::check (in an
application’s tests) or the kit-check example, and added with one
line, AppBuilder::kit. A kit with code is a crate exposing
pub fn kit() -> KitSource, its handlers registered at install. The
user’s kits are found in <persist>/kits. egui-pop’s default kit is
the folder themes/kit/, read by the same code. Details in
Kits as packages. A term added to the vocabulary is
also added to egui_pop_tokens::kit::COMPONENT_TERMS or STATE_TERMS,
which the checks read.
Adding a component
Each step touches its own file, plus one line in a list kept in alphabetical order, so changes adding different components can be made in parallel (the lanes of the umbrella issue):
- Its tokens in
crates/egui-pop-tokens/themes/kit/<component>.tokens.yaml(aliases of system tokens,restcomplete, other states only what differs).build.rsfinds it and compiles it in: no list to edit. - Its contract in
crates/egui-pop-tokens/src/contract/kit/<component>.rs(shape, the component terms and everyrestterm), plus one line inGROUPS(contract/kit/mod.rs). - The component in the kit: one line in
components!(crates/egui-pop-core/src/kit/mod.rs): its field, token name and default handler. - Its handlers, if
plainis not enough: a module underkit/shapes/and one line each inshapes::built_in. - The widget: computes its state with
State::from_response(plus what only it knows,SELECTED), paints withKit::of(ctx).<component>(paint, its own content,paint_label), and no longer reads colours fromTokensfor that part. - Its snapshots: only the gallery snapshots of that component change.
Compiled once
theme::install_tokens compiles the kit (kit::install): it reads the
component tokens, merges every combination of states ahead (32 boxes per
component) and picks the handlers. Drawing reads Kit::of(ctx)’s fields
and calls one handler per part: no lookup by name, no inheritance walk,
no fallback. What could not be compiled (an unknown shape, a bad side) is
in Kit::problems, logged, and drawn with the default.
Cost
Measured with crates/egui-pop-api/tests/it/bench_tabs.rs (72 tabs in three
areas, the interface built and tessellated without a GPU, the pointer
sweeping the window; release build, versions run in alternation, five
runs each, median of medians), 2026-10-18:
| Version | Median frame | Instructions (callgrind) |
|---|---|---|
| Before kits (egui_dock’s own tabs) | 360 us | 5.29 G |
| Kit, first version | 562 us | 5.96 G |
| Kit with prepared tabs | 355 us | 4.97 G |
The first version did per frame what only changes with the theme, the scale, the language or a panel’s title: titles translated and laid out three times per tab, egui_dock’s style rebuilt, and the box tab’s outline built as a path with arcs (an allocation and trigonometry per tab). Now each area keeps its tabs prepared (title, label laid out, width measured) and its egui_dock style, keyed on the kit, the pixels per point and the strings provider; a tab is prepared again only when its declared title changes. Handlers draw with egui’s rectangles, not paths.
Rule for handlers: nothing allocated or computed per frame that depends only on the kit. What a handler needs ahead goes in the component’s data, compiled at install.
Built so far
- Tabs of the workbench (
tab,tab-bar,tab-preview). egui_stack keeps the layout, docking, drag and drop and the tabs’ input; the kit is itsDockPainter(kit::dock): it measures each tab (tab_width, the kit’s padding, no floor of egui_stack’s) and paints the bars, the tabs, the borders of the panels’ bodies (dock-body: itsborder-width,border-color,radiusand glow, thering-*terms, atrest, under the pointer,hover, and for the dock’s focused panel,focus; none in a frameless area), the separators between two panels (dock-separator: itsfillatrest,hoverandactivewhile dragged) and the drop zones inside an area (dock-preview: the region a dragged tab would take, bordered and tinted; the buttons of egui_stack’s former cross overlay, for an application asking for it, inbutton) where egui_stack lays them out. Shapes shipped:box(joined to its panel, the default, close to egui_dock’s own look),underline, andplainfor the bar. The gallery’sworkbench-kit-underlinesnapshot is a theme that switches tounderlinewith data only. A tab dragged over another area leaves a ghost where it would land, thetab-previewcomponent at rest, based ontab(its handler, sizes and radius, so a kit restyling its tabs restyles their ghost), its fill the selected tab’s (surface.overlay) at 60 % alpha, its borderaccent.default. The vocabulary has no dashed border: a kit wanting one names a handler of its own. - The title bar and window buttons (
title-bar,window-button,window-close). The title goes wheretitle-bar.alignsays:centre(the default) orstart, after the leading items (the gallery’sframe-kit-title-startsnapshot). The buttons’ glyphs are thewindow-minimize,window-maximize,window-restoreandwindow-closeglyph roles (egui-pop’s painted marks by default, any icon of the set otherwise), in the box’stext,indicator-sizeacross (10 by default). In full screen, the bar keeps close and puts awindow-buttonleaving full screen where maximize was, its glyph thewindow-exit-fullscreenrole (exit-fullscreenby default). Buttons and items are centred above the bar’s line (title-bar.rest.border-width). - Drag and drop (
drag-ghost,drag-ghost-count,drag-verdict,drop-target). What a drag carries under the pointer (egui_pop_api::bus::drag::Ghost):drag-ghostframes the first item’s thumbnail (widthits longest side), with up to two edges of a stack behind it (offsetapart) when more go, or an object’s chip (its icon and name intext,heighthigh); the whole ghost atopacity.drag-ghost-count, based onindicator-badge, says how many go.drag-verdict, based onindicator-badge, is the symbol of what a drop would do on the ghost’s corner (itstext),disabledwhen the target refuses it;drop-target, based ontree-drop-marker, outlines the target hovered,disabledwhen it refuses. The title or the reason goes in thetooltip. - Data views (
list-row,list-view,table-header-cell,table-row,table-stripe,tree-drop-marker). One function paints the rows of the tree, the list and the table; a table’s rows aretable-row, based onlist-row(a kit restyling rows restyles both, a kit givingtable-rowits own tokens styles tables apart: the Rerun-like kits’ quiet selection with a marker on the left). A row isselected,hover(never while selected, so the selection stays under the pointer) andfocusfor the cursor, whose ring sits inside the row (ring-offset-2). The view’s outline islist-view’s focus ring, painted over the rows, so its fill stays transparent. A header ishoverwhen its column sorts andselectedwhen the table is sorted by it. A refused drop is the marker’sdisabledstate. Two handlers:box(a free-standing box) andoutline(a border only; a part with no height is a line between rows). The kit is fetched once per view and pass. The gallery’stable-kit-rowssnapshot restyles rows and headers with data only. - List items (
list-item,list-guide): the dense row of list items and property rows, which the tree’s and the list’s rows are too.list-itemis based onlist-row(a kit restyling rows restyles them), adding a fill whileactive, muted text whiledisabledand themutedtone (trailing text, property names).list-guideis an indent guide,outline’s line along a part with no width; itshoverstate (list-guide.hover.border-color) lights the guide of the hovered row’s parent in a places panel’s tree. Action buttons areicon-buttons. - Charts (
plot,plot-cursor): the plot area’s background and frame (fill,border-color,border-width,radius, handlerbox), its axis text and crosshair intext(hoverwhile the pointer is over it), its grid ingrid-colorfaded bygrid-fade(a decoration, not contrast-checked); the time cursor aplot-cursor, a line across the area (handlertick,widththick, infill,hoverunder the pointer and while dragged) with aheadat its top (noneortriangle,head-sizewide). The series are not the kit’s: they take the categorical palette (palette.category.*, tokens.md), which a kit may change like any token (Charts). - Window buttons per platform flavour. The buttons go where
title-bar.buttons-sidesays; each carries a tone (minimizewarning, maximizesuccess, closedanger) that a kit may give;traffic-lightdraws them as circles, and withbuttons-hover: grouptheir glyphs show together.examples/kits/flavour-macosis the macOS flavour, data only (frame-kit-macos).window.cornersis asked of Windows 11 when the application draws the frame; elsewhere there is no portable request.window.rest.border-widthandborder-color(1 px inborder.defaultby default) draw a line around every window the application decorates (the main window, a detached panel’s, an application window), inside its edges (the shell is laid out within it), inwindow.inactive.border-color(dimmer) while another window has the focus, and none in full screen.window.radiusrounds its corners while it floats free (frame::Placement), never maximized, in full screen or on a side against a screen’s edge, and only where the window is transparent (Wayland by default,AppBuilder::rounded_windows): what egui paints at a corner is rounded at the end of the pass (frame::paint_window_edge), a picture (a mesh) there is not. Wayland does not tell egui a tiled window (winit 0.30 keeps the compositor’s tiled states): one there keeps its rounded corners. - Resizable dialogs and splitters (
dialog-grip,splitter). A modal declared resizable takes the pointerdialog-grip.widthon either side of its edges, and draws three lines intext(border-widthwide) in a squaredialog-grip.heightacross at its bottom right corner, the handle that takes the keyboard (focus). A splitter (widgets::Splitter) is a linesplitter.widththick in the middle of the room it takes the pointer on, inrest,hover,activeandfocus. - Side areas (
area-strip,area-grip). A folded side area is a strip (area-strip.width) with thedrag-handleglyph and a line on the centre’s side; a click unfolds it (workbench.fold). An open side area’s grip is painted at the middle of its edge (widththick,heightlong), above the panels; egui still takes the drag and draws the separator line (it reserves room for it in the panel’s layout). The default kit’s grip is transparent; itshoverandactivefills (under the pointer, while the edge is dragged) let a kit show the grip as the only cue. Every dock area, side, bottom and centre alike, in the main window and the others (dock-area), haspadding-xandpadding-ybetween its edges and its panels (egui’s side-panel 8 and 2 by default): one set of margins, so neighbouring areas’ tab strips start at the same height and the gaps between areas match. An open side area (side-area) has no separator line when itsborder-widthis 0 (egui draws the line: see Bridges to egui). The line under the pointer or with the keyboard (hover) and while dragged (active) takesside-area.hover.border-widthandborder-colorand theiractivetwins: a width of 0 draws no line, a colour alone keeps the width at rest, a width alone egui’s colour. A state whose tokens say nothing is drawn with egui’s widget stroke (widgets.hovered.fg_stroke,widgets.active.fg_stroke), as the default kit does. Dragged far enough to fold the area on release, the line shows a guide where the strip will be:side-area.fold.border-widthandborder-colordraw it apart from the line (a width of 0: no guide; a term left out keeps egui_stack’s guide stroke, a 1-point line in egui’s selection colour). A side area may lie over the centre (workbench.place): its strip keeps the room (selectedwhile the area is open; a click folds it) and the area is drawn above the centre inside-area’s box, casting itsshadow-*towards the centre (shadow.sideby default). Its edge on the centre’s side, which resizes it, draws the line under the pointer and while dragged only when the kit givesside-area.hover.border-*orside-area.active.border-*, as a docked area’s; without them it draws none, as before. The gallery’sworkbench-over-pop-darksnapshot shows it. - egui’s own widgets (
button,field). egui’s style is built from the kit when a theme is installed (theme::style_with):button’s rest, hover, active and selected are egui’s inactive, hovered, active and open widget states,field‘s rest fill is text fields’ background. egui shares one set of states for every widget, so a field’s outline and text follow the button’s; what egui cannot draw (an indicator or a ring on a button, a field outline of its own) is listed in the kit’s problems.buttonhas tones, for an egui button drawn in one (UiPop::button_tone, aButtonscope (egui’s widgets in a scope), so the button keeps its layout, icon and shortcut text):accenta primary action on the accent fill,info,success,warning,dangerandrecordtheir status colour as fill with the panel’s colour as text (legible both ways, like a badge),mutedno box at rest. Components based onbuttoninherit them. - Menu items (
menu-item). egui lays each item out, takes its clicks and draws its label, its own frame transparent; the kit paints the box under it (Component::paint_under: a slot reserved before egui draws, filled once the rectangle and state are known), in the state egui’s button draws with,selectedwhile a submenu is open; the shortcut is themutedtone.menus-kit-barrestyles items with data only. Its gutter (menu-item-gutter, icons.md, section 5) is the column on the left holding the command’s icon, the tick, the radio dot or the spinner: itswidth(else the inline icon size plusspace.son each side, so the density moves it), and itsselectedstate the frame around the icon of a checked command (surface.activewith a 1 pointaccent.defaultborder, so the state does not rest on the fill alone). A theme sets a menu’s metrics onmenu-item, each left to egui when not given:heighta row’s least height,padding-xandpadding-ythe room around a label,widththe menu’s least width (else egui’s, and 200 points for a popup menu), andseparator-insethow far a separator stays from the menu’s edges (0: edge to edge; not given: egui’s, inside the menu’s margin). Labels, keys and notes are laid out in egui’sBodytext style (font.text-style.body), as egui’s own menus, not inButton‘s;key-font-sizedraws the keys and the notes at a size of their own (12 points beside 14 point labels), else at the labels’. Amenu-item-gutter.widthof 0 keeps no gutter at all: no icons and no marks, whatever themenus.iconssetting (a checked item still says so to assistive technology). A command’sCommandSpec::menu_noteends its entries, muted, in the keys’ column after its keys, andopens_linkadds a ↗ in the keys’ colour, three quarters ofkey-font-sizeacross when it is set (a glyph among the keys), else of an inline icon. - Frames (
card,dialog,backdrop,popover,fault-card,toast,palette-window,tip-card,job-log,fullscreen-exit(the strip at the top of a full screen window showing no title bar),editor-frame,terminal-frame,find-bar,assist-card), handlercard; thedialogs-kit-squaresnapshot restyles a dialog with data only. Their borders are snapped to whole physical pixels like the kit’s own painting (Component::frametakes the pixels per point).cardis the application’s own card (UiPop::card): the raised surface at rest, an edge in the status colour by tone,muteda sunken well; its padding isspace.group. - Tooltips (
tooltip, handlercard).egui_pop_core::tooltip’sTooltipExt::tip(anddisabled_tip,tip_ui) is the kit’son_hover_text: egui’s delay, grace and tooltip layer, the text the widget’s description, in thetooltipframe (fill, border, radius,padding-xandpadding-y, shadow) with itstextcolour and itsfont-size(else theBodystyle’s).placementiswidget, under the widget from its start edge as egui’s, orpointer, under the pointer from its position;offsetis the gap between them. At the pointer,offset-x(0 when not given) moves the tooltip right too, its corneroffset-xacross andoffsetdown from the pointer (13 and 13 for GPUI’s), and where the window lacks room on the right or below, it goes to the pointer’s other side, the same distance away, rather than under the pointer. The defaults are egui’s popup look, so a theme changes nothing until it sets them; egui’s ownon_hover_textkeeps the popup’s look. - The application’s chrome (
header-band,dialog-header,band-icon-button,find-bar-button,activity-bar-item,dock-preview,command-button,command-palette-row,toolbar-button). The band at the top of a movable dialog and of a palette is drawn by thebandhandler (its top corners follow the frame’sradiusinside its outline, its border is the line below it),hoverunder the pointer andactivewhile dragged; the dialog’s title isdialog-header’stext, the room below it itspadding-y. The band’s buttons (a palette’s close, roll and pin,selectedwhile pinned; a dialog’s close) and the find bar’s are boxes with an icon in theirtext, the close marks thecloseglyph role, a focus ring as data. An activity bar item isselectedwhile its panel is shown (neverhoverthen). The dock preview is at rest where a panel may dock anddisabledwhere it may not, its label saying why, its fill atopacity(theboxhandler fades its fill by the component’sopacity). A command button and a palette row are laid out by egui, which takes their clicks; the kit paints their box under them (paint_under), in the state of the last pass as egui’s own frame was; a palette row’s matches are theaccenttone, its keys themutedtone. The gallery’spalettes-kit-bandsnapshot restyles the bands with data only. A command button is based onbutton, a palette row onmenu-item, the dialog’s title onheader-bandand the band’s and find bar’s buttons onicon-button(based on another). A toolbar’s button (toolbars) is based onicon-buttontoo: a fill under the pointer and while pressed, its icon and label intext, andselectedwhile its command is on, framed (surface.activewith a 1 pointaccent.defaultborder) as a checked menu icon is. - Progress and status by tone (
progress-bar,progress-line,progress-fill,progress-caption,meter,meter-tick,progress-ring,spinner,status-indicator), handlerstrack,spanandtick. - Micro-indicators (
indicator-dot,indicator-badge,indicator-flag,indicator-swatch,indicator-outline,indicator-button; indicators). Dots and flags are colours only; the shapes that tell states apart are glyph roles, kept distinct (below). A badge is apillby tone, a swatch aboxover its colour, an interactive mark’s target anindicator-buttonin its state; pips arespinnerandprogress-ring. Theindicatorssnapshots. - Collapsible sections (
section-band,section-disclosure,section-count; sections). The band ishover,activewhile pressed andfocus(a ring inside it); thesectionhandler draws its fill and its border as a line along its top and its bottom edges, so two stacked bands share one line. Its mark is thedisclosure-*glyph role insection-disclosure’stext,widthacross; its count asection-count, based onindicator-badge, at the band’s end, or right after the title (space.inlinefrom it) withsection-count.placement: after-title, the title still clipped to the band’s room. Thesectionssnapshots. - Sliders (
slider,slider-fill,slider-thumb,slider-value,slider-toggle). The bar is a box with its label at the start (align),hover,activewhile dragged andfocus(a ring inside it in the default kit); a range slider’s bar is in the states of both thumbs, each thumb in its own. The fill is a strip along the bottom (slider-fill.height, else 15 % of the bar, handlertrack); a gradient track’s colours are content and stay code. A thumb is a line (tick,widththick). The value is a part of its own at the end, in thewarningtone past the soft range. The square button at the end isselectedwhile its toggle is on, its icon intext. Thesliders-kit-flatsnapshot restyles them with data only. - Icon buttons (
icon-button). AnIconWidgetmade clickable is a box (transparent in the default kit) with its icon intext:hover,focus(a ring one point outside),disabled, andselectedfor a toggle (IconWidget::selected). The icon’s tone is the part’s tone;StrongandOnAccent, which are not tones, keep their colour at rest. An icon that is not clickable is content and keeps its colour. - Placeholders (
skeleton,skeleton-shimmer,empty-state). Each shape of a skeleton is askeletonpart, and the band crossing them askeleton-shimmerpart where it meets a shape; their geometry (lines, blocks, gaps) stays code. An empty state is laid out by egui as before (padding-yabove and below), its box painted under it once its size is known (Component::paint_under; transparent in the default kit); its icon and sentence are intext, the icon in thedangertone when something went wrong. - The photo library (
thumb-cell,thumb-layer,thumb-overlay-badge,pill,tag-chip,mark-toggle,search-field,compare-pane). A cell isselected,hover(never while selected) andfocusfor the cursor of a focused grid; its caption is itstext. What it lays over its image isthumb-layerby tone:muteda rejected image’s veil,accentthe bar beside an expanded stack’s member (its indicator, the cell’s outline painted again over it); a failed image’s icon is the layer’stext. A pending image stays a skeleton (skeleton.fill). The flag, labels and stars sit onthumb-overlay-badges; the stars arerating-stars (Rating stars:restan empty outline,selectedgiven,hoverthe preview,selectedin themutedtone the current value’s ghost;rating-star-display, based on it, where a rating is only shown). Badges and a stack’s count arepills, badges by tone (info,success,warning,danger); thepillhandler caps the radius at half the height, so a large radius gives round ends. The neutral pill’s fill is the overlay surface at 85 %, an alias with the alpha modifier (docs/tokens.md). Tag and filter chips aretag-chips (pilltoo), the pick, reject and colour label buttonsmark-toggles (selectedwhile on), the search field acardwhosefocusring shows while its text has the keyboard. A comparison’s pane iscompare-pane,selectedfor the best image, its ring painted again over the image; the best star is that ring’s colour. Flags and colour labels are content and keep theirlibrary.*colours. Thelibrary-kitsnapshot restyles them with data only. - The viewport’s widgets (
thumbnail,readout,viewport-focus,viewport-label): a thumbnail isselected,hoverandfocus(its ring, clipped away before, now shows); the pixel readout is acardwith its text as label; the viewport’s focus outline isviewport-focus’s ring, inside its edges (ring-offset-3). A label over an image (an overlay’s name, a HUD’s readout:overlay::paint_label) is aviewport-label, apillby default whose fill is translucent so the image shows through; its text must read on that fill over black and over white alike (contrast::OVER_IMAGES). - Glyphs by role (
kit::Glyph,glyph.<role>tokens): the small marks widgets draw, named by what they mean and mapped by the kit to an icon of its set, compiled into a table read by index. The vocabulary is fixed: disclosure open and closed, sort ascending and descending, check, radio, indeterminate, bullet, submenu, chevron start and end, dropdown (a combo box’s arrow), close, more, expand, collapse, the window buttons’, and the shapes of the micro-indicators’ LEDs (led-off,led-on,led-busy,led-warning,led-error) and named flags (flag-modified,flag-pinned,flag-required,flag-invalid). Those must keep states apart: two roles ofegui_pop_tokens::kit::DISTINCT_GLYPHSnaming the same icon are a problem (kit::check, and at install, where both go back to their default shapes), so colour never carries a state alone. The marks they draw by default (circle,disc,square,triangle,diamond,asterisk,corner) are icons of the set. The tree, the menus and the find bar ask for roles, and so do the table’s sort arrows. - Drag cursors (
kit::DragCursorKit,drag-cursor.<kind>.hover,.dragand.policytokens): per kind of drag, the CSS cursor names shown hovered and dragged, and when the hover one shows (only-action,always,never). The default kit gives every kind’s own; the pointer profile, then the widget, can still change them (drag cursors). - egui’s small widgets (
checkbox,radio,combo-arrow,selectable-row,toggle-chip), and the switch (switch), below. - egui’s widgets in a scope (
combo-box,toggle-button, andbuttonandfieldby tone), handlerscoped, below. - Scroll bars (
scroll-bar), handlerscoped: egui’sScrollStylefor every scroll area, the thumb’s colours in a scope, below. - Application icons (
icon_set, featuresvg): SVG files registered by name, single-colour (a white mask tinted at draw) or full-colour, rasterised at install for the theme’s icon sizes and the window’s scale, and at any other size the first time it is drawn (a scaled texture blurs); a kit’s glyph may name them. - The default kit is these components’ tokens in
pop-dark, which every built-in theme extends. Atransparentsystem token says “paint nothing” (window buttons at rest).
egui’s small widgets
egui-pop draws egui’s checkbox, radio button and selectable label
itself (egui_pop_core::widgets, egui_pop::core::widgets from the
facade), keeping egui’s layout (its atoms, icon width, spacing,
padding and interaction height), its clicks and keyboard, and what it
tells assistive technology; the kit paints them. egui-pop’s own code
uses them everywhere, and an application switches by replacing the
call:
| egui | egui-pop |
|---|---|
ui.checkbox(&mut on, text) | widgets::checkbox(ui, &mut on, text), or ui.add(widgets::Checkbox::new(..)) |
ui.radio(on, text), ui.radio_value(..) | widgets::radio(ui, on, text), widgets::radio_value(ui, ..) |
ui.selectable_label(on, text), ui.selectable_value(..) | widgets::selectable_label(ui, on, text), widgets::selectable_value(ui, ..) |
egui::ComboBox::from_id_salt(id), ComboBox::new(id, label) | widgets::combo_box(id), widgets::combo_box_labelled(id, label) |
| a selectable label used as an on/off option | ui.add(widgets::ToggleChip::new(&mut on, "Aa").name("Match case")) |
| a checkbox drawn as a switch (egui has none) | widgets::switch(ui, &mut on, text), or ui.add(widgets::Switch::new(..)) |
a row of selectable_value buttons for a few exclusive modes (egui has no segmented control) | ui.add(widgets::Segmented::new(id, &mut mode, options).name("View")), each a widgets::SegmentOption::new(value, label) with an optional .icon("phosphor:…") |
use egui_pop::core::widgets;
fn options(ui: &mut egui_pop::egui::Ui, wrap: &mut bool, mode: &mut usize) {
widgets::checkbox(ui, wrap, "Wrap lines");
widgets::combo_box_labelled("mode", "Mode")
.selected_text(["Fast", "Exact"][*mode])
.show_ui(ui, |ui| {
for (i, name) in ["Fast", "Exact"].iter().enumerate() {
widgets::selectable_value(ui, mode, i, *name);
}
});
}
| Component | Part | States | Based on |
|---|---|---|---|
checkbox | the box; its mark the check glyph, or indeterminate | selected while checked; focus like active (egui’s look) | button |
radio | the circle (handler pill, radius 999); its mark the radio glyph | selected while chosen | checkbox |
combo-arrow | the box under a combo box’s arrow (transparent); the dropdown glyph in its text | selected while the list is open | |
selectable-row | a row picked from a short list: a combo box’s choices, the assist card’s completions and actions, small tab strips | selected for the chosen one, never hover then | list-row |
toggle-chip | a small on/off option showing a text or a glyph: the find bar’s case, whole word, regular expression and replace toggles | selected while on | selectable-row |
switch | an on/off switch’s track (handler pill, radius 999), 1.8 times as wide as high; its round thumb in text, at the start while off, at the end while on | selected while on (the accent track, the thumb in text.on-accent) | checkbox |
- A checkbox’s and a radio button’s mark is in the box’s
text, and its label in thetextof the same state withoutselected(a kit filling a checked box keeps the label readable);widthis the box’s side (egui’s icon width when not given). A radio’s circle grows by egui’sexpansionunder the pointer, as egui’s does, and so does a selectable row’s box. - A mark is the role’s icon (
glyph.check,glyph.radio,glyph.indeterminate,glyph.dropdown). The default icons are drawn with egui’s own geometry (a one-point check line, a dash, a dot of a third of the inner box, a triangle as wide as egui’s), so the default kit looks like egui; a kit naming another icon gets that icon, 80 % of the box wide (the arrow: the icon’s square).checkandindeterminatemust differ (DISTINCT_GLYPHS). - A toggle chip is a checkbox for assistive technology, named by
ToggleChip::name;ToggleChip::glyphdraws an icon on it. - A segmented control (
Segmented) is a radio group for assistive technology, named bySegmented::name, each option a radio button checked while selected. Each option is thetoggle-chipcomponent (selectedfor the chosen one), its icon from the registry atsize.icon.inline,space.xsbefore its label. It is one Tab stop: Left and Right select the option before or after (round), Home and End the first and the last, a disabled option passed over. A row too narrow folds its last options into a “More choices” menu (Glyph::More, as a toolbar does), the selected option staying in the row; or it wraps or scrolls (SegmentOverflow). - A switch is a switch for assistive technology (AccessKit’s
Switchrole, toggled while on), named by its label orSwitch::name; Space and Enter toggle it when focused. Itswidthis the track’s height (egui’s icon width when not given); the thumb does not animate. - The combo box’s box, and its list’s frame, are egui’s: they follow
buttonand egui’s popup throughVisuals, and the box followscombo-boxwhen shown withUiPop::combo_box(a scope, below). Drawing them would mean re-implementing egui’s combo box. egui’s ownComboBox(and the other egui widgets) keep egui’s arrow. - The gallery’s
builtinspage shows them next to egui’s own, and itsbuiltins-kit-togglessnapshot restyles them with data only.
egui’s widgets in a scope
Some of egui’s widgets are not worth drawing again: egui-pop would
re-implement their layout and input for a look that egui’s Visuals
can already carry. For those, a kit component’s states become egui’s
visuals in a ui.scope, and egui keeps drawing the widget, with its
layout, icons and shortcut text. This is the scoped handler: the
component’s boxes are mapped onto egui’s fields when the kit is
compiled, per tone (ScopedKit, one ScopedVisuals per kind and
tone), and a scope only copies them (Kit::scope); nothing is resolved
while drawing. Outside the scope, egui’s visuals are unchanged.
use egui_pop::core::ui::{Stock, Tone, UiPop};
use egui_pop::core::widgets;
fn view(ui: &mut egui_pop::egui::Ui, fit: &mut bool, mode: &mut usize, name: &mut String) {
ui.scoped(Stock::ToggleButton, Tone::Neutral, |ui| {
if ui.add(egui_pop::egui::Button::new("Fit").selected(*fit)).clicked() {
*fit = !*fit;
}
});
let combo = widgets::combo_box("mode").selected_text(["Fast", "Exact"][*mode]);
ui.combo_box(combo, |ui| {
widgets::selectable_value(ui, mode, 0, "Fast");
widgets::selectable_value(ui, mode, 1, "Exact");
});
ui.scoped(Stock::Field, Tone::Danger, |ui| ui.text_edit_singleline(name));
}
Stock | Component | egui’s widgets | Mapping |
|---|---|---|---|
Button | button, by tone | Button, and what egui draws as one (DragValue, a menu button, a CollapsingHeader’s header) | rest, hover, active, selected are egui’s inactive, hovered, active and open states; UiPop::button_tone is this scope |
ComboBox | combo-box (based on button) | ComboBox’s box (UiPop::combo_box) | the same; selected while its list is open |
ToggleButton | toggle-button (based on button) | Button::selected, egui’s selectable_label | the same, and selected’s fill and text are egui’s selection colours while on |
ScrollBar | scroll-bar | ScrollArea’s bars (UiPop::scroll_area) | the thumb’s rest, hover and active fills are egui’s inactive, hovered and active foreground colours, its radius their corners, track-fill egui’s extreme_bg_color; the content keeps the style outside the scope (below) |
Field | field, by tone | TextEdit | rest’s fill is the background, rest and hover the outline, focus the outline with the keyboard (egui’s selection stroke); the tones (accent changed, warning required, danger refused, info being checked, muted read-only) colour the edge |
- Every egui widget already follows
button(and text fields’ backgroundfield) without a scope, through the style installed with the theme (theme::visuals_with, the same mapping as aButtonscope). A scope is for a widget that should differ from the plain button: in a tone, on or off, a combo box. - egui reads one set of states:
focusis egui’sactivefor buttons and combo boxes; a disabled scope draws every state in the component’sdisabledbox when the kit gives one, which egui still fades (itsdisabled_alpha). egui’s expansion under the pointer is kept. - What egui cannot draw is in the kit’s problems: an indicator or a ring
on
combo-boxortoggle-button(beyond what they inherit frombutton, reported there), atoggle-button.selectedoutline or radius of its own (egui keeps the state’s outline on a selected button), a ring or a fill onfield.hoverorfield.focusother than its resting one, ashapeother thanscopedoncombo-box,toggle-buttonorscroll-bar. - egui-pop’s own combo boxes (settings, forms, the file chooser’s
filter, the theme editor, parameters) are shown with
UiPop::combo_box, and the navigator’s zoom buttons (fit, 100 %) with aToggleButtonscope. - Not given a component of their own:
Slider(egui-pop’s own slider is drawn by the kit),CollapsingHeader,DragValue, egui’s menus. They followbuttonglobally, or any scope they are put in (aDragValuein aFieldscope does not become a field: egui draws it as a button). - The gallery’s
scopedpage shows them; itsscoped-kit-restyledsnapshot restyles them with data only.
Scroll bars
egui draws every scroll area’s bars. The kit’s scroll-bar reaches
them two ways:
- With the theme, in every scroll area.
width,width-rest,opacity-rest,room,min-length,margin,placementandvisibility, and whether there is a track, become egui’sScrollStylewhen the theme is installed (ScrollBarKit::style,Kit::scroll), and in a scoped theme. An application’s ownegui::ScrollAreafollows them with nothing to change. - In a
ScrollBarscope, the colours. egui draws the thumb in the widget states’ foreground colours and corners, which every button shares, and the track inextreme_bg_color, which text fields and canvases share.UiPop::scroll_areashows a scroll area in a scope where they are the thumb’srest,hover(under the pointer) andactive(dragged) fills, itsradiusand thetrack-fill; the content is drawn in the style outside the scope. - Along the track, through
UiPop::scroll_area.margin-trackkeeps the thumb that far from both ends of the track. egui’sScrollStylehas no such field:UiPop::scroll_areagives egui the bar’s rectangle (ScrollArea::scroll_bar_rect), the area’s last inner rectangle shortened at both ends; an application’s ownegui::ScrollAreakeeps the whole length.
| Token | Meaning | Default |
|---|---|---|
scroll-bar.width | the bar at its widest, and its hit area | 10 |
scroll-bar.width-rest | the bar at rest, under rest | 4 |
scroll-bar.opacity-rest | the thumb’s opacity at rest, 0 to 1, under rest: quiet, but 3:1 against the surfaces (a test holds every built-in theme to it, through egui’s blending) | 0.45, 0.6 in pop-light, more where a theme’s text is close to its surfaces |
scroll-bar.room | the content’s width kept for the bar while it shows, under rest | 6 |
scroll-bar.min-length | the thumb at its shortest | 24 |
scroll-bar.margin | between the bar and the scroll area’s edge | 0 |
scroll-bar.margin-track | kept free at both ends of the track, along the bar (through UiPop::scroll_area) | 0 |
scroll-bar.placement | over: floats over the content, which runs to the edge under it; beside: takes room, the content is narrower by the bar, its margin and egui’s 4 point gap | over |
scroll-bar.visibility | always: at rest too, at full width; rest: at rest too, thin and quiet with no track, whenever the content overflows, wide over the bar; hover: while the pointer is over the scroll area, thin until it is over the bar (egui’s own); scroll: while scrolling | rest |
scroll-bar.track-fill | the track; transparent for none, in every scroll area | {surface.sunken} |
scroll-bar.rest.fill, hover.fill, active.fill | the thumb at rest, under the pointer, dragged | the button’s text colours |
scroll-bar.rest.radius | the thumb’s and track’s corners; half the width or more rounds them fully | the button’s |
The defaults are the survey’s quiet bar with the button’s colours, and the
high contrast themes take always, beside the content and 14 wide, which
covers nothing. A theme decides with data only: visibility: hover and a
min-length of 12 are egui’s ScrollStyle::floating(); tvty’s bar (a 6 point thumb, fully rounded, 4 points from the
edge, no track, over the content, shown at rest):
$extends: "pop-dark"
scroll-bar:
width: {$type: "dimension", $value: {value: 6, unit: "px"}}
margin: {$type: "dimension", $value: {value: 4, unit: "px"}}
placement: {$type: "string", $value: "over"}
visibility: {$type: "string", $value: "always"}
track-fill: {$type: "color", $value: "{transparent}"}
rest:
fill: {$type: "color", $value: "#4b4b4b"}
radius: {$type: "dimension", $value: {value: 999, unit: "px"}}
hover:
fill: {$type: "color", $value: "#5a5a5a"}
active:
fill: {$type: "color", $value: "#6a6a6a"}
use egui_pop::core::ui::UiPop;
fn tickets(ui: &mut egui_pop::egui::Ui, rows: &[String]) {
let area = egui_pop::egui::ScrollArea::vertical().auto_shrink(false);
ui.scroll_area(area, |ui| {
for row in rows {
ui.label(row);
}
});
}
The user decides over the theme. appearance.scroll_bars, under Settings ›
Appearance, is written into the theme’s spec (ThemeSpec::scroll_bars) and takes
over visibility and placement when the theme resolves, so it reaches every
scroll area, for both variants of a pair, and stays when the theme changes:
| Choice | Bars | Tokens |
|---|---|---|
auto (default) | what the theme says | the theme’s |
always | full and opaque, with a track, covering nothing | visibility: always, placement: beside; a transparent track-fill becomes {surface.sunken}, any other stays |
hover | nothing at rest, egui’s own over the content | visibility: hover, placement: over |
The system goes one way only: an application that knows the system always shows
its bars says so with AppBuilder::system_always_shows_scroll_bars, and auto
then gives what always gives, without saving anything; a choice stays the user’s.
A system hiding its bars lowers nothing, as that is most systems’ default and
nobody chose it. egui-pop reads no system yet
(the survey’s item 10).
Three things stay outside the choice. A scoped theme keeps what its own spec says.
The stack of Collapsible sections still shows its quiet bar under
hover, as it does on a hover theme: it is forced when the stack overflows
(ScrollBarKit::seen_at_rest). And under always or hover, the theme editor’s
preview of visibility and placement shows the choice, not the edit; the edit
is saved all the same.
rest is the survey’s quiet bar (Scrolling survey).
All of it is ScrollStyle: floating_width, dormant_handle_opacity,
floating_allocated_width and handle_min_length take its tokens, the track
opacities leave only the one over the bar. What ScrollStyle cannot say:
- The hit area is the whole
width, always: 4 points of the content beside a 6 point room lose their clicks to the bar, even with the bar thin. A view with something clickable at its right edge keepswidthas its room (the gallery’s pages do). - The opacity is one number: egui has none per surface, so the ratio of 3:1 holds on the surface it was chosen for, and differs on others.
- A bar
besidethe content is opaque and at full width, sorestneedsover. - A bar forced on by a scroll area (
ScrollBarVisibility) and a bar shown because the content overflows look the same; a view that wants a bar ahovertheme hides takesScrollBarKit::seen_at_rest, as the sections’ stack does.
What egui cannot draw is in the kit’s problems: a thumb whose colours
or radius differ from the button’s (egui’s scroll areas outside a
ScrollBar scope draw the button’s), a track in another colour than
surface.sunken outside a scope, visibility: scroll (egui 0.36 has no
while-scrolling state: drawn as hover), a bar beside the content
not always visible (egui shows such a bar whenever the content
overflows, and opaque under rest), a width-rest wider than width, and
an opacity-rest outside 0 to 1. The gallery’s scoped page shows one, restyled in its
scoped-kit-restyled snapshot.
Known limits of this first step:
- A kit can make tabs narrower than egui_stack’s default but cannot overlap them (Chrome-like tabs): egui_stack lays them side by side.
- Corner radius, border width and indicator are uniform; per-side borders and per-corner radii are a later step.
Next
- One component per change: the title bar, fields, buttons, menus.
- Kits as folders (data, fonts, icons),
kit!embedding and validating them at compile time, user kits found in the config directory, acheckcommand, the gallery previewing a kit. - egui’s combo box’s list frame (egui’s popup) from a kit component;
more of egui’s widgets in a scope (
Slider,CollapsingHeader) when a kit needs them apart frombutton.
Kits as packages
How a kit (Visual kits) is shipped and added to an application: a folder of data, embedded in the binary or read at run time, plus code when the kit draws shapes of its own.
The folder
underline-tabs/
kit.yaml a DTCG token file, like a theme (kit.json is read too)
*.tokens.yaml optional: more token files (one per component;
.tokens.json is read too)
fonts/ optional: .ttf, .otf or .ttc faces
LICENSE optional: the kit's licence and its fonts'
icons/ reserved for SVG icons, not read yet (reported)
kit.yaml is a theme file, in YAML or JSON (tokens.md): $description, $extends (pop-dark when
not given) and tokens in the vocabulary of kit.md
(tab.shape, tab.hover.fill), plus any system or palette token a
theme can give. Other *.tokens.yaml (or .json) files of the folder are read in
name order and merged into it; a token given twice keeps its first
value, and only kit.yaml says what the kit extends.
The manifest lives in kit.yaml’s root $extensions, so the file stays
plain DTCG:
$description: "Our product's look."
$extends: "pop-dark"
$extensions:
org.egui-pop.kit:
name: "brand"
label: "Brand"
fonts:
- {file: "JetBrainsMono-Regular.ttf", family: "JetBrains Mono", weight: 400}
font:
family:
mono:
$type: "fontFamily"
$value: ["JetBrains Mono", "monospace"]
Each of a kit’s token files may carry the format stamp a theme file
carries ("org.egui-pop.format": { "version": 1, "contract": 1 } in its
root $extensions, tokens.md), and is read
by its own: a file without one is current, a token renamed since the
contract it was written for is read under its new name, and a file
stamped newer than this egui-pop is read best-effort, each with a
warning (Problem::Format), never an error.
Every key is optional. name is the kit’s theme name (the folder’s name
otherwise; a built-in theme’s name gets -kit added); label is its
name for people.
Both variants in one kit. A kit may hold its light and its dark
variant: the manifest’s counterpart gives the other variant’s name,
label and tokens (a token tree, as a theme file’s, with its own
$extends; pop-dark when not given, so a light variant says
pop-light). It becomes a theme of its own, each variant naming the
other as its counterpart (org.egui-pop.variant-of, set for you), so
ThemeSpec::new("brand-dark") starts on the kit’s own variant and the
light, dark or system setting (the View menu’s toggle, the settings)
switches to the other without a second kit folder. kit.yaml’s own
tokens are its variant’s; the folder’s other token files and its faces
serve both, a token the variant gives itself winning (reported as a
repeat, as in kit.yaml). KitData::counterpart holds it,
Themes::add_kit and AppBuilder::kit add both themes, and
KitData::infos (ThemeService::kits) lists both. A counterpart
that cannot be used (no name or tokens, the kit’s own or a built-in
theme’s name) is a Problem::Manifest, the kit keeping one variant.
$extends: "pop-dark"
$extensions:
org.egui-pop.kit:
name: "brand-dark"
label: "Brand Dark"
counterpart:
name: "brand-light"
label: "Brand Light"
tokens:
$extends: "pop-light"
surface:
panel: {$type: "color", $value: "#fafafa"}
surface:
panel: {$type: "color", $value: "#101010"}
Faces. A face’s family and weight come from its manifest entry, or
else from its file name: Family-Weight.ext, the weight a CSS name
(Thin, ExtraLight, Light, Regular, Medium, SemiBold, Bold,
ExtraBold, Black and their usual synonyms) or a number
(Brand-700.otf); Family.ext is 400; a variable font’s axes in
brackets are dropped (Inter[wght].ttf is Inter at 400, its axis
serving every weight, see fonts.md). A family whose name has
spaces needs the manifest. The kit’s tokens name the families
(font.family.ui); its faces are registered through
egui_pop_core::fonts, so a family is found in the kit before the
system.
Reading a kit
egui_pop_tokens::kit reads a kit; nothing in it panics:
KitData::load(dir) | a folder at run time, its YAML through the default cache (KitData::load_with(dir, &cache) names one) |
kit!("dir", tokens = [..], fonts = [..], license = "LICENSE") | embedded in the binary (include_str!/include_bytes!, the path relative to the calling file); only kit.yaml is implied (kit = "kit.json" names another), the other files are listed |
KitData::from_text(name, text) | a data-only kit from its kit.yaml (or JSON) text |
kit::discover(dir) | each sub-folder holding a kit.yaml, kit.yml or kit.json (discover_with(dir, &cache)) |
kit::check(&kit) | every problem: reading it, and resolving its theme |
What is wrong is in KitData::problems(), and the kit is usable anyway
(ADR 0003):
kit.yamlunreadable, not YAML or JSON, or holding an unquoted#colouror{alias}: the kit is its base theme under its name; another token file that cannot be read is left out;- a token of a kit component outside the vocabulary (a misspelt term or
state, a per-state term without its state, a term of the wrong type),
or shaped
component.state.termfor a component no kit has: kept, read by nothing, reported; - a face named by the manifest and missing, or a file that is not a font: left out (the families naming it fall back);
- a token file stamped newer than this egui-pop, with a stamp that
cannot be read, or giving a token renamed since its contract
(
Format): read best-effort, as current, or under the new name; - an
icons/folder: not read yet; - a token file whose compiled form cannot be kept in the cache
(
NotCached): read uncached, parsed again next time.
Compile-time validation. kit! is a macro_rules macro: it embeds,
it does not check (that needs a proc-macro). An application checks its
embedded kits in a test, which also finds the faces its manifest names
that the macro was not given:
#[test]
fn our_kit_is_clean() {
let kit = egui_pop::tokens::kit!("../kits/brand", fonts = ["Inter-Regular.ttf"]);
assert!(egui_pop::tokens::kit::check(&kit).is_empty());
}
From the command line:
cargo run -p egui-pop-tokens --example kit-check -- path/to/kit
prints the kit’s name, base, faces, licence and problems, and exits with 1 when there are problems.
Adding a kit to an application
One line: AppBuilder::kit takes a folder read at run time, a kit!,
or a kit crate’s KitSource. The kit’s theme joins the themes under
its name; its faces and handlers are registered before the theme is
installed (at start-up, never per frame). Pick it as any theme:
use egui_pop::egui;
use egui_pop::prelude::*;
let kit = egui_pop::tokens::kit::KitData::from_text(
"underline",
r#"{ "tab": { "shape": { "$type": "string", "$value": "underline" } } }"#,
);
let ctx = egui::Context::default();
let app = App::builder()
.kit(kit)
.theme(ThemeSpec::new("underline"))
.build(&ctx)
.unwrap();
assert_eq!(egui_pop::core::kit::Kit::of(&ctx).tab.shape, "underline");
assert_eq!(app.handle().theme().kits()[0].label, "underline");
A kit’s problems are logged and in the diagnostics (kit-problem, the
kit’s name as subject); the application builds anyway.
ThemeService::kits() lists the kits added (name, label, description,
origin) for a theme picker; switching to one is theme().set(...).
A kit with code
A kit whose shape tokens name handlers of its own is a crate exposing
one function:
use std::sync::Arc;
use egui_pop::core::kit::KitSource;
pub fn kit() -> KitSource {
KitSource::new(egui_pop::tokens::kit!("../kit"))
.shape("tab", "notch", Arc::new(Notch))
}
Notch implements kit::Primitive<ComponentKit> (kit.md).
The application adds it with .kit(brand_kit::kit()).
KitSource::register(ctx) registers its faces (fonts::register) and
handlers (kit::register_shape); a handler for a component that does
not exist is reported and not registered. Without AppBuilder,
register, Themes::add_kit and theme::install_with are the three
steps.
User kits
AppBuilder::user_kits(true) also reads the data-only kit folders the
user put under the persistence directory (AppBuilder::persist):
<persist>/kits/<kit>/kit.yaml. They come after the application’s own
kits (a user kit of the same name replaces it) and are listed by
ThemeService::kits() with their folder as origin. A user kit is data
only: code comes only from crates the application links.
The cache of compiled files
A kit read at run time is YAML, which costs several times JSON to parse. Its files are compiled once into a cache folder, never next to the kit: read again unchanged, a file is read from its compiled JSON (the default kit’s 76 files as a folder: 6.8 ms parsed, 2.8 ms from the cache, release build). An entry is keyed by the file’s path, a hash of its contents and the compiler’s version, so an edited file, or a new egui-pop, compiles it again. The checks run on what is read either way, so a kit’s problems are the same on a hit.
The cache lives in the platform’s cache directory under the
application’s id (~/.cache/<id>/egui-pop on Linux,
~/Library/Caches/<id>/egui-pop on macOS,
%LOCALAPPDATA%\<id>\cache\egui-pop on Windows). egui-pop does not know
the id, so it is off until the application gives one, for every reader
at once or for the application’s user kits:
use egui_pop::tokens::cache::{self, Cache};
cache::set_default(Cache::for_app("org.example.App"));
cache::set_default(Cache::off());
let _builder = egui_pop::prelude::App::builder()
.user_kits(true)
.cache(Cache::for_app("org.example.App"));
Cache::at(dir) puts it elsewhere (a test’s temporary folder),
Cache::off() turns it off. A cache that cannot be written is not an
error: the kit is read uncached, with a NotCached problem. The store
is not specific to tokens (Cache::get, Cache::put with a
Compiler’s name and version): token files are its first user.
The default kit
egui-pop’s own look is a kit folder too: crates/egui-pop-tokens/themes/kit/
(a kit.yaml and one token file per component), read by the same code
as any embedded kit and layered into pop-dark, which every built-in
theme extends. It is not a theme of its own, because it is the base all
others fall back to. A test reads that folder with KitData::load and
checks it holds exactly the built-in kit’s tokens.
Example
examples/kits/underline-tabs is a
data-only kit: underlined tabs on a sunken bar. The gallery’s
workbench-kit-underline snapshot is drawn from it.
Design tokens
egui-pop’s look comes from design tokens: named, typed values in YAML files (JSON is read too) in the format of the W3C Design Tokens Community Group (DTCG 2025.10). No widget hard-codes a colour or a size; it reads a token.
The files live in crates/egui-pop-tokens/themes.
egui-pop-tokens reads and resolves them (it has no egui dependency);
egui_pop::theme turns the result into egui’s style.
The format, as read here
$description: "A theme"
$extends: "pop-dark"
gray:
$type: "color"
"2":
$value: {colorSpace: "oklch", components: [0.215, 0.006, 75], hex: "#1b1916"}
surface:
$type: "color"
panel:
$value: "{gray.2}"
$description: "Panels and side bars."
radius:
widget: {$type: "dimension", $value: {value: 4, unit: "px"}}
- A token is an object with
$value; anything else not starting with$is a group. A token’s name is its dotted path (surface.panel). $typeis given on the token or inherited from an enclosing group, or taken from the token an alias points to.- An alias is a whole value of the form
"{path}". Aliases chain; a cycle or a reference to nothing is reported, never followed forever. $descriptionand$extensionsare kept (tools may store their own data under$extensions, keyed by a reverse domain name).- At the root,
$extendsnames the theme a file builds on: every token not given comes from it, and chains of$extendsare followed. - Types read:
color(colour objects insrgb,srgb-linear,oklchoroklab, other colour spaces through theirhexfallback, and#rrggbb/#rrggbbaastrings),dimension(px, orremat 16 px),number,duration(msors) andfontFamily. Other types are kept as raw JSON.
Not read yet: references inside composite values, JSON Pointer $ref,
$deprecated, group-level $extends.
A colour at another opacity
DTCG has no way to say “this colour, translucent”. egui-pop reads one
modifier, in the spirit of Tokens Studio’s modify, kept under
$extensions so the file stays plain DTCG (another tool reads the
alias and ignores the modifier):
pill:
rest:
fill:
$type: "color"
$value: "{surface.overlay}"
# the overlay at 85 %: its alpha multiplied by 0.85
$extensions: {org.egui-pop.alpha: 0.85}
org.egui-pop.alpha (egui_pop_tokens::ALPHA_EXTENSION) is a number
from 0 to 1 the colour’s alpha is multiplied by, once its alias is
followed. A token aliasing a modified token gets the modified colour,
and its own modifier multiplies again. A value outside 0 to 1, or a
modifier on a token that is not a colour, is a reported problem, and the
token is treated as broken. The modifier belongs to the value it is
written with: a theme giving the token again, an override and the theme
editor’s export replace both, and to_dtcg writes the resulting colour
without it.
Three tiers
-
Reference: the palette, named by what a value is. Each base theme has a warm neutral scale
gray.0togray.12and five hue scales,gold,amber,red,greenandblue, steps1to12pluscontrast(the text colour that reads on step 9). Scale steps mean the same in every mode:Steps Use gray 0 to 2 the deepest backgrounds (in light mode, white paper) 3 to 5 subtle fills (hue scales: quiet accent backgrounds, selection) 6 to 7 borders 8 a solid fill being pressed 9 the solid fill (the accent) 10 the solid fill under the pointer 11 low-contrast text (status colours) 12 high-contrast text The light theme redefines the scales (light backgrounds, dark text) and keeps the same step meanings, so the system tier mostly aliases the same steps in both modes.
A theme may add hue scales of its own with the same steps (
1to12andcontrast): any such scale is offered as an accent (Themes::accents). The Catppuccin-inspired themes addpurple(Catppuccin’s mauve) and use it as their accent. -
System: roles, what a value is for. These are the tokens widgets read, listed in
contract():surface.{canvas, panel, raised, hover, active, overlay, sunken},text.{default, muted, strong, on-accent},border.{default, strong},accent.{default, hover, active, subtle},danger,warning,success,info,focus.ring,selection,palette.category.0topalette.category.9(the categorical palette, below),palette.log.{trace, debug, info, warn, error, critical}(the log levels’ colours, below),palette.axis.{x, y, z}(the axes’ colours, below),radius.{widget, window},shadow.{popup, window, side}.{offset-x, offset-y, blur, spread, color}(egui’s popup and window shadows, and a side area lying over the centre; their colours alias theshade.10andshade.38palette tokens, black at 10 % and 38 %),space.{xs, s, m, l, xl}(the spacing scale),space.{inline, group, section, page}(spacing by intent, below),text-role.{title, section, body, muted, meta}.{size, color, weight}(text by role, below),size.control.height,size.row.height(a row of a list, a tree or a property panel; an alias of the control height unless a theme gives it a value of its own),size.icon.{inline, toolbar, panel},size.dialog.width,size.magnet,size.toast.width,font.size.{xs, s, m, l, xl}(the size scale) andfont.text-style.{small, body, button, heading, monospace}(egui’s text styles, each an alias of a step),font.family.{ui, mono},font.baseline-offset.{ui, mono}(where a family’s glyphs sit in their row, a share of the size; 0 by default, Fonts),font.numeric("mono"or"ui": how values line their digits up, Fonts),motion.duration,motion.spinner.{delay, min, turn}(300 ms before a busy indicator shows, 500 ms at least once shown, a spinner’s turn),motion.progress.travel,motion.skeleton.shimmer,motion.toast.slide(a toast sliding in and out; none under reduced motion),motion.submenu.delay(200 ms of the pointer resting on a submenu item before its submenu opens),opacity.scrim. -
Component: one component’s tokens, each an alias of a system token (or, for a component based on another, of its base’s token under the same term: kit.md). The kit’s components are
component.state.term(kit.md):button.*(with tones),card.*(an application’s card, by tone), the sliders’ (slider.*,slider-fill.*…),field.*(input fields, their states as tones: read-only and the placeholdermuted, modifiedaccent, requiredwarning, invaliddanger, pendinginfo), the bars, rings, meters and spinners (progress-bar.*,progress-fill.*,progress-ring.*,spinner.*…),indicator-dot.*,indicator-badge.*,indicator-flag.*,indicator-swatch.*,indicator-outline.*andindicator-button.*(micro-indicators, see indicators),skeleton.*andskeleton-shimmer.*,dialog.*,palette-window.*,toast.*,scroll-bar.*(every scroll area’s bars:width,width-rest,opacity-rest,room,min-length,margin,margin-track,placement,visibility,track-fill, the thumb’srest,hoverandactivefill and its radius; kit.md). Content drawn in code keeps flat names:editor.*andsyntax.*(one colour per kind of code: keywords on the accent, strings onsuccess, numbers onwarning, comments muted…),terminal.*(its text, cursor, selection, links, andterminal.ansi.0toterminal.ansi.15, the 16 colours programs ask for by number: 0 is the colour furthest from the text, 7 the text’s own, 1 to 6 the status roles and the accent, 8 to 15 their stronger forms). A theme may re-alias a component token (high contrast outlines every button and field:button.rest.border-colorandfield.rest.border-colorare{border.strong}). A component’s text size aliases a step of the size scale ("{font.size.l}"), never a number of its own.
Spacing and text by intent
Layout code says why there is space, or what a piece of text is, rather
than how many points: the tokens below are system roles over the
scales, read through Tokens (t.space.group, t.text_role.section)
or the UiPop helpers (Getting started).
| Token | Alias of | Use |
|---|---|---|
space.inline | {space.s} | between items on one line |
space.group | {space.m} | between related groups of items |
space.section | {space.l} | before a section of a panel or a page |
space.page | {space.xl} | around a page’s content, between its main blocks |
They are aliases, so a density overlay, which moves the steps, moves them too; a theme may re-alias one onto another step.
A text role is three tokens, text-role.<role>.size (a step of the
size scale), .color (a text colour) and .weight (a number, 100 to
900; 400 is regular). The role names say what the text is; the colours
stay text.*, which the roles alias, so text.muted is still the one
muted colour:
| Role | Size | Colour | Weight | Use |
|---|---|---|---|---|
title | {font.size.xl} | {text.strong} | 600 | a page’s or a dialog’s title |
section | {font.size.m} | {text.strong} | 600 | a section’s title in a panel |
body | {font.size.m} | {text.default} | 400 | ordinary text |
muted | {font.size.m} | {text.muted} | 400 | hints, descriptions, an empty list’s message |
meta | {font.size.xs} | {text.muted} | 400 | a date, a size, a count |
A weight other than 400 is drawn with the theme’s interface font at
that weight (fonts::family), once a theme has installed the fonts;
egui’s bundled font has one weight, which draws them all. The role
colours are in the contrast pairs, over panels and the raised surface.
Beside the roles, three helpers of UiPop (experimental) read the same
tokens for what is not a role of its own:
ui.code_text(text): monospace text (a log or console line, a path) in egui’s monospace style (font.text-style.monospace,font.family.mono) and the body’s colour (text-role.body.color).ui.text_tone(tone, text): the body role in a tone’s colour (egui_pop_core::ui::tone_color):danger,warning,successandinfothe status colours,accentthe accent,mutedthe muted role’s colour,neutralthe body’s. Colour is not the only signal: the words say it too (“Failed: …”).ui.divider(): a rule across the layout between two sections, inborder.default, one point wide on whole pixels, centred in a space ofspace.group; upright in a row.
The categorical palette
Charts and data views colour what they tell apart by identity (an
entity, a sensor, a run) with palette.category.0 to
palette.category.9, in that order: the first series takes slot 0, the
second slot 1. A series keeps its slot whatever else is shown, so its
colour follows it from one view to the next. Code reads them through
Tokens::of(ctx).palette (DataPalette::series(i), which starts again
from slot 0 past the last); the plot component uses them
(Charts). More series than slots repeat colours: name them (a
legend) or group the smallest.
The slots alias a reference group named by hue, chart.blue,
chart.orange, chart.green, chart.pink, chart.olive,
chart.periwinkle, chart.lime, chart.red, chart.teal and
chart.purple, which each base theme gives for its surfaces; a theme
changes a hue there, or re-aliases a slot.
| Slot | pop-dark | pop-light | pop-high-contrast |
|---|---|---|---|
| 0 | #0aa5f8 | #014d74 | #15b3fe |
| 1 | #f69408 | #b66402 | #ff942f |
| 2 | #0dbd86 | #026a52 | #01c996 |
| 3 | #ff9fea | #a447a5 | #feb5f9 |
| 4 | #958801 | #564700 | #c1b007 |
| 5 | #a2b1ff | #4157c3 | #a9bdff |
| 6 | #a1df60 | #3f8304 | #bae962 |
| 7 | #dd556e | #d34d6a | #fe8b9e |
| 8 | #0398a7 | #078997 | #17f9fe |
| 9 | #a477eb | #672b98 | #cc8ffe |
Two checks hold them, in every built-in theme (the editor-inspired ones take their base’s hues):
- Contrast. Each slot reads at 3:1 (WCAG 1.4.11, a graphical object)
on
surface.canvas,surface.panelandsurface.raised: pairs ofcontrast::PAIRS, socontrast::checkand the overview page show them. The high-contrast hues reach 4.5:1 on black. - Separation (
contrast::check_category), measured as ΔE OK, the Euclidean distance in OKLab times 100 (contrast::delta_e): two neighbouring slots at 15 at least (CATEGORY_ADJACENT), any two at 10 (CATEGORY_ANY), and neighbours at 8 for people with protanopia or deuteranopia (CATEGORY_CVD_ADJACENT;Vision::simulate, Machado, Oliveira and Fernandes’ model at full severity). Each slot is a hue, not a grey (OKLCH chroma 0.08 at least).
Ten hues cannot all stay apart for colour-blind readers: any two slots are not checked for them, only neighbours, so the first series of a chart are the ones to tell apart, and a legend names them all. The built-in hues were searched for together under these checks (the same hue per slot in the three themes, the lightness moved for each theme’s surfaces) and reach 11.9 for any two, 20.9 for neighbours and 9.0 for neighbours with colour blindness.
Log levels
A log view colours a line’s level, or the whole line, with
palette.log.trace, palette.log.debug, palette.log.info,
palette.log.warn, palette.log.error and palette.log.critical: the
five levels of the log facade and a sixth past error, the critical level
some loggers add (Python’s logging, Rerun’s text log), from the least
to the most severe (egui_pop_tokens::LOG_LEVELS, in that order). Code reads them through
Tokens::of(ctx).palette.log (LogPalette, whose levels() gives
them in the same order).
pop-dark aliases them to the status colours and the muted text, so the
other built-in themes follow their own: trace is {text.muted}, debug
{info}, info {success}, warn {warning}, error {danger} and
critical {red.12}, danger’s red at its scale’s high-contrast text step
(danger is step 11): lighter than danger in a dark theme, darker in a
light one. Info is green and debug blue, as most log viewers draw them. A theme gives a
level a value of its own where its status colour does not read on its
canvas (gruvbox-light darkens info’s green).
| Level | pop-dark | pop-light | pop-high-contrast |
|---|---|---|---|
trace | #b3b1ad | #5d5a57 | #e0ddda |
debug | #9ac7ff | #2a5993 | #9ac7ff |
info | #9dd59e | #2a672f | #9dd59e |
warn | #f8b376 | #884300 | #f8b376 |
error | #ffa696 | #953226 | #ffa696 |
critical | #ffdfd7 | #4d1c16 | #ffdfd7 |
Each level is used as text: it reads at 4.5:1 (7:1 in high contrast) on
surface.canvas and surface.panel, pairs of contrast::PAIRS
checked like the status colours.
Axes
A view’s X, Y and Z axes (a gizmo, an axis line, a transform’s arrows)
take palette.axis.x, palette.axis.y and palette.axis.z: red, green
and blue, as most 3D and image tools draw them. Code reads them through
Tokens::of(ctx).palette.axis (AxisPalette). pop-dark aliases them to
the categorical palette’s hues, {chart.red}, {chart.green} and
{chart.blue}, which each built-in theme fits to its surfaces. Each is a
graphical object: it must be seen at 3:1 on viewport.background, pairs
of contrast::PAIRS.
A scale from one colour
A hue scale (steps 1 to 12 and contrast) can be generated from a
seed colour rather than written by hand:
egui_pop_tokens::palette::ramp(seed, Scheme::Light) gives its twelve
steps for a light theme, Scheme::Dark for a dark one, from the same
seed; palette::Ramp adds contrast and writes the scale as tokens
(Ramp::tokens("brick"): brick.1 to brick.12, brick.contrast).
use egui_pop_tokens::palette::{Ramp, Scheme};
use egui_pop_tokens::{Color, contrast};
let seed = Color::from_hex("#c0392b").unwrap();
let light = Ramp::new(seed, Scheme::Light);
// The text on the solid step reads, and so does the solid on the
// backgrounds (an accent is drawn as text on panels too).
assert!(contrast::contrast_ratio(light.contrast, light.steps[8]) >= 4.5);
assert!(contrast::contrast_ratio(light.steps[8], light.steps[0]) >= 4.5);
How it is made (in OkHsl, so no step leaves the sRGB gamut):
| Steps | Lightness | Saturation (times the seed’s) |
|---|---|---|
| 1 to 7 | fixed targets, from pop-light and pop-dark’s scales | 0.45 to 0.8 in light, 0.3 to 0.7 in dark |
| 9 | the seed’s, moved away from the text until it reads | the seed’s |
| 8, 10 | step 9’s, pressed and under the pointer | 0.9 to 1 |
| 11, 12 | low- and high-contrast text | 0.95 and 0.7 in light, 0.9 and 0.5 in dark |
- The solid step is the seed when the text on it reads: APCA’s Lc
60 at least (
apca::lc, informative elsewhere: the contrast pairs stay on WCAG 2.x) and WCAG 5:1. Otherwise its lightness moves, darker in light (white text), lighter in dark (nearly black text), its hue and saturation kept.contrastis the text APCA ranks higher on it. - Saturation is limited per hue band in large areas: greens and cyans (OkHsl hue 125 to 200) turn neon, yellows (85 to 115) muddy.
- Hue shifts a few degrees with lightness: lighter warm steps lean to yellow, lighter cool steps to cyan.
- A seed nearly black or white has no hue to speak of:
palette::clamp_seedbrings its lightness within 0.25 to 0.92 (and its saturation within its band), andrampapplies it first. A grey seed gives a neutral ramp.
An accent from a seed. ThemeSpec::new("pop-light").accent_color(seed)
(or .accent("#c0392b")) generates the accent’s scale when the theme
is resolved, as the custom scale (SEED_SCALE), for the base theme’s
scheme; a counterpart gets the other scheme’s ramp from the same seed.
The ramp is then fitted to the theme (Ramp::fitted, a Backdrop):
step 9 also reads as text on the theme’s surfaces and its editor
(4.6:1) and is seen on the slider and progress tracks (3:1), and steps
3 to 5 keep the theme’s text readable on them (the selection). A test
checks seeds round the hue circle in every built-in theme against the
contrast pairs at AA.
A scale saved as its seed. A token file may give a scale by its
seed rather than as twelve values, in its root $extensions
(palette::SEEDS_EXTENSION):
{
"$extends": "pop-light",
"$extensions": { "org.egui-pop.seeds": {
"blue": { "seed": "#8e44ad", "scheme": "light" }
} }
}
When the theme is resolved, the scale is generated from the seed
(Ramp::fitted), for the scheme given (light or dark; without one,
the theme’s, from surface.panel), fitted to the theme’s surfaces and
text as the file and the themes it extends give them (the scale’s own
tokens left out, so a scale never fits itself). A scale its base
already has gets the steps the base has (gray has no contrast); a
new scale gets its twelve steps and contrast. Then the file’s own
tokens are laid over it: a step the file also gives keeps the file’s
value. A file with the twelve values written out, and no seed, works
as before. An entry that cannot be read is a warning
(Warning::Invalid), and the scale keeps the values under it. The
theme editor’s “palette from a colour” writes the seed
(The theme editor).
The approach follows egui_colors (MIT), which builds 12-step Radix-like scales in OkHsl with APCA; egui-pop’s generator is a re-derivation with the targets above, not its code, and its tests check every hue in both schemes against the contrast targets.
Naming rules
- Name by role, never by hue, outside the reference tier:
text.muted, nottext.gray;danger, notred. - Path segments are lowercase, words joined by hyphens:
background-hover,on-accent. Dots separate groups, so a segment never contains.,{or}. - States are suffixes of the thing they modify (
button.hover.fill, the kit’s grid:docs/kit.md), sizes arexs,s,m,l,xl. - A component token points at a system token, a system token at the palette or another role, never the other way round (a test checks it).
The editor-inspired themes
Twelve built-in themes take their colours from popular, permissively
licensed editor themes (their workbench colours, not syntax): five
families with a light and a dark member, and GitHub’s high-contrast pair.
Each extends pop-light, pop-dark or pop-high-contrast and gives
its palette and the roles that differ; where an original colour missed a
contrast pair, only its OKLCH lightness was moved. Ids keep the family
names; the labels shown to people say “inspired” (theme_label).
Sources and licences are in NOTICE.
| id | label | extends |
|---|---|---|
github-light, github-dark | GitHub-inspired Light, Dark | pop-light, pop-dark |
github-light-high-contrast, github-dark-high-contrast | GitHub-inspired Light, Dark High Contrast | pop-light, pop-high-contrast (7:1 text) |
catppuccin-latte, catppuccin-mocha | Catppuccin-inspired Latte, Mocha | pop-light, pop-dark (+ purple) |
one-light, one-dark-pro | One Light-, One Dark Pro-inspired | pop-light, pop-dark |
solarized-light, solarized-dark | Solarized-inspired Light, Dark | pop-light, pop-dark |
gruvbox-light, gruvbox-dark | Gruvbox-inspired Light, Dark | pop-light, pop-dark |
Each one at full size: the built-in themes.
Composing a theme
The three base themes, pop-dark, pop-light and pop-high-contrast,
are shown at full size with the others in
the built-in themes (captured headless;
see CONTRIBUTING.md to regenerate).
The compact density changes spacing and sizes only:
A theme is resolved from a ThemeSpec, in this order:
- the base theme (mode and contrast:
pop-dark,pop-light,pop-high-contrast) with everything it$extends; - a density overlay,
density-comfortableordensity-compact, which touchesspace.*andsize.*only (a test checks it); - an accent: a colour scale whose steps become
accent.default(9),accent.hover(10),accent.active(8),accent.subtle(3),selection(5) andtext.on-accent(contrast); anything aliasing the accent (focus.ring,slider-fill.rest.fill) follows. The accent may also be a seed colour ("#3a7bd5",ThemeSpec::accent_color): its scale is generated ascustom.1tocustom.12andcustom.contrast(below), for the theme’s light or dark scheme; - reduced motion:
motion.durationbecomes 0 (egui’s animation time, cursor blink and scroll animation follow); - components based on another (
<component>.based-on) receive each token of their base they do not give, as an alias of it (kit.md); - the user’s overrides, raw values by path (aliases allowed); an override of a base reaches the components based on it;
- the user’s fonts, text size and scroll bars
(
ThemeSpec::font_ui,text_size,scroll_bars): the last writesscroll-bar.visibilityandplacement(kit.md).
use egui_pop::tokens::{Density, ThemeSpec, Themes};
use serde_json::json;
let spec = ThemeSpec::new("pop-light")
.density(Density::Compact)
.accent("blue")
.reduced_motion(true)
.override_token("radius.widget", json!({ "value": 2, "unit": "px" }));
let tokens = Themes::default().resolve(&spec);
Resolving never panics. Problems (an unknown theme, an $extends cycle,
an alias cycle, an unknown alias, a wrong type, an unreadable value, a
modifier that cannot apply, a missing contract token, an unknown override or accent, a
component based on an unknown one or components based on each other in a
circle) are listed in
tokens.problems(), and every contract token with a problem takes the
built-in pop-dark value.
Contrast
egui_pop_tokens::contrast lists, by hand, the token pairs that must stay
legible (PAIRS): text over every surface it is drawn on, status colours
used as text, labels on accent fills, component text, and the things that
must be seen (strong borders, the focus ring, slider fill and thumb on the
track). The tests check every built-in theme in every density against WCAG
2.x: 4.5:1 for text, 3:1 for interface parts, 7:1 for text in high
contrast; and every accent in every theme at 4.5:1 and 3:1. Decorative
borders (border.default) are not checked. A pair drawn over an image
(OVER_IMAGES: a label’s text on its translucent fill) is checked with
its background painted over black and over white, the poorer ratio
counting. The gallery’s overview page
shows the same table live.
YAML or JSON
A token file is the DTCG tree, written in YAML (.tokens.yaml, the
shipped files) or in JSON (.tokens.json): TokenFile::parse reads JSON
when the text starts with {, YAML otherwise, into the same tree. The
shipped files are compiled to JSON when egui-pop is built
(egui-pop-tokens/build.rs): reading YAML costs about seven times
JSON’s, and the built-in themes load at every start (24 ms in YAML, 3 ms
in JSON, release build). A trap below in a shipped file fails the build,
with its file and line. Files known only at run time, a user’s kits and themes
(KitData::load, Themes::add_path), are compiled into a cache folder
instead, never next to their YAML: see
the cache of compiled files.
Themes::add_path runs the loading rule below on what it reads, so a
theme’s warnings are the same on a hit. YAML
is there for comments. JSON stays the exchange format: what egui-pop
writes (the theme editor’s export, to_dtcg) is DTCG JSON, which other
token tools read.
In YAML, every string is quoted, colours and aliases first. Left bare, YAML reads them as something else, and a parser would take them silently, so egui-pop refuses them, with the line:
| Written | YAML reads | Write |
|---|---|---|
$value: #0a0a0a | a comment: the value is lost | $value: "#0a0a0a" |
$value: {surface.panel} | a map with one key | $value: "{surface.panel}" |
(The same rule as every YAML colour format, Asciidoctor’s themes or
DESIGN.md’s tokens among them.) Numbers stay bare
($value: {value: 1, unit: "px"}), and DTCG’s colour objects need no
quotes but their strings’:
accent:
default:
$type: "color"
# gold, kept in OKLCH so the light theme can derive its shades
$value: {colorSpace: "oklch", components: [0.832, 0.126, 83], hex: "#f0c060"}
A colour is "#rgb", "#rrggbb", "#rrggbbaa", or a DTCG object
(colorSpace srgb, srgb-linear, oklch or oklab; another space
is read from its hex fallback).
A file’s version
A token file may say which format and which contract it was written
for, with a stamp in the root’s $extensions:
{
"$extends": "pop-light",
"$extensions": { "org.egui-pop.format": { "version": 1, "contract": 1 } }
}
versionis the file format’s (FORMAT_VERSION): how a file is laid out, apart from which tokens it gives.contractis the contract’s (CONTRACT_VERSION): which tokens exist, under which names. It is a number of its own, not a crate’s version: it starts at 1 and goes up by one in a release that renames or removes a token of the contract. Adding a token does not raise it, since an older file still loads.- A file without a stamp is read as current, so a file written by hand
needs none. The theme editor’s export writes it
(
TokenFile::stamp,FormatStamp::CURRENT). - One stamp per file: each file a theme is made of says what it was written for, whoever wrote it, and a file keeps its meaning when it travels alone.
A file stamped with a newer format or contract than this egui-pop knows loads all the same, best-effort, with a warning saying so.
One loading rule. A theme file loads over its base theme (its
$extends, else pop-dark) the same way wherever it comes from:
Themes::add_text (an application’s own themes, a user’s), the theme
editor’s import (ThemeDraft::import), and Themes::check_file for a
file already parsed. Only a file that cannot be read at all (not JSON or
YAML, not a tree of tokens) is an error. Past that, nothing fails: each
of these is a Warning, with the token’s path and why.
- A token whose value does not load (an unreadable value, an alias to nothing or in a cycle, another type than the base’s or the contract’s) is left out: the base theme’s value stays.
- A token the base does not have is kept as the file’s own (a palette
scale, an extension’s component); under a group of the contract
(
surface,button) with a term no token of the base uses, it is reported as a likely typo. The theme editor, which changes its base’s tokens only, leaves it out. - A token renamed since the file’s contract is read under its new name.
- A file stamped newer than this egui-pop is read best-effort.
- A base not known yet (themes added in another order) leaves the tokens unchecked; resolving the theme reports what is wrong.
Themes::add takes a parsed file as it is, past this rule.
Renames. A release renaming a token raises CONTRACT_VERSION and
adds an entry to egui_pop_tokens::RENAMED: the former name, the new
one, the contract that dropped the former name, and the release of
egui-pop-tokens that renamed it (since: "0.3"). A file stamped with
an older contract has each former name read under its new one (aliases
naming it too), with a warning: “renamed, update your file”
(TokenFile::upgrade). The table is empty while the contract is at its
first version.
How long a rename is read. Two minor releases after the one renaming
it (RENAME_WINDOW): a token renamed in 0.N is still read under its
former name, with the warning, in 0.N, 0.N+1 and 0.N+2; its entry is
dropped in 0.N+3, after which the former name loads as a token the base
theme does not have (kept as the file’s own, or left out by the theme
editor, with a warning). A major release counts as one more minor
release. A test (no_rename_entry_outlives_its_window) compares each
entry’s since with the crate’s version and fails once an entry is
past its window, so the release raising the version drops it.
A light and dark pair in one file
A pair whose two variants were edited apart (the theme editor’s) is
saved as one file: the token file of the theme named first, carrying
its counterpart’s in its root $extensions under
"org.egui-pop.counterpart" (COUNTERPART_EXTENSION), with the name
it goes by. Each names the other (org.egui-pop.variant-of), and the
counterpart is an ordinary token file with its own stamp (one stamp
per file, see above): the format version stays 1, since a reader not
knowing the key still loads the file’s own variant.
{
"$extends": "pop-dark",
"$extensions": {
"org.egui-pop.format": { "version": 1, "contract": 1 },
"org.egui-pop.variant-of": "ocean-light",
"org.egui-pop.counterpart": {
"name": "ocean-light",
"file": {
"$extends": "pop-light",
"$extensions": {
"org.egui-pop.format": { "version": 1, "contract": 1 },
"org.egui-pop.variant-of": "ocean"
},
"accent": { "default": { "$type": "color", "$value": "#2060c0" } }
}
}
},
"accent": { "default": { "$type": "color", "$value": "#40a0ff" } }
}
Themes::add_text and Themes::add_path add both, the counterpart
under its name through the same loading rule; one that cannot be read
is a warning, and the file’s own variant is added alone. The file
travels in a package like any other (below).
A theme with its fonts
A theme naming font files of its own (a user’s, added in the theme
editor) travels as a package: a folder, or a .zip archive of the
same files, holding the token file and the faces by relative path
(egui_pop_tokens::package).
my-theme/
my-theme.tokens.json
fonts/Inter-Regular.ttf
The token file lists its faces in its root $extensions, with the
family a theme names each by and its weight:
{
"$extends": "pop-dark",
"$extensions": { "org.egui-pop.fonts": [
{ "file": "fonts/Inter-Regular.ttf", "family": "Inter", "weight": 400 }
] },
"font": { "family": { "ui": { "$type": "fontFamily", "$value": ["Inter", "sans-serif"] } } }
}
ThemePackage::read(path)takes the folder, the archive or the lone token file (its faces then looked for beside it by the same paths). In a folder or an archive, the token file is the one at the top ending in.tokens.json,.tokens.yamlor.tokens.yml(the first by name; another is a warning); an archive of the folder itself, its files under one top folder, reads too.- Only a package without a readable token file is an error. A face
missing, not a TrueType or OpenType file, or with a path leaving the
package is left out with a
Warning::Font, and the families naming it fall back. An archive holding more than 256 MiB once unpacked is refused. ThemePackage::write(path)writes what a user chose: a.zippath is an archive; otherwise a theme without faces is the lone token file, and one with faces a folder named after the theme beside the path.write_dirandto_zipwrite one or the other.- Archives need egui-pop-tokens’
zipfeature (theme-zipinegui-pop, on by default): zip (MIT), deflate only, through the flate2 that egui’s image decoding already uses. Without it, a folder or a lone file still reads and writes, and an archive is an error.
The theme editor saves and opens themes this way (The theme editor).
Adding a theme
-
Write
my-theme.tokens.yaml. The shortest way is to extend a built-in theme and change what differs:$extends: "pop-dark" $description: "Cooler greys" gray: $type: "color" "2": {$value: "#171a1f"} # a key that is a number is quoted too surface: $type: "color" canvas: {$value: "#000000"}A theme may also stand alone (no
$extends): it must then give every contract token, or the missing ones fall back topop-dark. -
Register it and resolve it:
let mut themes = egui_pop::tokens::Themes::default(); // What was read otherwise than written: a token left out, renamed... for warning in themes.add_text("my-theme", include_str!("my-theme.tokens.yaml"))? { eprintln!("my-theme: {warning}"); } let tokens = egui_pop::theme::install_with(ctx, &themes, &ThemeSpec::new("my-theme")); assert!(tokens.resolved().problems().is_empty()); -
Check its contrast:
contrast::check(tokens.resolved(), Level::Normal)returns the failing pairs.
For a new built-in theme: add the file under themes/, list it in
BUILT_IN_FILES and BUILT_IN_THEMES, and the contrast and contract tests
cover it at once. The default kit’s component tokens are not in
pop-dark.tokens.yaml: they live in themes/kit/<component>.tokens.yaml
and are layered into pop-dark at load (docs/kit.md). Add its
snapshots to the gallery tests
(UPDATE_SNAPSHOTS=1 cargo test -p egui-pop-gallery).
Into egui
egui_pop::theme::install sets egui’s styles from the system and
component tiers (see the module documentation for the mapping) and stores
a typed Tokens set in the context, read with Tokens::of(ctx). A theme
alone fills both of egui’s styles, dark and light; a theme with a
counterpart (org.egui-pop.variant-of, Themes)
fills each with its own variant, and Tokens::of gives the one of egui’s
theme of the moment. Install between frames; never change the global
style mid-frame to theme one widget. The kit’s scroll-bar becomes
egui’s ScrollStyle there, so every scroll area follows the theme’s
bars, or what the user chose over them (kit.md).
The theme editor
A theme’s tokens edited live, in any Ui of an application: grouped by
role, each colour with its picker, the contrast of every pair a token
takes part in, undo and redo, export and import as a token file. The
gallery’s theme-editor page shows it over the gallery’s own theme.
In an application
use egui_pop::api::App;
use egui_pop::api::theme_editor::{self, ThemeEditorPlugin};
// The plugin: the editor's state, its steps and agent commands.
let app = App::builder()
.plugin(ThemeEditorPlugin)
.build(&egui_pop::egui::Context::default())
.unwrap();
// The view, wherever the application wants it: a panel, a window, a
// page of its settings.
fn appearance(ui: &mut egui_pop::egui::Ui, app: &egui_pop::api::AppHandle) {
theme_editor::show(ui, app);
}
// Optional: the host's file chooser, here the files plugin's.
let handle = app.handle();
let editor = handle.service(&theme_editor::THEME_EDITOR).unwrap();
editor.set_file_dialog(Some(std::sync::Arc::new(|app: &egui_pop::api::AppHandle, request| {
app.service(&egui_pop::api::files::FILES)
.expect("the files plugin")
.choose(app, request)
})));
let _ = appearance;
The editor works on the application’s theme (the theme service): each
change becomes the spec’s base and overrides, installed before the next
frame, so every widget follows at once. When the theme changes elsewhere
(a theme switcher, AppHandle::theme().set), the editor starts again
from it, its history emptied.
A light and dark pair is edited as a pair. A theme with a light
and a dark variant (Themes) keeps
both in the draft, each with its own changes, history and generated
scales, and both stay installed: the variant edited’s changes are its
own (ThemeSpec::counterpart_overrides for the counterpart’s). The
variant edited is the one shown. The editor’s “Variant edited” switch
(Dark, Light; ThemeEditor::switch_variant) edits the other one and
shows it, the preference becoming its mode as the application’s
light or dark toggle does; that toggle, or the system’s mode while
the preference follows it, switches the variant edited too. Undo and
redo act on the variant edited. A theme alone (pop-high-contrast)
has no switch.
Live, or in a preview only. By default each change is installed at
once, as above. With “Preview only” ticked
(ThemeEditor::set_preview_only), changes stay in the draft: the
preview pane draws it (a theme::ScopedTheme, so Tokens::of and
Kit::of give the draft’s inside it, and the popups opened in it, a
combo box’s list, a tooltip, a menu, are drawn in it too), while the
editor and the rest of the window keep the theme installed, so a draft
with unreadable text or a broken control cannot make the editor itself
hard to use. “Apply”
(ThemeEditor::apply) installs the draft app-wide; “Discard”
(ThemeEditor::discard) goes back to the installed theme; going back
to live editing applies it. The draft’s fonts are not previewed: fonts
are global, see the Fonts tab.
The model is egui_pop_tokens::ThemeDraft, with no egui in it: a base
theme, the tokens changed over it (raw DTCG values, aliases kept as
aliases) and their history. Applications that want their own view use
it directly, or the service (THEME_EDITOR: set, undo, redo,
start, export, import, read, generate).
What it shows
- Tokens and Fonts: two tabs (
ThemeEditor::set_tab). The Fonts tab editsfont.family.uiandfont.family.monoin priority order (move a family up or down, remove it, add one by name) and the user’s font files (added through the file chooser, read to take their family and weight, kept as paths:ThemeEditor::font_files, for the host to save, andset_font_filesat the next start). It lists the families installed (ThemeEditor::installed_families: egui’s, the application’s, the user’s font files and the system’s withsystem-fonts), with a search and the role they are for (monospace ones only for monospace); resting the pointer on one previews it, picking one puts it first in the role’s families (ThemeEditor::choose_face), the others kept as its fallbacks and a generic family (sans-serif,monospace) added at the end when the list has none. A family missing on this machine is marked “Not installed here”. The tab previews the families edited before they are applied: its own preview pane draws the sampler and a sample line per role in the draft’s theme and in the fonts edited (ThemeEditor::font_preview, through the preview families of Fonts), the rest of the application keeping the fonts installed. Resting the pointer on a family previews it first (ThemeEditor::preview_face). “Apply the fonts” applies once (ThemeEditor::apply_fonts): the files are registered, the families written as one change, the draft applied, the atlas rebuilt once. “Cancel the font edits” (ThemeEditor::cancel_fonts) drops them. A file that cannot be read is reported and its previous face stays. A file added is drawn in the preview once applied. A theme names a system face by its family name, so it travels as a token file: where the face is missing, the next family of its list draws, and opening or importing the theme says so (Warning::FontMissing, the family drawing instead). To carry the face itself, add its file as a font file: the theme is then saved with it (below). - Preview: a pane drawing the draft in its own theme: text by
role, the status colours, buttons in their tones and states, a
checkbox, options, a slider, a field, a selected row and a progress
bar (
theme_editor::sample). An application shows its own widgets instead withThemeEditor::set_sampler(the gallery passes its component sampler). “Preview only”, “Apply” and “Discard” sit above it. - Start from: any built-in theme; the draft starts again from it.
- Undo and Redo, naming the token they would change.
- The tokens, by role: surfaces, text, accent and focus, states, borders, shape, space, type and motion (the system tier), the components’ tokens, then the palette (the reference tier). A filter narrows them; changed tokens are in bold, marked “changed”.
- The token picked: its description and type, whether it is changed
here or as in the base theme, what it aliases; its value with the
widget of its type (egui’s colour picker with alpha and, beside it,
a hex field, “Hex of
<token>”, a number field for dimensions, numbers and durations) and a text field taking a value or an alias ({gray.3}, checked: same type, no loop); reset to the base theme’s value. - Generate this scale from a colour (a palette token picked, of a
scale with a step 9:
blue.3,gray.7): a seed picker with its hex field, the twelve steps it gives for the variant edited, light or dark (egui_pop_tokens::palette, Design tokens), fitted to the theme’s surfaces and text, and “Generate”, which writes them and the scale’scontrastover the scale; one undo takes them all back. The seed is recorded, and the file saved gives the scale as its seed rather than twelve values (see The file). A seed too dark, too light or too vivid is clamped, and said so. Only the variant edited is written: the other keeps its own scale (switch to it and generate it there, or generate the other variant, below). An accent for both variants is the theme service’sset_accent_color(theappearance.accent_colorsetting). - Generate the other variant (a pair): the other variant computed
from the one edited (
ThemeEditor::propose_counterpart,egui_pop_tokens::ThemeDraft::generate_counterpart), offered, never applied silently: the changes it would make are listed (each token, its colour now and proposed), the preview pane draws the proposal, and “Apply to<theme>” writes it (ThemeEditor::apply_counterpart, each token throughtheme.token, one undo in that variant), or “Cancel” drops it. The rule, deterministic: a colour is mirrored (palette::mirror: the same OkHsl hue and saturation, the lightness1 - l; black and white swap), an alias ({blue.9}) and any other value (dimensions, numbers, durations, font families) are carried as they are, a scale generated from a seed is generated again from it for the other scheme (fitted to the other variant as generated), and the other variant’s own changes not among these are taken back. Tokens its base lacks, or whose value does not check there, are listed as left out. - Contrast: every pair of
contrast::PAIRSthe token takes part in, itself or through the tokens aliasing it, with its ratio, AA (4.5:1 for text, 3:1 for interface parts), AAA (7:1 for text; interface parts have no AAA) and what the theme needs: AAA text for a high-contrast theme (7:1), AA otherwise; and, for information, the pair’s APCA lightness contrast (Lc,egui_pop_tokens::apca): the theme’s contract stays on WCAG. - Export and import: the draft as a
.tokens.jsonfile (a pair as one file, both variants), or a file pasted and loaded; “Open a file” and “Save as a file” through a file chooser. A theme naming the user’s font files is saved with them: as a folder (<name>/<name>.tokens.jsonandfonts/) beside the path chosen, or as a.ziparchive when the path ends in.zip(ThemeEditor::save_file,ThemeEditor::package). “Open a file” takes a token file (a package’s faces found beside it) or an archive (ThemeEditor::open_file); the faces become the user’s font files, registered at once, copied first to the host’s font folder when it gives one (ThemeEditor::set_font_dir, else an archive’s faces are registered for this run only, with a warning). The chooser is the host’s (ThemeEditor::set_file_dialog, a function starting a choice and answering later, asfiles::Files::choosedoes), or thefilesplugin’s when it is connected, so the editor brings no file-dialog dependency; without either, files are pasted as text only. Tokens the base theme does not have, or whose value is not of their type, are left out and listed, with what else the file loaded with (a token renamed, a file newer than this egui-pop): the file loads over its base as any theme file does (Design tokens). - Problems: what the theme’s resolution reports.
The file
A draft is saved as an ordinary token file (see Design tokens):
$extends names the base theme, the file gives only the tokens changed,
each with its $type, and the root’s $extensions carries the format
stamp, "org.egui-pop.format": { "version": 1, "contract": 1 }
(Design tokens). A scale generated from
a colour is saved as its seed, under "org.egui-pop.seeds"
({ "blue": { "seed": "#8e44ad", "scheme": "light" } }), and generated
again when the file is loaded
(Design tokens): the steps still
at the value the seed gives are left out of the file, a step changed
since is written as it is, and a seed whose scale was undone or no
longer matches is not saved. Files the editor wrote
before carry "org.egui-pop.theme-editor": { "version": 1 } instead,
still read. A file stamped newer than this egui-pop knows loads
best-effort, with a warning. Any such file
loads as a theme (Themes::add_text) and imports back as a draft. The
editor writes DTCG JSON, the exchange format; a YAML file imports too. A theme
saved with the user’s font files lists them under "org.egui-pop.fonts"
([{ "file": "fonts/Inter-Regular.ttf", "family": "Inter", "weight": 400 }]),
by their path in the package (Design tokens).
A pair is saved as a new pair, both variants under the name given: the
file is the theme named first’s (named <name>), and carries its
counterpart’s, named <name>-light or <name>-dark, under
"org.egui-pop.counterpart", each naming the other
(Design tokens). Saved,
exported or packaged, it is one file; imported or opened, it is the
pair again, the first variant edited; added to an application’s themes
(Themes::add_text, add_path), it is two themes, a pair.
{
"$description": "Edited from pop-light",
"$extends": "pop-light",
"$extensions": { "org.egui-pop.format": { "version": 1, "contract": 1 } },
"accent": { "default": { "$type": "color", "$value": "#2060c0" } },
"button": { "rest": { "border-color": { "$type": "color", "$value": "{border.strong}" } } }
}
Steps and commands
| Step | Arguments | Default |
|---|---|---|
theme.token | path, from, to (raw DTCG values, null for the base theme’s), cause (edit, reset, undo, redo, agent) | writes to |
theme.load | base, overrides, counterpart ({base, overrides}, null for a theme alone), cause (start, import) | loads them, the history emptied |
A before-hook vetoes a change (the token keeps from) or redirects it
(another to, checked again); a run-hook’s result is the value written.
Undo and redo go through theme.token too, so a plugin can keep a token
from moving whichever way it is asked. A colour dragged in its picker is
shown live and becomes one change when the pointer is released; a
number moved with the keys, or a value typed in, becomes one when its
field lets the focus go.
Commands for agents (hidden from the palette): theme.read (the draft:
base, variant (dark or light), overrides, history, failing pairs
and problems, and the pair’s counterpart (its base, overrides,
whether it can undo; null for a theme alone); with path, one
token, its value, alias and contrast readouts), theme.set (path,
value, null for the base theme’s), theme.undo, theme.redo,
theme.start (base), theme.export (name, the file’s text back),
theme.import (text; the tokens left out back as skipped,
and what the file loaded with as warnings) and theme.generate
(scale, seed: a scale written from a seed colour, through
theme.token for each of its tokens, undone as one change),
theme.switch (the pair’s other variant edited, and shown) and
theme.counterpart (the other variant generated from the one edited:
its edits, seeds and skipped proposed, or, with apply: true,
written as one change, changed back).
The editor is a focus surface of its own (themeEditor), and its
draft is a local scope (theme, ADR 0014): while the editor
has the focus, Edit > Undo, Ctrl+Z, Ctrl+Shift+Z and Ctrl+Y undo and
redo its changes, not the application’s; a text field of the editor
keeps its own undo while it is being typed in.
Keyboard and screen readers
Every control is reached with Tab and used with Enter or Space: the
tabs, the theme picker, undo and redo, the variant switch (Dark,
Light), “Generate the other variant” with “Apply to <theme>” and
“Cancel”, “Preview only”, “Apply” and
“Discard”, the filter, each group and token, the value and hex fields,
reset, the seed picker’s hex field and “Generate”, export and import,
the Fonts tab’s moves, removals, additions and “Apply the fonts”. egui’s colour picker is drawn
for the pointer; its keyboard path is the value field beside it (a hex
colour or an alias). The colour button is a colour well named “Adjust
<token>”, the field “Value of <token>”; the contrast table is text.
Survey (2026-10-13)
| Crate | Licence | What it is | Decision |
|---|---|---|---|
egui’s color_picker (color_edit_button_srgba) | MIT OR Apache-2.0 | An HSV picker with alpha in a popup | Adopt: the colour widget |
| egui_colors 0.13 | MIT | 12-step palettes generated from a seed colour (Radix-like), with a clamped picker; “for exploring styling options” | Own, after it (2026-10-20): its approach (OkHsl, hue shifts, saturation limits per hue band, APCA) re-derived in egui_pop_tokens::palette with documented targets and contrast tests; it depends on egui and its constants are undocumented |
| egui_thematic | MIT | A theme editor over egui’s Visuals, with presets and JSON save | Own: it edits egui’s style, not DTCG tokens in tiers with aliases and contrast pairs |
| egui-themes, zeus-theme | MIT | Ready-made egui styles | Not relevant: egui-pop’s themes are token files |
Not done yet: renaming a theme and adding it to the themes the application offers (the editor works as overrides over a known base), a face picked from the system’s fonts in a list (the Fonts tab takes a family by name), and a sample drawn in a face before it is applied.
Plugins, commands and steps
An egui-pop application is a set of plugins. This page covers what a plugin registers, how commands work, how one plugin changes what another drew, and how a plugin takes part in the life of egui-pop’s features.
Plugins
A plugin has an id and a connect method. It registers through Ctx:
commands, settings, panels, blocks in zones, menus, services, steps and
hooks. Whatever it registers is owned by it and removed when it is
disconnected (ADR 0004). Plugins are sorted by
what they require before they connect.
A plugin’s going is said (ADR 0028).
Its disconnection leaves a plugin.disconnected event on the journal
(source egui_pop) and an info line in the log. The event’s data: the
plugin, its owner, the reason (removed for App::disconnect,
disabled for AppHandle::set_plugin_enabled, requirement gone for
a plugin that required it, failed connect when its connection failed
after it registered things), removed with counts by kind (commands,
panels, components, hosts, mounts, undo_steps,
mixed_undo_steps, jobs_cancelled, jobs_orphaned) and undo, one entry per
history that lost steps (history, steps, mixed: those also
changing other owners’ values). The value store logs each such history
at info level too (Store::remove_owner_report gives the counts).
A run of one of its commands asked after it went (queued with
AppHandle::run_as, a menu, a toast’s or a finished job’s action, an
accepted dialog) does not run: it is a command.refused event, from
the origin that asked, whose reason is “its plugin x is
disconnected” (or the registry’s refusal for a command never declared;
a key bound to a command never declared also logs a warning).
A key the user, the workspace or another plugin bound to one of its
commands is kept, dormant: it stays in its layer and is saved with
it, but it no longer takes its keys, which go to the next binding of
them (the application’s default, most often). The command shows no key
and the binding makes no conflict; the key trace says dormant: its command's plugin is disconnected for it
(egui_pop_model::keymap::DORMANT), the keys collector lists it under
dormant, an info line says it once, and the shortcuts editor lists it
under “Dormant keys” with the plugin’s name (AppHandle::dormant_keys).
When the plugin reconnects, the binding is live again as it was.
Its jobs (Progress): a job going on that names it
(owner, or command, in job.started) and can be cancelled is
cancelled by the host, asked by the framework (job.cancel with the
reason, from script:egui_pop); one that cannot, and one it published
itself, goes on and is said orphaned (job.orphaned), which the jobs
centre shows as “its plugin x is off”.
What it left on screen is closed, greyed or kept for its return. A
dialog on one of its commands, or a custom one it opened, is cancelled
(dialog.cancelled with the reason, Dialogs). A toast’s
action naming one of its commands is greyed, its tooltip saying which
plugin went (AppHandle::command_gone_with). Its panels leave the
layout but their places stay in it, dormant and saved
(SavedLayout::dormant), and a panel declared again goes back where it was
(Workbench). Its components, host offers and their
mounts are removed (Hosts).
DefaultPlugins is the paved road: the command palette, dialogs,
toasts, the settings window, the window’s place and saved arrangements.
MinimalPlugins is the bare shell. Both are plugin groups for
AppBuilder::plugins.
A complete plugin application is in Getting started.
Which of these a plugin uses to share data with others (the value store, a command, a step, the context stack, a service) is in State or event: what to use.
A plugin writes the values it owns, and those whose owner named it a
writer: what it writes while connecting, in its command handlers and in
its lifecycle hooks is written as it, and Ctx::writer writes as it
from a panel or a thread
(who writes a value).
Commands
A command is declared once, with a CommandSpec: its id, title,
category, keys, when clause, menu entries and arguments. Its key
binding, menu entry, palette entry and agent surface are derived from
it.
use egui_pop::api::app::MENU_VIEW;
use egui_pop::egui;
use egui_pop::prelude::*;
struct Greeter;
impl Plugin for Greeter {
fn id(&self) -> PluginId {
PluginId::from_static("greeter")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.command(
CommandSpec::new(CommandId::from_static("greeter.greet"), "Greet", "Greeter")
.key("Ctrl+G")
.menu(MENU_VIEW, "5_greeter", 0),
|_call| Ok(serde_json::json!("hello")),
)?;
Ok(())
}
}
let mut app = App::builder().plugin(Greeter).build(&egui::Context::default()).unwrap();
let out = app.run(&CommandId::from_static("greeter.greet"), serde_json::Value::Null, Origin::User);
assert_eq!(out.now(), Some(Ok(serde_json::json!("hello"))));
Keys are resolved by focus: layered keymaps, chords, the deepest focused scope first, with a trace of each resolution (ADR 0007). The settings window’s shortcuts editor rebinds them.
Who runs a command: the host
egui-pop wraps the application’s kernel through a host
(ADR 0010). The default, LocalHost, runs the
handlers given to Ctx::command in-process, so App::run returns a
Reply whose result is there now (Reply::now()). An application with
its own kernel implements egui_pop::api::host::Host, declares its
commands without a handler (Ctx::declare) and gives the host to
AppBuilder::host; a command may then answer later, from any thread,
and the frame never waits.
Settings pages
The settings window draws a page per section of declared settings. A
plugin adds a page of its own, with its own layout, through
Ctx::settings_page: a SettingsPage (an id, a title, a place in the
tree, keywords for the search, the settings it edits) and the closure
drawing it.
use egui_pop::api::settings_pages::SettingsPage;
use egui_pop::api::settings_window;
use egui_pop::egui;
use egui_pop::prelude::*;
const THREADS: SettingId = SettingId::from_static("compute.threads");
struct Compute;
impl Plugin for Compute {
fn id(&self) -> PluginId {
PluginId::from_static("compute")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.setting(THREADS, Descriptor::int("Worker threads", 1, 64, 4))?;
ctx.settings_page(
SettingsPage::new("compute.devices", "Compute")
.order(10)
.keywords(&["GPU", "OpenCL"])
.settings(&[THREADS]),
|ui, app| {
ui.label("The devices found, and which one runs what.");
settings_window::setting_row(ui, app, &THREADS);
},
);
Ok(())
}
}
let app = App::builder()
.plugins(DefaultPlugins)
.plugin(Compute)
.build(&egui::Context::default())
.unwrap();
assert_eq!(app.handle().settings_pages()[0].id, "compute.devices");
- Its place.
under("Appearance")puts it under a section (as the tree names it) or under a page of its own (its id); without a parent, or under one that does not exist, it is a page of its own, after the generated sections and before the keyboard shortcuts.ordersorts the pages of a parent (then the title). One level only. - The search finds it by its title, its parent, its description,
its
keywordsand its settings as shown; a hit lists the settings that match and a button opening the page. - Its settings (
settings) leave the generated sections: the page draws them, as the window does withsettings_window::setting_row. The page’s reset takes them back to their defaults as one undo step of the settings;reset_withadds a reset of its own for what is not a setting, and says when that is away from its defaults. - The mount contract. The page’s component (
needs, a plain widget by default) is checked against the settings page host (column T of hosts.md): modal, transient, the form’s width and the content’s height, not drawn while another page is shown. A component that does not fit is refused and reported (mount-refused), and the page is not added. The body is drawn in a focus scope and a fault boundary. - Agents read the tree and the pages in the
settings_windowcollector, and open a page withapp.settings.page({"page": "compute.devices"}).
A body moves the settings window by commands (app.settings,
app.settings.page), not through its service, which is held while the
body is drawn.
Zones and blocks
Zones and blocks let a plugin add to, replace, extend or wrap what another drew (ADR 0005); what cannot apply is reported, never silently dropped (ADR 0003). In the gallery, one plugin replaces, extends and wraps another’s blocks; switched off, the card is back as its owner made it:
| Extender connected | Extender switched off (pop-light) |
|---|---|
Alter hooks
Alter hooks (egui_pop::prelude::Hook) change lists of declarations: a
menu’s items, the palette’s entries, the settings form’s entries. They
run when the application is built or a plugin comes or goes, never per
frame, in priority order and after the hooks they name.
Steps: observe, veto, replace, extend
A feature names the moments of its life as steps: frame.close,
workbench.detach, arrangement.switch, dialog.show, menu.open,
edit.undo… (ADR 0011). Each module’s
documentation lists its steps, their arguments and their default. At
each step a plugin may, each optional:
- observe: the step publishes a signal on the host’s journal, named
after it, with its arguments and result (
<step>.vetoedwhen stopped); - veto or redirect: a before-hook (
Ctx::before) returnsBefore::Go,Before::Veto(reason)orBefore::Redirect(args); - replace: a run-hook (
Ctx::replace) does the step instead of the default (the last plugin to replace a step wins; two are reported); - extend: an after-hook (
Ctx::after) gets the arguments and the result.
A plugin declares its own steps with Ctx::step and runs them with
AppHandle::step(step, args, default):
use egui_pop::egui;
use egui_pop::prelude::*;
const SAVE: StepId = StepId::from_static("demo.save");
struct Guard;
impl Plugin for Guard {
fn id(&self) -> PluginId {
PluginId::from_static("guard")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.step(StepSpec::new(SAVE, "Saves the demo."))?;
ctx.before(SAVE, |_, args| {
if args["name"] == "" { Before::Veto("no name".into()) } else { Before::Go }
});
Ok(())
}
}
let app = App::builder().plugin(Guard).build(&egui::Context::default()).unwrap();
let h = app.handle();
let out = h.step(&SAVE, serde_json::json!({ "name": "" }), |_, _| Ok(serde_json::json!("saved")));
assert_eq!(out.vetoed(), Some("no name"));
let out = h.step(&SAVE, serde_json::json!({ "name": "a" }), |_, _| Ok(serde_json::json!("saved")));
assert_eq!(out.result(), Some(&Ok(serde_json::json!("saved"))));
Hooks are owned like everything else. Every run is traced (who
redirected, vetoed, ran and followed); the debug bridge’s steps
collector lists the declared steps, their hooks and the last runs. A
hook on a step nobody declares is reported.
State or event: what to use
A plugin has several ways to share data with the rest of an application: the value store, commands, steps, the context stack, services and alter hooks. Each has its own page; this one says which to pick, and what goes wrong with the wrong one.
There are two kinds of data:
- State: a value others read whenever they draw. The last value written is the truth; nothing is lost when someone does not look at it for a frame. A setting, a parameter, a selection, where the user is.
- Events: something that happened, or must happen, once. Each one is acted on exactly once, in order, whoever happens to be on screen. A request to delete, to save, to open; a moment others may stop.
The per-frame trap
egui is immediate mode: every visible panel’s ui() runs every frame,
and a hidden one does not run at all. Two mistakes follow from it.
- State written while drawing. A panel that copies its own field into a shared value each time it draws writes every frame. Two panels doing so race: the one drawn last wins, and a change the user made in the other is overwritten in the same frame by a stale copy.
- An event kept as a flag. A click that sets
delete_requested = true, for another panel to see and reset, is lost when that panel is hidden or closed (itsui()never runs), acted on twice when two panels read it, or late by a frame. A flag has no order and no count: two clicks in one frame are one.
egui-pop keeps both out of the frame:
- A bound widget (
Binding::bound) reads the store every frame but writes only when the user changes it, with an origin, and a drag is one gesture that holds the path against other writers (ADR 0009). AppHandle::rundoes not run the command in the middle of a panel: it queues the request, and the command runs once, before the next frame, whichever panels are visible.- Components hand edits back instead of changing shared data in place: a finished slider change, a node graph edit, a tree rename runs as a step, once per edit, not once per frame.
One row per need
| The need | Use | The mistake it avoids |
|---|---|---|
| A value others display and may edit (a setting, a parameter) | the value store: Ctx::setting, or a path declared on AppHandle::store(); widgets bind it with Binding::bound, views with Binding::watch | a copy per panel written back every frame |
| A value another plugin may write too | the owner names it a writer: Descriptor::writers (or any_writer); the other plugin writes through its command, its hooks or Ctx::writer | two plugins writing the same value, the last one winning (who writes a value) |
| To react when a value changes | Ctx::on_change(prefix, f) on the store | comparing with last frame’s value in ui() |
| A selection another panel follows | a value in the store, read when that panel draws (linked panels) | computing a preview for a panel nobody sees |
| A request someone must act on once (delete, save, open) | a command: Ctx::command, asked with AppHandle::run | a flag in the store that the next frame forgets or reads twice |
| A moment others may observe, veto, replace or extend | a step: Ctx::step, run with AppHandle::step; others use Ctx::before, replace, after | a callback list of its own, or a flag others poll |
| To follow what happened (steps, context changes) | the journal: each step publishes a signal, read with AppHandle::events_since | a “last event” value that two readers race to clear |
| Where the user is, and how the application behaves there | the context stack: contexts::enter, set_mode; read through when clauses and context.entered | a context key set by hand (AppHandle::set_context on place or mode.*), which the projection overwrites |
A flag for when clauses that is not a place or a mode | AppHandle::set_context with a key of the plugin’s own | a store value read in every when by hand |
| An object other plugins call (a file chooser, a log, an editor registry) | a service: Ctx::service with a ServiceToken, got with AppHandle::service | a global, or a value in the store that is really an object |
| To change another plugin’s declarations (menu items, palette entries, settings form) | an alter hook: Ctx::hook with Hook::menu, palette or settings; it runs when the application is built or a plugin comes or goes | rewriting a menu while it is drawn |
| Something a background thread hands over | a queue the thread fills, taken at On::Pass (Ctx::on) before the frame | reading the thread’s data from ui() |
Rules of thumb:
- If missing it for a frame is harmless and only the latest value matters, it is state: the store, or the context stack.
- If it must happen exactly once, it is an event: a command. If others may want to stop or change it, run it as a step inside the command.
- A service shares an object, not data that changes: what the object holds is either its own state or reached through its methods.
ui()reads state and asks for events. It does not write state every frame and does not act on events.
One example, both ways
A photo browser shows a “Picked” checkbox in two panels, the grid’s toolbar and the info panel, and a “Delete” button in the grid.
The wrong way: each panel keeps its own field, copies it into the store every frame, and the delete is a flag.
use egui_pop::core::lock;
use egui_pop::egui;
use egui_pop::model::panels::{Area, PanelSpec};
use egui_pop::model::values::{Change, Set, Value};
use egui_pop::prelude::*;
const GRID: PanelId = PanelId::from_static("photos.grid");
const PICKED: &str = "photos/picked";
const DELETE_ASKED: &str = "photos/delete_asked";
struct Photos;
impl Plugin for Photos {
fn id(&self) -> PluginId {
PluginId::from_static("photos")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
let mut picked = false;
ctx.panel(PanelSpec::new(GRID, "Grid", Area::Center), move |ui, app| {
ui.checkbox(&mut picked, "Picked");
let store = app.store();
let mut s = lock(&store);
// Written every frame: the info panel does the same and the last
// drawn wins, so a click in one panel is undone by the other.
let _ = s.set(Set::new(PICKED, Change::To(Value::Bool(picked)), Origin::User));
if ui.button("Delete").clicked() {
// A flag: lost if the panel that reads it is closed, read
// twice if two panels act on it.
let _ = s.set(Set::new(DELETE_ASKED, Change::To(Value::Bool(true)), Origin::User));
}
})?;
Ok(())
}
}
App::builder().plugin(Photos).build(&egui::Context::default()).unwrap();
The right way: the panels bind the stored value, and the delete is a command, with a step others may veto.
use egui_pop::core::{binding, lock};
use egui_pop::egui;
use egui_pop::model::panels::{Area, PanelSpec};
use egui_pop::prelude::*;
const GRID: PanelId = PanelId::from_static("photos.grid");
const INFO: PanelId = PanelId::from_static("photos.info");
const PICKED: &str = "photos/picked";
const DELETE: CommandId = CommandId::from_static("photos.delete");
const REMOVE: StepId = StepId::from_static("photos.remove");
struct Photos;
impl Plugin for Photos {
fn id(&self) -> PluginId {
PluginId::from_static("photos")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
// The state: one path in the store, declared once.
lock(&ctx.app().store())
.declare(ctx.owner(), PICKED, Descriptor::bool("Picked", false))
.map_err(|e| PluginError::Failed(e.to_string()))?;
// The event: a command, which runs a step others may veto.
ctx.step(StepSpec::new(REMOVE, "Removes a photo."))?;
ctx.command(CommandSpec::new(DELETE, "Delete", "Photos"), |call| {
let out = call.app.step(&REMOVE, call.args.clone(), |_, args| {
// Remove the photo named in `args`.
Ok(args.clone())
});
match out.vetoed() {
Some(reason) => Err(reason.to_string()),
None => Ok(serde_json::Value::Null),
}
})?;
// The same in both panels.
ctx.panel(PanelSpec::new(GRID, "Grid", Area::Center), picked)?;
ctx.panel(PanelSpec::new(INFO, "Info", Area::EndSide), picked)?;
Ok(())
}
}
/// Reads the store every frame, writes it only on a click.
fn picked(ui: &mut egui::Ui, app: &AppHandle) {
binding::edit(ui, Binding::bound(&app.store(), PICKED), |ui, v: &mut bool| {
ui.checkbox(v, "Picked")
});
if ui.button("Delete").clicked() {
// Queued: runs once, before the next frame.
app.run(DELETE, serde_json::json!({ "photo": "current" }));
}
}
// Another plugin refuses to delete a locked photo, without a flag of its own.
struct Locks;
impl Plugin for Locks {
fn id(&self) -> PluginId {
PluginId::from_static("locks")
}
fn requires(&self) -> Vec<PluginId> {
vec![PluginId::from_static("photos")]
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.before(REMOVE, |_, args| {
if args["locked"] == true { Before::Veto("the photo is locked".into()) } else { Before::Go }
});
Ok(())
}
}
let mut app = App::builder().plugin(Photos).plugin(Locks).build(&egui::Context::default()).unwrap();
let out = app.run(&DELETE, serde_json::json!({ "photo": "a" }), Origin::User);
assert_eq!(out.now(), Some(Ok(serde_json::Value::Null)));
let out = app.run(&DELETE, serde_json::json!({ "photo": "b", "locked": true }), Origin::User);
assert_eq!(out.now(), Some(Err("the photo is locked".to_string())));
Both panels now show the same value, a click in either one is the
only write, and it is one undo step with an origin. The delete runs
exactly once per click, whichever panels are open; a plugin that must
refuse it (the photo is locked) adds a before-hook on the step instead
of a flag of its own (Locks above), the key, the menu and agents reach the same
command, and the journal says it happened.
Who writes a value
A value has one writer, its owner, unless the owner names others
(ADR 0016). A plugin writes as
itself while it connects, in its command handlers and in its lifecycle
hooks, and through Ctx::writer anywhere else; a write to a value it
may not write is refused, with a not-a-writer diagnostic. The person
is not limited: the settings form, bound widgets and agents write as
the framework, which writes any value. Undo, redo and restoring saved
values are never refused.
use egui_pop::core::lock;
use egui_pop::egui;
use egui_pop::model::ids::OwnerId;
use egui_pop::model::values::{Change, Refused, Set, Value};
use egui_pop::prelude::*;
const SIZE: SettingId = SettingId::from_static("thumbs.size");
const SELECTED: &str = "thumbs/selected";
const FIRST: CommandId = CommandId::from_static("viewer.first");
struct Thumbs;
impl Plugin for Thumbs {
fn id(&self) -> PluginId {
PluginId::from_static("thumbs")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
// Its owner writes it, and the settings form for the person.
ctx.setting(SIZE, Descriptor::int("Size", 64, 512, 128))?;
// The viewer may move the selection too.
let viewer = OwnerId::new("viewer").expect("an id");
lock(&ctx.app().store())
.declare(
ctx.owner(),
SELECTED,
Descriptor::int("Selected", 0, 1000, 0).writers(&[viewer]),
)
.map_err(|e| PluginError::Failed(e.to_string()))?;
Ok(())
}
}
struct Viewer;
impl Plugin for Viewer {
fn id(&self) -> PluginId {
PluginId::from_static("viewer")
}
fn requires(&self) -> Vec<PluginId> {
vec![PluginId::from_static("thumbs")]
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.command(CommandSpec::new(FIRST, "First photo", "Viewer"), |call| {
let store = call.app.store();
let mut s = lock(&store);
// Its command writes as the viewer: the selection, yes.
let to = |v| Set::new(SELECTED, Change::To(Value::Int(v)), call.origin.clone());
s.set(to(0)).map_err(|e| e.to_string())?;
// The thumbnails' size, no.
let size = Set::new("settings/thumbs.size", Change::To(Value::Int(512)), call.origin.clone());
assert!(matches!(s.set(size), Err(Refused::NotWriter { .. })));
Ok(serde_json::Value::Null)
})?;
Ok(())
}
}
let mut app = App::builder().plugin(Thumbs).plugin(Viewer).build(&egui::Context::default()).unwrap();
let out = app.run(&FIRST, serde_json::Value::Null, Origin::User);
assert_eq!(out.now(), Some(Ok(serde_json::Value::Null)));
A plugin written before the check migrates under
AppBuilder::writer_check(WriterCheck::Warn): its writes go through
and each one it should declare is in the diagnostics. A test of a
plugin set ends with egui_pop_test::assert_writes_declared(&app).
See also
- Plugins, commands and steps: commands, hooks, steps.
- The context stack: places, modes, kernel state and view state.
- Linked panels: a selection driving a preview in another panel.
- ADR 0009 (binding a value), ADR 0011 (steps) and ADR 0016 (one writer per value).
- The “state versus events” question is also settled, for its own primitives, in egui_mobius’s book.
Linked panels
A selection in one view drives a preview in another panel: a list and its details, a grid and a loupe, a graph and its parameters. egui-pop has no global “the selection”. Several independent selections coexist, each one a value under a path the application names, because only the application knows what a selection means.
| Who | Owns |
|---|---|
| egui-pop | How a view says what is selected, how a value reaches another panel, what happens when a panel moves, closes or is detached, the slow load’s worker |
| The application | The path, the value’s form (a name, an id, a list), which view writes it, what a preview shows |
The linked-panels page of the gallery is this recipe
running, and its test covers each case below.
The recipe
- The application declares one value per selection.
- The source view writes it, after drawing, when the view’s selection
differs from what it last wrote. It writes with
untracked(): a selection is not an undo step. It asks for a repaint, since the panel may have been drawn earlier in the frame. - The following panel reads the value in
ui().
use egui_pop::api::ValueWriter;
use egui_pop::core::latest::{Latest, Loaded};
use egui_pop::core::lock;
use egui_pop::egui;
use egui_pop::model::panels::{Area, PanelSpec};
use egui_pop::model::values::{Change, Set, Value};
use egui_pop::prelude::*;
use egui_pop::views::ViewsPlugin;
use egui_pop::views::list::{ListRows, ListState, ListView};
const PREVIEW: PanelId = PanelId::from_static("album.preview");
const SELECTED: &str = "album/selected";
const VIEWS: PluginId = egui_pop::views::steps::VIEWS;
struct Photos(Vec<String>);
impl ListRows<String> for Photos {
fn len(&self) -> usize {
self.0.len()
}
fn key(&self, row: usize) -> String {
self.0[row].clone()
}
fn label(&self, row: usize) -> String {
self.0[row].clone()
}
}
struct Album;
impl Plugin for Album {
fn id(&self) -> PluginId {
PluginId::from_static("album")
}
fn requires(&self) -> Vec<PluginId> {
vec![VIEWS]
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
lock(&ctx.app().store())
.declare(ctx.owner(), SELECTED, Descriptor::text("The photo selected", ""))
.map_err(|e| PluginError::Failed(e.to_string()))?;
let writer = ctx.writer();
let mut state = ListState::new();
let mut rows = Photos(vec!["a.raw".into(), "b.raw".into()]);
let mut written = String::new();
ctx.story(Story::new(StoryId::from_static("album"), "Album", move |ui, app| {
list(ui, app, &writer, &mut state, &mut rows, &mut written)
}))?;
let mut latest = Latest::new();
ctx.panel(
PanelSpec::new(PREVIEW, "Preview", Area::EndSide),
move |ui, app| preview(ui, app, &mut latest),
)?;
Ok(())
}
}
fn list(
ui: &mut egui::Ui,
app: &AppHandle,
writer: &ValueWriter,
state: &mut ListState<String>,
rows: &mut Photos,
written: &mut String,
) {
let _ = ListView::new("album.photos").label("Photos").app(app).show(ui, state, rows);
// After drawing, from the state: the list also loses rows that are gone.
let now = state.selection().keys().first().cloned().unwrap_or_default();
if now != *written {
let write = Set::new(SELECTED, Change::To(Value::Text(now.clone())), Origin::User);
let _ = writer.set(write.untracked());
*written = now;
ui.ctx().request_repaint();
}
}
fn preview(ui: &mut egui::Ui, app: &AppHandle, latest: &mut Latest<String, String>) {
let photo = lock(&app.store())
.get(SELECTED)
.and_then(|e| e.value.as_text())
.unwrap_or_default()
.to_string();
let key = (!photo.is_empty()).then_some(&photo);
let shown = latest.want(ui.ctx(), key, |name, _cancel| format!("The preview of {name}"));
match shown {
Loaded::Nothing => ui.weak("Nothing selected."),
Loaded::Loading { .. } => ui.weak("Loading…"),
Loaded::Ready(text) => ui.label(text.as_str()),
Loaded::Failed(reason) => ui.label(reason),
};
}
App::builder()
.plugin(ViewsPlugin)
.plugin(Album)
.build(&egui::Context::default())
.unwrap();
For a selection that also moves from elsewhere (another panel, an
agent), the source view reads the value before drawing and, when it
differs from what it last wrote, calls set_selection: the page in the
gallery does both. Several plugins writing one value need the owner to
name them (who writes a value).
Why compare in ui() here
State or event says to react to a value with
Ctx::on_change rather than by comparing with last frame’s value. A
preview is the exception, on purpose: a listener runs whether the panel
is shown or not, so it would compute for a hidden panel; a comparison
in ui() runs only when the panel is drawn. Use on_change for what
must happen even with no panel on screen.
When panels move
Nothing is needed from the application, because the panel holds no copy of the selection: it reads the value when drawn.
| The panel is | What happens |
|---|---|
| Moved to another area | Its ui() runs from there; nothing changes |
| Detached into a window | Its ui() runs in that window’s pass; Latest wakes the window drawing it; a page’s request_repaint reaches it too, the window being an immediate viewport of the main one |
| Hidden behind another tab, closed | Its ui() does not run, so nothing is read or computed |
| Shown again | It reads the current value, and loads that alone |
A load running when its panel closes goes on to its end, since nothing
tells it: ui() is what notices. If the same key is still selected
when the panel comes back, it shows that result without a second load.
Which views say what
| View | Where its selection lives | How it says it changed | How another panel reads it |
|---|---|---|---|
ListView | ListState (the application’s) | list.select step, Signal::Select | state.selection(), or the value the application writes |
DataTable | TableState (the application’s) | table.select step, Signal::Select | the same |
TreeView | TreeState (the application’s) | tree.select step, Signal::Select | the same; pending_selection for what waits for nodes to load |
ThumbGrid, filmstrip | LibraryState (the application’s) | library.select step, Signal::Select | the same, or from any plugin Libraries::selection(id) and Libraries::cursor(id) (the LIBRARIES service) |
GraphEditor | GraphState (the application’s) | GraphEvent::Selection; on the journal graph.selection_changed when drawn through imaging::show_graph | state.selection, or the value the application writes |
FilePicker | The picker’s highlight and selected | Nothing: no step, no signal | Its own highlighted() and selected; held by the Files service, Files::highlighted(id) |
Thumbnail, thumbnail_grid | The caller’s variable (plain widgets) | The response’s click | The caller’s variable |
The list, the table, the tree and the library share select::Selection,
which keeps keys, not row numbers. The keyboard code (nav) holds none
of its own. A text editor’s or a terminal’s selection is a range of
text, not this.
Write from the state, not from the signals. A step and a signal mean
someone asked for a selection. Three things change a view’s selection
without either: rows that are gone leave it, set_selection runs no
step, and a tree takes a queued selection as its nodes load. A source
that writes only on Signal::Select, or from an after-hook on the step,
keeps previewing a row that was deleted. The library’s registry has
this right already: it publishes from the state, whatever changed it.
Other ways to follow, for a panel that cannot reach the source’s state:
an after-hook on the step (Ctx::after), or the journal
(AppHandle::events_since). Each sees only what ran as a step, as said
above.
Slow previews
A preview that decodes a file cannot run in the frame, and the selection moves faster than it loads. Three things go wrong by hand: a slow early load arriving after a fast later one overwrites it, one thread per row of a held arrow key, and work for a panel nobody sees.
egui_pop::core::latest::Latest handles them:
want(ctx, key, load), called each time the panel draws, startsloadon a worker only whenkeychanged, so the comparison with the last value is in it, and the panel keeps none of its own.- One load runs at a time. A key asked while one runs waits; a later
key takes its place, so it never starts. The running load is told
through
Cancel::cancelled, and its result is dropped. Loaded::Loading { previous }gives the last value, to show dimmed rather than a blank.- A load that panics gives
Loaded::Failedwith the message, and the next key loads as usual. - On the web there are no threads: the load runs in the frame that asks.
It holds one value, with no cache: keep one in load when rows are
visited again. For files, the picker’s Previews service does all of
this with providers and a cache (choosing files).
How others do it
| Practice | What it does | Here |
|---|---|---|
| List/details (Windows; also the “master-detail” of other platforms) | Selecting in the list updates the details pane; side by side or stacked by window width | Adopt the pattern: the page and the test are this |
| Qt’s shared selection model (“Sharing selections among views”) | Two views given one QItemSelectionModel show one selection; it is a third object with its own signals | Own, after it: the shared object is a value in the store, not a model class. Our views keep their own Selection, since most links are one way, to a view that shows something else altogether |
| Eclipse’s selection service | Each window tracks the selection of the active part; listeners follow the active part or one part by id | Rejected: following “whatever part is active” is the global selection this design avoids. Its listeners by part id are what a named path gives |
| VS Code’s context keys | Named keys in a global table (listFocus, listMultiSelection, your own through setContext), read by when clauses | Already here: AppHandle::set_context and when clauses, for what enables a command. A key saying a selection exists fits; the selection’s content belongs in the store |
tokio’s watch channel | Keeps only the last value; each receiver knows whether it saw it | Same idea: the store’s last value is the truth, and Latest is the receiver for a load |
| poll-promise (MIT or Apache 2.0) | A result polled each frame, made for immediate mode | Own instead of wrap: it holds one result per promise and documents neither cancelling nor replacing one, so the latest-wins part, the single worker and the panic’s message would be ours anyway, for a dependency |
See also
- State or event: which mechanism for which need.
- Lists and tables, the tree, the photo library, node graph editor and choosing files: each view’s steps.
- The workbench: areas, tabs and detached windows.
Late values and latest-wins loads
Two parts of the family “Values and binding” (ADR 0027) for values that arrive after asynchronous work: how a cell shows one while it comes, and how a panel following a selection loads only what is still wanted.
| Module | What it does |
|---|---|
egui_pop_core::late | A cell for a value that arrives late, in four states, keeping its size |
egui_pop_core::latest | A slow load following a key: the latest asked wins, one load at a time |
Owns: the four states of a late value and their drawing, the latest-wins loading of one value per key.
Refuses: running the work (the application does, on its thread or through the read kernel); reactive signals or a general state library.
Late values
A Late<T> says where the value stands; a LateValue draws it:
- pending: a skeleton line, or a delayed spinner (
Waiting::Spinner), in a box sized like the expected value (LateValue::sample,LateValue::size), so nothing moves when the value lands; - fresh: the value, as text in a
TextRoleor drawn by a closure (LateValue::show_with); - refreshing: the last value, a small spinner beside it;
- failed: an error icon, the reason and a Retry button.
use egui_pop_core::late::{Late, LateValue};
fn ui(ui: &mut egui::Ui, free: &Late<String>) {
let cell = LateValue::new("Free space", free.clone())
.sample("000.0 GB")
.show(ui);
if cell.retry {
// Run the work again.
}
}
The cell keeps the spinner’s room in every state, so its size is the
same pending, fresh and refreshing. Retry is the application’s to act
on (LateResponse::retry); the cell never runs the work itself.
LateValue::since gives when the work started, so a delayed spinner
waits from then rather than from the first draw.
Latest-wins loads
A panel previewing what is selected elsewhere asks for the current key
each time it draws (Latest::want). A key that changed starts a load on
a worker thread; a load asked before it and not started yet is dropped,
one running is told through its Cancel and its result is dropped. One
load runs at a time, so going down a list with an arrow key does not
start one thread per row.
use egui_pop_core::latest::{Latest, Loaded};
fn preview(ui: &mut egui::Ui, latest: &mut Latest<String, String>, selected: Option<&String>) {
let shown = latest.want(ui.ctx(), selected, |key, cancel| {
// On a worker thread; a long load looks at `cancel` now and then.
if cancel.cancelled() {
return String::new();
}
format!("the preview of {key}")
});
match shown {
Loaded::Nothing => ui.weak("Nothing selected."),
Loaded::Loading { .. } => ui.weak("Loading…"),
Loaded::Ready(text) => ui.label(text.as_str()),
Loaded::Failed(reason) => ui.label(reason),
};
}
Nothing runs behind a hidden panel: only want starts a load. A load
running when the panel closes goes on to its end, and the panel keeps
its result if the key is still the one selected when it comes back.
Linked panels shows it in a recipe.
States and failure
- A late value’s states mirror the read kernel’s (
Pending,Fresh,Refreshing,Failed), with one difference:Late::Failedholds the reason only, where a failed read also keeps the value before it.Late::mapandLate::as_refkeep the state while changing the value. - A latest-wins load that panics is
Loaded::Failedwith the reason; the next key asked starts afresh. - On the web there are no threads: the load runs in the frame that asks for it.
Accessibility
A late value’s accessible node is a status named after the value (“Free
space”); its value says the state (the value, “Loading”, the error), and
it is busy while the work runs. Retry is named after the value. A
latest-wins load draws nothing itself: the panel says what it shows.
Tier
From API stability: Experimental (“Values worked out
late (egui_pop_core::late, new, not yet released) and slow loads where
the latest asked wins (egui_pop_core::latest): no application has
adopted them yet”).
Tests
- Late values:
crates/egui-pop-core/tests/late.rs(the room kept from pending to fresh to refreshing, the state said to assistive technologies, the delayed spinner, Retry named and reported once). - Latest-wins loads: unit tests in
crates/egui-pop-core/src/latest.rs; the gallery’s linked panels page uses it. No frame test of its own yet.
The context stack: places and modes
The context stack says where the user is and how the application behaves right now. It is one small state machine, global to the application, owned by the application’s kernel and shown by the interface (ADR 0012). It is also the session state: what comes back, the same, when the application opens again.
use egui_pop::api::contexts::{self, ContextsPlugin, FrameSpec};
use egui_pop::api::{App, Ctx, Plugin, PluginError};
use egui_pop::model::ids::{FrameId, GroupId, PanelId, PluginId};
use egui_pop::model::panels::{Area, PanelSpec};
const ALBUM: FrameId = FrameId::from_static("photos.album");
const CULLING: FrameId = FrameId::from_static("photos.culling");
const RATINGS: PanelId = PanelId::from_static("photos.ratings");
struct Photos;
impl Plugin for Photos {
fn id(&self) -> PluginId {
PluginId::from_static("photos")
}
fn requires(&self) -> Vec<PluginId> {
vec![contexts::PLUGIN]
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.panel(PanelSpec::new(RATINGS, "Ratings", Area::EndSide).closed(), |ui, _| {
ui.label("Stars and flags");
})?;
ctx.frame(FrameSpec::place(ALBUM, "Album"))?.frame(
FrameSpec::mode(CULLING, GroupId::from_static("orientation"), "Culling")
.show(RATINGS),
)?;
Ok(())
}
}
let app = App::builder()
.plugin(ContextsPlugin::default())
.plugin(Photos)
.build(&egui_pop::egui::Context::default())
.unwrap();
let h = app.handle();
contexts::enter(h, ALBUM, egui_pop::model::serde_json::json!("holidays"));
contexts::set_mode(h, CULLING);
assert_eq!(h.context().get("place"), "photos.album");
assert_eq!(h.context().get("mode.orientation"), "photos.culling");
assert!(h.panel_visible(&RATINGS));
The gallery’s contexts page shows it: an album, a photo and a mask to
drill into, an orientation, a compare, keys and panels that follow, and
a guard that refuses.
Places or modes
| A place | A mode | |
|---|---|---|
| What it is | a drill-down: a group, a composite, a mask, a sub-workspace | a global state: an orientation, compare, read-only, a soft proof, “an agent is driving” |
| Shown as | a crumb of the breadcrumb (contexts::breadcrumb) | a chip with a way out (contexts::mode_chips), a switch (mode_switch), a toggle (mode_toggle) |
| Moves | enter (with a payload: which group, which mask), leave, jump to a level, go to a path | set_mode (sticky), push_mode (temporary), pop_mode, clear_mode |
| How many | a path from the root | one per group; groups combine |
| The projection | the place’s arrangement the first time (none declared: the enclosing place’s layout), then the layout it was left with | the panels it shows or hides, or an arrangement of its own; a layout change made in a mode is the mode’s, gone when it is left |
Back (nav.back, Alt+Left) | leaves it | a pushed mode pops (Escape too), putting back what it replaced; a set mode stays |
Use a place when the user goes somewhere and expects to come back to where they were. Use a mode when the same place should behave differently: other keys, other panels, other defaults. Use a pushed mode for a moment (compare, a tool mode with a clear way out), a set mode for an orientation that lasts. Declare a frame transient when it must never come back after a restart (an agent driving, a modal tool).
Modes are global to the stack: an orientation set at the root stays on in a sub-place. All windows of the application show the same stack.
A frame’s title (FrameSpec::place(id, "Album")) is English; crumbs,
chips and switches translate it like every other declaration, under
the key derived from its id: frame-<id>.title (photos.album gives
frame-photos-album.title). The extractor of egui-pop-i18n lists
them with the commands and panels. The root’s crumb says “Home”,
translated, unless the application names it: a text as given
(ContextsPlugin::default().root("Main")), or a string of its own
catalogue, translated each time the crumb is said (root_key).
The root’s crumb can also say what is open, a workspace or a project:
ContextsPlugin::root_label is asked each time the crumb is said,
given the translated title and the egui::Context to translate with;
None keeps the title. The breadcrumb, the status bar, context.read
(projection.crumbs), the announcement of where the user is and the
undo toast all say it, and follow when the name changes.
use egui_pop::api::contexts::ContextsPlugin;
use egui_pop::core::strings::{self, StrKey};
use std::sync::{Arc, Mutex};
const WORKSPACE: StrKey = StrKey::new("photos-workspace", "Workspace { $name }");
// The workspace open, as the application keeps it.
let open: Arc<Mutex<Option<String>>> = Arc::new(Mutex::new(None));
let name = open.clone();
let plugin = ContextsPlugin::default().root_label(move |c| {
let name = name.lock().ok()?.clone()?;
Some(strings::tr_args(c.ctx, &WORKSPACE, &[("name", &name)]))
});
Like a place’s label, it is called while the interface draws: it reads what the application keeps, never the context stack itself.
A place’s payload
A place’s crumb says its title, and its payload when the payload is a
text or a number (Album Holidays, Photo 3). A payload that is an
object (a sub-workspace, {"id": "darkroom"}) says nothing by itself:
the frame names it with FrameSpec::label, given the payload and the
translated title; None keeps the default. The breadcrumb,
context.read (projection.crumbs), the announcement of where the
user is and the undo toast all say the crumb this way.
use egui_pop::api::contexts::FrameSpec;
use egui_pop::model::ids::FrameId;
fn name_of(_: &str) -> Option<String> { None }
const SPACE: FrameId = FrameId::from_static("photos.space");
let space = FrameSpec::place(SPACE, "Workspace")
// The sub-workspace's name, read from the application's own state.
.label(|c| c.payload["id"].as_str().and_then(name_of))
// The darkroom starts from its own arrangement, the others from the
// frame's.
.arrangement_for(|p| (p["id"] == "darkroom").then(|| "Darkroom".to_string()))
.arrangement("Workspace");
The label is called while the interface draws: it reads what the
application keeps (behind an Arc it captured), never the context
stack itself.
FrameSpec::arrangement_for chooses, from the payload, the arrangement
an entry starts from; None falls back to the frame’s
arrangement. The chosen one is what the place declares for that
payload: the next section’s rules apply to it unchanged (the layout a
projection key was left with wins on later entries; the user’s choice
for the frame wins over what it declares).
The top place’s payload also sets context keys, for when clauses: a
text, a number or a boolean as payload, an object’s fields of those
kinds as payload.<field> (nested values set nothing). A key binding
for one sub-workspace only:
ctx.keybinding("K", PICK, "place == 'photos.space' && payload.id == 'darkroom'", Layer::Default)?;
Arrangements by place and mode
The current arrangement (the View menu’s switch, save and reset) is
the one of where the user is: the arranged frame, the last active
mode that declares an arrangement (FrameSpec::arrangement), else the
top place, else the root. A frame starts from the arrangement it
declares; when the user switches or saves there, the choice is that
frame’s, kept in settings/workbench.arrangement.frames (frame id to
name), and every later entry of the frame (another album, another
photo) starts from it. The root’s stays in
settings/workbench.arrangement, where it always was: a settings file
written before places had their own reads the same, its name the
root’s. Deleting an arrangement puts the frames that were on it back on
what they declare.
| Where | The current arrangement |
|---|---|
| the root | settings/workbench.arrangement |
| a place | its entry in settings/workbench.arrangement.frames, else its arrangement |
| a mode declaring an arrangement, on | the same, for the mode; it wins over the place while it is on |
A place that declares no arrangement, the first time it is entered, starts from the nearest enclosing place’s layout: as that place was left, else the arrangement it starts from, the root’s last. A photo under an album starts from the album’s layout, a place at the top level from the root’s, whichever place the user came from: opening the photo from another place does not carry that place’s layout over. With nothing remembered at all (the first start), it keeps the layout shown. Debug builds log a warning for such a place; declaring an arrangement for it says what it should look like.
arrangements::arranged_frame says which frame it is.
Kernel state and view state
The stack has an owner, and only the owner changes it:
- Kernel state (the owner’s): the places, the modes, their payloads,
the holds, a revision. Without a kernel of its own an application
uses
LocalContexts(kept byContextsPlugin), which writes the stack to thecontextdocument inside each transition, before anyone hears of it. An application with a kernel implements theContextstrait there and gives it throughHost::contexts(); it may be in another thread or process (Answer::Later). - View state (the interface’s): the workbench’s layout, the
focused panel, scroll offsets and whatever a component keeps through
contexts::view_valueandset_view_value(orcontexts::scroll_area), each kept per projection key (the place path and the active modes). It never reaches the kernel; it is written to theviewdocument about a second after it changes. Values kept per place rather than per projection key (contexts::place_value,set_place_value: the place’s frame id,rootat the root, whatever its payload and the modes) go into the same document; the status bar’s choices are kept so. The layout kept and put in is the main window’s part only (its areas, detached and floating panels): a switch leaves the panels docked in other application windows where they are, and coming back to a place does not put those windows back as they were when it was left.
The interface reads and asks; it never writes the stack. Each
transition is the step context.request: a before-hook stops it (the
interface’s own guards: unsaved typed input, a drag of a tab) or
redirects it, the default asks the owner. The owner’s guards
(FrameSpec::can_enter, can_leave) refuse or redirect (a deleted
place lands on its parent), and holds (contexts::hold, a drag, a
batch, an agent holding the image) refuse whatever touches their group
with their reason. The display changes only when the owner’s revision
moves, so a refusal leaves it as it was; the user sees why in a toast,
an agent in the answer.
Nothing waits for the exit: the stack is written at each transition,
the view state, the layout, the settings and the keymap a second after
they change (the debounced writer of egui_pop_core::persist). A crash
loses at most that second; a vetoed exit loses nothing.
The context and view documents sit beside the layout’s, as the
host names it (Host::layout_document): a host keeping a layout per
workspace (workspaces/photos/layout) keeps a stack and a view per
workspace too (workspaces/photos/context, .../view;
contexts::documents). When the host opens another workspace in the
same window, contexts::reload reads them again.
At start the saved stack comes back against today’s frames: an
unknown or transient frame, or a place whose payload is gone
(ContextsPlugin::valid), is dropped, a place with the places under
it; a toast says what did not come back.
How a plugin reacts
Nobody polls a global. Everything keys on the context keys the
projection sets, in when clauses (how the stack sits beside the value
store, commands and steps: State or event):
| Key | Value |
|---|---|
place | the top place’s id, root at the root |
placeDepth | how many places deep |
mode.<group> | the mode on in the group, empty when none |
modePushed | whether a pushed mode is on |
payload, payload.<field> | the top place’s payload: a text, a number or a boolean, or an object’s fields of those kinds |
| a frame’s own keys | FrameSpec::key, while the frame is on |
- Commands, menus, toolboxes:
when: "mode.orientation == 'photos.culling'". - Keys:
Ctx::frame_keybinding(&culling, "P", PICK)binds keys in the frame’s own layer, through its clause; the same key can do something else in another mode of the same group without a conflict. Two frames that can be on together (a place and a mode, modes of two groups) binding the same keys clash: while both are on, one never fires.contexts::frame_clasheslists them, the keymap check ofegui-pop-test(keymap_problems) and thecontextscollector say them, and each is a diagnostic at start (context-frame-key-clash). - Panels:
FrameSpec::showandhidefor a mode, an arrangement for a place or a mode; or a panel reads the keys and draws differently. - Events: the journal says
context.changed(with the whole new state and its revision), thencontext.leftandcontext.enteredper frame,context.refusedwith the reason,context.restored,context.heldandcontext.released. A plugin that must act on one frame readscontext.entered. - Undo: each step of a history carries the place it was made in
(
StepInfo::place, ADR 0014): the stack tells the value store where new steps are made (Store::set_place), and a host owning its own histories fills it the same way. An undo, a redo or a jump in the history panel that walks a change made out of sight says where in a toast (“Undone in Photo 3”), with “Go there”; a component’s local history (the theme editor, the settings window) is undone where it is shown and says nothing. See History.
The stack’s own keys (place, placeDepth, modePushed,
mode.<group>, payload, payload.<field>) are the projection’s alone: a plugin setting one by
hand (AppHandle::set_context) makes two truths, and the projection
overwrites it at the next transition. Each such write is reported: a
diagnostic the first time per key (context-key-by-hand), and the
contexts collector’s warnings (hand_writes: the key, the value,
how many times, the command running and its plugin).
Agents use the same path as the user: context.read (which also
gives what the status bar shows, in status),
context.request (any transition, with if_rev and dry_run),
context.go, context.set_mode, context.hold and context.release;
the contexts collector of the debug bridge shows the state, the
holds, the projection and the last context events.
History: undo, redo, the history panel
egui-pop’s undo is the kernel’s: the application’s owner keeps its
histories, egui-pop routes the keys to them and shows them. The decision
and its reasons are ADR 0014; this page is how to
use it. Everything below is egui_pop::api::history (the contract, the
routing), egui_pop::api::history_view (the panel, the agents’
commands) and egui_pop::model::history (scopes, steps, lines, no
egui).
The model
- The owner implements
History: its scopes (one history each: a document’s edit, a collection’s marks, the application’s values), their steps, and the requestsundo,redo,jump,groupandclose; and, when it supports them, snapshots, the hover preview, undoing one step out of order and the replaced steps (below: Beyond undo and redo). The host gives it (Host::history); without one, egui-pop’sStoreHistoryanswers over the value store’s application history (APP), capped at 500 steps. - A step says what it is, not how to undo it (
StepInfo): its id, scope, label (a message id and its arguments, shown in the interface’s language), origin (the user, an agent, a script, another process), group, the place of the context stack it was made in, its time, and whether it is still in progress. The inverse stays with the owner. - Local scopes are a component’s own history, kept in the
interface: the theme editor’s draft, the settings window’s values.
A component registers one for its focus surface
(
Ctx::local_scope). - Redo is linear: a new step drops the redo list of its scope.
- A group makes the writes of one action one step:
AppHandle::group(origin, label, |g| ...), orCall::group(label, |g| ...)in a command, ends the group when the closure returnsOkand cancels it (every write put back) on an error or a panic. It opens through the host (Host::begin_group); inside a command, while the host dispatches, throughHost::groups, which a host keeping its own history gives so that a command’s groups reach it.
Which history Ctrl+Z undoes
Innermost first:
- a focused text field keeps its own undo;
- a focused surface with a local scope undoes there;
- otherwise, by the routing the application sets
(
history::set_routing):Routing::Newest(the default): the newest step among the owner’s scopes active in the window (those whose focus targets are drawn; a scope without any is always active). Redo goes back to the scope last undone. For an application with one document.Routing::Focus: the scope of the focused view (a surface or panel a scope lists among its focus targets, or one that declared its history withCtx::history_target). With no view focused (the menu bar, an empty spot, a panel naming no history), the scope of the view focused last in that window, shown or not, as long as the owner still has it. With no view focused yet (at start-up), Ctrl+Z does nothing: a toast and the screen reader say “Nothing to undo here: click a view first”, andhistory.refusedis published with the kindnothing_focused. It never falls back to the newest step of another scope: that step may be on another plane (the layout, a plugin’s values) than the one the user has in mind. Redo goes to the same scope.
The scope picked goes through the pop.history.target step
({ "scope", "redo", "rule" }, rule one of focus, last_focused,
none or newest): a before-hook may name another scope, for
instance a default for none. The History panel’s rows and an agent
naming a scope (edit.undo with scope) undo there, whatever the
focus.
A focus target (ScopeInfo::focus) is a surface’s name or a panel’s id.
A panel kind declared with several instances names each of them too: a
scope focused on app.gallery is active while app.gallery#2 is drawn,
and Ctrl+Z goes to it while that instance has the focus (under
Routing::Focus). A target naming one instance (app.gallery#2) names
that one only.
Undo, redo and jump are steps (edit.undo, edit.redo, edit.jump):
a before-hook may veto one or name another scope, and a gesture still
going in the scope refuses them. Each answer is published on the
journal: history.changed (the scope, its revision and head) or
history.refused (the scope, the kind and the reason).
Changes made outside a history
A value can change outside the history that will undo it: a write that
is not a step (state the application keeps, a settings file read back
with Store::import), a step in another history (the settings
window’s), a step dropped with the plugin that owned one of its values
(ADR 0028). The value store keeps that change:
- an undo, a redo or a jump writes a value back only when it is still
what the step left (for a redo: what the step found). A value changed
since keeps the outside change and is skipped: the answer names it
(
skipped, with the paths) and so doeshistory.changed; - undoing one step out of order skips the same way, and is refused when every value it changed was changed outside since;
- a group or a gesture cancelled puts back only the values still as it
left them. A value changed meanwhile keeps that change, and the first
step made on it since then starts from the value before the group, so
undoing it comes back there. The next pass publishes
history.changedwith the skipped paths; - a group or a gesture’s step goes before the steps made after its first write, not after them: undoing everything comes back to where it began.
An agent’s request is a step like the user’s (named by its origin), so
it is never skipped: Ctrl+Z takes the newest step back, whoever made
it. A request read before such a step is refused as stale (if_rev).
An agent walks the history as its own writer: undo, redo, jump, undo
this step and restore are refused (dry runs too) when a value they
would write is not one the agent may write. Store::take_skipped lists
what was skipped for code that walks the store directly.
Undone out of sight: “Go there”
With the context stack (ContextsPlugin, contexts.md),
the stack tells the value store where new steps are made
(Store::set_place), so each of its steps carries its place. An undo,
a redo or a jump that walks a step made in another place than the one
shown says so in a toast, “Undone in Photo 3”, with Go there, which
goes back to that place. A host owning its own histories fills
StepInfo::place the same way and gets the same toast. A local scope
is undone where it is shown, and says nothing.
The history panel
HistoryPlugin brings the History panel (PANEL_HISTORY, in the end
side bar, closed until asked for: its egui_pop.history.toggle
command, or AppHandle::set_panel_visible); history_view::show(ui, app) draws the same list anywhere.
- With several scopes, chips pick the one shown; until one is picked, the panel shows where Ctrl+Z goes.
- A Start row comes first: the state before the first step.
- Then the steps, oldest first. The head is the selected row; the steps a redo would make again are muted under it.
- A step made by an agent, a script or another process names its origin after its label: “Radius (agent:helper)”.
- A click on a row brings the scope there: undos or redos, all or
nothing, through
edit.jump, so a hook can veto it as it vetoes an undo. - Hovering a row previews the state there (when the owner answers): the tooltip lists what differs, “Exposure: 0.30 EV (now 1.20 EV)”.
- The owner’s snapshots come first, under a “Take a snapshot” button; a click on one restores it, its context menu restores or deletes it.
- A step’s context menu has Undo this step, when the owner allows it; a refusal says why in a toast.
- With replaced steps, a Show replaced steps toggle lists them, muted and marked “(replaced)”, under the step their line left from; a click goes back to one.
use egui_pop::api::App;
use egui_pop::api::history_view::HistoryPlugin;
let app = App::builder()
.plugin(HistoryPlugin::default())
.build(&egui_pop::egui::Context::default())
.unwrap();
HistoryPlugin::default().without_panel() keeps the commands only, for
an application drawing the list in a place of its own.
For agents: history.*
The commands run through the same steps as the keys, so a hook vetoing an undo vetoes an agent’s too. They are kept out of the command palette (Edit > Undo and Redo are there).
| Command | Arguments | Answer |
|---|---|---|
history.list | none | Every scope (id, title, local, durable, cap), whether it is active, its revision, head and counts; where Undo and Redo go and what they would do. |
history.read | scope | The scope’s undo steps (oldest first) and redo steps (the next one last), each with its text in the interface’s language; rev and head; its snapshots, its replaced steps (each with the step it came after) and the features its owner supports. |
history.undo, history.redo | scope, if_rev, dry_run | The steps walked, the scope’s new rev and head. |
history.jump | scope, to (a step’s id, 0: the start, or a replaced step), if_rev, dry_run | The steps walked, in the order walked. |
history.snapshot | scope, name (none: “Snapshot 3”), if_rev, dry_run | The snapshot taken (id, name, the head it was taken at, origin, time). |
history.restore | scope, snapshot, if_rev, dry_run | The step made, the scope’s new rev and head. |
history.drop_snapshot | scope, snapshot, if_rev, dry_run | The snapshot deleted. |
history.undo_step | scope, step, if_rev, dry_run | The step undone; refused with the reason when a later step changed the same values. |
- Without
scope, a command goes where the keys go. if_rev: refused (stale) unless the scope’s revision is still that one; read it fromhistory.readfirst.dry_run: checked and answered, nothing changed and nothing published.
From code, history::ask(app, Walk::Undo, Some(&scope), if_rev, dry_run, &origin) is the same request (Walk::Restore and
Walk::UndoStep too).
The debug bridge’s history collector shows the scopes and where the
keys go; the runs are in the steps collector.
Beyond undo and redo
Each of these is a request of History with a default, so an owner
that implements none of them keeps working unchanged: the panel offers
only what History::features says the scope supports.
- Snapshots: named states pinned in a scope, never dropped by the
cap.
snapshotslists them;snapshottakes one (refused asunsupportedby default),restorebrings the scope back to one as a new step (edit.restore, vetoable like an undo, so an undo takes the restore back),forgetdeletes one. Taking or deleting one is published ashistory.snapshot_takenorhistory.snapshot_deleted. An owner whose history is saved may keep a snapshot only at its next save (an image editor pins it to the version that save writes): until then it setsSnapshot::pending, and the panel shows the name with “(not saved yet)”, its tooltip saying it is lost if the application quits first. - The hover preview:
preview(scope, Some(at))while the pointer is on a row (At::Step, 0 the start, orAt::Snapshot),preview(scope, None)when it leaves (or the panel is no longer drawn), asked once per row. The panel ends the preview right after drawing its rows in the pass the pointer leaves them, and a pointer resting on a row asks for no repaint: the window idles. The owner may show the state in its own views (Preview::shown: the image as it was) and list what differs (Preview::changes), which the tooltip shows. Nothing is committed. The default answersNone: no preview, the panel shows its hint only. - Undo this step:
undo_stepundoes one step out of order (edit.undo_step), or refuses with a reason. VS Code’s rule: refused when a later step changed one of the same values (history::may_undo_out_of_orderchecks it for an owner). - Replaced steps: redo lists a new step dropped, kept by an owner
whose history keeps every state;
replacedlists them, each with the step its line left from, andjumpreaches them. Hidden behind the panel’s toggle.
StoreHistory, the default owner, supports all four over the value
store:
- a snapshot pins the value of every path the scope’s steps touched (a path first changed after it is pinned at the value it had); restoring writes them back as one step, “Restore “Before the agent””;
- the preview lists the values that differ at the point, with their labels, units and precision; it shows nothing itself;
- undoing the newest step is an undo; an older one is undone by a new step, “Undo “set doc/n””, writing back the values it found;
- the redo list a new step drops is kept as a replaced line (as many steps as the cap); a jump to one of its steps goes back to where it left, then along it, and the line left becomes a replaced one in its place. A line that left from a step itself replaced is reached after going to that line first.
Not yet
- Undo across processes is the owner’s: it refuses with a reason, and
the interface shows it. A host owning its histories has no field yet
to report skipped values in its answer (
Walked); the value store’s are published. - Comparing two states side by side (a snapshot against now) is the owner’s view; the panel has no compare toggle yet.
- Agents have no command for the preview: it follows the pointer.
The gallery’s history page shows the list beside values bound to the
store, with a change made and a snapshot taken as an agent; every
feature above runs there over the default owner.
The shared selection
In an application showing the same things in several panels (a scene
tree, a list, a 3D view, a timeline), selecting or hovering a thing in
one should show it in all of them. egui-pop’s views keep a selection of
their own (the tree’s cursor and selected nodes, a list’s rows); the
shared selection is one selection for the whole application, which
widgets opt into. Everything below is egui_pop::api::selection, and
shared on the tree and the list in egui_pop::views.
The model
-
The service:
SelectionService, under theSELECTIONtoken, provided bySelectionPlugin. It holds the selected items, in the order selected, the one item hovered, the anchor of a range, and the past selections. It is thread-safe: a worker may select too. -
Items are
SelectionItems: a string id the application chooses, the same in every widget showing the thing: a path (world/points/a),kind:id, a number. A string rather than a typed key, because widgets with different key types (a tree by path, a table by row id, a canvas by entity) meet on it, and it goes through the journal, the history and the agents’ commands as it is.SelectionItem::from_keymakes one from a view’s key: a string key as it is, any other key its JSON text. -
Gestures (
Gesture,Gesture::of(modifiers)):Gesture Click Does Replaceplain selects the item alone ToggleCtrl (Cmd on macOS) adds the item, or removes it RangeShift selects from the anchor to the item, in the widget’s order, and only that AddRangeCtrl+Shift adds that range SelectionService::click(item, gesture, order, source)applies one;orderis the widget’s items as shown (empty when it has no order: a range then selects the item alone, as it does when the anchor is not in that order).set,add,remove,toggle,apply(add and remove as one change) andclearare there for the rest. -
Hover: one item at most. A widget says what it hovers every pass it is drawn (
hover(source, Some(item)), orNone): itsNoneclears a hover it said, never another widget’s, and a hover no widget repeats goes after a pass (a widget no longer drawn). An agent’s hover (selection.hover) stays until changed. -
Changes: each change of the items bumps
revision()(the hover hashover_revision()), and every change calls the subscribers (subscribe(f),unsubscribe) with aChange: the items, the hovered one, the revision, whether the items changed, and who made it (the widget’s id,command,history). Once a pass the plugin publishesselection.changedon the journal and sets the context keys.
Context keys
| Key | Value |
|---|---|
hasSelection | true when something is selected, else false |
selectionCount | how many items are selected |
selectionCanBack | selection.back has a selection to go back to |
selectionCanForward | selection.forward has one to go to |
A command acting on the selection says .when("hasSelection").
History: back and forward
Every change of the items keeps the selection before (100 at most).
selection.back selects it again, selection.forward comes back;
a new selection after going back drops what was ahead, as a browser
does. Selecting is not editing: the undo history does not see it, and
Ctrl+Z does not undo a selection.
The keys are Alt+Left and Alt+Right, bound on the selection’s
focus surface (SURFACE, selection): they work while the focus is in
a widget bound to the selection, and only when there is somewhere to go
(selectionCanBack, selectionCanForward). Elsewhere the keys stay
what they were: the context stack’s nav.back (Alt+Left, outside a
modal), the file picker’s back and forward (in its modal), the viewer’s
back and forward (on its surface). A surface binding outranks a global
one while its surface has the focus, so the keymap reports no conflict.
Binding a widget
The tree and the list bind with shared:
use egui_pop::api::selection::SELECTION;
use egui_pop::views::tree::TreeView;
let selection = app.service(&SELECTION).expect("SelectionPlugin");
TreeView::new("scene")
.app(app)
.shared(&selection)
.show(ui, &mut state.tree, &scene);
- Their rows show selected and hovered when they are so anywhere.
- What they select still runs through their step (
tree.select,list.select, which a plugin may veto or redirect), then goes to the service: a plain click or keyboard move replaces the whole selection; with Ctrl held, only the view’s own items change and the others’ stay. - A view keeps its own selection as a mirror of the shared one, limited
to its items, so its cursor, anchor (Shift ranges in its own order)
and keyboard work as before.
TreeState::selectionandListState::selectionread the mirror. - A row’s item is
TreeSource::item(key)orListRows::item(row), by defaultSelectionItem::from_keyof its key. Give the id the other widgets use: a list keyed by row number names its entity’s path. - The view is drawn inside the selection’s focus surface, where Alt+Left and Alt+Right walk the history.
A widget of the application’s (a canvas, a viewport) uses the service
directly: contains and is_hovered to draw, hover every pass,
click on a click, and selection::surface(ui, ...) around it for the
history’s keys.
use egui_pop::api::selection::{self, Gesture};
selection::surface(ui, |ui| {
let (rect, response) = ui.allocate_exact_size(size, egui::Sense::click());
let under = entity_at(response.hover_pos());
service.hover("scene.view", under.as_ref());
if response.clicked() && let Some(item) = &under {
let gesture = Gesture::of(ui.input(|i| i.modifiers));
service.click(item, gesture, &[], "scene.view");
}
// Paint each entity, selected when `service.contains(item)`, ringed
// when `service.is_hovered(item)`.
});
The gallery’s Shared selection page shows a tree, a list and a canvas sharing one selection.
For agents: selection.*
The selection collector shows the items (ids, in the order selected),
their count, the item hovered and by which widget, the anchor, the
revision, who made the last change, and how many selections back and
forward go to.
| Command | Arguments | Answer |
|---|---|---|
selection.set | items (ids) | Selects them, and only them: changed, items, count. |
selection.add | items | Adds them. |
selection.clear | none | Selects nothing. |
selection.hover | item (an id, or null) | Hovers it everywhere until a widget or another call hovers something else: hovered. |
selection.back, selection.forward | none | The selection before or after; refused when there is none (selectionCanBack, selectionCanForward). |
set, add, clear and hover are kept out of the command palette;
Back and Forward are there.
Not included
- Undoing a selection: back and forward are its history.
- A selection per window or per document: there is one per application. Several would be several services, a later change.
- Views other than the tree and the list (the table, the library’s grid) do not bind yet.
The clipboard
egui-pop copies and pastes typed content, not only text: a colour, a
set of nodes, a theme token, an application’s own types. The decision
and its reasons are ADR 0015; this page is how
to use it. Everything below is egui_pop::api::clipboard (the
contract, the plugin) and egui_pop::model::clipboard (formats, items,
negotiation, no egui).
The model
- The owner keeps the items: one per slot, the user’s and each
agent session’s own. It is the application’s kernel when the host
says so (
Host::clipboard), else egui-pop’sLocalClipboard, kept in memory byClipboardPluginand shared by the application’s windows. Eachputraises its revision and publishesclipboard.changed(the slot, the type, the revision, never the payload). - An item (
ClipItem) has a type (a private format,application/x-<app>.<type>+json), a version, a JSON payload, a title (“a colour”, “3 nodes”), readable fallbacks (text always, HTML when the type has one), where it came from, and what sanitisers left out. - The system clipboard receives the user’s copies’ fallbacks
(text), so a colour lands in a chat as
#d9a441. A paste whose text is still what the owner wrote there pastes the owner’s item; other text is external and pasted as text. A type declared internal (ClipType::internal) never reaches the system clipboard. How it is written and read is the system backend’s business. - A target accepts formats, richest first. A paste takes the first the item offers, or one a declared transform makes from what it offers (one transform, never a chain); nothing fits: the paste is refused with the reason, and Edit > Paste is greyed.
A component: a source and a target
A component registers an endpoint by name with a ClipSource
(what a copy takes; a cut’s delete) and a ClipTarget (the formats it
accepts; how it applies a paste), then says each pass which widget
draws it. While that widget has the focus, the Edit commands use the
endpoint.
use egui_pop::api::clipboard::{self, ClipItem, ClipSource, ClipTarget, Cut, Paste, TEXT};
impl ClipSource for Swatches {
fn copy(&self, _: &AppHandle) -> Option<ClipItem> {
let c = self.selected()?;
Some(ClipItem::new(COLOR, 1, json!({ "hex": c }), "a colour")
.fallback(TEXT, json!(c)))
}
fn can_cut(&self, _: &AppHandle) -> bool { !self.locked() }
fn delete(&self, _: &AppHandle, cut: &Cut<'_>) -> Result<(), String> {
self.remove_selected(cut.group) // its writes carry the group
}
}
impl ClipTarget for Swatches {
fn accepts(&self, _: &AppHandle) -> Vec<FormatId> { vec![COLOR, TEXT] }
fn paste(&self, _: &AppHandle, p: &Paste<'_>) -> Result<Json, String> {
let hex = p.repr.data["hex"].as_str().unwrap_or_default();
if !p.dry_run {
self.add(hex, p.group);
}
Ok(json!(format!("adds {hex}"))) // paste special's preview
}
}
// In `connect`: owned by the plugin, gone with it.
ctx.clip_endpoint("demo.swatches", Some(swatches.clone()), Some(swatches.clone()));
// Each pass, where it is drawn:
let response = draw_swatches(ui);
clipboard::bind(app, "demo.swatches", response.id);
In a node graph, a tree or a list of sliders, the focus sits on each node, row or slider, not on the panel. Such a component binds its elements, or an area, instead of one widget:
// Each element, with its key: the source and the target receive it.
for node in &graph.nodes {
let response = draw_node(ui, node);
clipboard::bind_element(app, "demo.graph", response.id, &node.key);
}
// Or any focused widget whose centre lies in the canvas.
clipboard::bind_area(app, "demo.graph", canvas.rect);
ClipSource::copy_element, Cut::element and Paste::element carry
the focused element’s key (clipboard::element says it); an agent
names one with element in clipboard.copy and clipboard.paste. A
widget bound alone wins over an area, and of two areas holding the
focused widget the smaller one. The focused widget’s rectangle is read
from egui’s lists of widgets: Context::read_response is never used
for it, as building a response for a widget that is not hovered during
a press makes egui surrender that widget’s focus (a host finding the
focused row that way steals the tree’s focus on the click that gave
it).
A paste is one undo step (“Paste a colour”): egui-pop opens a
history group (Host::begin_group, the store’s by default) and the
target’s writes carry it (Set::gesture(paste.group)). A cut is the
copy and the delete in one step, and copies only once its delete is
accepted: a refused delete copies nothing. A dry run (p.dry_run)
says what would change and changes nothing: paste special shows it as
the preview, an agent reads it as the plan.
Writes a source or a target makes are its plugin’s own (the scope of the plugin that registered the endpoint).
A target whose edit goes through the application’s own loop (a
network edit, a command the viewport applies on the next frame)
implements ClipTarget::apply and answers Pasted::Later with a
result to come (host::pending, the same as a host’s
Reply::Later). Its writes still carry paste.group, which stays
open until the result arrives, so the paste stays one undo step. The
clipboard.paste step answers at once with "pending": true (and no
changes); when the result arrives the group closes (kept only on
success), clipboard.pasted is published with the same summary and
the target’s changes or its error, and the user sees a failure or
a loss in a toast. An agent watches clipboard.pasted for the
outcome; clipboard::pending_pastes and the collector say how many
wait. A dry run (paste special’s preview, an agent’s plan) always goes
through ClipTarget::paste, now.
Types, transforms and sanitisers
Plugins declare them in connect, and they go with the plugin:
ctx.clip_type(
ClipType::new(COLOR, 2, "a colour")
.fallbacks(|p| vec![Repr::new(TEXT, p["hex"].clone())])
.parts(|_| vec![Part::new("alpha", "the opacity")])
.migrate(|from, old| match from {
1 => Ok(json!({ "hex": old["rgb"] })),
v => Err(format!("no colour of version {v}")),
}),
)?
.clip_transform(Transform::new(
TransformSpec::new("demo.parse-colour", TEXT, COLOR),
|r| parse(r.text().unwrap_or_default()).map(Transformed::exact),
))?
.clip_sanitiser(
Sanitiser::new("demo.paths", Boundary::System, |data| strip_paths(data))
.format(TEXT),
)?;
- A type’s title (“a colour”) is a declaration, translated under
clip-<format>.title(clipboard::type_title_key) and listed by the key extractor; an item’s own title (“3 nodes”) is translated when its source gives it as a message,ClipItem::title_key("demo-nodes", &[("count", "3")]), its Englishtitlethe fallback. The undo step’s label (“Paste a colour”) and paste special’s formats use them. - A type renders its fallbacks for items whose source gave none, lists its parts (paste special offers each alone), and migrates a payload made at an older version before it is pasted.
- A transform makes one format from another;
TransformSpec::lossysays it loses information: it is applied, and a toast names the loss (Transformed::lossy(data, "the hue")); paste special shows it beforehand.Transform::whenlimits it to some representations or targets.Transform::for_targetadapts to the target: it receives the target’s name, the element pasted into and what the target says of itself (ClipTarget::context: the image a mask lands on, the range a value is clamped to, the names already taken), so a mask scaled to the image, a value clamped or a name made unique is a transform, its loss shown in the toast and paste special’s preview, rather than an adaptation hidden inClipTarget::paste. - A sanitiser runs on each representation crossing its boundary:
Boundary::System(what leaves for other applications: local paths, secrets, owner-local ids),Boundary::External(what comes in),Boundary::Owner(inside, nothing by default). It returns what it removed; the item records it and the copy’s toast says it (“Copied; left out: a local path”).
egui-pop declares two of its own: egui_pop.controls removes control
characters and escape sequences from external text, and
egui_pop.html-to-text (lossy) reduces HTML to text for a target that
does not take HTML.
The system backend
A SystemBackend writes one copy’s representations to the system
clipboard at once and reads back what other applications left there:
| Backend | Writes | Reads |
|---|---|---|
EguiText (the default) | text, through egui | nothing: the paste key’s text only |
platform::clipboard::Arboard (feature clipboard) | text, HTML (with its text), an image, files | text, HTML, an image, files; the primary selection |
the host’s (Clipboard::system) | what the kernel decides (its private types too) | idem |
A copy gives the backend every representation it writes
(SystemBackend::writes), sanitised for the system boundary: the
fallbacks, and the private type itself where the backend writes it. A
paste reads every format the backend reads, as one external item
with several representations (ClipItem::external: files as
text/uri-list, an image as image/png, HTML, text), so negotiation
picks the richest the target accepts; it is sanitised at the external
boundary first. With a backend that reads, Edit > Paste from the menu
pastes what the system clipboard holds too, and the paste command is
enabled for a target taking only what the backend may read
(SystemBackend::readable). The system clipboard is read once per
pass.
The representations’ data: text, HTML and a URI list (one file://
URI per line, CRLF between) are JSON strings; an image is a string,
the PNG file’s bytes in standard base64; a private type is its JSON
payload.
// The application's own backend (or the platform crate's):
clipboard::set_backend(app, Box::new(MyBackend::new()));
// A kernel's: its `Clipboard` implementation returns it.
fn system(&mut self) -> Option<&mut dyn SystemBackend> { Some(&mut self.system) }
The clipboard collector names the backend in use and what it says of
itself (SystemBackend::describe: on Wayland, its path).
arboard (egui-pop-platform)
use egui_pop::platform::clipboard::SystemClipboardPlugin;
App::builder()
.plugin(ClipboardPlugin)
.plugin(SystemClipboardPlugin::new()) // feature `platform-clipboard`
SystemClipboardPlugin installs Arboard, which opens the clipboard
on first use. arboard writes one format per copy: files (a
text/uri-list of file:// URIs), else an image, else HTML with its
text alternative, else text; it reads all four. Private types stay in
the owner. Its path to the system clipboard:
| Platform | Path |
|---|---|
| Windows, macOS | the Win32 clipboard, NSPasteboard |
| X11 | selections, through x11rb |
| Wayland | XWayland by default: a copy reaches native Wayland applications only when the compositor hands XWayland’s selection over (some do only while an X11 window has the focus). With platform-clipboard-wayland (arboard’s wayland-data-control, through wl-clipboard-rs), the data-control protocol where the compositor offers it (wlroots compositors, KDE Plasma), XWayland elsewhere. The core protocol, which needs the window’s input serial, is what egui-winit’s text clipboard uses (smithay-clipboard), not arboard. |
| the web | none: the module is not built for wasm32 |
The primary selection (select to copy, middle-click to paste) is
read and written on X11 and Wayland through the backend
(clipboard::primary_text, clipboard::set_primary_text); egui-pop’s
text inputs and code editor do not use it yet (opt-in, ADR 0015).
Steps
Copy and paste are steps (ADR 0011), observed, vetoed, redirected or replaced like any other:
| Step | Arguments | A before-hook may |
|---|---|---|
clipboard.copy | source, slot, cut, dry_run, origin | veto (a secret field), redirect (another selection, another slot) |
clipboard.paste | target, slot, format, transform, parts, if_rev, dry_run, text, origin | veto, redirect (another target, another format) |
Their results say the type, the plan (format, to, transform,
lossy), what was lost and stripped, and the target’s changes.
clipboard::copy and clipboard::paste run them from code; a refusal
or a veto asked by the user shows in a toast.
Commands and keys
| Command | Keys | What |
|---|---|---|
edit.cut | Ctrl+X, Shift+Delete | cut the focused endpoint’s selection |
edit.copy | Ctrl+C, Ctrl+Insert | copy it |
edit.paste | Ctrl+V, Shift+Insert | paste in the richest format it accepts |
edit.pasteSpecial | Ctrl+Shift+V | choose the format, transform or part, each with its preview |
They sit in the Edit menu under undo (group 1_clipboard), with
when !textInputFocus and the keys canCut, canCopy, canPaste:
greyed when nothing focused answers. Ctrl is Command on macOS. Text
fields keep egui’s own copy and paste, as they keep their own undo; the
code editor and the terminal keep theirs too.
egui-winit turns the platform’s copy, cut and paste chords into events
and swallows the keys (see upstream); while an endpoint
has the focus, those events run the commands (Shift held on a paste:
paste special), so they work under winit as under the keymap. When the
system clipboard holds no text (files, an image), egui-winit makes no
paste event at all; egui-pop recognises the chord by its release and
pastes with no_text: the system backend reads what the clipboard
holds. With the default backend, which reads nothing, such a paste is
refused when the owner’s text is no longer on the system clipboard.
The chords in the keymap
With a backend that reads the system clipboard (SystemClipboardPlugin
added), AppBuilder::run_native turns eframe’s
NativeOptions::clipboard_shortcuts off: egui-winit sends the chords
as plain keys, and the keymap runs them everywhere. While a text field
has the focus, edit.copy, edit.cut and edit.paste (their when
also holds for textInputFocus && clipboardKeymap) give it egui’s own
Event::Copy, Event::Cut and Event::Paste, the pasted text read
through the backend, so the field edits as before. A remapped chord
(Ctrl+Shift+C for edit.copy) then copies from text fields too, and
the paste key is seen on its press whatever the clipboard holds.
An application whose NativeOptions already have the shortcuts off
gets the same; it then needs a backend that reads, or a text field
pastes nothing. Elsewhere nothing changes: on the web, with the default
backend (which reads nothing) and on eframe’s own runner, text fields
keep egui’s events and the events of an endpoint go to the commands as
above. clipboard::set_keymap_shortcuts says which applies (a host on
its own loop calls it); the clipboardKeymap context key shows it.
Agents
Agents go through the same steps, with the user’s refusals:
clipboard.copy {source, cut, dry_run};clipboard.paste {target, format, transform, parts, if_rev, dry_run}: a dry run answers the plan, the transform, what would be stripped and lost, and the target’s changes, without making them;clipboard.offers {target}: what the slot holds and every way it fits the target, each with its preview;clipboard.read,clipboard.write {format, data, title}.
Each works in the session’s own slot (agent:<name>): an agent neither
reads nor overwrites what the user copied, unless the owner allows it
(Clipboard::may_use; with LocalClipboard,
clipboard::allow_session). The clipboard collector of the debug
bridge shows the owner, its revision, each slot’s item (without its
payload), the endpoints and what plugins declared.
Not yet
- With the default backend, what the system clipboard holds is read only when the paste key brings it (egui reads it as text, on the key): Edit > Paste from the menu pastes the owner’s item.
- Private types across processes without a shared owner need a backend that writes them (a host’s); arboard writes only standard formats, one per copy.
- egui-pop’s text inputs and code editor do not use the primary selection yet, though the arboard backend reads and writes it.
- On the web no backend reads the system clipboard: a paste knows the browser’s paste text only.
- The first types (colours, graph nodes, theme tokens, table rows) and their sanitisers come next (ADR 0015, step 4).
Links
Every link in an egui-pop application opens the same way: through one
service, one policy and one step, with an opener the host may replace.
The decision and its reasons are ADR 0017;
this page is how to use it. Everything below is
egui_pop::api::links (the service, the widget, the openers, the
plugin) and egui_pop::model::links (targets, requests, the policy,
no egui). LinksPlugin is in DefaultPlugins.
Drawing a link
use egui_pop::api::links::{self, Link};
// A link the application declares (About, help, a tip).
links::link(ui, app, "Source code", "https://github.com/me/app");
// A link found in content (a document, a program's output).
Link::content("the report", "https://example.org/report").show(ui, app);
The widget draws in the theme’s link colour with a pointing hand, and:
- shows the real target on hover: the full address, then its host (an
internationalised host with its punycode beside it,
bücher.example (xn--bcher-kva.example)); - opens on a click, Enter or Space; Ctrl+click (Cmd+click on macOS) or a middle click opens it outside;
- has a context menu: Open, Open outside (when it would open
inside), Show in folder (a local file or folder), Copy link
(through the clipboard: a
text/uri-listitem with its text); - is a
linkfor screen readers, its label as its name and its target as its description.
A link whose text looks like an address (https://bank.example,
bank.example/login) but goes elsewhere is always confirmed, both
shown.
ui.hyperlink, ui.hyperlink_to, a third-party widget or
ctx.open_url still work: their OpenUrl is taken out of each frame’s
output and opened through the same service on the next pass, as a
declared link for http(s): and mailto:, as content otherwise.
Nothing reaches the browser without the policy.
What a click does
The policy classifies the target from its scheme, host and extension (never by fetching it) and picks the way:
| Target | A click | Ctrl+click, middle click |
|---|---|---|
Web page (https:, http:) | the system browser; a new tab on the web build | the same |
| Video on the web (YouTube, Vimeo, a remote video file) | the browser; a YouTube video in the viewer’s web view with views-webview on Linux (see below) | the same |
| Local video file | the viewer’s video page with views-video (see below), else as a local file | outside |
mailto: | the mail client (the same tab on the web, which hands it over) | the same |
docs: page | the viewer when there is one (see below), else its online copy (Policy::docs_online) | outside |
| Local file | its default application, after a confirmation; a program refused, Show in folder offered | Show in folder |
| Local folder | the file manager | the same |
The application’s own scheme (<app>://) | deeplink.open, inside | the same |
command:<id>?<json> | runs the command, from declared text only | nothing |
Anything else (javascript:, data:, a device, an unknown scheme) | blocked, with the reason | blocked |
Trust
Every request says where it comes from: declared by the application, found in content, or asked by an agent.
| Source | Web and mail | Local file | Show in folder | Command |
|---|---|---|---|---|
| Declared | opens | confirmed | opens | runs |
| Content | opens when its host is trusted, else confirmed | confirmed | confirmed | refused |
| Agent | always confirmed | always confirmed | always confirmed | refused |
The confirmation shows the full target, its host (and punycode), why it
asks, Copy link, Open and Cancel; for a content link to an
untrusted host, Trust
- Content opens only on a click: a content request not made by the user is refused.
- A program or a script (by its extension, or the executable bit of a file without one) is never opened; Show in folder is offered instead.
- An agent has one confirmation open at a time; five more requests wait behind it, then the next is refused with the reason.
- Allowed schemes:
https,http,mailto,file,docs,commandand the application’s own (the single-instance plugin adds its schemes). The host changes the policy through the service:
use egui_pop::api::links::{LINKS, LinksPlugin, Policy};
App::builder().plugin(
LinksPlugin::default().policy(
Policy::default()
.app_scheme("helios")
.docs_host("docs.example.org"),
),
);
// Later: app.service(&LINKS).unwrap().update_policy(|p| { p.schemes.remove("http"); });
Openers
The opening itself is an Opener the host replaces (ADR 0010):
EguiOpener(the default): web pages and mail through egui’sOpenUrl; on native eframe’slinksfeature (webbrowser) opens the system browser, on the web a new tab (mailto:in the same tab).SystemOpener(egui_pop::platform::open, featureplatform-open; install it withOpenPlugin): local files and folders with the system’s default application, and Show in folder (the file manager with the file selected: the freedesktop file manager interface, else the OpenURI portal;open -R; Explorer). Inside Flatpak,xdg-openis the portal’s. Not on the web.RecordingOpener(tests): records each call (target, how, kind, source, origin) and answers as scripted.NullOpener(a node without a screen): refuses with the reason, or forwards each request to an attached interface (NullOpener::forward).
let rec = RecordingOpener::default();
app.service(&LINKS).unwrap().set_opener(Arc::new(rec.clone()));
harness.get_by_role_and_label(Role::Link, "Source code").click();
harness.run();
assert_eq!(rec.records()[0].target, "https://github.com/me/app");
The step and the journal
links::open(app, request) runs the link.open step (ADR 0011): a
before-hook vetoes it or redirects it (another target, another way), a
run-hook opens it its own way, an after-hook sees the result. Its
result says the kind, the way, whether it asked, and the status:
opened, opening (an opener answering later), asked or queued
(waiting for the user). The journal says link.opened, link.failed
(with the reason), link.refused, link.asked and link.cancelled.
A refusal or a failure the user asked for shows in a warning toast with the reason and Copy link (Show in folder for a program).
Commands and agents
| Command | What |
|---|---|
links.open | target, how (auto, outside, inside, reveal), label, dry_run: opens a link; from an agent, always confirmed; a dry run says the kind, the way, whether it would ask and the verdict, opening nothing |
links.check | target, how, source: the policy’s decision and the opener’s capabilities, without the step |
files.reveal | path: shows a file in its folder |
links.copy | target: copies a link (a toast’s action) |
The debug bridge’s links collector shows the opener and what it can
do, the policy, the requests waiting for an answer (and queued per
agent), the recent requests with their decision and outcome, and the
links declared.
The lint
A plugin declares the links it shows (ctx.link(place, target), or
links::declare from the application); links drawn with the widget as
declared count too. links::lint::problems(app) checks them, with the
menu items running links.open or files.reveal, the links in the
tips’ texts and the toasts’ actions: each must parse, use an allowed
scheme, name a declared command (command:) and a file that is there.
In a test, after drawing the screens:
egui_pop_test::assert_links_clean(&app);
The gallery’s links pass it. Checking that remote links answer is not part of it (an opt-in task, never in the gate).
Short texts
Tips, toasts and settings descriptions read a small part of markdown,
drawn by links::Inline (links::inline(ui, app, text) for a text the
application declares):
| Written | Drawn |
|---|---|
*text*, _text_ | emphasis |
**text**, __text__ | strong |
`code` | code |
[label](target) | a link (the widget above) |
<https://…>, a bare https://… | a link showing its address |
\* | a literal * |
A delimiter without its pair stays as written (2 * 3), _ inside a
word too (snake_case_name); a text without any of it is a plain
label. Headings, lists, images and HTML are not read there: a longer
text belongs in the viewer.
use egui_pop::api::links::Inline;
Inline::new("Press `Ctrl+K`, or read [the guide](docs:guide).")
.weak()
.show(ui, app);
The viewer
egui_pop::views::viewer (feature views-markdown) shows pages inside
the application: a panel of the end side bar, detachable into its own
window like any panel, one page at a time. ViewerPlugin installs it
in the links service (Links::set_inside), so what the policy sends
inside opens there: docs: pages, markdown and HTML pages on the
application’s documentation hosts (Policy::docs_host), local images.
use egui_pop::views::viewer::{Docs, ViewerPlugin};
App::builder().plugin(
ViewerPlugin::default().docs(
Docs::new()
.page("index", include_str!("../help/index.md"))
.page("guide/start", include_str!("../help/guide/start.md"))
.file("img/panel.png", include_bytes!("../help/img/panel.png").as_slice()),
),
);
A docs: link names a page with or without .md or .html
(docs:guide/start), a folder its index (docs:guide/, docs: the
root’s), an anchor
its heading (docs:guide/start#install, the heading’s text in lower
case with dashes, or its {#id}). Links and images in a page resolve
against it (../img/panel.png).
- Toolbar: back and forward (the session’s history, nothing kept
across runs), reload, the address bar (the real target; typing a
target opens it through the links service, a bare name as a
docs:page), Open outside (adocs:page’s online copy), Copy link, the zoom (a click puts it back to 100%). - Keys, while the viewer has the focus: Ctrl+F finds in the page, F3 and Shift+F3 (Enter and Shift+Enter in the field) move between the matches, Ctrl+plus, Ctrl+minus and Ctrl+0 zoom the page (not the interface), Alt+Left and Alt+Right go back and forward, F5 reloads.
- Links in a page go through the links service: a
docs:page’s links are declared (they may runcommand:links), another page’s are content; anotherdocs:page stays inside, a web page goes outside; Ctrl+click or a middle click opens outside. - What it shows: markdown (egui_commonmark: tables, task lists,
footnotes, code), images (PNG, JPEG, GIF), text, and a safe subset of
HTML with the
views-htmlfeature (see below), local video files with theviews-videofeature (see below), YouTube videos with theviews-webviewfeature on Linux (see below). Other remote videos and full web pages are not shown inside: they open outside. Without the feature an HTML page gets an error page offering Open outside. - Remote pages and images come through a
viewer::Fetchthe host gives (ViewerPlugin::fetch); without one nothing remote is loaded and the page says so. A remote image never loads before the user asks: it shows its alt text, and a bar says “Images fromhostare not loaded” with Load images fromhost; the host is then remembered in theviewer.image_hostssetting (empty it to be asked again). Images on the page’s own host (a documentation host) load at once. Allowing a host is the user’s alone: agents cannot. - Local files load only from a page that is itself local (
docs:,file:). A page from the network never reads one: itsfile:image shows its alt text and is named in the bar over the page and inviewer.state’sdropped, however the address is spelled. Its links still go through the links service, as content. - Failures (not found, no connection, too large, a type it cannot
show) show an error page in place with Retry, Open outside
and Copy link, and
viewer.failedon the journal.
| Command | What |
|---|---|
viewer.back, viewer.forward, viewer.reload | the history |
viewer.find | query: searches the page and goes to its first match |
viewer.find_next, viewer.find_previous | the matches |
viewer.zoom_in, viewer.zoom_out, viewer.zoom_reset | the page’s zoom |
viewer.open_outside, viewer.copy_link | the page’s address |
viewer.state | the page (address, status or error, title, headings, text, links, what it did not show), the history, the search, the zoom, the images and the hosts allowed, the video |
viewer.video_toggle, viewer.video_back, viewer.video_ahead, viewer.video_louder, viewer.video_quieter | a video page’s keys |
viewer.video_seek, viewer.video_volume | seconds, volume (from 0 to 1): a video page’s position and volume |
The HTML subset
With views-html (egui-pop-views/html), the viewer shows HTML pages:
those the application ships (Docs::page("about.html", ...)) and those
on its documentation hosts. Any other HTML page goes outside, like any
web page: the policy decides, as for markdown.
A page is parsed by html5ever, as a browser would (broken markup included), and mapped to markdown, then drawn as the same blocks: find in page, anchors, zoom and links work as on a markdown page.
| Kept | As |
|---|---|
h1 to h6 (with id) | headings and their anchors |
p, div, section, article and their like | paragraphs |
ul, ol (with start), li, dl, dt, dd | lists |
table, thead, tbody, tr, th, td, caption | a table, its first row as the header; no cell spans |
blockquote, pre, hr | quotes, code, a rule |
em, strong, del, code, kbd, q, br and their like | inline styles |
a href | a link, through the links service |
img src alt | an image, through the same rules as markdown’s |
- Dropped with their content, and named in a bar over the page:
script,formand its controls,iframe,object,embed,audio,video,canvas,template,dialog, foreignsvgandmath. The bar says Open outside shows the page whole;viewer.statelists them asdropped. - Never read: every other attribute (
on*,style,class, …).<style>is ignored, without being named: the page has the theme’s look. Any other element leaves its text. - Links and images keep an address that is relative or whose scheme
the policy allows; a link with another (
javascript:,data:,vbscript:, an unknown scheme, however spelled) is left as its text, an image as its alt text.command:is kept only ondocs:pages,file:not on pages from the network (afile:image refused is named in the bar, as on a markdown page). A kept link still meets the policy when it is clicked: declared on adocs:page, content elsewhere. Remote images wait for the same click as markdown’s. - No script runs, no style applies, and nothing is fetched beyond the page and the images allowed.
The video page
With views-video (egui-pop-views/video, off by default), a local video file
(.mp4, .webm, .mov, .mkv, .ogv, .m4v, .avi) opens in the viewer.
Without the feature, on the web build, or with no player, it opens outside as any
local file. A remote video stays outside either way. The page is the
Video widget with its full controls, under the id
egui_pop.viewer (so the video.* commands and the videos collector reach it
too).
| Control | Mouse | Keys |
|---|---|---|
| Play, Pause | Play or Pause, or a click on the picture | Space on the picture |
| Position | the slider (a drag seeks when it ends) | Left and Right on the picture, five seconds; the slider’s own keys |
| Volume | the slider, kept for the session | Up and Down on the picture; the slider’s own keys |
- It opens paused on its first picture, with the focus on the picture, so that nothing makes a sound before the user asks.
- GStreamer’s threads decode and convert; each pass uploads only the last picture. Only a playing video asks for repaints.
- Leaving the page stops the player. So does its panel going out of view (closed, or a tab behind another): showing it again opens the file at the same place, paused.
- What it needs. To build: GStreamer’s development packages
(
libgstreamer1.0-devandlibgstreamer-plugins-base1.0-devon Debian and Ubuntu). To run: GStreamer’s libraries, its base plugins, and the plugins for the files to play. The crates are MIT OR Apache-2.0; GStreamer itself is LGPL and stays a system library. - Failures (a plugin or a codec missing, a file it cannot read) end on the
error page, with Retry, Open outside and Copy link, and
viewer.failedon the journal; a problem it plays on through (no sound device) is a line on the page. The binary links GStreamer’s libraries: without them installed it does not start, so an application declares them as a dependency of its package. video::VideoBackend(ViewerPlugin::video) replaces the player;video::GStreamer::audio_sinknames the element the sound goes to, kept in time with the pictures even when silent (fakesink). Both are also named underviewer::, as before the widget.video::write_test_clipwrites a small clip from GStreamer’s test sources, for tests and the gallery’s Video page (cargo run -p egui-pop-gallery --features video).
The YouTube page
With views-webview (egui-pop-views/webview, off by default, Linux only for
now), a YouTube link (youtube.com/watch?v=, youtu.be/, embed/, shorts/,
live/) plays in the viewer, in a web view: wry (MIT OR Apache-2.0) over the
system’s WebKitGTK. Without the feature, on another system, on the web build, or
when Ctrl+click or a middle click asks for outside, it opens in the browser as
before. Other remote video stays outside either way.
- What loads: YouTube’s privacy-enhanced player,
https://www.youtube-nocookie.com/embed/<id>, as the web view’s page, its request carrying aRefererthat names the application: YouTube’s player refuses to play without one (its error 153), and YouTube’s Required Minimum Functionality asks a desktop application to set it as a header, to anhttpsURL whose domain is the application’s id. It is built fromAppBuilder::app_id(reverse-DNS,org.example.App;run_nativetakes the window’sViewportBuilder::with_app_idwhen none is given) ashttps://<app id>/, lowercased (viewer::referrer_for);ViewerPlugin::embed_referrerreplaces it. Without either, YouTube links open outside and a warning is logged. The gallery sendshttps://org.egui_pop.gallery/(its idorg.egui_pop.Gallery). Nooriginorwidget_referrerplayer parameter is sent:origingoes with the IFrame API (enablejsapi=1), which the page does not use, andwidget_referrernames a page a widget is embedded in, which there is not (player parameters). Nothing else loads in the web view: a link the player follows (its title, “Watch on YouTube”) is opened outside through the links service, as content. - Its size: the player gets at least 200 by 200 of the web view’s
pixels (
viewer::MIN_PLAYER), YouTube’s minimum: its place in the panel is 16:9 and at least 200 tall when the panel allows. Over a panel too small for that, the web view is closed and a card says why, with Open outside; it opens again, from the start, when the panel grows. The web view’s pixels are the window’s physical pixels divided by the system’s scale: on a 2x screen the panel needs 400 physical pixels each way (viewer::fits_player). Its own window cannot be made smaller than 200 by 200. - Nothing over the player: the page draws only a background and a word under the web view, which covers them; no control, badge or popup of egui-pop’s is drawn on the player (egui’s popups could not be anyway: the web view is a native window above egui).
- Where: on X11 (or Xwayland), with the panel in the main window, the web view is a child window over the panel, following it as it moves and resizes. On Wayland, or with the panel detached, it opens in a window of its own (wry’s child web views need X11); the page then says so, and once that window is closed offers Show the video. A child web view is a native window above egui: popups over the panel are drawn under it.
- Its loop: GTK starts on the interface’s thread when the first web view
opens (on X11 when the main window is an X11 one), and its loop is turned
without blocking once per pass; while a web view is open the page asks for a
pass every 15 ms (
viewer::PUMP). - Leaving the page closes the web view. So does its panel going out of view, or the user closing its own window: showing it again starts the video again.
- The main window’s X11 id comes from
frame::record_native_window, whichAppBuilder::run_nativecalls; an application starting eframe itself calls it from its creation context. - What it needs. To build: WebKitGTK’s development packages
(
libwebkit2gtk-4.1-devon Debian and Ubuntu,webkit2gtk4.1-develon Fedora). To run: WebKitGTK 4.1 and GStreamer’s plugins for the video’s codecs. The binary links WebKitGTK: without it installed it does not start. One crate wry brings on Linux,option-ext(throughdirs), is MPL-2.0;deny.tomlallows it as a narrow exception for that crate alone (ADR 0017). - Failures (WebKitGTK cannot start, the web view cannot open) end on the error page, with Retry, Open outside and Copy link.
viewer::EmbedBackend(ViewerPlugin::web_video) replaces the web view; itsin_panelsays whether a web view sits over the panel (whose size is then checked) or in a window of its own (which it keeps at the minimum).
Terms
YouTube allows its videos in an application through its own embedded player
only (YouTube Terms of Service,
API Services Terms,
Developer Policies).
That is all this page does: the official player, unmodified, loaded from
YouTube, its links opened outside. Extracting the stream to play it in another
player, downloading or caching it, or drawing over the player is ruled out, and
egui-pop will not do it. The page follows the Required Minimum Functionality
egui-pop controls (the Referer naming the application, the 200 by 200
minimum, nothing over the player, one player, playing only once shown). An
application turning webview on accepts YouTube’s terms for itself, and owns
what they ask of it beyond egui-pop: an application id that is really its own,
and being able to be updated remotely (Developer Policies III.B.1), which is its
packaging’s part.
The viewer collector of the debug bridge shows the same state;
viewer.shown and viewer.failed go on the journal. The lint checks
declared docs: links against the pages the viewer has.
Not yet
- The lint does not yet walk the links inside
docs:pages. - No general web view: full web pages and remote videos other than YouTube open outside. The YouTube page is a trial (ADR 0017); it has no Windows or macOS backend yet.
The status bar and the context stack
Status: decided (2026-10-21), built. This note settles how the status bar and the context stack (contexts.md, ADR 0012) meet. The owner accepted every recommended default below, the open questions included. How to use it is in workbench.md; “As built” at the end says where the code differs in its details.
Why together
The context stack says where the user is (the place, a drill-down shown as
a breadcrumb) and what is active (modes, shown as chips). The status bar
(strips::Indicator, fed by the host’s events) says what is going on.
Both answer “where am I, and what is active?”. Today they are two separate
widgets an application places on its own. Putting the context in the
status bar gives that answer one home, always in the same spot.
1. The place at the start of the status bar
The breadcrumb (library › darkroom › IMG_0042) sits at the start of the
status bar, before the indicators. A crumb is a button: a click goes back
to that place (context.go), as nav.up does one level at a time. On a
narrow window the middle crumbs collapse into …, which opens a menu.
Default: on, when the context plugin and the status bar are both
installed. An application can keep the breadcrumb elsewhere and turn this
off (StripsPlugin::breadcrumb(false)).
2. Modes as status items
Each active mode shows as a chip after the breadcrumb: its title, coloured
with a shared tone (the micro-indicators’ Tone), and an icon when it has
one.
- A click on a chip leaves the mode (
context.set_modeto the group’s default). - A pushed mode (one that remembers what it replaced) shows a back mark;
a click returns to what it replaced, as
nav.backdoes. - A mode that refuses to be left (a guard) shows its reason in the tooltip and keeps the chip.
Default: only modes whose group is declared visible show. A group
that is pure plumbing stays out of the bar.
3. Status items that follow the context
An indicator gains a when clause, with the same grammar as commands, over
the context keys (place, placeDepth, modePushed, mode.<group>, and
each frame’s own keys). The bar shows an indicator only where its clause
holds. Examples:
- the image count shows in
place == 'library'; - zoom and the history step show in
place == 'darkroom'; - mask tool hints show in
mode.edit == 'masks'.
An indicator with no when shows everywhere, as today.
Default: a hidden indicator keeps reducing events, so its state is right the moment it reappears. Only its drawing is skipped.
4. One saved state
The context stack already saves the place, the modes and each projection’s view state, and restores them on reopen. The status bar’s user choices go into the same document, per place, so a bar arranged for the darkroom comes back as it was:
- which items the user hid (only status items can be muted, per the micro-indicators decision);
- their order.
Default: the choices are per place, falling back to the root place’s choices where a place has none.
5. What agents read
context.read returns, beside the place and modes, what the status bar
shows: each visible indicator’s id, text, tone, count and progress. An
agent then sees the same summary as the user, in one call. The strips
debug collector shows the same thing, with the when that hid each
hidden item.
Default: context.read gains a status field, and nothing else
changes in the command.
Open questions
- Should a click on the place’s last crumb (the current place) open a quick switch to sibling places, or do nothing? Default: nothing.
- When the window is too narrow for the breadcrumb, the chips and the indicators, which gives way first? Default: the breadcrumb collapses first, then low-priority indicators, then chips; chips never hide, since they show active states.
- Do frames contribute their own status items (declared with the frame,
live only while it is entered)? Default: yes, as a convenience over
writing the
whenby hand.
Build order
The status bar’s next pass (a rich hover and popover per item) was an ordering preference, not a dependency: these steps were built before it, and it is built now (the status bar).
whenon indicators. Built.- The breadcrumb and chips in the bar. Built.
- The saved choices per place. Built.
- The
statusfield incontext.read. Built. - Gallery page, tests (built), and an adoption by an application (library, darkroom, culling), still to come.
As built
Indicator::when(clause);Indicator::during(&frame)answers open question 3: it writes the frame’s clause (FrameSpec::clause: the top place, or the mode on in its group), so a frame’s status items need no clause by hand. A clause that does not parse keeps the item hidden and is a diagnostic (indicator-when).- Groups have no declaration of their own: a mode declared
FrameSpec::visible()makes its group visible. A chip’s tone isFrameSpec::tone(name)(a kit tone name,accentby default); a chip is the micro-indicators’ text badge, interactive. - A group has no default mode: a chip’s click turns its group off
(
ClearMode), or pops the last pushed mode (PopMode, back to what it replaced). A crumb goes back withcontext.jumpto its depth, the same transition ascontext.goto its path. - The guard’s reason is asked as a dry run of the stack’s own owner
(
contexts::why_not) only while the chip is under the pointer; a host owning the stack (an answer that may come later) gives no reason there, its refusal still shows in a toast on a click. - “Low-priority indicators” are those of the lowest
priority(Indicator::priority), then, among equals, the heaviest (weight): the lightest sit nearest the bar’s edge. They go into the bar’s…menu (the status bar). - The choices are a value per place in the
viewdocument (contexts::place_value, keyed by the place’s frame id,rootat the root), underegui_pop.status; without the context stack they last the session. They are changed from an item’s context menu, or bystatus.item.hideandstatus.item.move. - The root crumb shows at the root too (“You are in Home” for a screen reader), so the bar always says where the user is.
The status bar
The status bar is the window’s bottom line: where the user is (the
context stack’s breadcrumb and mode chips, see
status and context), then status items
declared by plugins, each a small reducer over the host’s events
(strips::Indicator, drawn by StripsPlugin; the basics are in
the workbench). This page covers what an
item can do beyond its text: where it sits, what gives way on a narrow
window, its live states, a popover per item, and a rich hover card.
Where an item sits
| Builder | What |
|---|---|
align(Alignment::Start) | after the breadcrumb and the chips, lightest first |
align(Alignment::End) (default) | at the bar’s end, the lightest nearest the end |
weight(n) | the order within its group |
priority(n) | what stays on a narrow bar: the higher, the longer (0 by default) |
when(clause), during(&frame) | where it shows (status and context) |
On a narrow window the breadcrumb’s middle crumbs collapse first; then
items give way, the lowest priority first and, among equals, the
heaviest. They are not clipped: they go into the bar’s … menu (“More
status items”), whose entries act as a click on the item (a popover
then opens next to …). Mode chips never give way.
The user hides items and moves them within their group from an item’s
context menu; agents use status.item.hide and status.item.move.
The keyboard
The status bar is one Tab stop (a roving group), as VS Code’s: Tab into it lands on the item focused there last (the first the first time), Left and Right go between its items in the order they are placed, round from one end to the other, Home and End to its ends, and Tab from any item leaves it. F6 reaches it as a region. The bar’s own background is not a stop: every item’s context menu lists the hidden items too.
Live states
An item’s state (IndicatorState) is what its reducer makes of the
events:
| Field | Shown as |
|---|---|
text, tone | the item’s text, in the kit’s status-indicator tone |
icon | an icon before the text, in the same colour (Indicator::icon, by name); with an empty text, the icon alone, named by the item’s label |
count | text (n) |
busy | a spinner before the text, after motion.spinner.delay |
progress | a thin line under the text |
errors | the error icon and the count, in the danger tone |
warnings | the warning icon and the count, in the warning tone |
detail | the tooltip, when the item has no hover card |
Colour never carries a state alone: the counts come with their icons, named for screen readers (“Errors: 2”), and the item’s accessible description gives its counts, its progress and its card (or tooltip). When an item turns to errors (from none), its error icon pulses a few times (a still ring under reduced motion) and a screen reader announces it once, politely (“Problems: Errors: 2”); more errors do not announce again.
An item’s icon (Indicator::icon("phosphor:plugs-connected"), or
IndicatorState::icon from its reducer) sits before its text, inside
the same button, in the item’s colour. An item without an icon of its
own that runs a command (Indicator::command) shows the command’s
(CommandSpec::icon, its icon_on while the command’s checked
clause holds). Most items are short texts and need none; one shown by
its icon alone (a connection, a sync) keeps its label as its
accessible name. The names are checked with the other declarations
(unknown-icon), an unknown one drawn as the placeholder.
An item with neither text nor icon (nor spinner nor counts) is not
drawn and takes no room: a reducer with nothing to say yet (a zoom
before an image is shown) leaves the text empty, and the item appears
once it has one. Agents still list it (strips::status).
Popovers
popover(|ui, app| …) gives an item a small layout opened by a click:
a list with actions, a picker, a connection form. It is a popover host
of the mount contract: transient, sized by its content (give
a list a ScrollArea with a maximum height), on egui-pop’s overlay
stack.
- A click on the item, or Enter when it has the focus, opens it above
the item; a second click closes it. The item’s
command, when it has one, is no longer run by the click: the popover can run it. - Tab goes from the item into the popover and stays there, coming back to the first stop after the last; Escape or a click outside closes it, and the focus goes back to the item.
status.item.open({ "id", "open" }) opens or closes it for an agent;strips::open_popoverandstrips::open_itemin code.
Hover cards
hover(|state, app| Card) replaces the item’s tooltip with a rich
card, as VS Code’s hovers: the tier between a tooltip and a popover.
The card is egui_pop::core::hover_card::Card, a shared component any
widget can use (a toolbar button, a row, a node graph port) with
HoverCard::new(id).show(ui, &response, &card):
- Content: formatted text (
**bold**,`code`, lines starting with-as list items), rows of key and value, a progress line, separators, and command links. The owner builds it from the state each time it shows, so live values (a job’s progress) follow. - Links run their command with its arguments (
app.run), with the samewhenand steps as anywhere else; the card then closes. - Behaviour: it opens after the hover delay (egui’s
tooltip_delay), stays while the pointer moves onto it so links can be clicked, and closes once the pointer has left both for a short grace, on Escape, or on a click elsewhere. A click on the item closes it until the pointer leaves. It never shows over the item’s open popover. - Keyboard:
Ctrl+K Ctrl+Iwhile the status bar has the focus (status.item.hover, the focused item by default) opens it with the focus on its first link; Tab moves through the links, Escape closes it and gives the focus back. - Accessibility: the card’s text is the item’s accessible description; links are buttons.
- Agents read it without hovering: each item’s
cardinstrips::status, thestripscollector andcontext.read, as data (blocksoftext,rows,progress,separator,links).
use egui_pop::api::strips::{Alignment, Indicator, Tone};
use egui_pop::core::hover_card::Card;
use egui_pop::model::ids::CommandId;
use serde_json::Value as Json;
const CLEAR: CommandId = CommandId::from_static("checks.clear");
let problems = Indicator::new("checks", "No problem", "check.")
.align(Alignment::Start)
.priority(5)
.reduce(|state, event| {
match event.name.as_str() {
"check.error" => state.errors += 1,
"check.warning" => state.warnings += 1,
"check.clear" => (state.errors, state.warnings) = (0, 0),
_ => {}
}
state.tone = if state.errors > 0 { Tone::Danger } else { Tone::Neutral };
})
.popover(|ui, app| {
ui.label("What the checks found");
if ui.button("Dismiss all").clicked() {
app.run(CLEAR, Json::Null);
}
})
.hover(|state, _| {
Card::new()
.text("**Checks** of the catalogue")
.row("Errors", state.errors.to_string())
.row("Warnings", state.warnings.to_string())
.link("Clear them", CLEAR, Json::Null)
});
let _ = problems;
What agents read
Each entry of strips::status (the strips collector’s items, and
context.read’s status for the visible ones) gives the item’s id,
text, tone, icon (the name shown, when any), count, progress,
align, priority (when not 0),
busy, errors and warnings (when not 0), popover (it has one),
open (it is open), its card, and hidden_by (when, user, or
narrow) for a hidden one. The collector also gives the item whose
popover is open.
| Command | Arguments | What |
|---|---|---|
status.item.open | { "id", "open": true } | opens (or closes) an item’s popover |
status.item.hover | { "id" } (the focused item by default) | opens an item’s hover card; Ctrl+K Ctrl+I in the bar |
status.item.hide | { "id", "hidden": true } | hides an item where the user is, or shows it |
status.item.move | { "id", "toward": "start" | "end" } | moves an item one step in its group |
The gallery’s strips page shows each: the problems at the bar’s start
with their counts and popover, the node item of high priority with its
icon, card and a small connection form, a sync shown by its icon alone,
and the job’s live card.
Not yet
- Built-in items over the services (the notifications’ counts by severity, connection indicators with a reconnect action); the jobs centre keeps its own status block and popover.
- The bar’s own height token, and separators between groups.
- The jobs item’s width is not counted when the items are fitted, so on a very narrow bar with jobs running the end group can run under it.
Toolbars
A toolbar is a row (or a column) of buttons, each running a command:
icon-first, the title and the key in the tooltip, as in Office, VS Code
or Photoshop’s tool palette. In egui-pop a toolbar is declared like a
menu: it is a menu id whose items plugins contribute, and
toolbars::Toolbar draws those items as buttons instead of a list
(VS Code’s toolbars are menus contributed to in the same way). Its
icons come from the commands (icons, section 4.2).
use egui_pop::api::toolbars::{Labels, Toolbar};
use egui_pop::model::commands::CommandSpec;
use egui_pop::model::ids::{CommandId, MenuId};
use egui_pop::model::menus::MenuItem;
const TOOLBAR: MenuId = MenuId::from_static("demo.toolbar");
const SAVE: CommandId = CommandId::from_static("demo.save");
// In a plugin's `connect`: a command placed in the toolbar...
ctx.command(
CommandSpec::new(SAVE, "Save", "File")
.icon("save")
.key("Ctrl+S")
.menu(TOOLBAR, "1_file", 0),
|_| Ok(serde_json::Value::Null),
)?;
// ...and a command someone else declared (egui-pop's own Cut).
ctx.menu_item(MenuItem::command(TOOLBAR, "2_edit", 0, egui_pop::api::clipboard::CMD_CUT))?;
// Where it is drawn (a block, a panel's header):
Toolbar::new(app, &TOOLBAR).show(ui);
Toolbar::new(app, &TOOLBAR).labels(Labels::Beside).vertical().show(ui);
What a tool shows
| Declared | Shown |
|---|---|
The command’s icon (icon_on while checked) | the button’s icon; a command without one shows its title |
The command’s title (or the item’s label) | the tooltip, with the first key binding (Save (Ctrl+S)); beside the icon with Labels::Beside, alone with Labels::Text; the button’s accessible name |
The item’s checked clause (the command’s, for a CommandSpec::menu placement) | the button on: toolbar-button’s selected state, framed as a checked menu icon is; announced as toggled (a radio item as a chosen radio button) |
The command’s when, the item’s when | greyed where it does not hold, the reason in the tooltip (or hidden, for an item not greyed) |
| A run waiting for its result | the spinner in the icon’s place, the button greyed and announced busy |
| Groups | a line between them, as a menu’s separators |
| A submenu | a button with its label and a drop-down mark, opening the menu |
A list (MenuItem::list) | a button per entry, with the entry’s own icon; asked of its provider when the toolbar is first drawn and again whenever the context changes, since a toolbar stays open |
Toolbar::args gives arguments of the moment (the document the toolbar
acts on): merged into every command a tool runs and seen by when
clauses as args.<key>, as a context menu’s are. A click runs the
command as the user, in the context the toolbar was drawn in.
Room and sizes
The tools are laid out from the start. When they do not all fit, the
last ones go into a More tools button (the more glyph role) at the
end, which opens them as a menu, with their icons, ticks and keys; a
separator never ends the row nor starts that menu. A column (a tool
palette, vertical) is as wide as its widest tool and overflows the
same way downwards; it measures the height its Ui offers, which
inside ui.horizontal is a single row’s, so give it room of its own
(ui.allocate_ui, a panel).
Toolbar::name names a toolbar for screen readers: its More tools
button is then “More tools: Formatting”, so two toolbars shown together
never have two controls of the same name. Name every toolbar of a
window that shows more than one.
A button is the toolbar icon size (size.icon.toolbar) padded by
space.xs on each side, so the compact density makes the whole
toolbar smaller; titles use the button text style. The kit’s
toolbar-button (kit) paints the buttons, based on
icon-button: a fill under the pointer and while pressed, the frame
while on, the muted text colour when disabled. The rows of More tools
take a menu’s look (menu-item, the icon in the gutter framed while
on, the key in the muted tone).
egui_stack’s toolbar::ToolRow lays the tools out, cuts the row into
More tools, takes the clicks and moves the focus; Toolbar builds its
tools from the menu’s items and the kit paints them, through the kit’s
DockPainter (tool_item, tool_more, tool_separator), the
painter of the docks and section stacks too
(ADR 0022).
The keyboard
A toolbar is one Tab stop (egui_stack’s TabFocus::Roving, as
a roving group is), as in
Office, VS Code and ARIA’s toolbar pattern:
| Key | What it does |
|---|---|
| Tab, Shift+Tab | Into the toolbar, on the tool focused there last (the first the first time); from any tool, out of it |
| Left, Right (a column: Up, Down) | The tool before or after, round from one end to the other; a greyed tool is passed over |
| Home, End | The first tool, the last |
| Enter, Space | Runs the tool, opens a submenu or More tools |
What agents read
toolbars::layout(app, &menu) (the toolbars debug collector, by menu
id) gives what a toolbar drew last: its orientation and labels, then
every tool in order, a command with its arguments, a submenu or a
separator, with its title, icon name, key, whether it is enabled and
why not, checked, busy, and whether it went into More tools. The
declared items are the menu’s (AppHandle::menu). Each icon drawn is
recorded in the icon registry’s drawn list (toolbar), and the rows of
an open More tools are in menus::rows_drawn, under the toolbar’s menu
id.
The gallery’s toolbars page shows a toolbar of icons with egui-pop’s
Edit commands in it, the same tools with their titles, a narrow one
with More tools, and a vertical tool palette whose tools come from a
list.
Not yet
- A setting to choose icons, titles or both for every toolbar, and a way for the user to customise a toolbar’s tools.
- Split buttons (an action and a menu of its variants) and tools that are not commands (a field, a zoom box).
The workbench
What an application’s window holds around its content: its own frame, the scale of each window, panels in areas, slim strips, panels detached into windows of their own, named arrangements, and the keymap changed at run time. Every change goes through a step (ADR 0011): a plugin may watch it on the journal, veto or redirect it, replace it or follow it.
Panels in areas
A plugin declares panels with their rules; the workbench places them in
areas (the centre, the start and end side bars, the bottom panel), as
tabs, rows, columns and grids over egui_stack
(the continuation of egui_dock),
saves where the user put them and repairs that layout at the next start.
A panel no longer declared (its plugin disconnected or not installed)
leaves the layout, but its place is kept dormant (SavedLayout::dormant:
docked in an area at its tab’s index beside the same panels, detached
on a screen, floating at a corner, or closed), saved with the layout,
and the panel goes back there when it is declared again (ADR 0028,
AppHandle::saved_layout, Layout::repair_dormant); the
log says each with a layout: info line.
The shell’s side bar, main and inspector zones are panels of their areas.
One dock space. The areas are the named docks of one egui_stack
DockSpace (center, start_side, end_side, bottom). The
workbench lays the areas out (a side area’s width, its fold and flyout,
an area lying over the centre, the bottom panel’s alignment) with
egui_stack’s layout layer: each area is a zone holding its dock, with
its least, largest and default sizes as constraints, the centre the zone
that grows, a folded side area the zone’s strip; the zones that hold no
dock refuse a dragged tab (DockSpace::bind). It draws each area’s dock
where the layout put the area; the docks share one drag, so a
tab goes from any area to any other as it goes inside one. Each area’s
rules are its dock’s: any split, as inside one area; never one of
egui_stack’s floating windows (a panel leaves the main window through
Detach, into a window of its own); kept when it is empty, so a closed
area stays a drop target. The layout document keeps one tree per area,
as before the space: a layout saved before reads as it did, each area’s
tree becoming its dock’s.
The starting layout. Without a saved layout, every panel starts in
its default area. AppBuilder::layout gives the layout to start with
instead (the panels’ areas, tabs and splits, the closed panels, the
folded areas), repaired against the declared panels as a saved layout
is; the Default arrangement resets to it. An application that does not
use the shell’s zone panels lists them as closed:
use egui_pop::api::workbench::{PANEL_INSPECTOR, PANEL_MAIN, PANEL_SIDE_BAR};
use egui_pop::model::ids::PanelId;
use egui_pop::model::layout::{Layout, Node};
use egui_pop::model::panels::Area;
use egui_pop::prelude::*;
const TREE: PanelId = PanelId::from_static("demo.tree");
const VIEW: PanelId = PanelId::from_static("demo.view");
let builder = App::builder()
.layout(Layout {
areas: vec![
(Area::StartSide, Node::tab(TREE)),
(Area::Center, Node::tab(VIEW)),
],
hidden: vec![PANEL_SIDE_BAR, PANEL_MAIN, PANEL_INSPECTOR],
..Layout::default()
})
// Every area runs to the window's edges, a line between them.
.frameless(&Area::ALL);
Frameless areas. An area has a margin around it, and each of its
panels’ bodies a margin and a rounded border (the kit’s dock-body).
AppBuilder::frameless takes both away for the areas it names, so their
panels run to the window’s edges and are set apart by the separator’s
line only (a viewer whose views draw to their edges); a panel then gives
itself the margin it wants. main_edge_to_edge takes away only the
centre’s outer margin.
Lines between panels. Two panels of one area meet at the dock’s
separator (the kit’s dock-separator); two areas meet at the layout’s
line between them, which the kit draws (as wide as the widgets’ border,
shown at rest only when side-area has a border). It lies inside the
side or bottom area, on its edge facing the centre, in the room the
area’s frame keeps for it, where egui drew a side panel’s separator
(Kit::paint_area_line); it takes the drag that resizes the area. Under the pointer and while dragged it is drawn from side-area.hover.border-* and side-area.active.border-* (a width of 0: no line), egui’s widget strokes when the kit says nothing. Those are the lines that mean something: the bodies’ borders
beside them only repeat them, and a kit that wants one line where two
panels meet sets dock-body.rest.border-width to 0, as the Rerun-like
kit does (it also hides the dock’s separator at rest).
Bare panels. A shell panel is declared bare (PanelSpec::bare): alone in
its area it is drawn plainly, with no tab bar and no scroll area from anyone. What
its blocks draw past its end is cut, and nothing says so. Beside another panel the
same content is in a tab, and egui_stack gives a tab’s body a scroll area on both
axes. So a block in SIDE_BAR, MAIN or INSPECTOR that may run long brings its
own scroll area, and one sized to what it is given stays inside it: a viewport
filling MAIN must not scroll. The gallery shows both: its pages get a scroll area
each, but for those filling the zone themselves (shell::FILLS_THE_ZONE).
use egui_pop::api::steps::Before;
use egui_pop::api::workbench::STEP_MOVE;
use egui_pop::egui;
use egui_pop::model::ids::PanelId;
use egui_pop::model::panels::{Area, PanelSpec};
use egui_pop::prelude::*;
const LOG: PanelId = PanelId::from_static("demo.log");
const TREE: PanelId = PanelId::from_static("demo.tree");
struct Demo;
impl Plugin for Demo {
fn id(&self) -> PluginId {
PluginId::from_static("demo")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
// The log stays in the bottom panel; the tree may go anywhere.
ctx.panel(
PanelSpec::new(LOG, "Log", Area::Bottom)
.only_in(&[Area::Bottom])
.min_size(80.0),
|ui, _| {
ui.label("log");
},
)?
.panel(
PanelSpec::new(TREE, "Tree", Area::StartSide).default_size(220.0),
|ui, _| {
ui.label("tree");
},
)?;
// A veto: the tree never goes to the bottom panel.
ctx.before(STEP_MOVE, |_, args| {
if args["panel"] == "demo.tree" && args["area"] == "bottom" {
Before::Veto("the tree stays on a side".into())
} else {
Before::Go
}
});
Ok(())
}
}
let app = App::builder().plugin(Demo).build(&egui::Context::default()).unwrap();
let h = app.handle();
assert_eq!(h.layout().area_of(&LOG), Some(Area::Bottom));
// Refused by the panel's rules, then by the plugin, then done.
assert!(!h.move_panel(&LOG, Area::StartSide).unwrap().ok());
assert!(h.move_panel(&TREE, Area::Bottom).unwrap().vetoed().is_some());
assert!(h.move_panel(&TREE, Area::EndSide).unwrap().ok());
assert_eq!(h.layout().area_of(&TREE), Some(Area::EndSide));
A side area is never narrower than the largest PanelSpec::min_size of
its panels. The shell’s own panels (PANEL_SIDE_BAR, 120 points at
least; PANEL_INSPECTOR, 160) take the application’s sizes:
AppBuilder::shell_panel_size the width they start at,
shell_panel_min_size and shell_panel_max_size their least and
largest, in points or as a share of the window
(workbench::ShellSize::Share(0.6)). While the application runs,
AppHandle::set_shell_panel_min_size and set_shell_panel_max_size
change them (None puts back the default): a least width measured from
the panel’s content, which depends on the fonts and the text size, is
set there, each frame or when it changes, and the area widens to it on
the next pass. AppBuilder::centre_min_size
keeps the centre at least that wide: the side areas give way to it,
each down to its own least, and a window too narrow for all of them
squeezes the centre.
Each panel gets <id>.focus and <id>.toggle commands. AppHandle::focused_panel,
the context key focusedPanel, is the panel the keys obey; see
The focused panel. The layout
changes through the steps workbench.move, workbench.show,
workbench.hide, workbench.focus, workbench.fold,
workbench.place, workbench.flyout, workbench.flyout_size,
workbench.arrange and workbench.zen (egui_pop::api::workbench).
Drop zones. A tab dragged inside an area shows where it would go on
the group under the pointer itself, with no buttons: near an edge (in
egui_stack’s edge band), the half of the group a split would give it,
bordered and tinted; elsewhere the whole group, to join its tabs; over a
tab bar, the place among its tabs. The zone is the kit’s dock-preview
(its rest border and fill, the fill at its opacity), so it follows
the theme like the hint between areas; the same tokens feed egui_stack’s
OverlayStyle::zone_fill, zone_stroke and zone_corner_radius. A tab
dropped outside every area stays where it was. A drop on the edge of a
group in a row (a column) joins that row (that column) rather than
nesting a split, and a drop beside a group in a grid joins the grid.
Rows, columns and grids. An area holds groups of tabs in rows,
columns and grids, nested. “Arrange as grid” (workbench.arrange.grid)
lays out the row, column or grid holding the focused panel’s group in
rows and columns, row by row: as many columns as the square root of
their number, rounded up, or columns from the command’s arguments;
“Arrange as row” and “Arrange as column” (workbench.arrange.row,
workbench.arrange.column) lay them out again side by side or one above
the other. Each takes a panel argument for another group than the
focused panel’s, an agent’s way in; a group alone in its area has
nothing to arrange ({ "arranged": false }). They go through the
workbench.arrange step (panel, as: grid, row or column,
columns), AppHandle::arrange from code. The layout document saves a
grid as a node of kind grid (columns, col_shares, row_shares,
children); a row or column of more than two as splits nested on their
second side, each ratio the share of its first side. Layouts saved
before grids read as they did.
Between areas. A tab dragged onto another area gets the same zones
there, with the same preview: the middle of a group joins its tabs, an
edge splits the group on that side, a tab bar takes it between two tabs.
An area its panel stays out of (PanelSpec::only_in, or content the
area cannot host) refuses it: the zone shows disabled, with the reason
(“Log stays out of the start side bar”), and a drop there changes
nothing. A closed side or bottom area is offered along the areas’ edge
(a band of 48 points), an area drawn bare (a zone alone, without a tab
bar) over its whole rect: dropped there, the tab joins its tabs. Once
the tab is dropped in another area, the move goes through the
workbench.move step (panel, area): a plugin’s veto puts the tab
back where it was, a redirect sends it to the area the step names.
The refusal itself is asked on the application’s bus: the space has it
(egui_stack’s bus feature), and the workbench’s listener of
egui_stack’s stack.dock.drop (pop.workbench.dock_drop) says the panels’
rules; any listener of the point may refuse a drop, its reason shown on
the zone, asked when the drop’s destination changes and again at
release. The workbench follows the zones the user resized, folded or
unfolded, and the flyouts, from stack.layout.changed
(pop.workbench.stack_layout), on the same bus. A palette dragged over an area it docks in, with the dock keys held (see
Palettes, Dragging), shows the hint with a ghost of its tab (the kit’s
tab-preview) after the area’s first tabs.
The hint is published like an overlay: AppHandle::drop_hint (panel,
area, rect, refusal, zone, the egui_stack DropZone (Center to join
tabs, an edge to split), index among the tabs it would join, and for a
palette preview, its ghost’s area, index and rect, and armed:
whether a drop now docks, always for a tab), overlay_rects (kind
DropHint, named drop:<panel>:<area>, only while armed: a hint not
armed is not drawn), and the debug bridge’s workbench collector
(drop_hint: {name, panel, area, rect, refusal, zone, index, armed, preview}), which also shows the layout, each area’s rect, the focused
panel and the tab being dragged.
The focused panel
There is one per window: the panel the widget focus is in, or the last one
it was in. The main window and its detached panels share the workbench’s;
an application window keeps its own (empty while none of its panels was
focused), so the keys of a panel bound in the panel:<id> scope, or with a
when testing focusedPanel, never fire from another window (key
scopes).
when clauses reading focusedPanel follow the keyboard. Beside it,
focusedPanelKind is that panel’s kind (PanelId::kind): its own id, or
app.gallery while the instance app.gallery#2 has the focus, so a
clause focusedPanelKind == 'app.gallery' reaches every instance (see
Panel instances).
| What happens | focusedPanel | The widget focus |
|---|---|---|
| Tab or a widget takes the focus, in a panel | that panel | that widget |
workbench.focus, <panel>.focus, focus_panel | that panel, at once | in the next pass, see below |
| F6 or Shift+F6 (regions) | the panel it lands in | the region’s last, or as below |
Ctrl+Page Down or Up (workbench.tab.next, .previous) | the tab beside it in its group, wrapping | as below |
| A press in a panel | that panel | as the widget pressed decides |
| The focus goes to the menu, the status bar or a dock’s tab | unchanged | there |
| Escape, or the focused widget going away | unchanged | none |
| A panel closes while focused | none, or back from a palette | none |
Handing a panel the keyboard. It shows the panel, then gives the focus to
the widget the panel named with egui_pop::core::focus::prefer; without one, to
the panel itself, from which Tab enters its widgets. Never to its first
focusable widget unasked: a slider focused that way would take the wheel meant
to scroll the panel (classic applications focus the panel, not its first
control). If the focus is
in the panel already it stays where it is. Behind a modal, or when a command
from an agent, a script or a device finds someone typing in a field, only
focusedPanel moves. The focus lands a pass later, so the key that ran the command is not
typed into the field it lands on.
- A canvas is a widget like another: one that senses clicks or drags is
focusable, and a panel whose toolbar comes first says
focus::prefer(ui.ctx(), response.id)so the canvas gets the keyboard. The image viewport does, as do the library’s grid (over its filters) and a text editor (over its find bar). A panel with a search field first and a list below should do the same, and a search panel names its field, so a “go to the search” key lands in it. - Any other panel holds the focus itself: a stop named after the panel, drawn only while it holds the focus, so it is no extra Tab stop. Tab goes on from there into its widgets. It shows nothing yet (item 4 of the keyboard survey).
The last panel stays when the focus goes to something no panel holds. In
egui a menu’s items take the focus and nothing gives it back when it closes, and
Escape on any widget leaves nothing focused: if focusedPanel emptied, opening
a menu or pressing Escape would turn off every key of the panel worked in, and
a command in that menu would act on nothing. VS Code has both kinds of keys:
focusedView, sideBarFocus and panelFocus empty on blur, activeEditor,
activeViewlet and activePanel stay. focusedPanel is of the second kind.
Whether a widget holds the focus at all is widgetFocus.
Palettes and flyouts only borrow the keys. A press on one leaves them where
they were: a click on a palette’s background keeps the keys on the image, as in
an image editor. A widget of it taking the focus (a press on a field, Tab, its
.focus command) does move them, and when it lets go (Escape, a click
elsewhere, the palette closing) they go back to the panel of the layout that
had them.
Detached windows. egui keeps a focus per window. A widget taking the focus
in a window, a press in it or the window getting the system’s focus back moves
focusedPanel; <panel>.focus raises the panel’s window.
Following is a plain write, not a step: it cannot loop back through
workbench.focus. Each change, from either side, is published once as the event
workbench.focused ({ "panel" }).
A side area lies beside the centre, taking its room, or over
it (workbench.place, { "area", "placement": "over" };
AppHandle::place_area, AppBuilder::over for the first start): its
folded strip keeps the room in the layout, so the centre keeps its
width (a terminal in it is not resized), and the area, unfolded, lies
above the centre next to its strip, with the kit’s side-area shadow
(shadow.side). A click on the strip’s grip folds or unfolds it; its edge on
the centre’s side resizes it. The placement is saved with the layout
(over), like folding; a plugin may veto the step. The centre never
folds: workbench.fold refuses it.
The line between a side or bottom area lying beside the centre and the centre resizes the area: by a drag, or with the keyboard once Tab or Shift+Tab reaches it (“Resize the start side bar”, a splitter to assistive technology). An arrow across the line moves it 16 points, with Shift 64, and Enter or a double click gives the area its default size back, as a dock separator and a section’s boundary do. The sizes the user gave are kept with egui’s memory, as egui’s side panels kept theirs; a session saved when the areas were egui panels keeps its areas’ sizes.
Strip icons and flyouts
A side area’s strip (folded, or lying over the centre) shows one icon
per panel it holds, in tab order: the panel’s PanelSpec::icon, a
vector icon tinted by the kit’s activity-bar-item and crisp at any
scale, or its title’s first letter when it has none. The strip widens
to hold them. An icon’s tooltip gives the panel’s title and its key
(the first binding of <panel>.focus, else of <panel>.toggle), and
the icon is a button named by the title.
An application keeps a side area’s strip bare with
AppBuilder::bare_strips(&[Area::StartSide]): its grip glyph alone,
area-strip.width wide, no icon per panel, and a click unfolding the
area as before (AppHandle::bare_strip says which areas are bare). It
is the application’s choice, as AppBuilder::frameless is, not the
theme’s: whether a folded area lists its panels is part of how the
application is laid out, and the same theme serves applications with
and without the icons.
On a folded area, a click on an icon opens that panel alone as a
flyout over the centre, next to the strip, without moving the
layout (workbench.flyout, { "panel", "open" };
AppHandle::open_flyout). Escape or a click away closes it, the focus
going back where it was: it is an overlay of the stack
(egui_pop::core::overlay::hold), above which menus and dialogs open
as usual. A combo box’s list or a context menu opened in the panel is
part of the flyout: a click in it does not close the flyout, and Escape
closes it first. A click on another icon switches to that panel. A double
click on the icon, or the pin button in the flyout’s band, unfolds the
area with the panel shown. The flyout’s free edge resizes it; the
width is kept per panel and saved with the layout (flyouts,
workbench.flyout_size). Only a folded side area’s panels fly out;
unfolding the area closes the flyout. On an area lying over the
centre, open, a click on an icon shows its panel there.
A panel publishes an indicator through the status bar’s model,
speaking for it with Indicator::panel: while the panel is not shown
(its area folded, or another tab in front), its icon carries the state
as a micro-indicator: a count as a badge, else its errors or warnings,
else a dot in its tone, and detail joins the icon’s tooltip. Such an
indicator is not a status bar item.
use egui_pop::api::strips::{Indicator, Tone};
use egui_pop::model::ids::PanelId;
const SEARCH: PanelId = PanelId::from_static("app.search");
// Hits waiting in the search panel, on its icon while it is folded.
let hits = Indicator::new("search.hits", "No hits", "search.")
.panel(&SEARCH)
.reduce(|state, event| {
let n = event.data["hits"].as_u64().unwrap_or(0);
state.count = Some(n);
state.text = format!("{n} hits");
state.tone = if n == 0 { Tone::Neutral } else { Tone::Accent };
});
let _ = hits;
Agents read the strips in the workbench collector (strips: each
icon’s area, panel, title, icon, key, whether its panel shows, and its
indicator’s state with marked when the icon shows it; flyout: the
panel and its rect) or with workbench::strip; the mark itself is in
the indicators collector as strip:<indicator id>.
Plugins declare panels too: egui-pop’s jobs centre (egui_pop.jobs)
and devtools are panels like the application’s.
AppHandle::declared_panels lists every declared panel with the plugin
that declared it (its OwnerId), so a host that checks layouts or
templates against its own panels can accept those of the plugins it
connected, and a template may place the jobs centre.
Layers: what lies over what
The areas lying over the centre and the flyouts are foreground layers,
as overlays are. egui puts the one clicked last on top; egui-pop fixes
the order instead, in each window, bottom to top
(ADR 0026): the docked panels, the areas
lying over and the flyouts (Rank::Over), the overlays (Rank::Overlay:
toasts, the tips card, hover cards, popovers, the zen way out, an
application’s own), then the menus, combo lists and dialogs, and the
tooltips last. A click on a panel lying over no longer puts it over a
card.
An application’s own overlay, a card in a corner say, is shown through
layers::area at Rank::Overlay, instead of an egui::Area raised
with ctx.move_to_top each pass:
use egui_pop::egui;
use egui_pop::layers::{self, Rank};
fn did_you_know(ctx: &egui::Context) {
let card = egui::Area::new(egui::Id::unique("app.did_you_know"))
.anchor(egui::Align2::LEFT_BOTTOM, [12.0, -12.0])
.interactable(true);
layers::area(ctx, card, Rank::Overlay, |ui| {
ui.label("Did you know?");
});
}
let _ = did_you_know;
A layer drawn some other way (a layer_painter) calls
layers::rank(ctx, layer, Rank::Overlay) each pass it is shown, and
layers::rank_from ranks it only when the layer it opens from is not
above that rank, so a card opened from a dialog stays above the dialog.
A foreground layer nobody ranked stays above every ranked one; a host
drawing its own surface lying over the centre makes it a sublayer of
layers::base(ctx, Rank::Over).
A panel’s state
A panel whose content follows something it does not hold (the photo
selected, a document) may show content that no longer matches it. Whoever
knows says so on the bus, never the panel: pop.panel.state
(bus::PanelStateSet) with the panel’s id and its bus::PanelState:
| State | What the chrome shows |
|---|---|
Stale (no longer matches, its work not started) or Updating | the content dimmed and a busy mark on the panel’s corner and its tab, once the state has lasted motion.spinner.delay, then for at least motion.spinner.min: a fast update shows nothing |
Failed { reason } | the content dimmed and a failed mark at once, read “Update failed: reason” |
Ready | nothing |
use egui_pop::api::AppHandle;
use egui_pop::api::bus::{PanelState, PanelStateAsk};
fn photo_selected(app: &AppHandle) {
app.request_panel_state(PanelStateAsk::new("app.histogram", PanelState::Stale, "app"));
}
let _ = photo_selected;
The state may be asked from any thread, on the application’s bus too.
Stale then updating is one wait, its delay going on. A tab holds one mark
(bus::TabMark): when a panel has several, the highest rank wins, the
busy mark first. The marks are indicators named by bus::mark_id, for
tests and agents (indicator::find).
A panel’s kind
A panel says what it does to what the application edits (a document, a
photo), declared with it: PanelSpec::kind takes a
egui_pop_model::panels::PanelKind, a view unless declared.
| Kind | What it is | What the chrome shows |
|---|---|---|
View | it only shows, or moves what is shown (pan, zoom, selection) | nothing |
Control | its purpose is editing (parameters, a node graph) | an edits mark, read “Edits your work” |
Mixed | a view with parts that edit (a histogram dragged to change the exposure) | the edits mark, read “Parts of it edit your work” |
use egui_pop::model::ids::PanelId;
use egui_pop::model::panels::{Area, PanelKind, PanelSpec};
let spec = PanelSpec::new(PanelId::from_static("app.params"), "Parameters", Area::EndSide)
.kind(PanelKind::Control);
assert!(spec.kind.edits());
The mark is drawn by the chrome, never by the panel: on a docked tab’s
top end corner, and after the title of a floating palette’s band (or on
its tab in a group of tabs). It takes the tab’s one mark slot
(bus::TabMark::Edits), of the lowest rank: while the panel is busy or
failed (pop.panel.state), that mark shows instead, and the edits mark comes
back once it is ready. It is the same indicator id as the state’s
(bus::mark_id(panel, true)), its state edit.
pop.panel.open (bus::PanelOpen, AppHandle::open_panel) opens a
panel, whoever asks: its <panel>.toggle command, the
workbench.panel.open command (agents, menus), a tab group’s menu (Open
panel ▸, a right click on its bar’s empty part) and the “+” on each tab
bar (DockControls::add_buttons, off by default: the closed panels that
may open in that group). Its place is last (the default), here or
an area’s name. A closed panel’s place is kept when it closes
(Layout::last_place): last puts it back among the same tabs at its
index, floating at its corner or in its window; that place gone, it
joins the focused panel’s tab group when its areas allow it, else its
declared area. here opens it in the tab group holding group (any
panel of it, docked, floating or detached), else in the focused panel’s.
The workbench answers through the workbench.show step, so a plugin may
veto it.
Each window’s own workbench
Every application window (AppHandle::open_window) can hold panels in
areas of its own: a centre, start and end sides and a bottom, with tabs
and splits, around its content (Layout::windows, saved with the
layout; workbench::window_areas). A window with no panel in its areas
draws its content alone. Each area is a dock of the window’s own space:
its tabs reorder, split and move between the window’s areas by drag and
drop, and each tab’s menu is the panel menu.
A window opened with WindowSpec::centre_dock(true) has no content of
its own: its middle is its centre area, as the main window’s is. The
panels docked in its centre take the whole middle, between its sides and
above its bottom; empty, the centre says “Drop a panel here” and takes a
tab dropped there, from that window or another one. A home window for a
set of panels is opened this way. Without it, the window’s content keeps
the start of the middle and its centre’s panels go beside it.
pop.panel.open carries origin, the window it is asked from; menus,
commands and keys fill it in with the window they run in. A closed panel
opens by rule A:
- where the application sends it:
pop.panel.home(bus::PanelHome) answers a window’s id (its home window, say); a window not shown is passed over; - back to its last place, while that window is shown;
- in the window it was asked from, in its declared area;
- that window gone, in the main window while it shows the shell, else in the first window shown.
Never in a window closed, nor in the main window while another window’s
content holds it. An area named (place: "bottom") opens in the window
asked from too.
The area is the panel’s declared one, unless the application answers
pop.panel.home_area (bus::PanelHomeArea), asked after
pop.panel.home with the window the panel opens in: an area answered
replaces the declared one (in the main window too), where the declared
one would be used. A panel back to its last place stays there, an area
named by the ask wins, and an area the panel’s rules refuse is passed
over. An application answering only pop.panel.home keeps the declared
areas.
A window’s areas have the main window’s chrome:
- Folding.
AppHandle::fold_window_area(theworkbench.foldstep withwindow) folds a side area to a strip: a grip that unfolds it, then an icon per panel; the bottom folds out of sight. Folds are saved with the window’s areas (WindowAreas::folded); the centre never folds. - Flyouts. A click on a strip icon opens the panel alone over the
window’s content, next to its strip (
workbench.flyout, as in the main window); Escape or a press away closes it, its band’s pin unfolds the area. - Zen mode. Zen mode on one of the window’s panels
(
AppHandle::set_zen_panel) draws it alone in that window; the main window is left as it is. - F6. Each area is a region (
region.window.<area>), and the window’s content one more (region.window.content): F6 and Shift+F6 pressed in the window go through them in rank order (sides, bottom, centre), a panel of text alone holding the focus itself.
pop.panel.describe (bus::PanelDescribe, AppHandle::describe_panel)
describes a declared panel on the bus: its title, whether it is a
palette, and its kind (bus::PanelDescription), for agents and tests
without a screenshot.
Panel instances
A panel is declared once, and most open once (Settings, an import
window). A panel declared with several (PanelSpec::instances with
Instances::Multiple, or Ctx::instance_panel) opens as many times as
asked: a second gallery, another quick collection.
use egui_pop::api::Ctx;
use egui_pop::model::ids::PanelId;
use egui_pop::model::panels::{Area, PanelSpec};
fn connect(ctx: &mut Ctx<'_>) {
const GALLERY: PanelId = PanelId::from_static("app.gallery");
let _ = ctx.instance_panel(
PanelSpec::new(GALLERY, "Gallery", Area::Center),
|ui, app, instance| {
// One function draws every instance, told which it draws; what
// each shows is its payload, the application's.
let payload = app.instance_payload(&instance.id);
ui.label(format!("{}: {payload}", instance.title));
},
);
}
- Ids. The panel declared is instance 1. Each new one is
<kind>#<n>(app.gallery#2), still aPanelId: the dock, the focus, the fault boundary, the panel menu and the steps treat it as any panel.PanelId::kindandPanelId::instance_numberread it back. Its title is the kind’s with its number (“Gallery 2”). - Keys and undo. An instance has its kind’s: a binding with
when: "focusedPanelKind == 'app.gallery'"fires in each instance (a clause onfocusedPanelnames one panel), and a history scope whose focus target is the kind (ScopeInfo::focus) is active and takes Ctrl+Z in each instance (history). - Payload. Each instance holds a payload the application owns,
opaque JSON (
AppHandle::set_instance_payload,AppHandle::instance_payload). It is kept in the layout (Layout::instances), saved with it and handed back on restore. A layout saved before instances existed loads as one with none. - Opening.
pop.panel.opentakesinstance:"new"makes the next instance and opens it atplace(last: its kind’s area;here, an area), an instance’s id opens that one. A panel declared once refuses"new". Theworkbench.panel.opencommand passesinstanceon, and says the new id in its result, for agents. - Menus. A tab group’s Open panel ▸ and its “+” list “New
<panel>” first, for each panel declared with several that the group’s place allows. The View menu has the same entries, opening in the panel’s area; an application’s own Window menu adds them withMenuItem::listandpanel_menu::LIST_NEW_INSTANCES. - Closing. Closing an instance drops it with its payload: it is not kept closed, and its number may come back later. Closing the panel declared keeps its place, as any panel’s.
- Facts. The journal says
panel.instance.openedandpanel.instance.closed({ "panel": <id>, "kind": <kind> }), so the application can drop what it kept for a closed instance. Restoring a layout says the instances it opens. - Titles. An instance’s tab title is generated until the
application names it:
pop.panel.retitle(bus::PanelRetitle, abus::PanelRetitleAsk{ "panel", "title" }), orAppHandle::set_instance_titlefrom code. A library view opened on a collection reads “Picks”, not “Gallery 3”, and follows the collection when it is renamed. The title is kept in the instance’s layout entry (PanelInstance::title, next to its payload), saved and restored with the layout; a layout saved without titles loads unchanged. The tab, the panel menu’s list of instances, the View menu, accessibility and theInstance::titlehanded to the draw function all read it;title: nullgives the generated one back. Only an open instance<kind>#<n>takes a title: the panel declared, a panel declared once, an instance not open and a blank title are refused with the reason. The journal sayspanel.instance.retitled({ "panel", "kind", "title" },titlenullwhen the generated one is back). - Plugins. An instance whose kind’s plugin is off keeps its place and payload, as a dormant panel does (ADR 0028); declared again with one instance, the kind’s other instances are dropped.
Interactive areas
Inside a panel, each interactive area says what it writes, to the area
registry (egui_pop_core::areas), each pass it is drawn, after its
widget: a display area only shows (a scope’s picture), a
navigate area moves what is shown (pan, zoom, a scope’s mode), an
edit area writes what the application edits, with the control it
writes and its value now. The framework, never the widget, draws what
tells them apart:
- an edit area’s grips at rest (
areas::Grip), small handles where a drag takes it, as a Levels tool’s: a graph with grips edits, a graph without is a picture (the histogram’s exposure grip on its right edge; a waveform or a vectorscope has none); - the edit cursor of its drag (
AreaSpec::cursor); - a hover card naming the control and its value (“Exposure +0.30 EV”), also the area’s accessible description.
use egui_pop::core::areas::{self, AreaSpec, Grip};
use egui_pop::egui;
fn exposure(ui: &mut egui::Ui, ev: &mut f32) {
// Ask before sensing: inert while the panel is not current.
let sense = if areas::inert(ui) { egui::Sense::hover() } else { egui::Sense::drag() };
let (rect, r) = ui.allocate_exact_size(egui::vec2(160.0, 40.0), sense);
*ev += r.drag_delta().x / rect.width() * 4.0;
areas::register(
ui,
&r,
AreaSpec::edit("app.exposure", "Exposure")
.value(format!("{ev:+.2} EV"))
.path("exposure")
.grip(Grip::horizontal(rect.right_center())),
);
}
An edit area is inert while its panel’s state is not current
(pop.panel.state stale, updating or failed): the workbench draws the
panel’s content in an areas::scope that says so, and the area senses
no edit and shows no grip, no card, no edit cursor (the histogram of the
previous photo is not dragged). pop.ui.areas (bus::UiAreas,
AppHandle::ui_areas) lists the areas of each window’s last pass: id,
kind, control, value, path, rectangle, panel, grips, and whether it is
inert, for agents and tests without a screenshot.
Auxiliary windows
A detachable panel moves to an OS window of its own, with its own scale
and the application’s frame when it draws one
(AppHandle::detach_panel, attach_panel; the tab menu offers
Detach). Closing that window is the workbench.close_window step: its
default docks the panel back, a veto keeps the window open. Its place is
kept in the layout and repaired before the window opens. The window is
titled with the panel and the application’s name (AppBuilder::name,
“Filmstrip — Helios”), not the main window’s whole title.
Tabs in a detached window. Other panels may join a detached window as tabs: it shows them in one tab bar (no splits) and is titled after the tab shown. A panel joins it:
- by a drag: the window’s tabs are a dock of the workbench’s space,
one of egui_stack’s native floats (
FloatsArea, hosted by egui-pop with its own viewport ids), so a tab dragged from any window is one drag of the space (DockSpace::dragging). A detached window under the pointer shows the drop zone the areas show (the kit’sdock-preview), disabled with its reason for a panel that may not leave the main window (stack.dock.drop); let go there, the tab joins the window’s tabs. egui keeps each window’s input apart and the system hands a drag to the window it began in, so the window sees the pointer only through the space’s drag: a window embedded in the main one (kittest, a backend without windows) always does, an OS window does when both windows know where they are on the screen (X11, Windows, macOS). On Wayland, which hides window positions, each window that may take the tab outlines its dock once the tab leaves its window (DockPainter::window_outline, the kit’sdock-previewborder,AppHandle::window_outlines), and the window the pointer is over once the drag lets it go takes it; - from the tab’s menu, “Move to window”, which lists the detached
windows by their panels and works everywhere; an agent runs the
workbench.move_to_windowcommand (panel, the focused one by default;window, a panel of that window),AppHandle::move_to_windowfrom code.
Each way is one workbench.join_window step (panel, window): a
drop egui_stack lands in a detached window is put back and moved by
that step, which a plugin may veto (the tab stays where it was). Its
tab’s menu moves a panel out again (“Move to …” docks it, Detach gives
it a window of its own); closing the window docks every panel it holds.
The layout document keeps the first panel under panel and the others
under tabs, the shown one as shown: an application that predates
tabs in windows opens the first panel there and docks the others in
their default areas.
A whole tab group. The empty part of a tab bar, right of its tabs,
the grip at the end of the bar, or a tab dragged with the group key
held (Shift by default) drags the whole group, as an editor group is
dragged by its tab bar in established IDEs. Each of these handles is a
setting the user turns off (workbench.group_handle.empty_space,
.grip, .modifier_drag, .menu; the key is
workbench.group_drag_modifier: shift, ctrl or alt), among those the
application allows (AppBuilder::group_handles, all of them by
default). The tab menu’s “Move group” (GroupHandles::MENU) lists a
new window and the other areas, each by its title and the titles of
the panels it holds (“Start side bar (Tree)”), translated. A floating window’s move handle
(workbench.group_handle.move_window) and what moving the window does
(workbench.float_move: move, the default, or dock) are settings
too, for egui_stack’s floats. Dragged whole, all its tabs move together, in order, the shown one
kept (egui_stack’s DockArea::dragged_node). Inside the main window it
takes the same zones as a tab (the middle of a group joins its tabs, an
edge splits the group), each tab dropped in another area running its
workbench.move; over a detached window it joins the window’s tabs
whole, with the same frames and outlines as a tab (the drag session
carries the group); let go outside every window, it opens a window of
its own holding it. A group goes whole or not at all: the first of its
panels that may not leave the main window refuses it, with its reason.
The tab’s menu offers the same, “Move group to window”, naming each
detached window and a new one, for keyboard users and where a drag
cannot reach a window (Wayland), on a group of two tabs or more. Across
windows, these are the workbench.join_window and workbench.detach
steps with group: true (Change::JoinWindowGroup,
Change::DetachGroup): the window it opens is its pop.window.open, a
window it empties closes as a panel’s joining another does.
Back out of a detached window. A detached window always shows its
tab bar, even holding one panel. A tab dragged out of it and let go
over another window of the application goes there: over the main
window, it docks in the area under the pointer (the centre, a side or
the bottom area drawn, or a closed one along the areas’ edge), as a
workbench.move step; over another detached window, it joins its tabs.
Over the main window the areas show the zones of a drag begun there
(a group’s middle, its edges, a tab bar, a closed area along the
areas’ edge), disabled with its reason where the area refuses the
panel (only_in); a drop there is refused with that reason
(drag.refused, workbench.refused), the tab staying in its window,
and a drop it takes is said as dropped on workbench.area.<area>.
Let go outside every window, nothing moves. Where the system tells
where windows are (X11, Windows), the zone shows during the drag; on
Wayland, which hides window positions, the main window’s docks are
outlined instead, and the drop goes to the window the pointer is over
once the drag lets it go; the way home that
always works is the Dock back button at the end of the window’s
tab bar, the tab menu’s Dock back, or Ctrl+Shift+D
(workbench.panel.dock_back, on the focused panel): the shown panel
docks back where it came from, else in its own area
(workbench.dock_back).
Such a window is a window of the application in full:
- Keys. The keymap reaches it: the key dispatcher runs in each
window’s pass, in that window’s context. Its focus chain is its own
(egui keeps a focus per window), so an editor’s find or save fires in
the window where the editor has the keyboard, and the
windowcontext key holds the detached panel’s id there (empty in the main window):when: "window == 'app.log'"binds a key in that window only. - Dialogs. A dialog comes up over the window the user worked in
last (
AppHandle::active_window: focused, clicked or typed in), so a dialog opened from a detached panel’s window is shown there. While it is open, every other window is blocked: its keys are dropped and a backdrop covers it; a click there brings the dialog’s window to the front. A window closed with a dialog open gives it to the main window. Each window has its own overlay stack (egui_pop_core::overlay); blocks of theWINDOW_OVERLAYSzone are drawn in every window, each drawing what belongs to it. - Menus, the palette and toasts. As in VS Code’s auxiliary windows,
they open in the window in use: the command palette and a popup menu
(
menus::popup_at) open over the window the user worked in when they opened, and a context menu over the widget it belongs to; the toasts show in the active window. Each goes to the main window when its window closes. The palette, a modal overlay, blocks the other windows as a dialog does. The settings window and the in-app file chooser open in the main window.
The bottom panel lies under the editors by default, between the side
bars, which go down to the bottom, as VS Code has it. The
workbench.panel_alignment setting lines it up otherwise, as VS Code’s
panel alignment does: justify (the window’s whole width, under both
side bars), start (under the start side bar) or end (under the end
one); AppBuilder::panel_alignment gives the default.
The menu bar
The shell draws the main menu (app.main) as a menu bar. When the
window is too narrow for all of it, the menus that fit stay in the bar,
from the start, and the rest become submenus of a “…” entry (the
more icon, named “More menus”), keeping their titles, items and
when clauses. When no menu fits besides “…”, the whole menu is one
entry (the menu icon, named “Main menu”). The blocks of the
app.top-bar zone keep the width they took, after the menus. At the
bar’s end, the commands of MENU_BAR_END show as icon buttons, and the
blocks of the app.top-bar-end zone (zones::TOP_BAR_END) before them,
left to right: a document’s name, a readout, any widget of the
application’s. They too keep the width they took; the menus overflow
first. Without the menu bar (AppBuilder::menu_bar(false)), the top bar
still shows when either zone has blocks. Each
label is measured once, and again only when the language, the kit or
the scale changes.
Each menu has an access key: the first letter of its label not taken by a menu before it (File, Edit, View, Help: F, E, V, H). Alt and that letter open the menu, in the bar or inside “…” with the menu’s submenu open; a key binding on the same keys wins. The accessibility tree gives each menu its access key.
menus::bar_layout(app, &MENU_MAIN) says where each menu went last,
and the menu_bar debug collector shows it: bar, overflow,
collapsed and keys. menus::bar_within draws any declared menu as
such a bar, keeping room at its end.
Zen mode
workbench.zen (View > Zen mode) toggles a view of the panel that
matters alone, full size: the title bar, the menu and status bars, the
activity bar, every other panel and the floating palettes are hidden,
and the frame publishes no caption. Which panel, in this order:
- the one named:
panelin the command’s arguments, which the panel menu’s “Zen this panel” passes (a tab’s, a floating panel’s); - the focused panel, when it is a view or a mixed one
(
PanelSpec::kind; zen on a control panel makes no sense); - the application’s choice, asked on the bus as
pop.zen.panel(bus::ZenPanel, an alter point egui-pop does not answer itself): an image viewer answers with the surface a double click reaches; - the centre’s active tab;
and with none of them open, the centre whole. The centre’s only panel
is shown as the centre whole: drawn where it was, the widget holding
the keyboard keeps it. AppHandle::zen_target
says which it would be, AppHandle::set_zen_panel zens a panel,
AppHandle::zen_panel says which one is shown. A panel in a detached
window is zenned in that window: the window draws it alone, without its
title bar and tabs, and the main window stays as it is. Zen mode only
changes what is drawn, never the layout: leaving it draws the layout as
it was. Shift+F11 toggles it (Sublime Text’s
distraction free mode; VS Code’s Ctrl+K Z is left out, since it would
make Ctrl+K a prefix everywhere while it deletes to the line’s end in
a text field). An application binds its own key in its defaults, and
takes the default away below them:
ctx.keybinding("Ctrl+K Z", workbench::CMD_ZEN, "", Layer::Default)?
.unbind("Shift+F11", Layer::Workspace)?;
Escape leaves it (workbench.leave_zen, while no
overlay is open, no mode is pushed and no text field has the
keyboard; in a text field, the first Escape leaves the field and the
second leaves zen mode). The way out stays in sight: on entering, a
strip at the top centre (the kit’s fullscreen-exit component) says
“Zen mode: Escape to leave” (the key bound to workbench.leave_zen)
next to a “Leave zen mode” button, for three
seconds, then fades over motion.duration (at once under reduced
motion); screen readers hear it once. Afterwards, the pointer at the top
edge brings the strip back, as the menu bar of a full screen window on
macOS, until it leaves the strip. The command palette (Ctrl+Shift+P)
still opens in zen mode and offers “Leave zen mode”. In full screen,
zen’s strip stands in for full screen’s own. The change is the
workbench.zen step ({ "zen": bool, "panel"? }, its result naming the
panel and its window,
AppHandle::set_zen, AppHandle::zen, the workbenchZen context
key): a plugin may veto it, and the journal records it. Zen mode is a
state of the session, not of the layout: it is never saved, and the
next start shows the whole workbench. Combined with full screen, it
leaves the content alone on the screen.
The layout controls
VS Code’s layout controls, the rule here (egui_pop::api::layout_controls):
-
The area toggles.
workbench.toggle.primarySideBar(Ctrl+B),workbench.toggle.panel(Ctrl+J) andworkbench.toggle.secondarySideBar(Ctrl+Alt+B) fold a shown area to its strip, or show it again, through theworkbench.foldstep: the area keeps its panels, its tabs and its size. An area with nothing left to show gets its first closed panel back (workbench.show). The primary side bar is the start side area, the panel the bottom one, the secondary side bar the end side one. They are in the View menu, ticked while their area shows; the context keyssideBarVisible,panelVisibleandauxiliaryBarVisiblesay so. The strips plugin’s own fold command (view.side_bar.toggle) has no key:Ctrl+Bis VS Code’s. -
The options, settings each change of which is one undo step: the primary side bar on the left or the right (
workbench.side_bar_position,leftby default; the secondary one lies across from it, the activity bar beside the primary one; theworkbench.layout.sideBarPositioncommand), and the bottom panel under the editors or across the full width (workbench.panel_alignment,centerby default as VS Code’s; theworkbench.layout.panelAlignmentcommand). -
The layout menu (
layout_controls::MENU_LAYOUT, View > Customize layout, theworkbench.layout.customizecommand): the area toggles; the arrangements, the application’s templates and the saved ones, the current one ticked; “Save the current arrangement as…”, which asks for a name in a dialog; and the options. -
In the title bar, when the application asks for them:
App::builder().plugin(FramePlugin::own().layout_controls(true))A “Customize layout” button opening that menu, then a toggle per area, at the end of the bar before the window’s buttons (the
egui_pop.frame.layoutblock of theapp.captionzone). Each toggle’s icon is filled while its area shows and outlined while it is folded or hidden (layout-left,layout-bottom,layout-rightand their-offtwins); its tooltip gives its key, and assistive technology hears it as a toggle. They are drawn by the kit’sicon-button.layout_controls::showdraws the same controls anywhere else (the gallery’s Layout controls page). -
The side bars’ icons follow their side, as VS Code’s: with the primary side bar on the right, its toggle shows
layout-rightand the secondary side bar’slayout-left, and the title bar’s toggles read secondary, panel, primary from the start. The layout menu, the View menu and the palette mirror the toggle commands’ icons the same way (layout_controls::command_icon); the menus keep their order, as VS Code’s layout menu does, and the commands and their keys stay the same. The title bar’s icons are listed by the debug bridge’siconscollector (thelayout controlssurface), the menus’ rows bymenus::rows_drawn.
Palettes and toolboxes: never modal
Decided on 2026-10-13: a toolbox, a colour palette or a navigator
floating over the canvas is non-modal, always. It never blocks the
interface, never takes the keyboard unless clicked into, and gives the
keyboard back on Escape. Anything that must block until it is answered
is a dialog (egui_pop::api::dialogs, movable when it hides what it
acts on), never a palette.
One model, two placements. A palette is a panel declared with
PanelSpec::palette(): it opens floating over the workbench, and its
area is where it docks. Every other panel may float too, unless its
spec opts out (floatable(false): a view that would leave its area
empty, such as the centre’s document). The user’s “Floating panels”
setting (workbench.float_panels) narrows that to the palettes
(palettes) or leaves it (any, the default); it never widens what a
spec allows. The layout keeps floating panels next to the docked and detached
ones (Layout::floating: place, size, rolled up, pinned), saved and repaired
with them.
use egui_pop::egui;
use egui_pop::model::ids::PanelId;
use egui_pop::model::panels::{Area, PanelSpec};
use egui_pop::prelude::*;
const TOOLS: PanelId = PanelId::from_static("demo.tools");
struct Demo;
impl Plugin for Demo {
fn id(&self) -> PluginId {
PluginId::from_static("demo")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
// Floats when it opens; docks in the start side bar.
ctx.panel(
PanelSpec::new(TOOLS, "Tools", Area::StartSide).palette(),
|ui, _| {
ui.label("Brush");
},
)?;
Ok(())
}
}
let app = App::builder().plugin(Demo).build(&egui::Context::default()).unwrap();
assert!(app.handle().layout().floating_of(&TOOLS).is_some());
- The band. A palette has the movable dialogs’ header band
(
egui_pop_core::band, the kit’sheader-bandandband-icon-button): its title, then Pin, Roll up and Close. Rolled up, only the band is left (a double click on the band does it too). Pinned, it stays where it is, in sight and opaque. - Dragging. The band drags the palette, kept inside the workbench
(again when the window is resized) and snapping to the workbench’s
edges and to the other palettes within the
palette.magnettoken. Dropped on a side bar or the bottom panel (or a closed one’s edge) with the dock keys held, with the drop hint the tabs use, it docks there. A docked panel floats from its tab menu (Float); where it may not, Float is greyed and says why (“Float (Document cannot float)”, “Float (only palettes float)”). Float group, in the tab menu and the group menu (the empty part of the tab bar, its grip), floats the docked tab group whole as one floating group of tabs, in order, its shown tab shown (workbench.panel.floatwithgroup); Dock back on any of its tabs puts the whole group back where it was. Float group is offered while the tab menu’s group entries are allowed (theMENUgroup handle and its setting). - Moving or docking (decided on 2026-11-17,
design). A plain drag of a floating
palette (its band, a member’s band, a floating tab) only moves it:
the drop targets (an area, another palette’s group) show and take it
only while the dock keys are held, the
gesture.workbench.dockgesture (Ctrl+PrimaryDrag, Cmd on macOS, in every shipped pointer profile, rebindable in the shortcuts editor). The keys are read every pass of the drag: pressed or let go mid-drag, the targets show or go. Snapping and anchoring stay on a plain drag. The mode is theinput.dock_dragsetting (said once aspop.settings.changed):modifier-docks(the default),modifier-floats(a plain drag docks, the keys keep it floating: Photoshop’s and Visual Studio’s way, the Photoshop pointer profile’s),dwell(docking arms once the pointer rests on a target forpalettes::DWELL, half a second: for touch and pen), orprofile(the pointer profile’s, itsoptions.dock_drag); an application picks the default withAppBuilder::dock_drag. While a palette is dragged over a target, a one-line hint says how to dock or not, worded after the mode and the keys bound (“Hold Ctrl to dock”, “Release Ctrl to move only”, “Hold Ctrl to move without docking”, “Rest here to dock”): in the status bar, or under the pointer without one (palettes::drag_hint).palettes::GroupHint::armedandDropHint::armedsay whether a drop now docks or joins; only armed targets are drawn. The panel menu of a floating palette (a right click on its title) docks it too: Dock in the start side bar, the end side bar or the bottom panel, for a pointer with no keyboard. - Sticky edges. Dropped on an edge of the workbench (snapped onto it
or kept against it), a palette is anchored there:
FloatingGroup::anchorholds, on each axis, the start edge, the end edge or none, and the distance to it. When the window is resized, or a saved layout is restored at another size, an anchored edge keeps its distance, so a palette on the right edge follows it; the other axis keeps its place. Dragged away from the edge, it is no longer anchored. A palette off the edges, or snapped to another palette only, is just kept inside. The anchor is saved with the layout (layouts saved before it load unanchored);palettes::anchor_ofandpalettes::anchored_poscompute it. - Groups. Palettes float in groups (
Layout::floatingholdsFloatingGroups; a palette alone is a group of one). A palette dropped on another one’s top or bottom quarter (palettes::join_at, with the drop hint the tabs use) stacks above or below it: a column where each member keeps its own band, its own roll-up (a column of rolled-up toolboxes) and its Close. The group’s band, over its members’, lists their titles: it drags the group as one unit, pins it and anchors it as a single palette. Dropped on a side bar or the bottom panel, it docks every member there, as tabs; floating one of them again (Float) gives the whole group back, from the members still docked beside it (Layout::docked_groups). A member’s own band drags it out of its group (dropped back over its group, it stays), or onto another palette’s edge into that group. Dropped on the middle of another palette, a palette joins its group as a tab: the group’s band holds the tabs (a click shows one), the shown member keeps its own band, which drags it out. Thepalette.group.gaptoken is the room between stacked members. A group is saved as the floating panel it was before groups, its other members undergroup: an application that predates groups floats them apart. - Docking conventions. Groups follow the classic docking
conventions (Photoshop, Krita, GIMP, Qt docks, VS Code), decided on
2026-10-21:
- Close group is an entry of the menu on the group’s band (its
…button), never a button on the band, so that a stray click cannot close a group. It runspalette.close_group, which a hook may veto. - A tab dragged out of its tabs comes out of them
(
palette.ungroup): alone where it is dropped, or into the palette or group it is dropped on, following the usual drop rules (an edge stacks, the middle adds a tab, an area docks it). Dropped back on its own tabs, it stays. The member’s band still drags it too. - Closing the shown tab shows its neighbour on the right, or the one on its left when it was the last (Qt’s default, as in browsers).
- An edge drop on a group of tabs stacks the palette above or below
it, and the tabs stay tabs: a stack’s member may be a tab group
(
Member::tabs), one level deep, never a stack in tabs. Its band holds its tabs, the shown tab’s Close and the tab group’s Roll; the band drags the tab group out of the stack whole (palette.ungroupwithtabs: true). A middle drop on a member of a stack makes that member alone a tab group, the rest of the stack staying a stack. A group docked whole (palette.dockwithgroup: true) and floated back comes back nested as it was. - Layouts. A nested tab group is saved as its first tab, its other
tabs under
tabsand the shown one asshown: layouts saved before load unchanged, and an application that predates nesting reads the first tab as a plain member of the stack and puts the other tabs back as it does any panel missing from a layout (a palette floats again on its own, a panel opening closed stays closed).
- Close group is an entry of the menu on the group’s band (its
- Sizes. A palette is sized by its content until it is resized:
each of its four edges and four corners (the
palette.griptoken’s width, each with the cursor of its direction) drag its size, a left or top edge keeping the opposite edge where it is (the steppalette.resizethen carries the new place,pos), kept between thepalette.min-widthandpalette.max-widthtokens (never narrower than its panels’ least width),palette.min-heightandpalette.max-height, and inside the workbench. Its content scrolls when it is taller than the room left; rolled up, it keeps its width. The size is the group’s (FloatingGroup::size, saved with the layout; layouts saved before it load sized by their content): palettes joining a group take its size, a palette coming out of it is sized by its content again. Resized against an edge of the workbench, it is anchored there; pulled away from it, it no longer is. A double click on an edge gives it its content’s size back, andpalettes.resetdoes for every palette. - Tab (
palettes.toggle, rebindable) hides and shows the unpinned palettes. It is the toggle only while some panel floats, no widget has the keyboard and no overlay is open; otherwise Tab moves the keyboard to the next widget, as always. - Strokes and the pointer.
palettes::set_stroke(app, true)says a stroke is in progress: with thepalettes.fade_on_strokesetting on, the palettes fade until it ends.palettes.idle_opacitymakes them translucent while the pointer is elsewhere. - Reset.
palettes.resetputs them back where they first open, rolled down, sized by their content and shown. - Steps (ADR 0011):
palette.open,palette.float,palette.dock,palette.move(once a drag is dropped: a veto puts the palette back, a redirect places it elsewhere),palette.resize({panel, size}, once an edge is dropped;size: nullfor the content’s size; a veto gives it its size back),palette.roll,palette.pin,palette.group({panels, into, at},atbeingabove,belowortab),palette.ungroup({panel, pos},tabs: truefor a nested tab group whole) andpalette.close_group({panel}); a group docks whole throughpalette.dockwithgroup: true. Once done, the journal sayspalette.opened,palette.floated,palette.docked,palette.moved,palette.resized,palette.rolled,palette.pinned,palette.grouped,palette.ungroupedorpalette.group_closed.
Not built yet: a palette outside the main window, as a native utility window. egui’s viewports have no owner window (only “always on top” of every application), so such a window would float above other applications too.
Where the layout is kept
With a persistence directory (AppBuilder::persist), the layout is
loaded at the start and saved by App::save (so at exit) in the
document the host names, Host::layout_document: layout by default,
a workspace’s own (workspaces/photos/layout, asked again at each load
and save), or None for a host keeping the layout itself through
AppHandle::layout and set_layout (LocalHost::with_layout_document
opts out the same way). An application switching workspaces calls
App::load_layout once its host names the new one. Both are steps,
layout.load and layout.save ({ "document" }): a plugin may
redirect the document, veto, or load and save elsewhere.
Arrangements
Named layouts saved, switched and reset, kept in the host’s store
(egui_pop::api::arrangements, in DefaultPlugins). A plugin offers
templates (Ctx::arrangement); resetting goes back to the current
arrangement’s template. The Default arrangement’s template is the
starting layout (AppBuilder::layout), or every panel in its default
area. Steps: arrangement.save, arrangement.switch,
arrangement.reset, arrangement.delete.
Slim strips
StripsPlugin (opt-in) draws the activity bar, a button per panel of the
start side bar (Ctrl+B, the workbench’s workbench.toggle.primarySideBar,
folds the side bar to its strip), and status bar
indicators fed by the host’s journal: an Indicator is a reducer over
the events of a prefix, so a long job publishes its progress and the
status bar follows it.
The activity bar and the status bar are each one Tab stop (a roving group): Up and Down go between the activity bar’s buttons, Left and Right between the status bar’s items, and Tab coming back lands on the one focused there last.
use egui_pop::api::strips::{Indicator, Tone};
let jobs = Indicator::new("jobs", "Idle", "job.").reduce(|state, event| {
let n = state.count.unwrap_or(0);
state.count = Some(match event.name.as_str() {
"job.started" => n + 1,
"job.done" => n.saturating_sub(1),
_ => n,
});
state.tone = if state.count == Some(0) { Tone::Neutral } else { Tone::Accent };
});
let _ = jobs;
An indicator can follow the context stack (contexts):
when("place == 'photos.album'") shows it only where the clause holds,
with the grammar of commands over the context keys (place,
placeDepth, modePushed, mode.<group>, a frame’s own keys);
during(&frame) writes a frame’s clause for it. Hidden, it keeps
reducing events, so its state is right the moment it shows again. A
clause that does not parse keeps it hidden and is a diagnostic
(indicator-when).
With the context stack installed too, the status bar starts with where
the user is and what is active (status and context):
the breadcrumb (a click on a crumb goes back to that place, the current
one does nothing), then a chip per active mode whose group is declared
visible (FrameSpec::visible, its tone FrameSpec::tone). A click on a
chip leaves its mode; a pushed mode shows a back mark and goes back to
what it replaced; a mode whose guard refuses keeps its chip and says why
in its tooltip. On a narrow window the middle crumbs collapse into …
(a menu of them) first, then indicators give way (the lowest
priority first, then the heaviest) into the bar’s … menu; chips
never hide. StripsPlugin::breadcrumb(false) keeps the bar to its
indicators, for an application showing the breadcrumb elsewhere
(contexts::breadcrumb, contexts::mode_chips); contexts::crumbs,
contexts::chips and contexts::why_not give what they show.
The user hides status items and orders them from an item’s context
menu (only status items can be muted); agents use status.item.hide
({ "id", "hidden" }) and status.item.move ({ "id", "toward": "start" | "end" }), code strips::hide and strips::move_item. The
choices (strips::choices) are kept per place of the context stack in
its view document (contexts::place_value, set_place_value), so a
bar arranged for the darkroom comes back as it was; a place without
choices of its own takes the root’s. Without the context stack they
last the session.
Items sit at the bar’s start or end (align), show busy, error and
warning states, and may open a popover or a rich hover card: see
the status bar.
Agents read what the user sees: context.read gives the visible status
items in its status field (each one’s id, text, tone, count,
progress, and the states of the status bar), and the strips debug collector shows the breadcrumb,
the chips, every item with why it is hidden (hidden_by: the when
clause that does not hold, user, or narrow) and the choices of the
place shown; in code, strips::status and strips::visible.
The window’s own frame
FramePlugin (opt-in) draws the title bar in the TITLE zone above the
menu bar, and the window’s resize edges, never thinner than 6 physical
pixels; a setting gives the system’s frame back. The frame publishes
each window’s hit regions in physical pixels (egui_pop::core::frame,
HitTable, HitRegions::hit), what a platform layer needs to answer
the system’s hit tests itself. Steps: frame.minimize,
frame.maximize, frame.close, frame.system_menu,
frame.exit_fullscreen, frame.hit_test.
The bar starts with the CAPTION_START zone, whose default block
(frame::BLOCK_MENU, egui_pop.frame.menu) is the system menu button
and the application’s name; an application puts its logo there by
replacing that block, and keeps the menu with frame::menu_button. The
bar itself (frame::BLOCK_TITLE) keeps following the setting. The
CAPTION zone holds the application’s buttons, before the window’s;
FramePlugin::layout_controls(true) puts VS Code’s layout controls
there, nearest the window’s buttons (see “The layout controls”).
In full screen (F11) the bar stays, with both zones: an
application keeps its menus, status items and logo there. Only what a
window needs goes: minimize, the resize edges (the hit table publishes
no edge), and moving the window by its bar. Close stays, and a button
leaving full screen takes maximize’s place (the
window-exit-fullscreen glyph role, the frame.exit_fullscreen
step). A double click on the bar does nothing in full screen: it would
otherwise maximize, which full screen has no use for, and leaving full
screen on a double click aimed at an item of the bar would surprise
more than it helps; the way out is that button, or F11. The
window.bar_in_fullscreen setting (on by default) gives the former
behaviour back: off, the bar is not drawn in full screen and publishes
no caption, and the strip at the top edge (WindowPlugin) is the way
out.
use egui_pop::api::frame;
use egui_pop::prelude::*;
fn connect(ctx: &mut Ctx<'_>) {
ctx.block(
zones::CAPTION_START,
Block::replace(frame::BLOCK_MENU, BlockId::from_static("app.logo"), |ui, app| {
frame::menu_button(ui, app);
ui.strong_text("My app");
}),
);
}
Windows: Snap Layouts and Aero Snap
On Windows, when the application draws the frame, FramePlugin
subclasses the main window (the egui-pop-win32 crate) and answers the
system’s hit test from the published regions: the caption moves the
window natively (Aero Snap, shake), the maximize button shows Snap
Layouts, the edges resize. Clicks on the buttons and a double or right
click on the caption still come back as the frame’s requests, so their
steps run. In full screen the caption is answered as client area (the
system must not move the window) and so is the button leaving full
screen, which is no maximize button: Snap Layouts never show in full
screen. The window’s handle comes from eframe when the application
starts with run_native (or run_native_with); an application starting
eframe itself passes it with frame::set_native_window. Elsewhere,
nothing is installed. A plugin may keep the system’s hit testing:
use egui_pop::api::frame::{FramePlugin, STEP_HIT_TEST};
use egui_pop::core::frame::{FrameLayout, Hit, HitRegions};
use egui_pop::egui;
use egui_pop::prelude::*;
struct KeepSystemHitTest;
impl Plugin for KeepSystemHitTest {
fn id(&self) -> PluginId {
PluginId::from_static("keep_hit_test")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.before(STEP_HIT_TEST, |_, args| {
if args["install"] == true { Before::Veto("ours".into()) } else { Before::Go }
});
Ok(())
}
}
let app = App::builder()
.plugin(FramePlugin::own())
.plugin(KeepSystemHitTest)
.build(&egui::Context::default())
.unwrap();
assert!(app.handle().diagnostics().is_empty());
// What the layer answers is what the regions say (physical pixels).
let bar = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(800.0, 32.0));
let layout = FrameLayout {
window: egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(800.0, 600.0)),
caption: Some(bar),
maximize: Some(egui::Rect::from_min_size(egui::pos2(712.0, 0.0), egui::vec2(44.0, 32.0))),
grip: 4.0,
resizable: true,
..FrameLayout::default()
};
let regions = HitRegions::measure(&layout, 2.0);
assert_eq!(regions.hit(1468, 30), Hit::Maximize);
assert_eq!(regions.hit(800, 30), Hit::Caption);
Scale
Each window has its own scale: egui_pop::core::scale gives it
(Scale::of), snaps stroke widths to whole pixels (stroke,
hairline) and says once when it changes (changed; scale.changed on
the journal). The interface zoom is egui-pop’s (egui_pop::api::zoom): a
setting in fixed steps, Ctrl+Alt+=, Ctrl+Alt+- and Ctrl+Alt+0
(rebindable), the interface.zoom step; egui’s own zoom keys are off.
The keymap at run time
A host whose registry changes declares commands after build
(AppHandle::declare, undeclare): menus, the palette and the keymap
follow. A profile is a whole keymap document: export_keymap(layer) and
load_keymap(doc, layer) keep scopes, when clauses and every key, and
report what changed (KeymapDiff). Rebinding is the keys.rebind step,
loading keys.load; each new conflict is a keys.conflict signal.
Keys change in the user’s layer (rebind, reset_keys, saved with the
interface’s settings) or in the workspace’s (rebind_in,
reset_keys_in with Layer::Workspace), which the application keeps
and reads back with export_keymap. The shortcuts editor offers the
choice once the application asks (offer_workspace_keys), the user’s
by default, and says after each key where it comes from
(key_sources): workspace or user, nothing for a default, or the
application’s own name for it (name_key_sources). Two
bindings of one key whose when clauses can never both hold
(view == 'masks' and view == 'lighttable', When::excludes) are no
conflict.
Pointer gestures live in the same keymap (Ctrl+Wheel, MiddleDrag
bound to gesture commands in a canvas’s scope), the pointer profile’s
in the default layer; rebind_gestures gives a gesture several
triggers at once. See Pointer gestures and profiles.
Around the shell
AppBuilder::wrap draws around the whole application,
main_edge_to_edge drops the centre’s margins, frameless an area’s
margins and its panels’ frames, layout gives the starting layout,
on_exit runs before the
app.exit step (whose default saves), run_native_with hands the built
application to an eframe::App of the application’s own (its make
returns a Result: an error is logged, published as app.make_failed
and returned by eframe), and
window::restore gives NativeOptions the window’s kept place.
Hosts and components: what can live where
A host is a place egui-pop draws content in (a docked panel, a floating palette, a dialog). A component is something drawn there (the image viewport, the tree, the terminal). Each cell answers: can this component be mounted in this host, and if not, why not?
This page is generated from the mount contract
(ADR 0013): each component declares what it
needs (Mountable), each host what it offers (HostOffer), and each
cell is the verdict of egui_pop::model::mount::check on the pair.
cargo xtask hosts writes it, and a test fails when the committed page
is stale. In an application, AppHandle::where_can gives the same
verdicts and the debug bridge’s mounts collector shows them to agents.
How to read a cell
| Cell | Status | Meaning |
|---|---|---|
yes | fits | Nothing in the way; mounted by the mount tests. |
if c… | fits under conditions | Fits, under every condition named (see Conditions). |
D… | does not fit, by design | It would break a named rule on purpose; the rule says what to do instead. |
E… | does not fit, egui-pop limit | egui-pop does not do it yet; an estimated cost is given. |
U… | does not fit, upstream limit | egui, eframe or another dependency cannot do it; linked to upstream.md. |
…* | not tried | Fits by the declarations, but no headless test can mount it there (see Notes): a gap, not a refusal. |
“Impossible” is only ever a D or a U. An E is work not done yet.
The hosts
| Column | Host | Where in the code | What it offers |
|---|---|---|---|
| P | Docked panel | Ctx::panel, PanelSpec, workbench | A whole rect; resized by the user; shared focus; persistent; main window; the keymap reaches it; keeps its place; gives a Ui, an AppHandle, a focus scope, a fault boundary; wide gamut; may hide its content. |
| F | Floating palette | palettes | A bounded width, the content’s height; resized by the user; the keyboard once clicked into; persistent; main window; the keymap reaches it; keeps its place, size; gives a Ui, an AppHandle, a focus scope, a fault boundary; sRGB; may hide its content. |
| W | Auxiliary window | workbench::windows, show_viewport_immediate | A whole rect; resized by the user; shared focus; persistent; an auxiliary window; the keymap reaches it; keeps its place, size; gives a Ui, an AppHandle, a focus scope, a fault boundary; sRGB; system cursors only. |
| D | Dialog (four kinds) | dialogs: Confirm, Form, Choose, Info | A bounded width, the content’s height; not resizable; modal: the whole keyboard; owns Enter, Escape; closed by an answer, Escape; transient; main window; the keymap reaches it; keeps its place; gives a Ui; descriptor fields only; sRGB. |
| C | Custom dialog | dialogs: Dialog::Custom, Dialogs::open_custom | A size of its own declaration; not resizable; modal: the whole keyboard; owns Enter, Escape (given to a content claiming them); closed by an answer, Escape; transient; main window; the keymap reaches it; keeps its place; gives a Ui, an AppHandle, a focus scope, a fault boundary; sRGB. |
| M | Raw modal | overlay::show with Kind::Modal | A bounded width, the content’s height; not resizable; modal: the whole keyboard; owns Escape; closed by Escape; transient; main window; the keymap reaches it; gives a Ui, an AppHandle, a fault boundary; sRGB. |
| O | Popover | overlay::show with Kind::Popover, egui::Popup | A bounded width, the content’s height; not resizable; shared focus; owns Escape; closed by Escape, a click outside; transient; main window; the keymap reaches it; gives a Ui, an AppHandle; sRGB. |
| L | Line zone | zones: TOP_BAR, TOP_BAR_END, TITLE_BAR, ACTIVITY_BAR | One row; not resizable; shared focus; persistent; main window; the keymap reaches it; gives a Ui, an AppHandle, a focus scope, a fault boundary; sRGB. |
| S | Status bar | zones: STATUS_BAR, strips | One row; not resizable; shared focus; persistent; main window; the keymap reaches it; gives a Ui, an AppHandle, a focus scope, a fault boundary; sRGB. |
| T | Settings page | Ctx::settings_page, SettingsPage | A bounded width, the content’s height; not resizable; modal: the whole keyboard; owns Escape; closed by Escape; transient; main window; the keymap reaches it; gives a Ui, an AppHandle, a focus scope, a fault boundary; sRGB; may hide its content. |
| V | Viewport overlay | egui_pop_viewport::overlay | no Ui: data only; no keyboard; persistent; its panel’s window; sRGB. |
| G | Gallery story | Ctx::story, Story | A whole rect; resized by the user; shared focus; persistent; main window; the keymap reaches it; gives a Ui, an AppHandle, a focus scope, a fault boundary; wide gamut. |
Hosts that take no component at all, by design, and so have no column:
- Toast (
toasts): text, a level, actions and a job’s progress; data only. A component goes in the jobs centre or a panel the toast’s action opens. - Menus and the command palette: items, not content.
- A palette outside the main window (a native utility window): not built, and blocked upstream, U3.
The components
| Row | Crate | What it needs |
|---|---|---|
| Image viewport | egui-pop-viewport | Keys while hovered, claims Space, Escape; drags, wheel, bitmap cursors; workers, bounded while hidden, kept under a modal; wide gamut wanted; fills; role image. |
| Navigator | egui-pop-viewport | Keys when focused; drags, wheel; at least 120 by 80, at most 320 by 214, aspect 1.5; role image. |
| Node graph | egui-pop-viewport | Keys when focused, claims Escape, Space; keymap bindings; drags, wheel; fills; holds a session; role group. |
| Curves | egui-pop-viewport | Keys when focused, claims Escape; drags; at least 120 by 120, at most 320 by 320, aspect 1; role image. |
| Wheels | egui-pop-viewport | Keys when focused, claims Escape; drags; at least 48 by 48, 160 by 160 preferred, aspect 1; role slider. |
| Histogram | egui-pop-viewport | Keys when focused, claims Escape; drags; at least 120 by 40, at most 600 by 200; a preview mode; role image. |
| Thumbnail | egui-pop-viewport | No keyboard; at least 16 by 16, 96 by 72 preferred; a preview mode; role image. |
| Library grid | egui-pop-views | Keys when focused, claims Space; keymap bindings; drags, wheel; workers, bounded while hidden; fills; role grid. |
| Filmstrip | egui-pop-views | Keys when focused, claims Space; keymap bindings; drags, wheel; workers, bounded while hidden; at least 120 by 120, fills; role grid. |
| Compare view | egui-pop-views | No keyboard; drags, wheel; workers, bounded while hidden; at least 0 by 80, fills; role image. |
| Tree | egui-pop-views | Keys when focused, claims Enter, Space; drags; workers, bounded while hidden; fills; popups of its own; role tree. |
| Table, list | egui-pop-views | Keys when focused, claims Enter, Space; drags; fills; popups of its own; role grid. |
| Text editor | egui-pop-editors | Keys when focused, claims Enter, Tab, Escape; keymap surface editor; drags; fills; holds a session; role text. |
| Code editor | egui-pop-editors | Keys when focused, claims Enter, Tab, Escape; keymap surface editor; drags; workers, bounded while hidden; fills; holds a session; popups of its own; role text. |
| Terminal | egui-pop-editors | every key while focused, claims Enter, Tab, Escape; keymap surface terminal; drags; workers, bounded while hidden; at least 32 by 32, fills; holds a session; role terminal. |
| Sliders | egui-pop-core | Keys when focused, claims Enter, Escape; drags; at least 120 by 20; a descriptor field; role slider. |
| Forms | egui-pop-core | Keys when focused, claims Enter; at least 200 by 48; popups of its own; a descriptor field; role form. |
| Progress | egui-pop-core | No keyboard; at least 40 by 4, 200 by 8 preferred; a preview mode; role progressbar. |
| Jobs centre | egui-pop-api | Keys when focused; keymap bindings; at least 240 by 120, fills; one per application; an AppHandle; role list. |
| Theme editor | egui-pop-api | Keys when focused; keymap bindings; at least 520 by 320, fills; one per application; an AppHandle; holds a session; popups of its own; role form. |
| Tips | egui-pop-api | Keys when focused; at least 240 by 80; an AppHandle; role group. |
The matrix
| Component | P | F | W | D | C | M | O | L | S | T | V | G |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Image viewport | yes | if c1 c3 | if c3* | D6 | if c3 c9 | if c1 c3 c4 | if c1 c3 c4 | D1 | D1 | if c1 c3 c4 | D2 | yes |
| Navigator | yes | yes | yes* | D6 | yes | yes | yes | D1 | D1 | yes | D2 | yes |
| Node graph | yes | if c1 | yes* | D6 | if c9 c10 | if c1 c4 c10 | D3 | D1 | D1 | if c1 c4 c10 | D2 | yes |
| Curves | yes | yes | yes* | D6 | if c9 | if c4 | if c4 | D1 | D1 | if c4 | D2 | yes |
| Wheels | yes | yes | yes* | D6 | if c9 | if c4 | if c4 | D1 | D1 | if c4 | D2 | yes |
| Histogram | yes | yes | yes* | D6 | if c9 | if c4 | if c4 | D1 | D1 | if c4 | D2 | yes |
| Thumbnail | yes | yes | yes* | D6 | yes | yes | yes | if c6 | if c6 | yes | D2 | yes |
| Library grid | yes | if c1 | yes* | D6 | yes | if c1 | if c1 | D1 | D1 | if c1 | D2 | yes |
| Filmstrip | yes | if c1 | yes* | D6 | yes | if c1 | if c1 | D1 | D1 | if c1 | D2 | yes |
| Compare view | yes | if c1 | yes* | D6 | yes | if c1 | if c1 | D1 | D1 | if c1 | D2 | yes |
| Tree | yes | if c1 | yes* | D6 | if c5 c9 | if c1 c5 | if c1 c5 | D1 | D1 | if c1 c5 | D2 | yes |
| Table, list | yes | if c1 | yes* | D6 | if c5 c9 | if c1 c5 | if c1 c5 | D1 | D1 | if c1 c5 | D2 | yes |
| Text editor | yes | if c1 | yes* | D6 | if c9 c10 | if c1 c4 c10 | D3 | D1 | D1 | if c1 c4 c10 | D2 | yes |
| Code editor | yes | if c1 | yes* | D6 | if c5 c9 c10 | if c1 c4 c5 c10 | D3 | D1 | D1 | if c1 c4 c5 c10 | D2 | yes |
| Terminal | yes | if c1 | yes* | D6 | if c9 c10 | if c1 c4 c10 | D3 | D1 | D1 | if c1 c4 c10 | D2 | yes |
| Sliders | yes | yes | yes* | if c4 c8 | if c9 | if c4 | if c4 | if c6 | if c6 | if c4 | D2 | yes |
| Forms | yes | yes | yes* | if c4 c5 c8 | if c5 c9 | if c5 | if c5 | D1 | D1 | if c5 | D2 | yes |
| Progress | yes | yes | yes* | D6 | yes | yes | yes | if c6 | if c6 | yes | D2 | yes |
| Jobs centre | if c7 | if c1 c7 | if c7* | D6 | if c7 | if c1 c7 | if c1 c7 | D1 | D1 | if c1 c7 | D2 | if c7 |
| Theme editor | if c7 | if c1 c7 | if c7* | D6 | if c5 c7 c10 | if c1 c5 c7 c10 | D3 | D1 | D1 | if c1 c5 c7 c10 | D2 | if c7 |
| Tips | yes | yes | yes* | D6 | yes | yes | yes | D1 | D1 | yes | D2 | yes |
Columns: P docked panel, F floating palette, W auxiliary window, D dialog (four kinds), C custom dialog, M raw modal, O popover, L line zone, S status bar, T settings page, V viewport overlay, G gallery story.
Counts
| Status | Cells |
|---|---|
fits (yes) | 84 |
fits under conditions (if) | 87 |
does not fit, by design (D1 36, D2 21, D3 5, D6 19) | 81 |
| does not fit, egui-pop limit | 0 |
| does not fit, upstream | 0 |
| total (21 components by 12 hosts) | 252 |
Of the cells that fit, 21 are not tried (*): their host
cannot be mounted headless.
Rules
Each rule looks at one need against one offer. The worst verdict wins, and every condition is kept.
| Rule | Name | What it compares |
|---|---|---|
| R1 | size | The size needed (minimum, fills) against the room the host gives (a rect, a given size, the content’s height, one row). |
| R2 | keyboard | The keyboard needed and the keys claimed against the host’s focus policy and the keys it owns; bindings of the keymap against the host’s keymap reach. |
| R3 | sessions and lifetime | A session (unsaved work, a running program) or popups of the component’s own against a transient host and what dismisses it. |
| R4 | questions | A question to answer against a host that is not modal. |
| R5 | display | Wide gamut wanted or required, and bitmap cursors, against what the host’s window can show. |
| R6 | instances | One state per application against a host that may show it beside another mount. |
| R7 | application | A component needing the application against a host giving none. |
| R8 | a Ui | Any component against a host that gives no Ui. |
| R9 | workers | Workers drained when the component is drawn against a host that can stop drawing it. |
| R10 | view state | A view-state key against a host that keeps no view values and is outside the projection. |
| R11 | dialog content | Free content against a dialog of the four kinds, which takes value-descriptor fields only. |
Conditions
| Code | Condition |
|---|---|
| c1 | Content-sized host. The palette, the raw modal, the popover and the dialogs of the four kinds size themselves from their content: a component that fills the space it is given must be given an explicit size (.size(), a ScrollArea with a maximum height) or it grows to the window. A palette keeps its content’s size until the user resizes it. |
| c2 | No keymap in this window. The host’s window is not reached by the key dispatcher, so bindings of the keymap (global and surface ones: an editor’s find and save, the terminal’s clear, the library’s commands) do not fire while it has the keyboard. Keys a widget reads itself (arrows, zoom keys, typing) work. No host of egui-pop has this condition since E3 closed; a host an application declares may. |
| c3 | sRGB and system cursors. Wide gamut and HDR fall back to sRGB in this host, with the reason reported (U2); bitmap tool cursors fall back to their system cursor (U1). |
| c4 | The host takes its keys first. The host owns keys the component claims: Escape closes a modal or a popover before any component sees it, Enter accepts a dialog (ADR 0007’s Escape order). A component’s own Escape (a graph’s deselect, a terminal program’s Escape) never arrives; Shift+Escape still leaves the terminal. |
| c5 | Popups inside a transient host. The component opens egui areas of its own (completion lists, context menus, drop-downs) outside egui-pop’s overlay stack; whether a click in them counts as a click outside the host (which closes a popover) is not checked. |
| c6 | One row. A compact size given by the application: a slider at least 120 wide, a small thumbnail, a thin bar, within one row. |
| c7 | One state per application. The component draws a service’s state: two mounts (a panel and a popover) show the same jobs or the same draft, not two independent instances. |
| c8 | As a descriptor field only. In a dialog of the four kinds, the component exists only as a Form field made from a value descriptor (a slider from a float or int), not as a free widget; a Custom dialog takes it as it is. |
| c9 | Claims honoured by declaration. The host owns Enter and Escape, and gives them to a content that claims them: when the content claims Enter, Ctrl+Enter accepts; Escape goes first to a content that claims it and has something to cancel (a drag), then cancels. |
| c10 | A session per showing. The host is transient: shown again, the component starts a new session (a new program, an empty draft) unless the application keeps its state; closing it asks first or loses the session. |
| c11 | A queue while hidden. The host can stop drawing its content (a tab behind another, a palette hidden by Tab or rolled up) while the component’s workers keep delivering: their queue grows until it is drawn again (docs/threading.md, section 2.2). No component of egui-pop has it: each drains its queue off-draw or caps it (Mountable::bounded_workers); a component an application declares with workers() may. |
| c12 | View state not kept. The host keeps no view values and is outside the context stack’s projection: the component’s zoom, scroll or selection is not kept across places and restarts. |
Reasons
By design
| Code | Rule | Do instead |
|---|---|---|
| D1 | Line hosts hold one row. The top bar, the caption, the activity bar and the status bar hold indicators and small controls; nothing there takes the keyboard for long or needs more than a row. | An item in the line that opens a popover (the jobs centre’s status item) or focuses a panel (<panel>.focus). |
| D2 | Viewport overlays are data. Overlays on the image are shapes and handles in image coordinates, drawn by the viewport, their edits handed back as signals; there is no Ui to put a component in. | A palette floating over the canvas (a navigator, a toolbox), or a heads-up host over the viewport (not built yet: decided for later). |
| D3 | Popovers are transient. A click outside or Escape closes them; an edit session (graph wiring, an editor with unsaved text, a running program, a theme draft) would end by accident (confirmed 2026-10-14). | A panel, a palette, or a dialog that asks before closing. |
| D4 | Only a modal asks. Palettes are never modal (decided 2026-10-13), nor are panels and popovers: a question that must be answered before going on goes in a modal. | A dialog. |
| D5 | One dialog at a time. Dialogs queue; a dialog does not open another over it. | Draw the second choice inline in the dialog (as a form’s path field draws the in-app file picker). |
| D6 | The four dialog kinds take descriptors. Confirm, Form, Choose and Info are drawn from data: a form’s fields come from value descriptors, and no kind takes free content. | A Custom dialog, which takes a body and keeps every dialog rule. |
D4 and D5 constrain how a component is used rather than where it fits: no component of today asks a question of its own, and a dialog’s body draws a second choice inline.
egui-pop limits
| Code | Limit | Estimated cost |
|---|---|---|
| E1 | No free-content dialog (closed). Closed by Dialog::Custom (ADR 0013): a dialog with a body of its own, keeping the dialog rules. | Done. |
| E2 | Palettes are not resizable (closed). Closed: a palette is resized by its right and bottom edges, between the palette.min-* and palette.max-* tokens, its size kept in the layout. | Done. |
| E3 | No keymap in auxiliary windows (closed). Closed: the key dispatcher runs in each auxiliary window’s pass, in that window’s context (its focus chain, window naming its panel). | Done. |
| E4 | Overlays live in the main window (closed). Closed: each window has its own overlay stack. A dialog, the command palette and a popup menu open over the window in use, a context menu over its widget, and the toasts show in the active window, each going to the main window when its window closes; while a modal is open every other window is blocked. | Done. |
| E5 | No custom page in the settings window (closed). Closed by settings pages (Ctx::settings_page): a page a plugin draws itself in the settings window, placed in its tree, searched, with its reset (column T). | Done. |
Upstream limits
| Code | Limit | Entry |
|---|---|---|
| U1 | No custom cursor in immediate viewports. eframe shows no custom cursor in an immediate viewport (nor on the web): bitmap cursors fall back to system cursors there. | upstream.md |
| U2 | Wide gamut in the main window only. Wide gamut goes through the image’s own Wayland surface, made from the main window’s handles: eframe gives no surface colour space and winit no colour management, so other windows draw sRGB. | upstream.md |
| U3 | No owner window for egui viewports. A palette in a native utility window would float above every application. | upstream.md |
U1 and U2 degrade a cell (condition c3) rather than refuse it: no component of today requires wide gamut. One that did (a mastering view) would be refused outside the main window with U2.
Notes
- Evidence.
crates/egui-pop-gallery/tests/it/mounts.rsmounts every component’s gallery story in a mock host built from each offer that accepts it (the panel and the story by the gallery itself; the palette as an area of bounded width; the raw modal and the popover through the overlay stack; the custom dialog as aDialog::Custom; the lines as one row), checks that nothing faults, that every interactive node has a name and that no diagnostic is raised, and checks that each refused mount is reported with its rule. - Workers. Tile, thumbnail, tree and terminal sources run on the
application’s threads and keep running whatever the host, a modal
included. Hidden, a component keeps bounded memory (c11 closed): the
terminal and the jobs take their input off-draw; the viewport folds
its source’s changes past
source::NOTICES, the tree reloads pasttree::EDITS_WAITINGedits, the library keeps itsINBOXlatest requests and a console itsCONSOLE_PENDINGlatest bytes, each counting what it dropped (docs/threading.md, section 2.2). - Accessibility in an auxiliary window is not tried: whether eframe gives an immediate viewport its own AccessKit tree has not been checked.
- Tests across windows. egui_kittest draws an immediate viewport
inside the main one. The keys, overlays and focus of auxiliary windows
are tested with an immediate viewport renderer of the tests’ own
(
crates/egui-pop-api/tests/it/windows.rs), each window’s pass run with its own input, but no component is mounted in a real window there: the cells stay*. - Declarations can lie. A component declared as reading keys when focused that reads one globally (the node graph’s Space) shows a fit where it misbehaves; the mount tests are the guard.
- A plugin that goes takes its components, its host offers and
their mounts with it, and the mounts made while its code ran (ADR
0028): the
mountscollector no longer lists them, and itsplugin.disconnectedevent counts them (components,hosts,mounts). Connected again, it declares them again.
The native runner, reads and waiting
Three parts of the family “Application API” (ADR 0027) that the guides (Plugins, commands and steps, Threading) do not cover: how the application runs natively, how a page reads from the host without blocking, and how a test or an agent waits on the application.
| Module | What it does |
|---|---|
egui_pop_api::runner | The native runner: eframe on a winit event loop egui-pop owns (create-native feature) |
egui_pop_api::reads | The read kernel: keyed reads from the host, never waiting, stale while revalidating |
egui_pop_api::wait | Waiting until a journal event matches, or until the application is settled |
Owns: the event loop handler around eframe, the read cache and its policies, the wait conditions shared by the test kit and the bridge.
Refuses: an async runtime (reads run on a thread of the kernel’s, waits are checked per frame); an application’s kernel (the host gives the transport); a windowing system of its own (eframe and winit paint and create every window).
The native runner
With the create-native feature (on by default),
AppBuilder::run_native and run_native_with build the winit event
loop, hand eframe to it through eframe::create_native, and run it with
a handler that sees every winit callback before eframe. eframe still
creates and paints every window; owning the loop adds:
-
The screens before the main window (
egui_pop_api::runner::screens): the place restored from the last run is repaired against the real monitors, not only bounded. -
Every window’s raw handles (
egui_pop_api::runner::window_handle): eframe hands out the main window’s only. The handler pairs each painted window with its egui viewport and records its handles where the file chooser’s parent and the frame’s hit testing read them. They are used only once winit’s ids were checked against eframe’s own handles for the main window (egui_pop_api::runner::ids_verified). -
Each viewport’s window, by its id (
egui_pop_api::runner::window): aWindowimplementingHasWindowHandleandHasDisplayHandle, what a file chooser’s parent, a Wayland subsurface or a Win32 subclass takes. The main window’s is eframe’s own window, known as soon as eframe creates it, on every system (macOS included); another deferred viewport’s comes from its winit id, once painted and verified as above.egui_pop_api::runner::windowslists the viewports whose window is known, the main one first; a closed viewport leaves the list. -
Paced paints: a window paints at most once per interval, a little under the fastest screen’s refresh period (60 Hz when no screen tells its rate); a redraw that comes sooner is held and painted at its time. Vsync and Wayland’s frame callbacks pace a window already; this holds where the present does not wait (an X server without DRI3, Mesa’s software rendering), where a window that animates would otherwise draw hundreds of frames a second. The wbox scenario
tools/wbox/multi_window.pychecks it on X11 and Wayland: over a few idle seconds the idle windows draw at most a few frames a second, the animating one at most its screen’s refresh. -
The main window’s frames owed (
egui_pop_api::main_wake): on Wayland a compositor sends no frame callback to a window it does not show (GNOME, the main window covered by the application’s other windows), so the system sends it no redraw and eframe runs no pass of it, onlyApp::logic. That pass is what lets a closed window go (the backend drops the system windows it no longer declares) and what draws the detached panels’ windows (immediate viewports): without it a closed Settings window stayed on screen frozen, and a detached panel froze, until a click or Alt+Tab showed the main window.MainWakekeeps a frame owed to the main window (a repaint asked of it, or a redraw of a window that began no pass of its own), and the handler paints the main window itself once one is owed pastmain_wake::GRACE(100 ms), where the present does not wait for the compositor (main_wake::paint_safe: not FIFO on Wayland; egui-pop’swindows::present_modechooses one that does not wait there). A host running its own event loop does the same:PassCounter::installon the context,MainWake::user_eventbefore eframe’suser_event, everyRedrawRequestedthroughMainWake::redraw, andMainWake::due(withnextfor the loop’s wake-up time) innew_eventsandabout_to_wait. The test kit’sMultiWindow::withhold_framesandhost_wakemodel it.
use egui_pop_api::runner;
fn diagnostics() -> String {
format!("screens: {:?}, ids verified: {:?}", runner::screens(), runner::ids_verified())
}
fn windows_known() -> Vec<(egui::ViewportId, Option<runner::raw_window_handle::RawWindowHandle>)> {
runner::windows()
.into_iter()
.map(|v| (v, runner::window(v).and_then(|w| w.raw_window())))
.collect()
}
The handles name windows winit keeps: read them on the thread running the application’s frames (the runner’s state is kept there; elsewhere the functions answer nothing), and keep them no longer than the viewport stays open.
The windows the runner knows are one side of a check
ADR 0029 decides: the window registry (the
one list of what egui-pop believes is shown, fed by pop.window.open and
pop.window.close on the bus) must equal the windows that exist, every
pass. Until its slices land, each module shows and closes its own
viewports.
Immediate viewports (painted inside their parent’s pass) are not
paired. On the web, and without the feature, eframe runs as before and
these functions answer nothing (Vec::new(), None).
Reads
A page reads what the host knows (a status’s value, a list’s rows)
through a ReadKernel over a ReadTransport the host gives:
use std::sync::Arc;
use std::time::Duration;
use egui_pop_api::reads::{ReadKernel, ReadPolicy, ReadState, ReadTransport};
use serde_json::{Value as Json, json};
struct Host;
impl ReadTransport for Host {
fn serves(&self, command: &str) -> bool {
command == "storage.free"
}
fn read(&self, _command: &str, _args: &Json) -> Result<Json, String> {
Ok(json!("120 GB"))
}
}
let kernel = ReadKernel::new(Arc::new(Host));
kernel.policy(
"storage.free",
ReadPolicy::new().fresh_for(Duration::from_secs(30)).invalidated_by(&["volume.*"]),
);
let first = kernel.read("storage.free", &json!({}));
assert!(matches!(first.state, ReadState::Pending | ReadState::Fresh));
- Keyed: a read is a command and its arguments; two pages asking the same share one entry and one request in flight.
- At once:
ReadKernel::readnever waits; it answers aReadin aReadState:Pending,Fresh,Refreshing(the last value while a new one is read) orFailed(the error, and the value before it if any).ReadKernel::peekanswers without starting anything. - Stale while revalidating: a value past its freshness stays shown,
Fresh, while it is read again; one an event made out of date (ReadKernel::event,invalidate,invalidate_all) isRefreshing. - The kernel repaints the context set with
ReadKernel::set_contextwhen an answer comes. On the web, or when no thread starts, the transport runs at once.
The Settings app reads through it the commands its transport serves
(egui_pop_api::admin::Admin::attach_reads); late values draw a read’s
states (Late values).
Waiting on the application
AppHandle::wait_met says whether a WaitFor holds now, for the
journal’s events after a sequence number: an event by name (and
optionally its cause), Settled (no command queued or running, every
job idle, no repaint asked), or Any of several. A job orphaned by its
disconnected plugin (Progress) is not waited on: it may
never end; AppHandle::orphaned_jobs counts it, and bridge.wait’s
answer carries the count (orphaned) beside met and last. It never
blocks: who waits checks again after each frame. The test kit’s
egui_pop_test::wait::wait_until steps frames until it holds or a deadline
passes; the bridge’s bridge.wait holds the call in the transport.
use egui_pop_api::wait::WaitFor;
use egui_pop_api::{App, DefaultPlugins};
let app = App::builder().plugins(DefaultPlugins).build(&egui::Context::default()).unwrap();
let since = app.handle().last_event();
let _ = app.handle().wait_met(&WaitFor::event("command.done"), since);
Failure behaviour
- Runner: handles not verified (
ids_verifiedfalse) are never recorded, so what reads them (the file chooser’s parent, the frame’s hit testing,runner::window) gets nothing for windows other than the main one; the main window’s stays known, from eframe. - Reads: a failed read keeps the value before it, so a page shows the
value and the error beside it; a command no transport serves is not
the kernel’s (
ReadKernel::serves) and keeps going through the command bus. - Waits: an unknown argument shape is refused by
WaitFor::from_argswith the reason; past the deadline the test kit’s error names the condition, the frames stepped and the journal’s last events.
Accessibility
None of its own: what a read feeds is drawn by its family (a late value
says “Loading” and is busy while pending).
Tier
From API stability: Experimental (“Application
windows (egui_pop_api::windows) and the native runner
(egui_pop_api::runner, the create-native feature, not yet released):
the run loop they share may still move”; “The read kernel
(egui_pop_api::reads) and waiting on the application
(egui_pop_api::wait): their states are kept, their API may move”).
Tests
- Runner: unit tests in
crates/egui-pop-api/src/runner.rs(a place repaired against screens, no window before the loop runs); the window ids are checked per system byegui-pop-winit’swindow_idtest. The run loop itself has no headless test (it needs a display): the gallery’smulti_windowexample, run under wbox on the box, reports each viewport’s window and display handles (runnerandopenedlines). - Reads: unit tests in
crates/egui-pop-api/src/reads.rs; through the Settings app incrates/egui-pop-api/tests/it/admin.rs. - Waits:
crates/egui-pop-api/tests/it/wait.rs(each condition read back from its arguments, the refusals, an event matched only aftersinceand by its cause,anyin its order,bridge.wait’s answer met or not, the schemas);crates/egui-pop-test/tests/wait.rs(the bridge’sdescribe, the frame-stepping wait) and the module’s doc test. Settling on idle jobs is tested with the jobs model.
The hook kernel
The contract of the family “Hook kernel”
(ADR 0027): egui-pop-hooks, a small
crate without egui that re-exports bus-kernel,
an implementation of the bus contract
(bus-contract, no
dependencies of its own), for named points where
several parts of a program contribute to one result, in an order they
declare, and where one failing contribution never breaks the others.
Its README has the full examples; this page is its contract.
It is not the application API’s alter hooks and steps
(egui_pop_api::hooks, egui_pop_api::steps, ADR 0011), which are
tied to App: the kernel works in any Rust program, the interface
thread or not. Applications use it for their own extension points.
ADR 0029 makes it part of egui-pop’s own
central bus: the steps (requests), the journal (events) and this kernel
for the listeners of each, named and run in the order they declare, the
window lifecycle first. egui-pop-api depends on it: each application
holds a kernel (AppHandle::bus) where the window points
(egui_pop_api::bus) and their listeners live. The kernel itself stays
no bus: it carries nothing and keeps no record. That ADR added one
constraint to it, “last” (an invariants listener after every other of
its point).
ADR 0030 makes the bus a contract
the application supplies: the traits and types live in the external
bus-contract crate (re-exported here), and Kernel is its default
implementation, the one egui-pop-api builds when the application gives
it no bus (AppBuilder::bus). A library never constructs a kernel
(cargo xtask bus --check); an application may, or write its own
implementation of bus_contract::Bus.
Owns: typed hook points, listeners with ids ordered by
after/before and priority, alter and collect emits, a
per-listener error boundary (errors, caught panics, deadlines), failure
sinks, introspection.
Refuses: UI of any kind; event buses, and anything across processes (a listener answering from another process is the caller’s transport, given a longer deadline).
The API
use egui_pop_hooks::{Kernel, ListenOpts, Point, PointId, PointSpec};
/// The findings of a health report: each check adds its own.
struct HealthReport;
impl Point for HealthReport {
const ID: PointId = PointId::new("health.report");
type Input = ();
type Value = Vec<String>;
}
let kernel = Kernel::new();
kernel.declare::<HealthReport>(PointSpec::new("The findings of the health report")).unwrap();
kernel
.listen::<HealthReport>("storage.free-space", ListenOpts::new().owner("storage"), |_, out| {
out.push("disk 91% full".into());
Ok(())
})
.unwrap();
let report = kernel.collect::<HealthReport>(());
assert!(report.failures.is_empty());
- A point is a type (
bus_kernel::Point): its id, theInputevery listener reads, theValuea listener edits. Declaring it (Kernel::declare, with aPointSpec) is optional and adds a description and a deadline for introspection. - Ids are checked (bus-contract 0.5 and later): a point id is a
PointId, checked when made, so a bad one in aconstdoes not compile; a listener id breaking the same rule (<prefix>.<segment>…, the first segment[a-z][a-z0-9_-]*) is refused withRefused::BadIdand nothing is registered. - Listeners (
Kernel::listen) have ids, unique per point. They run ordered byafter/before, then by priority (higher first), then by registration order: the same listeners always run in the same order.ListenOpts::lastruns one after every other listener of its point (itsafterholdsbus_kernel::LAST); a second one on a point closes a cycle and is refused.Kernel::unlistenremoves one,Kernel::forgetevery listener of an owner. alterpasses one value through the listeners in order (Altered: the value and the failures);collectgives each listener a fresh value and gathers each successful part with its listener’s id (Collected).- Introspection:
Kernel::pointsandKernel::listenerslist the points, their listeners in run order, owners, constraints, deadlines, missing targets and counters (runs, failures, the last failure).
Failure behaviour
-
Registration refusals (
Refused) change nothing: a duplicate id, an ordering cycle (named with the listeners in it), a point id registered with another type, a point declared twice. -
Per listener: an edit counts only when the listener returns
Ok, without panicking (panics are caught), within its deadline. Otherwise the edit is dropped, the other listeners still run, and the emit returns aFailure(FailureKind::Error,Panic,Late). -
Deadlines: one second by default (
bus_kernel::DEFAULT_DEADLINE), set per point and per listener (PLUGIN_DEADLINE, five seconds, for listeners answering from another process); a listener’s own deadline wins over its point’s, which wins over the kernel’s. An inline listener runs on the emitting thread and counts as late once it returns; athreadedone runs on a thread of its own and the emit stops waiting at the deadline. -
A missing
after/beforetarget is reported (FailureKind::MissingTarget) and ignored; the listener’s part still counts. It is not sent to the sinks. -
An emit on a point registered with another type runs no listener and reports
FailureKind::TypeMismatch. -
Sinks (
Kernel::on_failure) receive each dropped contribution as it happens; a host publishes them as ahook.failedfact (bus_kernel::FAILED_FACT) or logs them. -
Listeners may call the kernel again (re-entry), and emits may come from several threads: the kernel is
Send + Sync. -
Local listeners (
listen_local::<P>) hold state that is notSend(an interface’sRc<RefCell<…>>). Each is bound to the thread that registered it and takes its place in the same order as the others. An emit on that thread runs it inline; an emit from another thread runs the others, queues it (Altered::deferred,Collected::deferred) and calls theon_pendingwakers; the thread runs the queue in order withrun_pending(). egui-pop’s application callsAppHandle::run_pendingonce per pass, before theOn::Passhandlers, and asks for a pass when work is queued. -
Listeners for a window (
AppHandle::listen_local_in::<P>(window, …)): a local listener registered for an application window wakes that window each time it runs, inline or from the queue, so what it changed is drawn there within one frame without a hand-writtenrequest_repaint_of. The main window is still woken to run the queue and the asks; the window’s wake comes in addition. A window drawn in the main one (the main window, a detached panel’s, every window where they are embedded: the web, kittest) or no longer open wakes the main window.AppHandle::wake_windowasks a window’s pass the same way. -
Requests heard after the drawing (the contract’s
Defercapability, which the kernel offers): code that cannot be re-entered while it draws (a panel with its state borrowed) asks a request withAppHandle::ask::<P>(orbus.defer()?.ask::<P>); it returns at once and the listeners run at the thread’s next drain. egui-pop’s application drains (AppHandle::drain_asks) once per pass, after the main window’s panels, its detached panels’ windows and its zones are drawn, so an ask made while drawing is heard in the same pass; and before it quits (App::exit: before theon_exitfunctions, and after them for what they asked), so no ask is lost. An ask made by a listener during a drain waits for the next one. A drain that ran something asks for a pass. An application window (a deferred viewport) is drawn on the same thread after the main window: its asks wait in the same queue, and the main window’s next pass is asked for.AppHandle::asks_waitingcounts what waits; on a bus withoutDefer,askanswersNoneand the caller asks at once or keeps its own queue. -
Listener times and budgets (the contract’s
Timingscapability, which the kernel offers): every listener run is timed (the two clock reads the deadlines already make, then a few relaxed atomic adds into a log histogram of √2 steps), per listener and per pass. A pass is what one emit’s listeners ran on one thread (an inline emit, a queued run, a drained ask).bus.timings()?.points()gives count, total, max, p50 and p95 (within a bucket) andPointTimings::slowest;reset()starts a new window;Kernel::set_timing(false)stops counting. A point may declare a budget for a pass (PointDecl::budget); a pass over it goes to theon_over_budgetsinks and its results are kept: a budget is not a deadline. egui-pop’s application says it as thebus.overBudgetfact (point,took_us,budget_us, each listener’s time,slowest, andunsaid: the passes over budget not said since) and one warning in the log, at most once a minute per point. The debug collectorbusshows each point’s budget and passes, each listener’s runs, andslowestacross points. -
A journal and a relay from the host (the contract’s
JournalandRelaycapabilities, which the kernel delegates): a host that runs a fact bus (entries numbered, read again from a number, relayed between processes) hands it to the kernel withKernel::with_journalandKernel::with_relay;bus.journal()andbus.relay()(theBusJournalandBusCrossingextension traits ofbus-contract-journalandbus-contract-crossing) then answer, and points may be declared journaled (.facets(&[JOURNALED])) or relayable (.facets(&[relayable_event::<P>()])). Without them such points are refused (Refused::Unsupported), bydeclare_alland byKernel::declare_pointalike, and a relay with no journal is not offered. The kernel checks each publish itself: a point it does not hold declared journaled, or under another type, is refused (the journal contract’sRefused::Contract,Refused::TypeMismatch) before the host sees it. The host keeps the entries and runs the pump: each entry of a journaled point is delivered by a collect emit on the kernel (Bus::collect_any) from the pump’s thread, never the publisher’s, in number order; every rule of an emit holds (order, deadlines, failures, local listeners queued for their thread’srun_pending). The host reads a point’s declaration (its journaled flag, its codec) withKernel::declaration. A host journal that needs the kernel to deliver is built withArc::new_cyclic, holding aWeakof the kernel:let kernel = Arc::new_cyclic(|me: &Weak<Kernel>| { let host = Arc::new(MyJournal::new(me.clone())); Kernel::new().with_journal(host.clone()).with_relay(host) });Given to the application (
AppBuilder::bus), it is the busAppHandle::busreturns. The debug collectorbusshows each point’sjournaledandrelayable, the bus’scapabilitiesand itsjournal_seq. -
One journal per process (ADR 0030, slice 3): when the application’s bus offers the
Journalcapability, egui-pop’s own journal (AppHandle::publish,AppHandle::events_since,AppHandle::last_event, so the agents’wait, the debug bridge’sjournalreads, the jobs’job.*events, the links’link.*and the agent sessions’agent.*) is that journal, unless the host keeps a journal of its own (Host::last_seqanswers): the default host then keeps none. egui-pop declares one journaled point for it,pop.journal(bus::HOST_JOURNAL, kept out ofCONTRACTsince a bus without a journal refuses it); each event it publishes is an entry of that point, its input abus::HostEvent(source, name, data), its number and cause the entry’s. Read back throughAppHandle::events_since, an egui-pop entry keeps its name (command.done); any other entry, a fact of the application’s, is an event named by its point (library.imported), its source the process it was relayed from orbus, its data its text read as JSON (null when the entry holds its input only typed). What changes for awaiton such a bus:- numbers are the process journal’s: egui-pop’s events and the
application’s facts share them, so two egui-pop events in a row may
be numbers apart, and
last(the nextsince) counts the facts too; { "event": <name> }matches an application fact by its point’s id as well as egui-pop’s events by name;- the window is the bus journal’s (an application’s, sized for its facts too), not egui-pop’s 1024 events: an agent that falls behind it misses entries as before, sooner when facts are many.
Without a journal on the bus, or with a host keeping its own, nothing changes: egui-pop’s in-memory journal, or the host’s.
- numbers are the process journal’s: egui-pop’s events and the
application’s facts share them, so two egui-pop events in a row may
be numbers apart, and
-
Names: several libraries share one bus, so a point’s id starts with the prefix of the crate declaring it (bus-contract’s “Naming points”:
<crate>.<subject>.<moment>). egui-pop’s prefix ispop.: every point it declares (pop.window.close,pop.command.run,pop.layout.changed…) and every listener it registers (pop.window.registry,pop.jobs.model…) carries it; egui_stack’s arestack.*. A test fails on an egui-pop point or listener without it. An application names its own points and listeners under its own prefix, neverpop.. -
Refusals and fail-closed points: a listener on a request returns
HookError::refuse(reason)and the request stops there; on a point declaredfail_closed, a listener’s error, panic or missed deadline refuses it too. egui-pop’spop.command.run(bus::CommandRun) is such a point: every command run (a key, the palette, a menu, a toolbar, an agent) is asked on it before its handler; a refusal stops the run, which never reaches the host, and is journaled ascommand.refusedwithby(the listener),reasonandfailed. With nobody listening, commands run as before. A run whose arguments do not match its command’s JSON Schema is refused before the point is asked (by: "pop.command.args",bus::ARGS_VALIDATOR). -
A command’s live text:
pop.command.label(bus::CommandLabel, an alter point egui-pop does not answer itself) asks the application for a command’s title and tooltip (bus::CommandText) each time a menu item, a toolbar button, the menu bar’s end or a layout control naming it is drawn: “Zen: Compare” for the panel zen would show.AppHandle::command_titleandAppHandle::command_tooltipread it; with nobody answering, the declared title and description are shown.
Accessibility
None: the kernel has no UI. What a host builds from its results (a health report, a menu) follows the rules of the family that draws it.
Tier
From API stability: Experimental (“The hook kernel
(egui-pop-hooks): new; its API may move while the first applications
move their extension points onto it”). The kernel itself is the
bus-kernel crate, which
egui-pop-hooks re-exports.
Tests
The kernel’s own tests live in bus-kernel (its tests/kernel.rs,
tests/journal.rs, tests/timings.rs, and its conformance suite run on
itself). tests/kernel.rs there: ordering by constraints,
priority and registration; cycles refused; missing targets; duplicate
ids and mismatched types; alter keeping only successful edits;
collect in order; inline and threaded deadlines and their resolution;
sinks; introspection; forget and unlisten; re-entry and emits across
threads; local listeners in order, deferred from another thread, removed
from any thread. tests/journal.rs there: journaled
and relayable points refused without a host journal or relay, shown by
introspection; with an in-memory host journal, entries delivered once
in order off the publisher’s thread, local listeners at their thread’s
run_pending, a slow listener not holding the publisher, publishes on
other points refused by the kernel, and a relay’s resume and ingest
between two kernels (a restart and refusals included).
crates/egui-pop-api/tests/it/host_journal.rs: egui-pop’s journal on a
bus offering one, its events and the application’s facts in one
sequence with no hole, a wait (in-process and through the bridge)
returning the command.done entry among facts, a host keeping its own
journal and a bus without one unchanged; and bus-kernel’s conformance
suite on egui-pop’s application bus, bare and with a journal and relay.
crates/egui-pop-api/tests/it/bus_defer.rs: an ask made in a panel heard after
it in the same pass, asks made before and during exit heard, a palette
command refused by a pop.command.run listener, a failing listener refusing
on the fail-closed point. crates/egui-pop-api/tests/it/app_bus.rs: a local listener
on pop.window.close in its place, and run at the next pass when the
request comes from a worker, and a host’s journal reachable from
AppHandle::bus and shown by the bus collector. The README’s examples run as doc tests.
The image viewport
egui-pop-viewport (the facade’s viewport feature, re-exported as
egui_pop::viewport) shows an image the application computes, in tiles:
pan and zoom in physical pixels (100 % is one image pixel per screen
pixel, in every window), a proxy first and exact tiles after, a display
transform where colour management plugs in, overlays with handles,
before and after, a pixel readout. The crate also has thumbnails in a
virtualised grid and the image tools: a histogram, a curve editor,
colour wheels, a zoom control and a navigator (see
Image tools), and the tools’ cursors and a loupe (see
Cursors and the loupe). What the wheel, a pinch and each
button do on it follows the pointer profile, and a double click may ask
the application to leave the view (Signal::Leave): see
Pointer gestures and profiles. The
on_double_click hook replaces that double click: a hook that handles
it returns its own view without calling the default action it is
given; one that passes it on calls the default, which fits, zooms or
sends Signal::Leave as the profile says, exactly as without a hook.
cargo add egui-pop --features viewport
The application implements the tile source; the viewport asks, never waits, and says what changed with signals.
use egui_pop::egui;
use egui_pop::viewport::source::{Pixels, Tile, TileRequest, TileSink, TileSource};
use egui_pop::viewport::{Signal, View, Viewport, ViewportState};
/// A flat mid-grey image, answered at once (a real source works on a
/// thread and delivers through the sink when done).
struct Grey {
sink: TileSink,
}
impl TileSource for Grey {
fn size(&self) -> Option<[u32; 2]> {
Some([6000, 4000])
}
fn request(&self, requests: Vec<TileRequest>) {
for r in requests {
let n = r.size[0] as usize * r.size[1] as usize;
// Scene-referred floats: the display transform runs on them.
self.sink.deliver(Tile::answer(&r, Pixels::Scene(vec![0.18; n * 4])));
}
}
}
fn draw(ui: &mut egui::Ui, state: &mut ViewportState, view: &mut View, source: &Grey) {
let out = Viewport::new("main").source(source).readout(true).show(ui, state, view);
for signal in out.signals {
if let Signal::View { view, .. } = signal {
// Keep the view in the document, one undo step per gesture...
let _ = view;
}
}
}
let state = ViewportState::new();
let source = Grey { sink: state.sink() };
let _ = (draw, source);
A source may also answer the pixel readout (TileSource::readout, then
TileSink::readout). Requests the viewport stops wanting get their
cancel token set.
The viewer example (cargo run -p egui-pop-viewport --example viewer,
a Mandelbrot set computed on a thread) and the gallery’s viewport page
show it in an application:
Overlays
The application owns its overlays (overlay::Overlay: a shape in image
pixels, its handles, a label) and gives them to the viewport each frame
(Viewport::overlays). Dragging a handle is one gesture
(Signal::Handle, begin, update, end, or cancel on Escape), which the
application applies to its own data (Overlay::apply does it for the
standard shapes); a double click resets (Signal::HandleReset), the
wheel adjusts (Signal::HandleWheel). The before_handle hook may veto
or snap a move; it gets where the handle was when the gesture began
(HandleMove::start), where it is, where the pointer would put it and
the keys held (modifiers). A click on a handle is
Signal::HandleClick (select its shape), a click on an outline away
from the handles Signal::EdgeClick with the segment and the nearest
point (add a point there; overlay::hit_edge numbers the segments).
Lines and handle outlines are drawn in whole physical pixels at the
window’s scale (scale::stroke), so they stay sharp at 125 % and 150 %.
Shapes are points, lines, boxes, circles, ellipses (Shape::Ellipse,
sized along its axes and turned by its handles) and paths. Each overlay
has a style: selected() (a heavier line in the handle colour),
faint() (half-transparent, handles included) and dashed(). An
overlay may carry handles of its own (Overlay::handles), among them
HandleKind::Control, a Bézier control drawn as a small diamond, whose
moves the application applies. Two paint hooks extend the drawing:
under_overlays between the image and the overlays (a mask’s tint),
after_paint above the handles.
An overlay’s label (Overlay::label) is drawn as a label over an
image: the kit’s viewport-label component, a translucent pill the
image shows through, whose text reads over the image’s brightest and
darkest pixels alike. overlay::paint_label draws one anywhere, for a
HUD’s readout or a name on an image:
use egui_pop::viewport::overlay::paint_label;
// Above and right of the point, as an overlay's label sits.
paint_label(&painter, point + egui::vec2(8.0, -8.0), egui::Align2::LEFT_BOTTOM, "Crop");
The X, Y and Z axes take the theme’s palette.axis.x, .y and .z
(Tokens::of(ctx).palette.axis), red, green and blue, each seen at 3:1
on viewport.background.
use egui_pop::viewport::overlay::{Overlay, Shape};
let overlays = vec![
Overlay::new("crop", Shape::Rect([100.0, 100.0, 900.0, 700.0])).selected(),
Overlay::new(
"vignette",
Shape::Ellipse { center: [500.0, 400.0], radii: [400.0, 250.0], rotation: 0.0 },
)
.dashed()
.faint(),
];
let _ = overlays;
Device tiles
A source that renders on the GPU hands the viewport tiles that already
live on the render device (feature wgpu, module device): nothing
crosses the CPU, nothing is uploaded, and the GPU path’s shader reads
them in place. The device is the one the GPU path was installed with
(gpu::install, eframe’s render state): the source’s engine runs on
that device (eframe’s RenderState hands out its device and queue)
and answers a request with a DeviceTile through
TileSink::deliver_device, after submitting the work that writes it.
use egui_pop::viewport::device::{BufferLayout, DeviceTile};
use egui_pop::viewport::gpu::egui_wgpu::wgpu;
use egui_pop::viewport::source::{Pixels, TileRequest, TileSink};
/// An engine's result for one request: `rgba` holds the scaled image
/// as packed `f32` RGBA rows of `width` pixels, on the render device;
/// `image` owns it on the engine's side.
fn hand_over(
sink: &TileSink,
device: &wgpu::Device,
request: &TileRequest,
rgba: wgpu::Buffer,
width: u32,
image: std::sync::Arc<dyn std::any::Any + Send + Sync>,
) {
let [x, y] = request.origin;
let tile = DeviceTile::buffer(device, rgba, BufferLayout::packed(width, 4))
// The request's pixels start there in the image.
.origin([x as u32, y as u32])
// Asked only if the viewport refuses the tile, on this thread.
.fallback(|| Option::<Pixels>::None)
// Held while the viewport holds the tile: the engine's image,
// and the charge it carries in its memory accounting.
.keep(image);
sink.deliver_device(request, tile);
}
let _ = hand_over;
- The resource: a 2D texture of any float-sampled format
(
Rgba16Float,Rgba32Float,Rgba8Unorm,Rgba8UnormSrgb…) withTEXTURE_BINDINGusage (DeviceTile::texture), or a storage buffer off32values withSTORAGEusage (DeviceTile::buffer): one to four channels a pixel, rowsrow_floatsapart, from a byteoffset(BufferLayout). The viewport binds only the rows a tile covers, so a tile may be cut from a whole image’s buffer (DeviceTile::origin). - Buffers need fragment storage: the tile shader reads a buffer in
its fragment stage, which WebGL 2 (and some downlevel adapters) cannot
do: no
DownlevelFlags::FRAGMENT_STORAGE, andmax_storage_buffers_per_shader_stageis 0.gpu::installchecks both (gpu::reads_fragment_storage) and, without them, builds no buffer binding or pipeline (creating one would fail wgpu’s validation); a buffer device tile is then refused withDeviceTileError::BuffersUnsupportedand served from its fallback. Texture device tiles and uploaded tiles work on every adapter. A producer readsgpu::render_device(ctx).buffers(or theviewportcollector’stiles.device.buffers) and delivers textures or host tiles where it is false. - The colour:
Encoding::Scene(the default) isPixels::Sceneon the device, linear values in the working space: the display stage of the viewport’s display transform (its matrix, clamp and transfer, for the window’s target) runs on them in the shader, as on uploaded tiles, and a new target or transform needs no new tile.Encoding::DisplayisPixels::Display: sRGB-encoded values shown as they are (an…Srgbtexture is read back to its encoded values). A transform that overridesDisplayTransform::apply(a LUT the stage cannot express) is not run on device tiles: deliver display values then. Alpha is not drawn, as on the GPU path. - The check: a tile is checked on the delivering thread against the
render device installed now (
TileSink::render_device, read from the viewport’s context when called), and again when the interface takes it in. One made on another device, without a GPU path, or whose resource does not fit (usage, format, size, binding limits) is refused:ViewportState::last_errorsays why (DeviceTileError), therefusedcounter counts it, and the tile’s fallback pixels, when it offers some (DeviceTile::fallback, called only then), take the usual CPU or upload path; without, the request fails.TileSink::render_devicetells a source’s thread which device to use before it renders. - Where the fallback runs: on the thread that calls
deliver_device, never on the interface thread (unless the source delivers from it). A tile refused when the interface takes it in (the render device changed after the source’s check) is dropped, its fallback not called, and its request made again through the source’srequest, as for any tile the viewport no longer holds: the source then checks against the new device and falls back on its own thread. - The order of install and first frame: install the GPU path
(
gpu::install) before the firstViewport::show, as eframe’s creation context allows (cc.wgpu_render_state); the first frame’s requests then take the device path. Installed later, the requests made before it are refused (no GPU path) and served from their fallback pixels, or fail without them; when the render device appears (or changes), the viewport asks for those tiles again, and they come back as device tiles, the fallback shown until then. A failed request is asked for again on the next frame anyway. - What a tile keeps alive:
DeviceTile::keepattaches a value (the producer’s image, with the charge it carries in a GPU memory ledger) that the viewport holds exactly as long as it holds the tile, waiting or shown, and drops when the tile is replaced, invalidated, evicted or refused, or the viewport’s state is dropped. On the GPU path a tile released is dropped at the next paint, once its binding is gone (a tile replaced before its first paint is never bound). The viewport’swgpu::Bufferorwgpu::Textureclone keeps the memory alive anyway; the kept value makes the producer’s accounting see it. - The counters:
ViewportState::transferscounts the tile pixels copied to the GPU where the copy happens (an egui texture loaded, a GPU path texture written at the paint), and the device tiles bound in place (bound, no byte);frame_transfersis the last whole frame, its paint included. Theviewportcollector shows both (tiles.uploads), withtiles.last_error, what the render device takes (tiles.device:nullwithout a GPU path,buffers), and thedeviceandrefusedcounters intiles.stats. A view drawn from device tiles alone copies zero bytes a frame. - What draws them: everything that draws the tiles: the window, the
before and after sides, the image surface on Wayland, the loupe
(which draws the tiles again, magnified), and what the
under_overlayshook paints over them (a mask’s tint).
The tests in crates/egui-pop-viewport/tests/device_tiles.rs make
textures and buffers on the test harness’s device and check the picture
against the CPU path and the counters at zero; the gpu_tiles example’s
gpu-render intake measures the hand-over on a real GPU.
Wide gamut and HDR
A window’s surface has an encoding (display::DisplayTarget: primaries,
transfer, headroom, format); the viewport’s display stage converts the
scene into it, on the GPU (its shader) and on the CPU
(Stage::encode): Display P3 and BT.2020 primaries (matrices computed
from the chromaticities), the sRGB curve, extended linear (scRGB) and
extended sRGB, SMPTE ST 2084 (PQ) and BT.2100 HLG.
An application says what it wants for a window; the viewport draws for what the surface carries, and says why when that is less:
use egui_pop::egui;
use egui_pop::viewport::display::{self, ColorSpace, DisplayTarget, SurfaceFormat, TargetSource};
let ctx = egui::Context::default();
display::want(&ctx, egui::ViewportId::ROOT, DisplayTarget::display_p3());
// Under eframe the surface is 8-bit sRGB: sRGB is drawn, with the reason.
let r = display::resolve(&DisplayTarget::display_p3(), &DisplayTarget::srgb(), true);
assert!(!r.faithful());
assert_eq!(r.drawn.color_space(), Some(ColorSpace::Srgb));
println!("{}", r.reason().unwrap());
// A host that configured an extended sRGB surface on half floats says so,
// and P3 (or HDR) is drawn faithfully.
let surface = DisplayTarget::for_color_space(
ColorSpace::ExtendedSrgb,
SurfaceFormat::Rgba16Float,
4.0,
TargetSource::Tagged,
);
display::set_target(&ctx, egui::ViewportId::ROOT, surface);
assert!(display::resolve(&DisplayTarget::display_p3(), &surface, true).faithful());
What works where:
| Surface | Who configures it | Wide gamut / HDR |
|---|---|---|
| 8-bit sRGB | eframe 0.36, every platform | no: sRGB drawn, the reason given |
| extended sRGB, half floats | a host with its own surface (gpu::choose_surface), where wgpu offers it (Metal on macOS; Vulkan drivers exposing EXTENDED_SRGB_NONLINEAR) | yes, and egui’s interface stays right |
| scRGB, HDR10 (PQ), HLG | a host with its own surface (SurfacePolicy::Any): DX12 and Vulkan on Windows, Metal | the image yes; egui’s interface is written sRGB-encoded, so the host composes it itself |
| any, CPU path | (no GPU path installed) | no: tiles are 8-bit sRGB textures |
gpu::installrecords what eframe configured (its format, wgpu’s default colour space);gpu::install_for_surfaceis for a host that configured its surface with another colour space, andgpu::choose_surfacepicks the format and colour space to configure for a wanted target among the surface’s capabilities.ViewportState::display_resolutiongives what the last frame was drawn for; the debug bridge’sviewportcollector shows it, and thebefore_displayhook may veto (draw sRGB) or redirect (a soft proof) it.- Why eframe cannot do more today, and what is missing on Wayland, is in Upstream workarounds.
The gallery’s display page shows the resolution for each wish and
surface, and the transfers’ curves.
Wide gamut on Wayland
On Wayland, the image can get a surface of its own while the interface
stays the 8-bit sRGB eframe configures (image_surface, feature
wayland, on by default; the research behind it is in
wayland-colour.md). The viewport draws its image
into a subsurface below the main window, presented just before the
window in the same compositor frame, and punches a transparent hole in
the interface where the image is: overlays, menus and tooltips are drawn
over it as before. The subsurface is tagged through
wp_color_management_v1 with the wanted encoding (BT.2020 with a 2.2
power, the encoding a compositor maps to its screen), or presented in a
colour space the driver declares when the driver holds the surface’s
colour itself.
use egui_pop::egui;
use egui_pop::viewport::display::{self, DisplayTarget, Primaries, Transfer};
use egui_pop::viewport::gpu::{self, egui_wgpu};
use egui_pop::viewport::image_surface::{self, Offer, Route, raw_window_handle as rwh};
/// At start-up: `window` is eframe's creation context, its main window
/// built with `ViewportBuilder::with_transparent(true)`.
fn wide_gamut(
ctx: &egui::Context,
rs: &egui_wgpu::RenderState,
window: &(impl rwh::HasWindowHandle + rwh::HasDisplayHandle),
) {
gpu::install(ctx, rs);
let offer = image_surface::install(
ctx,
rs,
window,
image_surface::Options { transparent_window: true },
);
if let Some(why) = offer.unavailable {
eprintln!("no image surface: {why}");
}
let rec2020 = DisplayTarget {
primaries: Primaries::Bt2020,
transfer: Transfer::Gamma22,
..DisplayTarget::srgb()
};
display::want(ctx, egui::ViewportId::ROOT, rec2020);
}
// Where the image goes is plain code, tested with fake compositors.
let rec2020 = DisplayTarget {
primaries: Primaries::Bt2020,
transfer: Transfer::Gamma22,
..DisplayTarget::srgb()
};
let x11 = Offer::unavailable("not a Wayland window (X11 or another system)");
assert_eq!(image_surface::negotiate(&rec2020, &x11).route, Route::Window);
| Compositor (Mesa Vulkan driver) | The image | Why |
|---|---|---|
| KWin 6.3+, sway (wlroots 0.19+), Weston 15+ with colour management | tagged by egui-pop: BT.2020, gamma 2.2 (10 bits when offered) | the compositor does not announce the srgb transfer, so the driver leaves the subsurface’s colour alone |
| GNOME 48+, Hyprland 0.48+ | Display P3, declared by the driver | the compositor announces srgb + srgb to the driver, which then holds every surface’s colour-management object; a second one is a fatal protocol error, so egui-pop does not tag |
without wp_color_manager_v1, X11, Windows, macOS | sRGB, on the window | said by display::Resolution::reason |
| an opaque window, a secondary window | sRGB, on the window | said |
image_surface::negotiatedecides from anOffer(the colour manager’s announcements, the subsurface’s formats and colour spaces);display::targetthen answers the image surface’s target, andFallback::Unavailablecarries why the image stayed sRGB.- The
viewportcollector’simage_surfacefield shows the route, the compositor’s announcements, each image surface (its place, tag and configuration) and the compositor’s preferred image description for the window (its primaries, transfer, luminances and target volume), re-read when the window moves to another screen. EGUI_POP_IMAGE_SURFACE=offturns it off;=no-tagkeeps the driver’s colour spaces only (for a driver that would hold the colour of surfaces beyond Mesa’s rule).- Per window: each window drawing the image has its own image surface,
negotiated for what that window wants (
display::want), set up from its handles (image_surface::install_window, or the first frame it draws onceset_window_sourcesays where handles are read) and freed when it closes (close_window, or once egui no longer knows the window).windows.listshows each window’s (surface: route, format, colour space, why). egui’s interface keeps egui-wgpu’s one format. - Detached panels’ windows: with
AppBuilder::transparent_panel_windows, built transparent on Wayland (opaque elsewhere, each saying why inwindows.list’stransparency); their handles are paired by the runner, or by a host running its own loop throughrunner::host(windows.list’shandles). - Limits: a window whose handles are known; a transparent window; the subsurface is placed on whole logical pixels (at a fractional scale its pixels may sit up to one pixel off the interface’s); the perceptual intent (the one every compositor takes).
Checking it on a screen (automation has no colour-managed Wayland session):
- In a Wayland session with colour management (KWin 6.3 or later is
the reference: the tagged route), on a wide-gamut screen with its
profile set in the display settings, run
cargo run -p egui-pop-gallery -- --wide-gamut --page viewport. A missing image surface is printed on stderr at start-up. - Open the
displaypage: “Image surface” shows the route (taggedon KWin,wsion GNOME), the image’s encoding, why when less, what the compositor announces and its preferred description. Back on theviewportpage, the image must look exactly as it does without--wide-gamut(the demo’s colours are within sRGB: the compositor maps the BT.2020 encoding back to them), with no seam or offset at its edges, and overlays, the before/after split and menus drawn over it. Pan, zoom and resize the window: the image follows in the same frame as the interface. WAYLAND_DEBUG=1 cargo run -p egui-pop-gallery -- --wide-gamut --page viewport 2>&1 | grep -E 'wp_color|wl_subsurface|set_image_description'shows one subsurface per viewport,set_primaries_named(6)(BT.2020) andset_tf_named(2)(gamma 2.2), andset_image_descriptionon the subsurface (not on the window’s surface).- In Helios,
helios doctor displayprints what the compositor announces; it should agree with the display page. With the Wide-gamut preview setting on, a test chart with colours outside sRGB (a saturated P3 or BT.2020 green) shows them distinct where the sRGB preview clips them.
The contract
The family “Image viewport” (ADR 0027).
Owns: the view model and mapping, tile sources and the cache, the GPU path, the display transform, the Wayland image surface, gestures, hooks, cursors, the loupe, overlays in image coordinates, navigation, the debug collector, a demo source.
Refuses: decoding image formats; colour management beyond the display transform; raw development. The source computes pixels, the viewport asks and draws.
The modules the sections above do not name:
| Module | What it is |
|---|---|
egui_pop_viewport::tiles | The tile cache’s limits and counters: TILE_SIZE, DEFAULT_BUDGET, DEFAULT_SETTLE, UploadBudget, UploadReport, Transfers, Device, and the scales (proxy_scale, exact_scale) |
egui_pop_viewport::thumbnail | A re-export of egui_pop_core::thumbnail (Thumbnails) |
egui_pop_viewport::tokens | ViewportTokens: the viewport.* colours of the installed theme (background, frame, grid, guides, handles, cursors) |
egui_pop_viewport::debug | The viewport collector for the debug bridge |
The tile cache. Each frame, for each side shown, the cache takes in
what the source delivered (dropping answers no longer wanted, marking a
changed region’s tiles stale) and uploads it within the upload budget,
the visible area’s tiles first; it wants the proxy (the whole image at a
power of two at or below the fit scale) and, once the view has been
still for DEFAULT_SETTLE seconds, the exact tiles of what is visible;
asks for what it lacks and cancels what is no longer wanted; draws the
proxy, then the exact tiles over it, stale tiles staying until their
replacements come; and evicts the least recently drawn tiles past the
texture budget, never one drawn this frame. A tile is never larger than
the device’s largest texture side. The limits are the state’s:
use egui_pop::viewport::ViewportState;
use egui_pop::viewport::tiles::UploadBudget;
let mut state = ViewportState::new();
state.set_texture_budget(128 << 20);
state.set_upload_budget(UploadBudget::tiles(8));
state.set_tile_size(512);
The debug collector. Register egui_pop_viewport::debug::collector
on the bridge; its viewport snapshot lists every viewport drawn (view,
mapping, hooks set and what they decided, the last signals, the tiles,
the bytes their uploads copied, the device tiles), and its set_view
action moves a viewport as a command would, through its before_view
hook, on the next frame.
use egui_pop::core::debug::DebugBridge;
let mut bridge = DebugBridge::with_core_collectors();
bridge.register(egui_pop::viewport::debug::collector()).unwrap();
States and failure: a source that never answers leaves its requests outstanding (the collector’s tiles say how many) and nothing drawn where its tiles would be; a failed device request falls back to uploaded tiles (see Device tiles); a view larger than the texture budget still shows whole, the budget only evicting what is not drawn.
Accessibility: the viewport is an image node (Role::Image, said
as an image or a graphic), named by Viewport::label (“Image
viewport” by default), and says its zoom as its value (“100 %”); its
keys follow the pointer profile and the canvas commands
(Pointer gestures).
Tier: Experimental (“The image viewport (egui-pop-viewport):
its view model, mapping, signals and hooks may still move while the
first application adopts it”, API stability).
Tests: crates/egui-pop-viewport/tests/: tiles.rs (proxy then
exact tiles, cancelling on pan, changed regions, bounded backlog,
eviction, conversion on the delivering thread, the largest texture
side, one image pixel per physical pixel at 100 % on both paths),
device_tiles.rs, view.rs (the collector and set_view),
overlays.rs, navigation.rs, canvas_navigation.rs, pointer.rs,
cursor.rs, loupe.rs, images.rs, gestures.rs (the tables read
from each built-in profile, the plain double click from the profile’s
option, the default keys, a context’s gestures following its profile
until set), hooks.rs (the hooks named, the trace kept to its bound,
before_compare asked once per press and release, its veto and
redirect traced). The tokens and the thumbnail re-export have no test
of their own; the on_readout hook’s text is painted only, with no
test.
Image tools
The image tools of egui-pop-viewport (the facade’s viewport
feature) are the controls of a photo editor’s develop panels: a
histogram, a curve editor, colour wheels, a zoom control and a
navigator. The node graph editor, for processing networks, has its own
guide: Node graph editor. They follow one rule: the application computes, egui-pop
draws and handles the interaction. The histogram’s bins, the curve’s
maths, what a wheel’s value means and the image itself are the
application’s; the widgets draw them, take the gestures and hand back
what changed.
Every tool works like the sliders:
- each change is a
Change(from,to, theCause, and whether the gesture isdone), seen by the tool’son_changehook before it is written; the hook answersVerdict::Allow,VetoorRedirect; - a drag’s frames come with
done: false, and its end once more, from the value before the drag, withdone: true; a veto then puts the value back, and Escape during a drag puts it back with no trace; - Ctrl (Cmd) makes a drag or an arrow ten times finer, Shift ten times
coarser (the sliders’
Gestures); - a click never makes a relative control jump;
show(ui)returns what was written in the frame.
Histogram
use egui_pop::egui;
use egui_pop::viewport::histogram::{Channel, Clipping, Histogram};
fn histogram(ui: &mut egui::Ui, red: &[f32], green: &[f32], blue: &[f32], exposure: &mut f64) {
let out = Histogram::new([
Channel::new("Red", red, egui::Color32::from_rgb(220, 70, 60)),
Channel::new("Green", green, egui::Color32::from_rgb(80, 190, 90)),
Channel::new("Blue", blue, egui::Color32::from_rgb(70, 120, 230)),
])
.log(true)
// The application measured them: the share of pixels clipped.
.clipping(Clipping { shadows: 0.0, highlights: 0.004 })
.draggable(true)
.show(ui);
// Four stops per width of the histogram.
*exposure += f64::from(out.moved()) * 4.0;
}
- Bins per channel, any scale, normalised together; linear or logarithmic heights.
- Clipping markers: a triangle in the bottom-left corner (shadows,
histogram.clip-shadows) and one in the bottom-right corner (highlights,histogram.clip-highlights), lit when the fraction is above zero; the accessible value says how much. - Drag: darktable’s drag of the exposure on the histogram. The
widget owns no value; each change is a
Drag(where the gesture began,at, from 0 on the left, and how far it moved,delta, in widths). The output’s changes say how far the gesture has moved, fromfromtoto: addingto.delta - from.delta(moved()) to the value keeps it in step, including after a veto or Escape (a change back to 0 comes then). Where it began (at) lets the application drag the black level from the left and the exposure from the right. Focused, the left and right arrows move it by a step. - Edit area: draggable, it registers as an edit area
(
egui_pop_core::areas, see the workbench’s interactive areas): the framework draws its grip at rest on its right edge and a hover card naming what the drag writes (edits("Exposure", "+0.30 EV")); not draggable, it is a display area, without a grip. In a panel whose state is not current the drag is inert, and a drag under way is given up.
Curve editor
use egui_pop::egui;
use egui_pop::viewport::curve::{CurveEditor, Linear, Pick, PickAction, Spline};
/// The application's curve maths: here straight segments, eased.
struct Eased;
impl Spline for Eased {
fn eval(&self, points: &[[f32; 2]], x: f32) -> f32 {
let y = Linear.eval(points, x);
y * y * (3.0 - 2.0 * y)
}
}
fn tone(ui: &mut egui::Ui, points: &mut Vec<[f32; 2]>, bins: &[f32], under_pointer: Option<f32>) {
CurveEditor::new(points, "Tone curve")
.spline(&Eased)
.histogram(bins)
// The value under the pointer in the image: marked, its point lit.
.pick(under_pointer.map(|x| Pick { x, action: PickAction::Hover }))
.show(ui);
}
Points are [x, y] in 0..1, sorted by x, at least two. The spline is
the application’s, through the Spline trait; MonotoneCubic (the
default: smooth, through every point, never overshooting) and Linear
are supplied.
| Gesture | What it does |
|---|---|
| Press on the curve | Adds a point there; a drag moves it at once |
| Drag a point | Moves it between its neighbours (Ctrl finer, Shift coarser; Escape puts it back) |
| Double click or right click on a point | Deletes it (two points stay) |
| Double click elsewhere | Back to the default points (default_points, the identity unless given) |
| Page Down, Page Up | The next, the previous point (when focused) |
| Arrows | Move the selected point by a step |
| Insert | Adds a point halfway to the next one |
| Delete, Backspace | Deletes the selected point |
| R | Resets the curve |
The keys are data (curve::CurveKeys, curve::set_keys).
The targeted adjustment. In a photo editor, the user points at the
image and drags up or down to adjust the tone under the pointer. The
application reads the value under the pointer (the pixel’s input on the
curve, 0..1) and passes it with what the pointer does:
PickAction::Hover marks it and lights the nearest point, Press
selects that point or adds one on the curve, Move(dy) moves its
output, Release ends the gesture (one done change, cause pick), and
Cancel puts the points back. The gallery’s Curves and wheels page
does it on a grey ramp standing in for the image.
Colour wheels
use egui_pop::egui;
use egui_pop::viewport::wheel::{ColorWheel, WheelValue};
fn grading(ui: &mut egui::Ui, wheels: &mut [WheelValue; 3], colour: &mut WheelValue) {
ui.horizontal_top(|ui| {
for (value, label) in wheels.iter_mut().zip(["Lift", "Gamma", "Gain"]) {
ColorWheel::offset(value, label).size(130.0).show(ui);
}
ColorWheel::picker(colour, "Colour").size(130.0).show(ui);
});
}
A wheel’s value is a WheelValue: a hue in degrees (0 to the right,
counter-clockwise), a chroma (0 at the centre, 1 at the rim) and a
luminance; what they mean (an offset, a power, a gain, a colour) is the
application’s.
ColorWheel::offset: the grading wheels. Neutral at the centre; a drag moves the puck relatively, so a press never makes it jump; a double click resets; the luminance slider is signed, from -1 to 1.ColorWheel::picker: hue and saturation. A press takes the colour under the pointer and a drag follows it; the luminance runs from 0 to 1.- The luminance slider is one of egui-pop’s sliders, named after the
wheel (“Lift luminance”); its changes go through the wheel’s hook as
changes of the whole value.
.luminance(None)leaves it out. - Focused, the arrows move the puck by a step.
The disc’s colours are content (the hues around a neutral centre); its
ring and puck are tokens (wheel.ring, wheel.puck,
wheel.puck-outline).
Zoom control and navigator
use egui_pop::egui;
use egui_pop::viewport::navigator::{Navigator, ZoomControl};
use egui_pop::viewport::{View, Viewport, ViewportState};
fn darkroom(ui: &mut egui::Ui, state: &mut ViewportState, view: &mut View, proxy: egui::TextureId) {
ZoomControl::new(state, view).show(ui);
ui.horizontal_top(|ui| {
Viewport::new("main")
.image_size([6000, 4000])
.size(egui::vec2(640.0, 420.0))
.show(ui, state, view);
Navigator::new(state, view).texture(proxy).show(ui);
});
}
Both share the viewport’s own state: what they change goes through the
viewport’s before_view hook, like its own gestures, and comes out as
its Signal::View with the next frame.
ZoomControl: zoom out and zoom in (one step of the zoom ladder), the zoom in percent, fit and 100 %.Navigator: the whole image (a texture the application gives, its proxy) with a frame around the part in view and a veil over the rest. A drag of the frame pans (relative, Escape puts the view back), a press elsewhere centres the view there, the wheel zooms, a double click fits; focused, the arrows pan,+and-zoom,0fits.
Steps
egui-pop-imaging (the facade’s imaging feature) turns each tool’s
hook into a step of the application (ADR 0011). Each finished change
runs the tool’s step; a drag’s frames stay out of it, and its release
decides.
| Step | Arguments | Default |
|---|---|---|
histogram.drag | histogram, from, to ({at, delta}), cause | writes to |
curve.change | curve, from, to ([[x, y], ...]), cause (drag, add, delete, reset, key, pick, access) | writes to |
wheel.change | wheel, from, to ({hue, chroma, luminance}), cause | writes to |
zoom.change | viewport, from, to ({zoom: "fit" or a number, center}), cause | writes to |
graph.connect, graph.disconnect, graph.move, graph.delete, graph.add | graph, the edit, cause | hands the edit to the application (Node graph editor) |
A before-hook vetoes the change (the tool keeps, or goes back to,
from) or redirects it; a run-hook gives the value to write; an
after-hook follows it, and the journal records every run.
ImagingPlugin declares the steps.
use egui_pop::egui;
use egui_pop::api::steps::Before;
use egui_pop::api::{AppHandle, Ctx, Plugin, PluginError};
use egui_pop::imaging::{self, STEP_CURVE};
use egui_pop::model::ids::PluginId;
use egui_pop::viewport::curve::CurveEditor;
/// Refuses curves of more than eight points.
struct EightPoints;
impl Plugin for EightPoints {
fn id(&self) -> PluginId {
PluginId::from_static("eight_points")
}
fn requires(&self) -> Vec<PluginId> {
vec![imaging::IMAGING_PLUGIN]
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.before(STEP_CURVE, |_, args| {
if args["to"].as_array().map_or(0, Vec::len) > 8 {
Before::Veto("eight points at most".into())
} else {
Before::Go
}
});
Ok(())
}
}
fn tone(ui: &mut egui::Ui, app: &AppHandle, points: &mut Vec<[f32; 2]>) {
CurveEditor::new(points, "Tone curve")
.on_change(imaging::curve(app, "tone"))
.show(ui);
}
let _ = (EightPoints, tone);
Accessibility
Every tool is an AccessKit node named by its label, with a value screen readers say:
| Tool | Role | Value | Actions |
|---|---|---|---|
| Histogram | slider when draggable | its channels and bins, what is clipped | increment and decrement move the drag |
| Curve editor | slider | the selected point and its input and output | increment, decrement and set-value change that point’s output |
| Colour wheel | slider (and the luminance slider) | hue, chroma and luminance | increment and decrement change the chroma |
| Zoom control | buttons | ||
| Navigator | scroll view | the zoom and the centre in view |
Tokens
histogram.* (with clip-shadows, clip-highlights), curve.*
(background, grid, identity, line, point, point-selected,
pick), wheel.* (ring, puck, puck-outline) and navigator.*
(background, frame, veil), each an alias of a system role; the
curve and its points are contrast-checked against the editor’s
background. See Design tokens.
Why its own
egui_plot draws histograms and lines but brings its own axes, pan and zoom; no crate checked has a curve editor with an application’s spline, colour grading wheels or an image navigator for egui 0.36. See the survey.
Node graph editor
egui_pop::viewport::graph (the facade’s viewport feature) is a node
graph editor over a graph the application keeps: it describes its
nodes, typed ports, wires and groups through a trait, the editor draws
them on egui’s Scene (pan and zoom) and hands back what the user did
as edits, which the application applies, or not. The editor never owns
the graph.
The model
use egui_pop::viewport::graph::{Edge, GraphModel, Group, Kind, Node, Param, Port, PortType};
struct Pipeline {
nodes: Vec<Node>,
edges: Vec<Edge>,
radius: f64,
}
impl GraphModel for Pipeline {
fn nodes(&self) -> Vec<Node> {
self.nodes.clone()
}
fn edges(&self) -> Vec<Edge> {
self.edges.clone()
}
fn groups(&self) -> Vec<Group> {
vec![Group::new("detail", "Detail")]
}
// Shown in the detail view, edited inline with egui-pop's sliders.
fn params(&self, node: &str) -> Vec<Param> {
match node {
"blur" => vec![Param::new("radius", "Radius", self.radius, 0.0..=20.0).step(0.1).unit("px")],
_ => Vec::new(),
}
}
// What the canvas's menu (a secondary click) offers to add.
fn kinds(&self) -> Vec<Kind> {
vec![Kind::new("blur", "Blur")]
}
}
let image = || PortType::new("image");
let _graph = Pipeline {
nodes: vec![
Node::new("load", "load", "Load", [0.0, 0.0]).output(Port::new("image", "Image", image())),
Node::new("blur", "blur", "Blur", [240.0, 0.0])
.input(Port::new("image", "Image", image()))
.output(Port::new("image", "Image", image()))
.group("detail"),
],
edges: Vec::new(),
radius: 2.0,
};
- Ids are the application’s strings: a node’s
id, a port’sidwithin its node, a group’s, a kind’s. Steps, commands and the debug bridge show them. - Positions are the application’s too (
Node::pos, the top-left corner in graph units, points at 100 %): a drag hands back a move. - Types: a
PortTypehas a name and a colour token. By default the colour is one ofgraph.type-1tograph.type-6, picked from the name (the same name, the same colour);.color("my.token")takes any token of the theme. An output feeds any number of inputs; an input takes one wire (a new one replaces it) unless it is.multiple(). - Checks:
GraphModel::can_connectsays whether an output may feed an input; the default (graph::check) wants the same type and two different nodes. ItsRefusalis shown and announced.
The editor
use egui_pop::egui;
use egui_pop::viewport::change::{Cause, Verdict};
use egui_pop::viewport::graph::{Edge, Edit, GraphEditor, GraphMinimap, GraphModel, GraphState, Node};
struct Pipeline {
nodes: Vec<Node>,
edges: Vec<Edge>,
}
impl GraphModel for Pipeline {
fn nodes(&self) -> Vec<Node> {
self.nodes.clone()
}
fn edges(&self) -> Vec<Edge> {
self.edges.clone()
}
}
fn graph_panel(ui: &mut egui::Ui, graph: &mut Pipeline, state: &mut GraphState) {
let out = GraphEditor::new(&*graph, state)
.snap(Some(10.0))
// A slot in each title bar, the application's.
.header(|ui, _node| {
ui.small("on");
})
// Sees every edit first: allow, veto, or redirect.
.on_edit(|edit, _cause: Cause| match edit {
Edit::Delete { nodes, .. } if nodes.iter().any(|n| n == "output") => Verdict::Veto,
_ => Verdict::Allow,
})
.show(ui);
for edit in &out.edits {
match edit {
Edit::Connect { from, to, replaces } => {
graph.edges.retain(|e| !replaces.contains(e));
graph.edges.push(Edge::new(from.clone(), to.clone()));
}
Edit::Disconnect { edges } => graph.edges.retain(|e| !edges.contains(e)),
Edit::Move { moves } => {
for m in moves {
if let Some(n) = graph.nodes.iter_mut().find(|n| n.id == m.node) {
n.pos = m.to;
}
}
}
Edit::Delete { nodes, edges } => {
graph.nodes.retain(|n| !nodes.contains(&n.id));
graph.edges.retain(|e| !edges.contains(e));
}
// Adding nodes, parameters, and edits to come.
_ => {}
}
}
// The minimap shares the editor's state, like the image navigator.
GraphMinimap::new(state).show(ui);
}
GraphState is the view: the part of the graph in view (view), the
selection, the collapsed nodes and the folded groups, all for the
application to keep; request asks for something at the next frame
(Request::Fit, Level, Select, SelectWires, Focus, or an Edit
as if the user made it). GraphState::selected_edges holds the wires
selected, beside selection’s nodes. GraphOutput gives the edits after
the hook, the events (Selection, WireSelection, Level,
Refused), the level and the zoom.
Edits
| Edit | When | Fields |
|---|---|---|
Connect | a wire dropped on a port that accepts it, two ports clicked, Enter on two ports; a wire’s end moved to another port | from (an output), to (an input), replaces: the wires it takes the place of (the input’s old wire, the wire whose end moved) |
Disconnect | a wire dragged off an input or by its end and dropped nowhere, Delete on a port or with only wires selected, a port’s or a wire’s menu | edges |
Move | the end of a drag of nodes, a stack or a group’s title; Shift and the arrows | moves: each node’s from and to (snapped with snap) |
Delete | Delete or Backspace, a node’s menu | nodes, and the edges touching them and the wires selected |
Add | the canvas’s menu (at the pointer), Ctrl+D (copies, copy_of) | nodes: kind, at, copy_of |
Param | a parameter’s slider in the detail view | node, param, from, to, done (a drag’s frames are not done) |
A drag never writes: the nodes follow the pointer in the editor, and
one Move comes at the end (Escape during the drag drops it).
Each drag keeps its cursor until it ends, wherever the pointer goes (drag cursors): move over a node, a stack or a group’s title; a closed hand for a wire’s end and a pan; a crosshair for the rubber band.
Gestures
Pan and zoom follow the pointer profile (pointer-gestures.md); the defaults (Document):
| Gesture | What it does |
|---|---|
| Wheel, two fingers | Pans (Shift and the wheel: sideways) |
| Ctrl (Cmd) and the wheel, a pinch | Zooms around the pointer |
| Drag with the middle button, with Space held, or any primary drag in hand mode (H) | Pans, wherever it starts on the graph (a node, a port, a wire too) |
| Drag on the canvas | A rubber band: selects the nodes it touches (Shift or Ctrl adds) |
| Click on the canvas | Clears the selection (nodes and wires), drops a wire begun with a click |
| Double click on the canvas | Fits the graph (gesture.graph.fit) |
| Click on a node | Selects it (Shift or Ctrl adds or removes it) |
| Drag a node | Moves the selection |
| Double click on a title, or its chevron | Collapses the node to its title |
| Drag from a port | Draws a wire, checked as it goes: ports that accept it are ringed, others dimmed, the wire turns to the refusal colour over a port that refuses it |
| Drag from a connected input | Takes its wire along: dropped nowhere, it disconnects |
| Click a port, then another | Connects them |
| Hover a wire | Within 6 points of it (12 on a touch screen), where no node or port is: the pointer becomes a hand, the wire is drawn thicker and lighter (graph.wire-hover), its two ports ringed, a tooltip at once naming its ends (“Load · Image to Blur · Image”), the hint line says what the pointer does |
| Click a wire | Selects it, and no node (Shift or Ctrl adds or removes it, nodes kept): drawn thicker in the selection’s colour over a soft glow (graph.wire-selected), with a larger handle near each end and its two ports ringed: seen even when the wire is short |
| Drag a wire | Takes its nearer end along (one of an output’s several wires too): dropped on a port that accepts it, one Connect replacing it; dropped nowhere, a Disconnect; Escape puts it back |
| Delete with wires selected | One Disconnect of them all; with nodes selected too, one Delete |
| A group’s title | Folds the group into a stack; a click on the stack unfolds it; dragging either moves the group |
| Secondary click | The canvas’s menu (add a node), a node’s (duplicate, delete), a port’s (disconnect), a wire’s (disconnect, select the source, select the destination) |
The graph follows the shared navigation model
(design/navigation.md,
egui_pop::viewport::navigation), the same on every canvas:
| Key or command | What it does |
|---|---|
H, view.hand | Hand mode on or off: a primary drag pans from anywhere; the grab cursor and an indicator in the top-left corner show it |
Home on the graph, view.fit (Shift+1) | Fits the graph |
F, view.frame_selection (Blender: also .; Document: also Shift+2) | Frames the selected nodes (the whole graph when none is) |
Ctrl and + / -, view.zoom_in / view.zoom_out | Zooms around the view’s centre |
Ctrl+0, view.zoom_100 | 100 % (within the zoom range) |
Ctrl and the arrows, view.pan_* | Pans a tenth of the view |
The keys work while the pointer is over the graph or the graph has the
keyboard; in an application the same commands are in the palette and
the keymap and reach the canvas in use. The overview (the minimap) shows
in the bottom-right corner when the graph is more than twice the view on
one axis (GraphEditor::overview: when needed, always or never); a click
or a drag on it moves the view. GraphEditor::keep_view(id) keeps the
view across sessions in egui’s persisted memory: the graph opens where
it was left. On a canvas kind’s first use a one-time hint says how to
move around; the first pan or a click dismisses it for good
(GraphEditor::hint(false) turns it off).
Wires answer the pointer at the ports and detail levels, between nodes (not into a folded group’s stack). A node selection and a wire selection live side by side: a plain click on either selects it alone, Ctrl or Shift adds to both, the rubber band selects nodes (keeping the wires with Ctrl or Shift).
Wires
wires(style) picks how the graph’s wires are drawn (WireStyle):
| Style | What it draws |
|---|---|
Curves (the default) | A curve out of each port; it may cross nodes |
Orthogonal | Horizontal and vertical segments around the nodes (and stacks), keeping a margin from them, with few bends; wires through one channel are spread apart |
Straight | A straight segment from port to port |
Orthogonal routes come from ortho-router,
a crate of this workspace without egui, published on its own for any
project that draws connectors: A* with a bend cost over the grid of
the nodes’ edges grown by the margin. The routes are kept in the
GraphState and computed again only when the layout changes (a node
moved, collapsed or folded, a wire added or removed, another level), so
a frame that changes nothing routes nothing; while nodes are dragged
they follow at each frame. When a port has no way out (boxed in by
other nodes), its wire falls back to one elbow halfway. The wire being
drawn is that elbow too, routed once it is connected.
GraphState::wire_style says the style drawn last, and the graph’s
snapshot (describe, graph.read) carries wires (its name) and,
when orthogonal, routes: each wire’s edge and points.
Overview and detail
The zoom picks the level (Level), with levels(overview_below, detail_from) (0.55 and 0.9 by default):
- Overview: compact nodes with their titles at a size readable at
that zoom, groups folded into stacks (
+12), wires between boxes; nodes still select and move. - Ports: every node with its ports and their labels, the wires between ports.
- Detail: also each node’s parameters, egui-pop sliders edited inline (the arrows, a typed value, a double click to the default).
A group folded at the ports or detail level stays folded
(GraphState::folded); in the overview, groups are folded unless
unfolded there (GraphState::unfolded).
Keyboard
| Key | Where | What it does |
|---|---|---|
| Tab, Shift+Tab | anywhere | A large graph is one stop: into it, on the node (or the canvas) focused there last, and out of it from anywhere in it. A small one: through the canvas, each node, its chevron, its ports and its sliders |
| Enter | a node of a graph that is one stop | Into its parts: its chevron, ports, sliders and header, where Tab and Shift+Tab go round |
| Escape | a part of a graph that is one stop | Back to its node |
| Arrows | the canvas | To the node nearest the centre of the view |
| Arrows | a node | To the nearest node that way |
| Shift + arrows | a node | Moves the selection by a grid step (Move) |
| Space; Enter where every part is a stop | a node | Selects it |
| Arrows | a port | To the node’s other ports |
| Enter, Space | a port | Begins a wire there; on a second port, connects (or says why not) |
| Delete, Backspace | a port | Disconnects it |
| Escape | a port | Drops the wire begun, else back to the node |
| Tab | a connected input | To each of its wires, then on to the next port |
| Delete, Backspace | a wire | Disconnects it (Disconnect), back to its input |
| Enter | a wire | Picks its input end up: choose an input as above (Enter on it reconnects, one Connect replacing the wire) |
| Shift+Enter | a wire | Picks its output end up: choose an output |
| Menu key, Shift+F10 | a wire | Its menu |
| Escape | a wire | Drops the end picked up, else back to its input |
| Delete, Backspace | a node, the canvas | Deletes the selection (the focused node when it is not selected) |
| Ctrl+D | a node, the canvas | Duplicates the selection |
| Ctrl+A | a node, the canvas | Selects every node |
| Home | a node, the canvas | Fits the graph |
A graph is one Tab stop from twelve nodes (graph::ONE_STOP_FROM), as ARIA
asks of a composite widget: on a network of thirty modules Tab otherwise
went through well over a hundred stops before leaving.
GraphEditor::tab_stops(TabStops::One) or TabStops::Each chooses for any
size. There, Enter on a node goes into its parts rather than selecting it
(Space still selects), and a group’s band or a folded stack is the pointer’s.
The keys are data (graph::GraphKeys, graph::set_keys). The view
follows the focus: a node or port brought into focus out of view is
brought into it.
Steps
egui_pop::imaging::show_graph shows an editor as part of the
application (ADR 0011): each edit runs its step, the events go on the
journal, agents’ requests reach it.
| Step | Arguments | Default |
|---|---|---|
graph.connect | graph, from, to ({node, port}), replaces, cause | hands the edit to the application |
graph.disconnect | graph, edges ([{from, to}]), cause | hands the edit to the application |
graph.move | graph, moves ([{node, from, to}]), cause | hands the edit to the application |
graph.delete | graph, nodes, edges, cause | hands the edit to the application |
graph.add | graph, nodes ([{kind, at, copy_of}]), cause | hands the edit to the application |
A before-hook vetoes the edit (it never reaches the application) or
redirects it (another place, another kind); a run-hook’s result is the
edit handed back; an after-hook follows it. A parameter’s slider is not
a step. cause is drag, click, key, command…
Events on the journal: graph.selection_changed (graph, nodes),
graph.wire_selection_changed (graph, edges), graph.level_changed (graph, level), graph.refused (graph,
from, to, reason).
use egui_pop::egui;
use egui_pop::api::steps::Before;
use egui_pop::api::{AppHandle, Ctx, Plugin, PluginError};
use egui_pop::imaging::{self, graph::STEP_GRAPH_DELETE};
use egui_pop::model::ids::PluginId;
use egui_pop::viewport::graph::{GraphEditor, GraphModel, GraphState};
/// The output node stays.
struct KeepOutput;
impl Plugin for KeepOutput {
fn id(&self) -> PluginId {
PluginId::from_static("keep_output")
}
fn requires(&self) -> Vec<PluginId> {
vec![imaging::IMAGING_PLUGIN]
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.before(STEP_GRAPH_DELETE, |_, args| {
if args["nodes"].as_array().is_some_and(|n| n.iter().any(|n| n == "output")) {
Before::Veto("the output stays".into())
} else {
Before::Go
}
});
Ok(())
}
}
fn panel(ui: &mut egui::Ui, app: &AppHandle, graph: &dyn GraphModel, state: &mut GraphState) {
let out = imaging::show_graph(app, "main", GraphEditor::new(graph, state), ui);
for _edit in out.edits {
// Apply it to the graph.
}
}
let _ = (KeepOutput, panel);
Commands for agents
ImagingPlugin declares them (hidden from the palette); graph names
an editor shown with show_graph (without it, the only one). Edits
asked by a command are done at the editor’s next frame, as the user’s:
a connection is type-checked, then the edit runs its step.
| Command | Arguments | Result |
|---|---|---|
graph.read | graph | the graph as drawn: nodes (place, ports, group, collapsed, selected, parameters), edges, groups, kinds, selection, selected_edges, level, zoom, visible |
graph.edit | graph, edit (connect, disconnect, move, delete, add) and the edit’s fields; a connect whose replaces names a wire there moves that wire’s end, one edit | queued |
graph.select | graph, nodes, edges ([{from, to}]): one or both, what is named becomes the selection | queued |
graph.view | graph, and fit: true, level or focus (a node) | queued |
graph.export | graph, format (svg, png, pdf), selection, level, wires, background, title, scale | svg as text, or png or pdf base64-encoded: the graph as an image (see Export) |
Export
The graph exports as an SVG image, drawn from the model and its layout rather than from the screen: it is crisp at any size, and the same graph with the same options gives the same text, so an export can be compared in a test or reviewed in a diff.
use egui_pop::egui;
use egui_pop::viewport::graph::{ExportOptions, GraphEditor, GraphExport, GraphModel, GraphState, Level, WireStyle};
fn save(ctx: &egui::Context, graph: &dyn GraphModel, state: &mut GraphState) -> (String, String) {
// What this editor would draw: its wire style and node width.
let whole = GraphEditor::new(graph, state)
.wires(WireStyle::Orthogonal)
.export_svg(ctx, &ExportOptions::default());
// From a model and the state alone (the style drawn last), the
// selection with each node's parameters.
let selection = GraphExport::capture(ctx, graph, state)
.svg(&ExportOptions::default().selection(true).level(Level::Detail));
(whole, selection)
}
let _ = save;
| Option | Default | What |
|---|---|---|
selection | false | Only the selected nodes, the wires between them and the frames of their groups (an empty selection, an empty image) |
level | Level::Ports | The overview (compact nodes, groups folded into stacks unless unfolded there), the ports, or the detail (each parameter’s label, value and unit, and how far along its range it is) |
background | true | The graph’s background behind the drawing; off, transparent |
margin | 24 | Around the drawing, in graph units |
title | “Node graph” | The image’s <title>, for screen readers |
What is drawn: group frames with their labels, the wires in the graph’s
WireStyle (curves, straight segments, or orthogonal routes computed
for the exported layout) in their port type’s colour, each node with
its title bar, its type band, its ports and their labels, and stacks
with their count. The state’s collapsed nodes and folded groups are
kept. What only an interactive canvas shows is left out: the grid, the
selection’s outline, focus rings, chevrons, the application’s slot in
title bars. Coordinates are graph units (a point at 100 %); the
viewBox frames what is drawn and the margin.
The colours and sizes come from the theme (ExportTheme::of: the
graph.* tokens, each port type’s colour token, the font.family.ui
family then sans-serif, the body and small sizes); an application
builds its own ExportTheme for a light export of a dark interface,
and passes it to GraphExport::with_theme. Elements carry the graph’s
ids for tools and tests: <g data-node>, <path data-edge="a.out->b.in">,
<g data-group>, <g data-stack>, <circle data-port data-side>,
<g data-param>.
PNG and PDF
Two features render that SVG, so an application that does not want them does not pay for font shaping:
| Feature | Method | What |
|---|---|---|
graph-png | GraphExport::png(&options, scale) | resvg with its text support: scale pixels per graph unit (1 for a point at 100 %, 2 for a high density screen), transparent without the background; at most GraphExport::MAX_SIDE pixels a side |
graph-pdf | GraphExport::pdf(&options) | svg2pdf: one page, a graph unit a point, the text kept as text and its fonts embedded as subsets |
use egui_pop::viewport::graph::{ExportOptions, GraphExport};
let export = GraphExport::capture(ctx, graph, state);
let png: Vec<u8> = export.png(&ExportOptions::default(), 2.0)?;
let pdf: Vec<u8> = export.pdf(&ExportOptions::default().title("Pipeline"))?;
The labels match the screen: GraphExport::capture takes the faces
egui-pop installed for the theme’s font.family.ui
(egui_pop::core::fonts::installed_faces: the families the theme
names, registered by the application, egui’s or the system’s), and
egui’s bundled faces always come behind them for what they lack. The
system’s fonts are never searched, so an export is the same on every
machine. GraphExport::with_theme draws in egui’s bundled faces unless
GraphExport::faces gives others.
Both are deterministic: the same graph, options and scale give the same
bytes. The PDF’s metadata is fixed (the title, egui-pop as producer,
no date, no file identifier), and its objects are numbered and written
in a canonical order (svg2pdf writes some in hash order). A failure is
an ExportError: an empty image (nothing selected and no margin), a
scale that is not positive, an image too large.
The facade’s graph-png and graph-pdf features turn them on, in
egui-pop-imaging too.
Agents
show_graph keeps a copy of the graph at each frame
(GraphEditor::keep_export, GraphOutput::export), which the
graph.export command exports: format (svg by default; png and
pdf when built with their features, base64-encoded), level by name,
wires (curves, orthogonal, straight) to draw another style than
the editor’s, scale for a PNG (1 by default).
A graph file
An application without a graph model of its own can keep its graph in
a YAML file: egui_pop::viewport::graph::yaml::YamlGraph (the facade’s
graph-yaml feature) reads one, is the editor’s GraphModel, and
writes the edits back into the file’s text. The file is the source of
truth: it can be written by hand or by an agent, reviewed in a diff and
versioned.
use egui_pop::egui;
use egui_pop::api::AppHandle;
use egui_pop::imaging;
use egui_pop::viewport::graph::yaml::YamlGraph;
use egui_pop::viewport::graph::{GraphEditor, GraphModel, GraphState};
fn panel(ui: &mut egui::Ui, app: &AppHandle, graph: &mut YamlGraph, state: &mut GraphState) {
let out = imaging::show_graph(app, "main", GraphEditor::new(&*graph, state), ui);
for edit in &out.edits {
// The one mutation point: the edit lands in the text.
graph.apply(edit);
}
// `graph.text()` is the file to save.
}
let graph = YamlGraph::parse("nodes:\n - id: a # the first\n pos: [0, 0]\n").expect("a graph file");
assert_eq!(graph.nodes().len(), 1);
let _ = panel;
The format
# The format's version, as token files carry theirs.
$extensions:
org.egui-pop.graph: {version: 1}
groups:
detail: Detail # an id and its label, or {label: Detail}
kinds:
load:
title: Load
outputs:
image: image # a port's id and its type
blur:
title: Blur
inputs: {image: image}
outputs: {image: image}
params:
radius: {label: Radius, value: 2, min: 0, max: 20, step: 0.1, unit: px}
mix:
title: Blend
inputs:
base: image
mask: {type: mask, label: Mask, multiple: true, color: graph.type-3}
outputs: {image: image}
nodes:
# The source.
- id: load
kind: load
pos: [0, 0]
- id: blur
kind: blur
title: Soft blur # instead of the kind's
pos: [240, 0]
group: detail
params:
radius: 3.5 # the value; the rest is the kind's
edges:
- load.image -> blur.image
- {from: blur.image, to: mix.base, note: kept}
| Key | What |
|---|---|
$extensions | org.egui-pop.graph: {version: N} (FORMAT_EXTENSION, FORMAT_VERSION); a file without it is read as the current version, a newer one is read with a warning (YamlGraph::warnings). Other extensions are the application’s. |
groups | Each group’s id and label (detail: Detail or detail: {label: Detail}). |
kinds | What the canvas’s menu adds, and what a node of the kind has: title, inputs and outputs (each port id: type, or {type, label, multiple, color}), params (each {label, value, min, max, step, unit, default}; min and max are required). |
nodes | A list of nodes: id (required, unique), kind, title (else the kind’s, else the id), pos ([x, y], the top-left corner, else [0, 0]), group, and inputs, outputs, params of their own: a port of the same id replaces the kind’s, a parameter’s fields go over the kind’s (a number alone sets the value). |
edges | A list of wires: node.port -> node.port (an output, then an input; the port’s id is after the last dot), or {from: node.port, to: node.port}. |
Labels left out are the id, capitalised. A parameter’s value is its
value, else its default, else min; a double click goes back to
its default, else to the kind’s value. A kind or a group a node
names must be declared. A file the format does not allow is refused
with the line and column of what is wrong (YamlGraphError): YAML
that does not parse, a top level that is not a block mapping, two
nodes with one id, a kind, group, node or port that is not there, a
parameter without its range.
What round-trips
YamlGraph::text is the file as read until an edit, byte for byte. An
edit changes the lines it lands on and nothing else:
| Edit | In the text |
|---|---|
Move | the node’s pos value (the comment after it stays), or a pos line added |
Param | the parameter’s value under the node’s params, or a line added there |
Delete | the node’s item and the comment right above it, the items of its wires |
Connect, Disconnect | the wires’ items removed, a new item after the last wire |
Add | a new item after the last node (kind-1, kind-2…; a duplicate takes the group and parameters of the node it copies) |
Comments, blank lines, key order, quoting, line endings and the keys
egui-pop does not know (in a node, a wire, anywhere else) are kept.
Two cases are written again: a node written in flow style
(- {id: a, pos: [0, 0]}) that an edit reaches is written again in
block style, its unknown keys as flow values; a nodes or edges list
in flow style (nodes: [...]) is written again whole in block style
at its first edit, comments inside it lost. Each splice is read back
and compared with the graph the edit makes; a splice that would not
read back falls back to writing the two lists again.
An edit is one gesture (a drag’s Move comes at its end, a slider’s
frames with done: false): an application that keeps an undo history
records text() before an edit and reads it back to undo.
Accessibility
| Part | Role | Name | Value |
|---|---|---|---|
| The canvas | group | its label (“Node graph”) | nodes, wires and the level |
| A node | group, described as “node”, selected or not | its title | its inputs, outputs and wires |
| A port | button, described as “input port” or “output port” | “Blur, input Image” | its type and wires |
| A wire, after its input | button, described as “wire”, selected or not; its keys as the description | “Load, output Image to Blur, input Image” | |
| The chevron | button | “Collapse Blur”, “Expand Blur” | |
| A group’s title | button | “Fold Detail” | |
| A stack | button, described as “stack” | “Unfold Detail (12 nodes)” | |
| A parameter | slider | its label | its value |
| The minimap | scroll view | “Graph overview” | the zoom |
A wire begun, made, refused, removed or picked up by an end, and the
number of wires selected, are announced (a live region). The
editor’s widgets sit in the Scene’s transformed layer, whose
AccessKit bounds egui reports untransformed: the editor sets them
itself (see upstream).
Tokens
graph.*: background, grid, node, node-header, node-border,
node-selected, wire (a type with no colour), wire-preview,
wire-refused, group, group-border, band, and type-1 to
type-6 (the port types’ colours, aliases of the accent and the
status colours). The minimap draws with navigator.*. The selected
outline is contrast-checked against the node.
The wire under the pointer and the wires selected:
| Token | pop-dark | What |
|---|---|---|
graph.wire-hover.color | {text.strong} | a hovered wire’s colour is its own mixed halfway toward it |
graph.wire-hover.width | 3.5 px | a hovered wire’s stroke (a plain wire: 2) |
graph.wire-selected.color | {accent.default} | a selected wire’s stroke, its handles, its ports’ rings |
graph.wire-selected.width | 4 px | a selected wire’s stroke |
graph.wire-selected.glow | {accent.default} | the glow under a selected wire |
graph.wire-selected.glow-width | 12 px | the glow’s width |
graph.wire-selected.glow-opacity | 0.35 | the glow’s opacity |
Widths are screen points. Every built-in theme takes them from
pop-dark through its own accent and text; both colours are
contrast-checked against the canvas (graph.background), 3:1.
Why its own (2026-10-13)
| Crate | Licence | egui | What it does | Why not |
|---|---|---|---|---|
egui’s Scene | MIT OR Apache-2.0 | 0.36 | A pan and zoom container (a transformed layer) | Adopted: the editor is drawn in it |
| egui-snarl 0.12 | MIT OR Apache-2.0 | 0.36 | A node graph widget with a viewer trait | It owns the graph (Snarl<T> keeps nodes, positions and wires; the viewer’s callbacks change it in place), so edits cannot come back as requests to veto; no AccessKit nodes for nodes and ports, no keyboard path, no levels of detail, styled outside the tokens |
| egui_node_graph 0.4 | MIT | 0.2x | The first node graph editor for egui | Unmaintained since 2022 |
| egui_node_graph2 0.7, egui-graph-edit 0.9 | MIT | 0.29, 0.35 | Its forks | Own the editor’s graph state (a slotmap); not on egui 0.36 |
| egui_graphs 0.32 | MIT | 0.36 | Shows a petgraph graph, with force layouts | A viewer of the application’s petgraph, not an editor of typed ports |
Decision: own, built on egui’s Scene. The application’s graph,
requests run as steps, levels of detail and the keyboard and screen
reader paths are what egui-pop needs and none of the editors offers;
no code is taken from them.
Cursors and the loupe
The image viewport (egui-pop-viewport, the facade’s viewport
feature) shows the cursor of the tool in use, drawn crisp at the
window’s scale, and a loupe on the pixels under the pointer.
Cursors
The viewport’s cursors are its own; every other draggable shows the
cursor of its kind of drag (drag cursors):
always while it is dragged, and hovered only when dragging is its only
action (a splitter, a resize grip, a view frame), the arrow staying until
the drag starts where a click does something (select, seek, set a
value). The widget, the pointer profile and the kit
(drag-cursor.<kind>.hover, .drag, .policy) can each change the
cursors and that rule, the most specific winning
(three levels).
A cursor::Cursor is one of:
| Variant | What it is | How it reaches the screen |
|---|---|---|
System(CursorIcon) | one of egui’s system cursors | the system draws it |
Tool(ToolCursor) | one of egui-pop’s tool cursors | a bitmap drawn at the cursor size and the window’s scale, in the theme’s colours, handed to the system |
Image(name) | a bitmap the application registered (cursor::register_image) | the size closest to the one wanted, its dark variant in a dark theme |
Brush(BrushOutline) | a brush outline: its radius in image pixels and its hardness | painted over the image, the system cursor hidden |
The tool cursors are Crosshair, Picker (an eyedropper), Hand,
Grab (a closed hand), ZoomIn, ZoomOut, Move, Rotate, Brush,
Eraser, MaskAdd, MaskSubtract and NotAllowed. They are drawn
from vector strokes in the icon set’s line style, ringed in the
outline colour so they read on any image (cursor.fill,
cursor.outline), at the exact number of physical pixels of the
cursor size, then kept.
The tool decides, the situation changes it
The application gives the viewport its tool (Viewport::tool); the
viewport asks cursor::default_cursor each time the situation under
the pointer changes (a CursorQuery: the tool, the keys held, a drag,
the pan key, a handle under the pointer, whether it is over the image):
| Situation | Cursor |
|---|---|
| The pan key held, or a pan | an open hand, closed while dragging |
| Over a handle | move (rotate on a rotation handle), a closed hand while dragging it |
Tool::Zoom | zoom in; with Alt, zoom out |
Tool::Pan | an open hand, closed while dragging |
Tool::Picker, Crosshair, Move, Rotate | their tool cursor |
Tool::Brush, Eraser, Mask | the brush outline (an eraser’s marked with a cross, a mask brush’s with a plus, a minus with Alt) |
Tool::Disabled | not allowed |
Tool::None, Tool::Named | the system’s arrow |
Viewport::on_cursor gets the query and that default and returns the
cursor to show; a change of answer is traced (on_cursor,
redirect). With egui-pop-imaging, imaging::cursor runs it as the
cursor.resolve step, where plugins give another cursor:
use egui_pop::egui;
use egui_pop::api::{AppHandle, Ctx, Plugin, PluginError};
use egui_pop::imaging::{self, STEP_CURSOR};
use egui_pop::model::ids::PluginId;
use egui_pop::viewport::cursor::{Brush, Tool};
use egui_pop::viewport::{View, Viewport, ViewportState};
use serde_json::json;
/// The brushes cannot paint outside the image.
struct InsideOnly;
impl Plugin for InsideOnly {
fn id(&self) -> PluginId {
PluginId::from_static("inside_only")
}
fn requires(&self) -> Vec<PluginId> {
vec![imaging::IMAGING_PLUGIN]
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.replace(STEP_CURSOR, |_, args| {
if args["query"]["tool"] == "brush" && args["query"]["over_image"] == false {
Ok(json!({ "tool": "not-allowed" }))
} else {
Ok(args["default"].clone())
}
});
Ok(())
}
}
fn darkroom(ui: &mut egui::Ui, app: &AppHandle, state: &mut ViewportState, view: &mut View) {
Viewport::new("main")
.image_size([6000, 4000])
.tool(Tool::Brush(Brush::new(40.0, 0.5)))
.on_cursor(imaging::cursor(app, "main"))
.show(ui, state, view);
}
let _ = (InsideOnly, darkroom);
The step’s arguments are viewport, query ({tool, modifiers, dragging, panning, handle, over_image, brush}) and default; a cursor
in JSON is {"system": "Crosshair"}, {"tool": "zoom-in"},
{"image": "lasso"} or {"brush": {"radius", "hardness", "mark"}}.
The answer is kept until the situation changes;
ViewportState::refresh_cursor asks again.
The brush outline
A brush outline is sized in image pixels: its radius on screen is the radius times the zoom (physical pixels per image pixel), in points. Below 4 points it gives way to a crosshair. Under 1 in hardness, an inner, fainter ring shows where the full strength ends; a dot marks the centre. Lines are whole physical pixels, a light line over a dark one (or the reverse in a light theme).
Settings and accessibility
cursor::CursorSettings(cursor::set_settings) turns the painted cursors off: system cursors stand in for the tool cursors (zoom in and out, grab, move, not allowed, a crosshair for the rest), for the registered images (their fallback) and for the brush outline (a crosshair).- The cursor size follows the system’s:
XCURSOR_SIZEon X11 and Wayland desktops, else 24 points; the settings override it. Bitmaps are drawn at that size times the window’s scale. - Reduced motion: an application’s animated cursor (
CursorImageframes) holds its first frame. egui-pop’s own cursors never move. ViewportState::cursorandcursor_shownsay what was resolved and shown; the debug bridge’sviewportcollector shows both.
Where bitmaps reach the system
Bitmap cursors go through egui::Context::set_cursor_image, which
eframe’s native integration (wgpu and glow) hands to winit as a custom
cursor. Where they cannot reach the system (the web, immediate
viewports), the tool cursor’s system fallback shows instead (see
Upstream workarounds). A bitmap is kept by egui from
frame to frame: the viewport clears it when the pointer leaves, and
cursor::apply says whether one was set for a widget of the
application’s own.
The loupe
The loupe shows the pixels under the pointer, magnified, in a square beside it (above and to the right, flipped at the viewport’s edges):
use egui_pop::egui::Key;
use egui_pop::viewport::ViewportState;
use egui_pop::viewport::loupe::Values;
let mut state = ViewportState::new();
let loupe = state.loupe_mut();
loupe.key = Some(Key::L); // L turns it on and off over the viewport
loupe.magnification = 8; // 4 to 16 points per displayed pixel
loupe.values = Values::Display; // RGB and Lab as displayed (or Scene)
loupe.on = true; // a tool option: the picker's loupe
- Displayed pixels: the loupe draws the viewport’s own tile textures again, after the display transform, through a magnifying mapping clipped to its square. On the GPU path a second paint callback samples the half-float tiles with the viewport’s shader (its own uniforms), so nothing is read back to the CPU; on the CPU path the tiles’ egui textures (nearest filtering) are drawn again.
- From 100 % up a displayed pixel is an image pixel; below, a screen pixel. Each becomes a block of whole physical pixels, the one under the pointer at the centre, with a grid between them and a marker around the centre.
- Readout: the pixel’s coordinates, then its values as displayed
(the source’s
R,GandBthrough the display stage, in 8 bits, and their CIE Lab, D65), or as the source gave them (Values::Scene). - With the image on a Wayland subsurface of its own (
image_surface), the loupe still draws on the window’s surface, above the interface, with the display stage of the image’s target: in a wide-gamut setup its colours are those of the image’s encoding read as sRGB. Drawing it into the subsurface is not done yet. - The key’s toggles come out as
Signal::Loupe;loupe::Sampling,loupe::placeandloupe::readout_linesare the maths, andViewportState::loupe_framewhat was shown.
Tokens: loupe.background, loupe.frame, loupe.grid,
loupe.marker.
Survey (2026-10-13)
What was checked before writing the cursors and the loupe, and the decision for each.
| What | Licence | Finding | Decision |
|---|---|---|---|
winit 0.30 CustomCursor | Apache-2.0 | CustomCursor::from_rgba (straight RGBA, a hot spot, up to 2048 px a side) made into a cursor by the event loop; on Wayland the buffer gets the window’s integer scale, on X11 and Windows the bitmap is used as is | adopt, through egui |
| eframe and egui-winit 0.36.2 | MIT or Apache-2.0 | Context::set_cursor_image(CustomCursorImage) exists: egui-winit registers the bitmap with the event loop (cached by the Arc’s address) when it has one, which eframe’s wgpu and glow integrations give for the root and deferred viewports; immediate viewports and the web drop it and show cursor_icon | adopt: the viewport hands bitmaps there, with a system cursor as the fallback |
egui CursorIcon | MIT or Apache-2.0 | 35 CSS-like cursors: crosshair, grab and grabbing, zoom in and out, move, not allowed, none (hides the cursor); no eyedropper, brush or rotate | adopt as the fallbacks and for Cursor::System |
| GIMP | GPL-3.0 | tool cursors composed from a pointer, a tool image and a modifier badge (plus, minus, intersect, move…), with high-DPI variants; the brush outline drawn on the canvas; preferences for the outline, the pointer mode (tool icon, crosshair, both) and black-and-white or colour rendering | behaviour only: badges as the brush marks, the outline on the canvas, a setting for system cursors |
| Krita | GPL-3.0 | a cursor shape setting (tool icon, arrow, small circle, crosshair, a pixel) separate from the brush outline shape (none, circle, the brush’s preview), the outline kept while painting, a small cursor when the outline is too small | behaviour only: the outline separate from the cursor, a crosshair under a minimum size |
| darktable | GPL-3.0 | system cursors by name for the views; drawn masks’ brushes painted in the centre view with their border and their hardness as two circles, the system cursor hidden while placing a shape | behaviour only: the hardness ring, the hidden cursor |
| crates.io: “egui magnifier”, “egui loupe”, “egui zoom lens”, “egui cursor” | no loupe or tool cursor crate for egui; egui-phosphor (MIT) has the icon glyphs, but a glyph needs a font rasteriser to become a bitmap, which egui does not expose | own: the loupe redraws the viewport’s tiles, the tool cursors are rasterised from vector strokes |
Photo editors with a loupe (Lightroom, Photoshop, a system colour meter) magnify what is displayed and read out the values under it; none of the GPL projects above has one in the pointer. egui-pop’s loupe magnifies the displayed tiles because the viewport already holds them on the GPU, and the values come from the source’s readout through the same display stage the shader runs.
Pointer gestures and profiles
What the wheel, a trackpad’s two fingers, a pinch and each mouse button do on a canvas is not one fixed rule: photo applications zoom with the wheel, document tools scroll with it, node editors pan with the middle button. egui-pop ships five pointer profiles and lets the user pick one, then change any gesture in the shortcuts editor, as a keyboard shortcut is changed. The study behind it, with the survey of fifteen applications, is design/pointer-gestures.md.
Gestures are keymap bindings
A chord’s key may be a pointer gesture, with the usual modifiers
(Ctrl is Cmd on macOS):
| Gesture | What it is |
|---|---|
Wheel | a mouse wheel’s notches (line units) |
Scroll | a smooth scroll in points: a trackpad’s two fingers, a free-spinning wheel |
Pinch | two fingers apart or together (a browser sends a trackpad’s pinch the same way) |
PrimaryClick, MiddleClick… | a button pressed and released without moving |
PrimaryDoubleClick… | a double click |
PrimaryDrag, MiddleDrag, SecondaryDrag… | a button held while the pointer moves |
Buttons are Primary, Secondary, Middle, Back and Forward: the
logical buttons (a left-handed setup swaps them in the system). A
pointer chord stands alone, never in a sequence: Ctrl+Wheel,
Shift+MiddleDrag, Pinch. It is bound to a gesture command in the
scope of a canvas kind:
| Scope | Commands |
|---|---|
surface:canvas.image (the image viewport) | gesture.image.zoom (holding at fit and 100 %), zoom_free, pan, pan_x, pan_y, zoom_cycle (100 %, 200 %, fit), fit, zoom_toggle (fit or 100 %) |
surface:canvas.graph (the node graph) | gesture.graph.zoom, pan, pan_x, pan_y, fit |
surface:widget.value (sliders) | gesture.value.step (its wheel’s modifiers step a slider without the focus), fine and coarse (their drag’s modifiers: ten times finer or coarser, for drags, arrows and the wheel), panel (its wheel’s modifiers leave the wheel to the panel), reset (a primary click with its modifiers, Ctrl+PrimaryClick for one, puts the value back to its default; bound by no shipped profile) |
surface:widget.sections (stacked sections) | gesture.sections.pull (a drag on a boundary or a title moves the sections below as a block; its keys also make the arrows on a boundary do so, sections.md) |
surface:workbench.palette (a floating palette’s drag) | gesture.workbench.dock (its keys, held while a palette is dragged, dock it or join another palette, or keep it floating, as input.dock_drag says; workbench.md) |
The keymap’s layers, removals, conflicts and resolution trace apply unchanged (plugins.md); the key dispatcher never sees a pointer chord: canvases read the resolved table instead.
The six profiles
A profile is a pointer-profile document (in
crates/egui-pop-model/profiles/): bindings for the default layer, the
options it gives its default for, the modifiers egui’s own scrolling
follows (egui::InputOptions), so plain scroll areas agree, and, where
they differ from the drag’s, the modifiers of a value’s arrow keys
(value_keys). Each profile named after an application follows that
application; where it has no equivalent the gesture is left unbound.
| Document (default) | darktable | Photoshop | Lightroom Classic | Blender / node editors | Trackpad | |
|---|---|---|---|---|---|---|
| Wheel on the image | pans | zooms (Ctrl: no stops) | pans | — | zooms | pans |
| Ctrl + wheel on the image | zooms | zooms without stops | pans sideways | zooms | pans sideways | zooms |
| Shift + wheel on the image | pans sideways | pans sideways | — | — | pans up and down | — |
| Alt + wheel on the image | — | — | zooms | — | — | — |
| Two fingers / a pinch | pan / zoom | pan / zoom | pan / zoom | pan / zoom | pan / zoom | pan / zoom |
| Primary drag on the image | pans | pans | pans | pans | pans | pans |
| Middle drag | pans | pans | — | — | pans (graph: also a secondary drag) | — |
| Middle click on the image | — | 100 %, 200 %, fit | — | — | — | — |
| Click on the image | — | — | — | fit or 100 % | — | — |
| Double click on the image | fits | leaves the view | — | leaves the view | fits | fits |
| Wheel on the graph | pans | zooms | pans | pans | zooms | pans |
| Wheel over a slider | scrolls the panel | changes the value | scrolls the panel | scrolls the panel | scrolls the panel | scrolls the panel |
| Steps a slider without the focus | Alt + wheel | the wheel; Ctrl+Alt + wheel scrolls the panel | — | — | Ctrl + wheel | Ctrl + wheel |
| Finer / coarser drag | Ctrl / Shift | Ctrl / Shift | Alt / Shift | Shift / — | Shift / Ctrl | Ctrl / Shift |
| Finer / coarser arrows | as the drag | as the drag | as the drag | Alt / Shift | as the drag | as the drag |
| Pulls stacked sections as a block | Ctrl + drag | Ctrl + drag | Ctrl + drag | Ctrl + drag | Ctrl + drag | Ctrl + drag |
In every profile a drag with Space held pans the image and the graph,
Escape cancels a drag, a primary drag on a handle moves it and the wheel
over a handle adjusts it. The finer and coarser modifiers apply to a
slider’s drag, its wheel and, unless the profile gives them their own,
its arrow keys: Lightroom Classic makes a Shift drag finer but Shift
with the arrows coarser, and has no coarser drag. Neither Adobe
application has a node graph: both profiles take Photoshop’s canvas
wheel there. Lightroom’s click on the image toggles fit and 100 %, and
a double click leaves the view, as its Loupe goes back to the Grid: its
first click toggles the zoom, its second press only leaves. The id adobe, from before the split into Photoshop
and Lightroom Classic, still works and names lightroom; pickers do
not list it. “Leaves the view” is a signal
(Signal::Leave): the application decides what it means (darktable
goes back to the lighttable).
An application picks its profile with AppBuilder::pointer_profile
("darktable"); the user changes it in the settings
(input.pointer_profile). Two options follow the profile unless set:
input.slider_wheel (guarded: the wheel scrolls the panel and steps a
slider with the focus or the step modifiers; value: it changes the
slider under the pointer) and input.image_double_click (fit,
leave, nothing). A third, knob_drag, is in each profile’s
options (vertical, horizontal, both, circular; vertical in
every shipped profile): how a drag turns a knob that does not say
(Knob::drag), carried to the widgets in the sliders’ Gestures.
input.dock_drag (profile, modifier-docks, modifier-floats,
dwell; the profile’s options.dock_drag, modifier-floats in
Photoshop’s, modifier-docks in the others) says what a plain drag of
a floating palette does; an application picks its default with
AppBuilder::dock_drag (workbench.md). input.wheel_device settles what sends wheel
events: auto takes lines for a mouse wheel and points for a
trackpad, mouse and trackpad say it outright (some mice send
points). input.wheel_speed multiplies how far a notch goes, in scroll areas
and on the canvases that read it through wheel_inputs, zoom included; what
comes in points is left alone, whichever device sends it, and a slider’s wheel
still steps once a notch. Its default is 1, or the system’s lines a notch over 3
when the application gives them with AppBuilder::system_wheel_lines
(egui_pop_platform::wheel_lines::read, Windows only).
use egui_pop::api::{App, DefaultPlugins};
let app = App::builder()
.plugins(DefaultPlugins)
.pointer_profile("darktable")
.build(&egui_pop::egui::Context::default())
.unwrap();
assert_eq!(egui_pop::api::pointer::profile_id(app.handle()), "darktable");
Navigation keys
A profile also gives the keys of the canvas navigation commands
(view.fit, view.frame_selection, view.zoom_in, view.zoom_out,
view.zoom_100, view.pan_*, view.hand), after its application:
Photoshop’s Ctrl+1 for 100 % and Ctrl+0 to fit, darktable’s Alt+1 and
Alt+3, Figma’s Shift+1 and Shift+2 in Document, Blender’s .. They are
the view_keys of the profile document, loaded with its gestures into
the keymap’s default layer, active while a canvas is in use
(canvasActive && !fileBrowserFocused && !textInputFocus && !modalOpen): the shortcuts editor
lists them under View and the user rebinds them there. The full table
is in the navigation study.
"view_keys": {
"view.fit": ["Home", "Ctrl+0"],
"view.zoom_100": ["Ctrl+1"]
}
Drag cursors
What a drag does decides its cursor, not the widget it starts on: a
widget names the drag kind of each of its drags
(egui_pop::model::pointer::DragKind) and shows its cursors with
egui_pop::core::pointer::drag_cursor(&response, kind) (or
UiPop::drag_cursor). The drag cursor shows every pass the response is
dragged, wherever the pointer is: egui resets the cursor each pass, and
the pointer leaves a widget it drags. A widget following a drag of its own
(a state rather than one response) calls hold_drag_cursor(ctx, kind),
and hover_drag_cursor(ctx, kind, clicks) over what it hovers itself.
The hover rule
Hovered, before any drag, a draggable shows its drag cursor only when
dragging is its only action: nothing happens on a click or a double
click on it. Where a click does something (select, set a value, move the
playhead, open, add a point, deselect), the arrow stays until the drag
starts; then the element shows its drag cursor as any other. This is the
hover policy only-action (HoverPolicy::OnlyAction), every kind’s
default but text’s (always: an I-beam over text). Whether an element
clicks is read from its response’s sense (Sense::click), unless the
widget says so (.clicks(false) on a splitter whose click only takes the
focus).
| Element | Hovered | Dragged |
|---|---|---|
| splitters, side area and flyout edges | column resize | column resize |
| palette edges, dialog grips | resize | resize |
| item handles | move | move |
| the navigator’s and the graph minimap’s view frame | move | move |
| the histogram (drag only) | horizontal resize | horizontal resize |
| text (the code editor, the terminal) | I-beam | I-beam |
| outside the view frame (a click jumps there) | arrow | move |
| timeline lanes, a DJ deck’s content (a click moves the playhead) | arrow | closed hand |
| timeline clips, markers and trim handles, graph nodes, bands (a click selects) | arrow | move, resize |
| sliders, the curve editor, the colour wheels (a click sets a value, adds a point) | arrow | horizontal resize, crosshair |
| the compare view’s panes (a double click fits) | arrow | closed hand |
| Kind | Hover | Drag | Where |
|---|---|---|---|
pan | open hand | closed hand | the graph’s canvas (a pan), the compare view’s panes, a timeline’s middle drag |
scrub | open hand | closed hand | a fixed playhead’s content (DJ decks) |
move | move | move | graph nodes, stacks and group titles, timeline clips, bands, item handles, the navigator’s and the graph minimap’s view frame |
carry | arrow | closed hand | a port’s or a wire’s end, a tree’s drag and drop, a palette’s tab |
value | arrow | horizontal resize | sliders, range sliders, the video’s scrub bar, a timeline’s scrub |
point | arrow | crosshair | the curve editor, the colour wheels |
select | arrow | crosshair | rubber bands (the graph, the thumbnail grid), a timeline’s Shift+drag range |
text | I-beam | I-beam | the code editor’s text, the terminal |
resize-horizontal, resize-vertical, resize-nw-se, resize-ne-sw | resize | resize | panel, palette and window edges, dialog grips, timeline markers and trim handles, the histogram |
split-columns, split-rows | column resize, row resize | the same | splitters between panes, side area and flyout edges |
The image viewport keeps its own tool cursors (cursors.md); egui_stack’s dock separators and tabs, and the stacked sections’ boundaries, set theirs in egui_stack; a window’s frame hands its moves and resizes to the system.
Three levels
Everything above can be changed, at three levels; the most specific one wins, and what a level leaves out is the level below’s:
-
The widget, in code: the value
drag_cursorreturns is applied when it is dropped, at the end of the statement, and changes first:pointer::drag_cursor(&response, DragKind::Move) .hover(egui::CursorIcon::Grab) // the cursor hovered .dragging(egui::CursorIcon::Grabbing) // the cursor dragged .hover_policy(HoverPolicy::Always); // only-action, always, never -
The pointer profile:
drag_cursors, by kind, a CSS cursor name forhover,drag, and apolicy(an empty or unknown name, no policy, keep the level below’s;PointerMap::drag_cursor_overresolves them). Blender / node editors keeps the arrow over what can be panned or moved; a profile could also show the open hand over a DJ deck’s content although a click there seeks:"drag_cursors": { "pan": { "hover": "default" }, "move": { "hover": "default" }, "scrub": { "policy": "always" } }(Blender’s are the first two.)
-
The kit:
drag-cursor.<kind>.hover,.dragand.policy, string tokens, so that a kit restyles them without code. The default kit gives every kind’s own (kit.md); a name that is not a CSS cursor, or a policy that is not one of the three, is reported among the kit’s problems and the default kept:drag-cursor: pan: hover: {$type: "string", $value: "all-scroll"} policy: {$type: "string", $value: "always"}
egui_pop::core::pointer::resolve_drag_cursor(ctx, kind) gives the kit’s
cursors under the profile’s; drag_cursor_icons the same as egui’s
cursors.
The gallery’s drag_cursors test drives each draggable and fails if
one shows the arrow while it is dragged, or a cursor hovered other than
the rule’s; one test per level shows it wins over the level below.
Changing a gesture
The shortcuts editor (Ctrl+,, then Keyboard shortcuts) lists every
gesture command under Pointer, says which profile is in force and how
many of its gestures the user changed, and has a filter showing the
gestures alone. Each trigger of a gesture has its own removal; Add a
gesture opens a pad on which the gesture is done (the wheel, a pinch,
a click, a double click or a drag, holding its keys), then used. The
reset takes the profile’s triggers back. Conflicts are reported per
canvas scope, as for keys. On Linux, Alt with a drag or the wheel comes
with a warning: some window managers take it.
The user’s changes are user-layer bindings, saved in the keymap
document (version 3), and stay over the profile. When the profile
changes and some exist, a dialog asks whether to keep them on the new
profile or drop them (pointer.overrides, { "value": "keep" | "drop" }).
AppHandle::rebind_gestures changes a gesture’s triggers from code.
What canvases read
The application publishes the table in force to its context after each
change (egui_pop::core::pointer::map); without an application, canvases
follow the default profile. A canvas of an application’s own reads the
wheel raw with egui_pop::core::pointer::wheel_inputs (unit and
modifiers kept: egui merges a pinch with Ctrl and the wheel once it
smooths the delta) and looks each gesture up in its scope
(PointerMap::command). The image viewport’s Gestures and the
graph’s take their pointer part from it (viewport::gestures::ViewGestures),
sliders their modifiers (core::slider::Gestures::from_map), stacked
sections whether a drag pulls (core::sections, as long as it lasts, so
that a key pressed or released changes the mode from there);
set_gestures still sets either outright.
The image viewport and the graph give a hint while the pointer is
over them: what the pointer does with the keys held now
(Wheel: pan · PrimaryDrag: pan, with Ctrl Wheel: zoom), in their
output (ViewportOutput::hint, GraphOutput::hint) and for a status
line (egui_pop::core::pointer::hint_now). The viewport shows the hand
when the keys held make a drag pan where a plain drag would not.
The canvas in use
egui_pop_core::canvas says which canvas (the node graph, the image
viewport, a plot, an application’s own) the navigation commands go to.
It belongs to the family “Pointer and canvas”
(ADR 0027); it owns which canvas is
in use and the commands waiting for it, and refuses the navigation
model itself (the viewport crate’s egui_pop_viewport::navigation).
- A canvas marks itself active each frame the pointer is over it or it
has the keyboard (
egui_pop_core::canvas::mark_active);egui_pop_core::canvas::activeis the one marked this frame or the one before,lastthe one marked last however long ago. - The application’s
view.*commands (view.fit,view.frame_selection,view.zoom_in, …) go throughegui_pop_core::canvas::requestto the canvas in use, else to the one marked last (where an agent’s command goes), or to one by id withrequest_to; the canvas takes them at its next frame (egui_pop_core::canvas::take). ThecanvasActivecontext key says whether one is in use, so the commands’ keys reach nothing else. - A canvas publishes its zoom (
set_zoom, 1 is 100 %) for a zoom control to show; hand mode (hand,set_hand: a primary drag pans every canvas, for a pen) is shared by every canvas.
use egui_pop::core::canvas;
use egui_pop::egui;
fn my_canvas(ui: &mut egui::Ui, zoom: &mut f32) {
let id = ui.id().with("my_canvas");
let response = ui.allocate_response(ui.available_size(), egui::Sense::click_and_drag());
if response.hovered() || response.has_focus() {
canvas::mark_active(ui.ctx(), id);
}
for command in canvas::take(ui.ctx(), id) {
if command == "view.zoom_in" {
*zoom *= 2.0;
}
}
canvas::set_zoom(ui.ctx(), id, *zoom);
}
A command sent when no canvas was ever marked is dropped (request
answers false); commands a canvas does not know are its to ignore.
Tier: Experimental, with the pointer gestures (“Pointer gestures
and the canvas … profiles of input are not designed yet”, API
stability). Tests:
crates/egui-pop-viewport/tests/canvas_navigation.rs (the image takes
the view commands and their keys and is the canvas in use, hand mode,
each profile’s navigation keys) and navigation.rs; the module’s own
contract (the canvas in use this frame or the one before, the one marked
last, commands queued per canvas and taken once, a dropped command, hand
mode, zoom per canvas) in crates/egui-pop-core/tests/canvas.rs.
A widget’s own secondary button
The secondary button opens a context menu everywhere by default, and a
canvas may bind a secondary drag in its profile (Blender / node editors
pan the graph with it). A widget that needs the right click for
something else (a curve editor deleting a point, a swatch resetting its
colour, a canvas of the application’s binding a right drag) claims
it on its rect, each pass it is drawn
(egui_pop::core::pointer::claim):
use egui_pop::core::pointer::claim::{self, SecondaryClaim};
use egui_pop::egui;
fn swatch(ui: &mut egui::Ui) {
let r = ui.allocate_response(egui::vec2(24.0, 24.0), egui::Sense::click());
claim::claim_secondary(&r, SecondaryClaim::new("Swatch").click("Resets the colour"));
if r.secondary_clicked() {
// reset the colour
}
}
SecondaryClaim::click takes the click, drag the drag; a widget may
take both. Where the button was pressed over a claim:
- no context menu opens, neither one declared on a parent
(
menus::context_menu) nor egui-pop’s own (the graph’s, the status bar’s, a tree’s, the window’s system menu on the title bar); a menu drawn with egui’sResponse::context_menushould go throughclaim::context_menuto obey claims, and code reading the click itself asksclaim::opens_context_menu; - the canvas’s profile binding for that gesture does not fire (the
image viewport’s secondary clicks and drags, the graph’s secondary
drag), and a canvas of the application’s asks
claim::claimedthe same way.
A claimed click leaves the secondary drag to the canvas, and a claimed drag leaves the click to the menus. A claim counts for the pass it was made in and the next, so a parent that reads its response before its children are drawn sees them; a window or popup drawn above it hides it. The curve editor claims the secondary click, which deletes the point under the pointer.
What a claim says it does is kept as the widget’s use: the
shortcuts editor lists the uses seen so far under Widgets’ own
gestures (they are the widget’s, so not changed there), and
claim::declare_use lists one before its widget is first drawn. The
debug bridge’s pointer collector shows the profile in force, the hint,
the claims in force (widget, rect, click and drag with what they do)
and the uses.
The web
Ctrl and the wheel zoom a page, and a trackpad’s pinch arrives the same
way: a web build takes them from the browser. Pass
egui_pop::core::pointer::web_prevent_default as eframe’s
WebOptions::should_prevent_default, and give the canvas
touch-action: none in its page, as the gallery does.
Choosing files
FilesPlugin (in DefaultPlugins, egui_pop::api::files) chooses
files and folders without ever holding a frame: Files::choose returns
a Pending, the host contract’s result to come
(ADR 0010), which gives { "paths": [...] }, or
null when the person cancelled.
- The in-app picker, egui-pop’s own: what answers, unless an application turns to the fallback below.
- The system’s chooser (feature
native-dialogsof the facade, throughrfd): a fallback kept in case an application cannot do with the in-app picker, off at build time and at run time. The xdg desktop portal on Linux, the common dialogs on Windows, the open and save panels on macOS. It is made on the interface thread and awaited on a thread of its own.
use egui_pop::api::files::{self, Chosen, FileRequest, FilesPlugin, FILES};
use egui_pop::egui;
use egui_pop::prelude::*;
let mut app = App::builder().plugin(FilesPlugin::in_app()).build(&egui::Context::default()).unwrap();
let h = app.handle().clone();
let f = h.service(&FILES).unwrap();
let pending = f.choose(
&h,
FileRequest::open("Open an image").filter("Images", &["png", "jpg"]),
);
// The picker is open; the frame goes on. An agent (or a test) answers it
// as a person would.
let id = f.open_ids()[0];
f.deliver(id, Some(vec!["/photos/harbour.png".into()])).unwrap();
// The next frame finishes the choice (the `file.chosen` step).
let ctx = egui::Context::default();
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| app.show(ui));
out.textures_delta.clear(); // no renderer here
let result = pending.take().unwrap();
assert_eq!(files::chosen(&result), Ok(Chosen::Paths(vec!["/photos/harbour.png".into()])));
A request is one of FileRequest::open, open_many, save (with a
proposed name) and folder, with a starting directory, a
purpose and filters.
A path field of a form dialog (Descriptor::path) goes through the
same chooser when its Browse button is pressed; inside a dialog of its
own, an application starts the choice with Files::choose_inline and
draws the in-app picker where it wants it (Files::show_inline). Files::highlighted
says which entry it highlights, for another panel to follow
(linked panels).
The system’s chooser, a fallback
The system’s chooser is never used by itself. It takes all of these:
- the
native-dialogsfeature, off by default (build time); - the application allowing it,
AppBuilder::system_file_chooser(true), off by default (run time). Only then is the person’s settingfiles.nativedeclared, on by default; - that setting on, a request without
choices(rfdcannot show them) and, on Linux and the BSDs, a session bus for the portal; - no test running.
files::system_chooser_refusedrefuses it, whatever the feature and the application say, when any of these holds (files::system_chooser_refusalsays which):cfg(test):egui-pop-api’s own unit tests;- a harness of
egui_pop_testwas made: each (app,app_at,app_wgpu,harness_for,themed) callsfiles::refuse_system_chooser, for the whole process, so an application’s own tests built on it are covered; EGUI_POP_TESTis set in the environment (egui-pop’s CI sets it), for a test run that uses neither;- the process is a test of cargo-nextest (
NEXTEST); - the frames come with no window’s focus: egui_kittest and a bare
Context::runsay none, while a window of eframe or egui-winit always says whether it has the focus. An integration that does not report it gets the in-app picker.
use egui_pop::prelude::*;
// A fallback for an application that cannot do with the in-app picker.
let builder = App::builder()
.plugins(egui_pop::api::DefaultPlugins)
.system_file_chooser(true);
let _ = builder;
Tests never need it, and never build with it: test with the default
features. CI only lints native-dialogs (clippy), it runs no test with
it.
The last folder per purpose
FileRequest::purpose("import") names what the choice is for. Its last
folder is kept under that key, so an import and an export do not share
one, as Windows’ SetClientGuid and the identifier of a macOS panel do.
use egui_pop::api::files::FileRequest;
// Starts in ~/Pictures the first time, then where the last import was made.
let import = FileRequest::open("Import").purpose("import").directory("/home/me/Pictures");
// Always starts in the document's folder; still updates the last folder.
let save_as = FileRequest::save("Save as", "a.png").purpose("export").force_directory("/work/doc");
let _ = (import, save_as);
With a purpose, a choice starts in the first of these that exists:
- the purpose’s last folder (
files::last_folder); - the request’s
directory: a first-time default, as Windows’ guidance has it (SetDefaultFolder, which does not hide the last location, rather thanSetFolder, which does); - home.
So an explicit directory does not beat a remembered folder on later
openings. A request that means it uses FileRequest::force_directory,
which swaps the first two (SetFolder).
- What is kept. On a choice only (a cancel keeps nothing): the folder
chosen, or the parent of the first path, as
file.chosengives it after its hooks. It is in the host’s store, saved with the settings (settings/files.last_folders), for the lastLAST_FOLDERS_KEPT(32) purposes. - Recent places stay global. A purpose without a last folder or a
directorystarts at home, not in the last recent place, which may be another purpose’s. - No purpose keeps nothing per choice: the request’s
directory, else the last recent place, else home. - The system’s chooser gets the same folder through
rfd’sset_directory, and only that:rfdhas noSetClientGuid, and how far a system honours a suggested folder is up to it. egui-pop has not run one to see it. - A
FilePickerdrawn on its own has no store and starts in the request’sdirectory; its caller remembers.
The in-app picker
- The field filters the folder with the fuzzy filter the choice dialog
uses; with a
/(or starting with~) it is a path, andTabcompletes it. - The folder reads as breadcrumbs, beside the row’s controls (under them when
they leave too little room). A segment opens its folder; the chevron after it
lists its subfolders, by name, hidden ones only when the list shows them. A
segment on the folder shown reads that folder again. When the path does not
fit, its start collapses behind a
…button listing those folders, the nearest first: the deepest segments stay, and the deepest alone is cut only when it does not fit by itself.- Every segment, chevron and
…is a named stop (Open folder photos,Subfolders of photos,Folders above). Enter or Space on a chevron opens its menu with the focus on the folder on the path, else on the first; Up and Down go round it, Enter chooses, Tab or Escape close it and the focus goes back to the chevron. A folder without subfolders or that cannot be read says so, in the menu and to a screen reader. - Choosing a folder this way hands the keyboard to the field, as a click on a row does.
- Every segment, chevron and
Ctrl+L(thefile.edit_pathcommand, rebindable, for agents too) puts the folder into the field as a path to edit, the cursor at its end, in place of a filter; a path being typed stays. Typing/or~while an entry has the focus starts a path there, as in GTK and macOS. They are what is typed, whichever keys make them on the layout. There is no second field: the one that filters takes the path, and completes it withTab. Saving,Ctrl+Lkeeps the name at the path’s end with its stem selected, and a path that leads to another folder brings that name back there.- A click on Up, the bookmark button, List or Grid gives the keyboard back to the
field, where a press would otherwise leave nothing focused; with Enter or Space
the focus stays on the button. A typed
..is resolved in the folder’s path:gotakes it out by its name, without asking the file system, soa/link/..isa, even iflinkis a link elsewhere. - A click selects; a double click or Enter opens: Enter on a folder goes
into it, on a file chooses it. A click no longer enters a folder, so a
mis-click navigates nowhere.
Ctrlis Cmd on macOS, here as in the keymap. - Arrows move the highlight (what the preview is of, and what Enter acts
on); Backspace in an empty field or
Alt+Upgoes to the parent folder;Ctrl+Enterchooses the folder (choosing a folder) or the selection;Ctrl+Dbookmarks the folder; Escape cancels (from the field, the first Escape lets go of the focus, as everywhere in egui-pop). Alt+LeftandAlt+Rightgo back and forward through the folders shown (as Windows and Blender),Ctrl+Hshows or hides hidden files (as GTK and KDE),F5reads the folder again,Alt+Pshows or hides the preview. They are commands of the keymap (file.back,file.forward,file.toggle_hidden,file.reload,file.toggle_preview), so they can be rebound, and the check boxes’ tips say their keys as bound. AFilePickerdrawn on its own reads the default keys itself (go_back,go_forward,reload).- The field keeps the keyboard: a click on a row gives it back, so typing goes on filtering. Tab goes on to the rows: a row holding the focus moves the highlight there, Space clicks it, and Enter and the arrows work from it as from the field.
- Several files (
FileRequest::open_manyonly). A click selects that file alone;Ctrl+click adds or takes one away;Shift+click andShift+arrows select from the last one clicked or moved to, as a range;Ctrl+Spaceselects or unselects the highlighted file;Ctrl+Aselects every file shown. Plain arrows leave the selection as it is, forCtrl+Spacefurther on. Selected rows are filled and a ring marks the highlight, which is a separate thing here. A line under the list counts the selection (Selected: 3, orSelected: 3 (2 not shown)when the filter hides some, which stay selected), and each change is announced to screen readers. With nothing selected, it says that Enter or the button acts on the highlighted entry.- Enter or the button then takes the selection, wherever the highlight is among files. On a folder Enter goes into it, and going to another folder leaves the selection behind, so nothing is chosen unseen. A double click opens that file alone.
- A folder is not selected with the files:
Ctrl+click orCtrl+Spaceon one says so in the picker, and a range leaves folders out.Ctrl+Awith no file shown says that too. In a typed path,Ctrl+Ais the field’s. file.select_all(Ctrl+A) andfile.toggle_selection(Ctrl+Space) are commands: rebindable, and only bound while a picker offers them (filePickerSelectAll,filePickerSelects), soCtrl+Aselects the field’s text in any other request.- In the grid, a rubber band drawn from the room around the cells selects the files it crosses as it goes (folders left out), the highlight on its last file once it is let go: the file browser’s band.
- One file. Modifiers add nothing: any click or arrow moves the single highlight, which is the selection.
- Choosing a folder. Nothing is selected at first and the line under the
list says what the button takes: the folder shown. A click or an arrow
selects a folder in the list, and the line says the button now chooses it
and Enter goes into it;
Ctrl+click orCtrl+Spaceunselects it. The change is announced. Typing a filter drops the selection for the filter’s first match. - Beside the list, a preview pane: the highlighted entry’s preview
(below) and its facts: a file’s size and modification time (in UTC),
a folder’s items, dimensions, pages, and the provider’s own.
Alt+P(as in the Windows file explorer) or the Preview box shows or hides it; thefiles.previewsetting remembers. The dialog keeps its size either way: the pane takes its width from the list’s, the list keeps at leastLIST_MIN_WIDTH(240), and with less room the pane shrinks first, down toPANE_MIN_WIDTH(120), under which it is not drawn. - The dialog is yours to size: drag its edges and corners, down to
PICKER_MIN_SIZE(640 by 280 points) and within the window. Its bottom right corner is a handle for the keyboard too: Tab reaches it, the arrows resize (with Shift, by bigger steps). The size starts atPICKER_WIDTHbyPICKER_HEIGHT(960 by 398 points) and is kept in the host’s store (settings/files.dialog_size, read withfiles::dialog_size). A size that no longer fits the window when the picker opens (a smaller screen) goes back to the default; one the window comes to hold smaller while the picker is open stays as it was asked, and comes back when the window grows. - Between the list and the pane, a splitter sets the pane’s width: drag
it, or Tab to it (from the field, past the places; in a typed path Tab
completes instead) and use the left and right arrows, with Shift for
bigger steps. It stays within the limits above; a double click or
Enter gives the default width back (
preview::PANE_WIDTH, 240). The width is kept insettings/files.pane_width(files::pane_width). The places column keeps its fixed 150 points. - With previews, the file browser’s mode switcher beside the folder shows the
entries in its
detailsmode (a list with columns) or itsthumbnailsmode (a grid of thumbnails from the same providers), also withCtrl+1andCtrl+2(thefile.view.mode1tofile.view.mode9commands, active while a file browser holds the keyboard). Each dialog reopens in the mode it was last shown in: by its request’s purpose, else its kind (open,open_many,save,folder), kept in the host’s store (settings/files.views, read withfiles::view_for); a dialog never shown opens in the mode last used (settings/files.view,files::view;listandgrid, kept before the modes, read asdetailsandthumbnails). A picker without previews keeps its list. - Choosing a folder, the switcher also offers the
columnsmode, Finder’s column view (FilePicker::viewslists what a picker offers): the path’s folders side by side from the root, the folder shown’s subfolders, then the highlighted folder’s. Up and Down move in the folder shown’s column and select, Right goes into the highlighted folder (the selection left behind, so the folder entered is the choice), Left goes back to the parent with the folder left selected, and a click in another column goes to that folder with the folder clicked selected. The button chooses the folder selected, else the folder shown, as in the list. Columns last used by a folder chooser are not a file dialog’s: it opens indetails. The grid’s zoom is a count of thumbnails per row (browser::ThumbZoom, the library grid’sZoom): five at first, one across at most, and no more than cells ofTHUMBNAIL_MIN_SIZE(64 points) fit. The cells share the grid’s width, so the zoom survives a resize: a wider dialog shows the same count, larger. The slider beside the switch (fewer, larger to the right),Ctrland the wheel over the grid, orCtrland+or-step it; it is kept insettings/files.thumbnails_per_row(files::thumbnail_zoom,files::want_thumbnails_per_row). A size in points an older version kept insettings/files.thumbnail_sizeis read until then, and converted to the count it gives at the grid’s width when the grid is next drawn. Only the cells in view ask for a thumbnail, so a folder of thousands of raws costs what a dialog’s worth does: what leaves the view leaves the worker’s queue (see Previews); the row after the last in view is asked next, as the file browser does. A placeholder stands in until a thumbnail is made; a folder shows its sign and asks for nothing, a file without an image the file’s sign, a failure a warning with its reason in a tip. - In the grid, the four arrows move the highlight in two dimensions,
HomeandEndgo to the first and the last entry, andShiftwith any of them extends a selection of several files; Enter, a click and a double click are the list’s. While the field holds text and the focus,Left,Right,HomeandEndmove its cursor, and onlyUpandDownthe highlight:Tabto a cell gives all of them to the grid, and the focus then follows the highlight. - The list has columns: the name, when it last changed (in UTC, as in the
pane), the size, and the type (a file’s extension; a file without one says
File, a folder Folder). A folder has no size, so choosing a folder shows the
name and the time alone. When the list is too narrow for
them and at least
NAME_MIN_WIDTH(140) of name, they go: the type first, the modification time last; a name cut short shows whole in a tip. - Only the rows in view are drawn, so a folder of thousands of files costs what a dialog’s worth does. Tab walks the rows drawn, then leaves the list; the arrows go on through the whole folder, scrolling.
- A click on a header sorts by that column, and another turns it. The name and
the type start upwards, the size and the time with the largest and the newest
first, as Finder and Nautilus do. There is always an order: unlike the data
table’s headers, these do not go back to none. The headers stay above the grid,
whose cells follow the same order, and Tab reaches them. The order is kept in
settings/files.sort(name,-namefor downwards, andsize,modified,typethe same way;files::sort_order), and the highlighted entry stays highlighted, wherever it lands. - Names sort as people read them (
files::sort::natural_cmp):IMG_9beforeIMG_10, whatever the case. It compares characters rather than following a language’s collation, soécomes afterz. What has no value in a column (a folder’s size and type, a time the file system does not give) goes last in both directions, and the name settles ties, upwards. - Folders stay first in every order, in the same direction among themselves. The
Folders first box and the
files.folders_firstsetting (files::folders_first), as GTK’ssort-directories-first, sort them among the files instead. - While the field filters, its best matches come first, the order settling only what ties: the headers are disabled then, their tip says why, and the arrow goes until the field is empty. A typed path, and the name when saving, do not rank.
- The size and the time are read off the file system once per listing, for the rows in view; sorting by either reads them all then, on the interface thread, as listing the folder does. Sorting by name or type reads nothing more.
- Beside the folder, a side bar that scrolls: home, the system’s folders (Desktop, Documents, Downloads, Pictures, Music, Videos, those that exist), the volumes mounted under Devices (a camera card is the first place of a photo import), the recent places and the bookmarks. See Places.
- Below: the request’s filters (and all files), hidden files.
- For assistive technology, the entries, in the list or the grid, are a list
box named by the folder (
Files in Photos; several selectable when choosing several files), each entry an option, selected as its row shows, and the highlighted entry its current one (active descendant). The preview pane is a group named Preview. Another folder is announced with how many entries it shows (2026, entries: 12). The grid’s thumbnails are never smaller than 64 points. - Files that go together can be one entry, by the application’s rules: see Grouped files.
Places
- The system’s folders come from the XDG user directories on Linux and
the BSDs (
user-dirs.dirs, so a French desktop’sImagesis Pictures), and from the folders of the same names in home on macOS and Windows (a folder Windows moved elsewhere, to OneDrive for instance, is not found). One that does not exist, or is home itself, is not listed. - Devices are the volumes mounted: on Linux the mount points under
/run/media/<user>,/media/<user>,/mediaand/mnt(a folder on another device than its parent’s), on macOS/Volumeswithout the system’s own, on Windows the drives fromC:. They are read when a picker opens, not each frame. - An application’s own.
Files::set_system_placesgives them instead of the system’s (files::places::SystemPlaces): a demo, a sandbox, tests. The gallery gives its demo folder’s. The web build has none. - Bookmarks.
Ctrl+Dor the button bookmarks the folder. A bookmark’s menu (a secondary click) renames it, moves it up or down, or removes it. A name is typed over the old one: Enter, or leaving the field, keeps it; Escape keeps the old one; an empty name gives back the folder’s. The functionsfiles::rename_bookmark,files::move_bookmarkandfiles::set_bookmarkdo the same for an application. - An application’s sections. A
files::places::PlaceProviderregistered onFiles::place_providers(or withFilesPlugin::places) addsPlaceSections ofPlaceItems: a photo import’s cards, services and history. An item has a name, an icon of the icon registry, a detail (its tip), a badge said with its name (“EOS_DIGITAL, 214”) and, for a folder, its path. The picker lists the folders of each section under its bookmarks, each title a heading. A provider answers from what it holds: it is asked each time a picker or a panel is drawn. egui-pop knows nothing more of an item: an account of a service is an item without a path, the application’s to act on. - A panel of places on its own.
files::places::PlacesPaneldraws sections anywhere (an import window’s sources column): one Tab stop, Up and Down from item to item across the sections, Enter, Space or a click chooses (PlacesOutput::chosen, with the section’s id), the item shown selected by id, a context menu per item (PlacesPanel::menu).Files::placesandPlaces::sectionsgive every place the picker lists as sections (files.places,files.devices,files.recent,files.bookmarks, then the application’s). The gallery’s file browser page shows one beside the browser. - An import window’s sources column, each part opt-in (a panel without
them looks as before): a section folds under its band
(
PlaceSection::foldable;PlaceSection::openwhen the application keeps the state, the user’s clicks inPlacesOutput::folded), says what it lacks when empty (PlaceSection::empty, “No cards”) or stays for the application’s content (PlaceSection::keep). An untitled section (PlaceSection::untitled, a library’s “All photos” above its titled sections) draws no heading and no fold band, its rows shown directly; it stays a group for screen readers, named by the name it was given. An item shows a line under its name, said as its description (PlaceItem::line: why in a word, never in a tip only), a badge in a tone (PlaceItem::badge_tone, a warning ▲), and a toggle at its end (PlaceToggle, a pin), reported inPlacesOutput::toggled: the application flips its state.PlacesPanel::under_itemandPlacesPanel::under_sectionhand the application the room under an item (an account’s albums) or a section’s items (a history’s past imports with “Import again”); their widgets join the panel’s keyboard order. The gallery’s places page shows them all. - A library’s sources, each part opt-in too: an item’s children
(
PlaceItem::children) make its section a tree, rows indented by depth under a toggle named after the item (“Show or hide Animals”), open at first (PlaceItem::open_at_first) or kept by the application (PlaceItem::open, the user’s clicks and arrows inPlacesOutput::expanded); Right opens and Left folds a branch from its row, each row is said at its level. A dimmed item (PlaceItem::dimmed, a folder of an offline volume) is drawn muted and said unavailable, still choosable.PlacesPanel::on_rowhands the application each row’sResponse(a drop target or a drag source throughbus::drag, a menu of its own), andPlacesPanel::selected_setselects one item in each of several sections (a folder, an album and a keyword together). A tree draws VS Code’s indent guides when asked (PlacesPanel::indent_guides:IndentGuides::Neverby default,OnHoverwhile the pointer is over the panel,Always), in the kit’slist-guide, the hovered row’s parent’s guide lit withPlacesPanel::indent_guide_highlight(list-guide.hover.border-color). An item’s name can be a compacted chain,a / b / c(PlaceItem::segmentsofPlaceSegments, the separator drawn by the panel): each segment is underlined under the pointer, its own click target and its own node named by the chain up to it (or itsPlaceSegment::name, a full path), and a click on it comes back inPlacesOutput::segment(its index and id) instead ofchosen: the application decides. The row keeps its selection, hover, keyboard and tip. The gallery’s places page shows a Library’s sources beside the import column. - Kept in the host’s store with the settings:
settings/files.recent,settings/files.bookmarks, and the names given insettings/files.bookmark_names.
Saving
- A folder in the list. A click or an arrow selects it: Enter, and the button, which reads Open then, go into it, the name kept. Typing in the field takes the selection back, and Enter saves. A click on a file puts its name in the field; an arrow onto a file leaves the name alone.
- The name. The field proposes the request’s name with its stem selected, whenever the field gets the focus: typing replaces the name and keeps the extension. A click in the field places the cursor as usual.
- The extension. Enter or Save appends the active filter’s first
extension to a name that has none (
dawngivesdawn.png). When the filter changes, a name whose extension one of the request’s filters names takes the new filter’s first (dawn.pnggivesdawn.jpg), as Windows’ dialog does, unless the new filter accepts it too. An extension no filter names is the person’s and is never touched (dawn.tiffstays under PNG), and all files, or a filter without extensions, leaves the name as it is. A hidden file’s name (.config) gets no extension; what follows a dot inMr. Smithholds a space and is not one, so that name gets one. - Replacing a file. When the name exists, the picker asks first
through the dialogs plugin, with a
Confirmin the danger style: “Replace a.png?”, the focus on Cancel. No key accepts it from there: Enter and Space press the focused button whatever the modifiers (egui’s rule), so Ctrl+Enter or Space cancels; replacing takes a click on Replace, or Tab to it first. Cancel or Escape gives the picker back, the keyboard in its field and the stem selected for another name; Replace ends the choice (file.replace). The picker is inert meanwhile. An application that asks itself turns this off withFileRequest::confirm_overwrite(false).- It is the in-app picker’s question only, so egui-pop adds no second one
to a system chooser: a choice answered by the system goes straight to
file.chosen. egui-pop relies on the system’s own question there and has not run one to see it.rfdasks for it in its GTK and zenity backends and leaves Windows’ default (FOS_OVERWRITEPROMPT) alone; with the desktop portal and macOS’s save panel, the question is up to them.rfdhas no way to turn it off, so the opt-out does not reach them. A run-hook onfile.choose,Files::deliverand the bridge’sansweranswer for themselves. - Without the dialogs plugin nobody can ask: nothing is replaced, and the picker says so and wants another name.
- A
FilePickerdrawn on its own answersPickerAnswer::Replace(path): its caller asks. - Inside a dialog (
Files::show_inline), the question comes up in that dialog’s place, and the dialog comes back after the answer, as it was. Its overlay closes and opens again, so it is drawn anew.
- It is the in-app picker’s question only, so egui-pop adds no second one
to a system chooser: a choice answered by the system goes straight to
- A new folder, saving or choosing a folder: the New folder button, or
the
file.new_foldercommand (Ctrl+Shift+N, rebindable, working through the picker’s modal and while typing). A row under the folder asks the name: Enter or Create makes it through the file system (FileSystem::create_dir) and goes into it, the name to save under still in the field; Escape closes the row and leaves the picker open. A name that is empty, holds a path or exists, or an error from the system, shows in the picker, and the row stays to fix the name. The name comes first, as in GTK and macOS, so nothing needs renaming. The journal saysfile.folder_created. An agent gives{ "name" }to the command and the folder is made at once.
FilePicker is usable on its own, in any Ui: its list and headers are
LIST_HEIGHT (280) high, or take the height left with fill. Its order is
FilePicker::sort and FilePicker::folders_first (set_sort,
set_folders_first keep the highlight on its entry); its caller remembers them. With no
keymap to go through, it reads Ctrl+A, Ctrl+Space and Ctrl+L itself, and they do
not rebind. A
modal of your own that the person resizes is
OverlaySpec::resizable (overlay module).
How other dialogs do it, and what the picker should take from them: the file dialogs survey.
Grouped files
An application declares which files go together, and they are one entry: a RAW with its sidecars, as Lightroom shows a RAW and its JPEG, and darktable and digiKam treat an XMP. egui-pop has the mechanism and no rule: nothing groups until a grouping is declared, and it has no list of photo extensions of its own.
use std::sync::Arc;
use egui_pop::api::files::groups::SidecarRule;
use egui_pop::api::files::FilesPlugin;
// x.xmp, x.cr3.xmp and x.jpg belong to x.cr3; the badge says +XMP, +JPEG.
let photos = SidecarRule::new("my_app.photos", &["cr3", "nef", "arw"], &["xmp", "jpg"])
.badge("jpg", "JPEG");
let files = FilesPlugin::default().grouping(Arc::new(photos));
let _ = files;
A plugin registers on the service instead, Files::groupings().register(...),
and takes it back in its disconnect (Groupings::unregister). A
SidecarRule goes by extension, whatever its case, and an exact stem; the main
extensions come in the order they win, so &["cr3", "jpg"] makes x.jpg a
member beside x.cr3 and a main file of its own otherwise. Anything else, such
as darktable’s duplicates (x_01.cr3.xmp), is a FileGrouping of your own: it
is given a folder’s file names, without folders or hidden files, and gives groups
of names. It is asked once per listing, on the interface thread, as the folder is
read, and reads no file. What makes no sense in its answer is ignored and the file
stays an entry of its own (a name not there, a file an earlier group or grouping
took); one that panics counts for nothing, and the log says so.
- The entry. It stands for the main file: its name, its size, its time and
its type in the columns, in the grid’s cell and in every order. It says the
others with badges (
+XMP,+JPEG) at the end of the name’s column or in the cell’s corner,+2when they do not fit, and its description and the badges’ tip name them. The pane lists them under the facts. Arrows, ranges andCtrl+Ago by entries, andSelected: 2counts groups. - What a choice gives.
pathsholds the main file, asfiles::chosenreads it, so a caller who does not care changes nothing. The result’sgroups, whichfiles::chosen_groupsreads, holdsFileGroup { main, members, badges }for each path that heads a group, andfile.chosen’s arguments hold them too for a before-hook. A redirected choice gives the groups of where it leads. They come from the paths at the end of the choice, so a run-hook,Files::deliver, the bridge’sanswerand the system’s chooser give them as well; the system’s window shows each file apart, and a member chosen there is only that file. AFilePickerdrawn on its own takeswith_grouping, answers with the main file, and tells its caller the rest withgroup_of. - Filters. The group forms over the whole folder, and the filter judges its
main file: under
Raws (*.cr3)an entry still has its+XMP, and underSidecars (*.xmp), which refuses the RAW, each XMP is an entry of its own. - The field. A group answers to its members’ names too, and choosing it still
gives the main file. A typed path is a path:
/shoot/x.jpgchooses that file alone, and its completions list every file. - Previews. Only the main file is asked for a preview, in the pane and in the
grid’s queue. Where no provider gives it one (
Nothing, or a failure), its members are asked in turn, and the first image stands in, withPreview from x.jpgunder it in the pane; the facts stay the main file’s, but for what the provider said of the image, such as its dimensions. A sidecar’s text does not stand in for a photo. Thefilescollector says it asstand_in. - Each file its own entry. The Group files switch beside the view shows
every file, to reach a member with the pointer, and a choice then gives no
groups. It shows only with a grouping declared, and is kept in
settings/files.grouped(files::grouped), outside the settings window where it would mean nothing without a grouping. Switching back moves the highlight to the group that takes its file in, and a member selected leaves the selection. - Not grouped. Saving and choosing a folder never group, as a name to save
under must see every file it could replace. A hidden file joins no group, even
shown.
FileRequest::ungrouped()turns groups off for a choice that wants a sidecar as much as a RAW.
The application’s options
A choice can carry options of the application’s, shown above the picker’s
buttons and given back with the paths: an import’s “Only new photos”, an
export’s format. Their shape is the desktop portal’s choices (Windows’
customize interface and macOS’s accessory view do the same): a combo box of
values, or a check box.
use egui_pop::api::files::{self, FileRequest};
let request = FileRequest::open_many("Import")
.check("only_new", "Only new photos", true)
.choice("copy", "Files", &[("add", "Add in place"), ("copy", "Copy")], "add");
let _ = request;
// When the choice ends:
let result: Result<serde_json::Value, String> = Ok(serde_json::json!({ "paths": [], "choices": { "only_new": "true", "copy": "add" } }));
let choices = files::chosen_choices(&result);
let only_new = choices.get("only_new").map(String::as_str) == Some("true");
assert!(only_new);
- Values. Each choice ends with a value: an option’s id, or
"true"or"false"for a check box.files::chosen_choicesgives every id with its value, the defaults included; a cancelled choice and a request without choices give none, and the result then has nochoices. - The labels are the application’s, translated by it; each combo box takes its label as its name for a screen reader.
- Whoever answers. The picker’s values, unless a run-hook on
file.chooseanswerschoiceswith itspaths, or callsFiles::set_choicesbeforeFiles::deliver, or the bridge’sanswergiveschoices. Each value is checked against the request: an id it does not have or a value its choice cannot take is refused.file.chosencarries them in its arguments, and a before-hook may change them as it may redirect the paths. AFilePickerdrawn on its own gives them withchoices, andset_choicesets one. - The system’s chooser cannot show them.
rfdhas no way to: a request with choices opens the in-app picker even where the system’s chooser is used (files.native), so that the options are seen, not silently left at their defaults.
Where it reads
The picker reads through a files::fs::FileSystem: the system’s
(StdFs, the default), or a folder held in memory (MemoryFs: files
with their bytes and modification times, and folders). The web build
has no file system: an application gives the picker a MemoryFs there
(FilesPlugin::file_system, or Files::set_file_system later), as the
gallery does for its demo folder. FilePicker::new_in makes a picker
on any file system.
It writes one thing, a new folder, and only on a file system that says
it can (FileSystem::can_create_dirs, create_dir). StdFs can. A
MemoryFs is read-only, and a FileSystem of your own is too unless it
says otherwise: the New folder button is disabled with the reason as its
tip, and the key shows the reason in the picker. So on the web, whose
picker reads from memory, no folder can be made, and it says so; saving
still chooses a path and still asks before replacing a file held there.
The file browser
files::browser is the component the choosers are moving onto (the
design): a FileBrowser shows the entries of a
place from a FileSource in a ViewMode chosen in its toolbar. The in-app
picker shares its modes’ ids, its switcher and its mode keys; it still draws
its own list and grid (columns to sort by, groups) for its two modes.
- Sources.
FsSourcelists aFileSystemin pages (on a thread of its own for the system’s, at once for aMemoryFs); a source of your own streamsPages through aListing, errors included. - Modes.
details(rows: the name, the size, the date) andthumbnails(a virtualised grid, its size from 64 to 256 points) are built in;ViewModes::registeradds others. A mode draws and reports clicks; the browser keeps the selection (one or several, Ctrl and Shift as in the picker) and the focus, which a change of mode keeps. - Rubber band. In
thumbnails, a drag from the room around the cells draws a band. The selection follows it as it is drawn: its cells alone, or added to the selection with Ctrl or Shift held. When it is let go, the focus goes to its last cell. The band comes fromThumbnailGrid::rubber_band, which tells the cells it touches (show_with_band), scrolled away or not. - Filmstrip.
filmstripis one virtualised row of thumbnails (64 to 128 points) under a large view of the focused entry (Lightroom’s Loupe and Filmstrip). Left and Right move along the strip, Page Up and Page Down by a strip’s width. The large view asks the provider first (Visible), then the strip’s cells in view, then the next screen of them (Near). - Carousel.
carouselshows the focused entry large in the middle, its neighbours smaller and smaller on each side as far as the width goes (Finder’s Gallery). Left and Right bring the previous or next entry to the middle, Page Up and Page Down the neighbours of one side; a click on a neighbour does too. The middle one asks for its thumbnail first, then the neighbours outwards, then the next one beyond each side (Near). Each entry is an option named by its name for screen readers. - Order. Entries come folders first, then by name as people read them
(
IMG_9beforeIMG_10). The toolbar’s sort menu, orFileBrowser::set_sortwith asort::PickerSort, orders them by name, by when they last changed, by when they were taken (SortColumn::Taken:SourceEntry::taken, else when they last changed), by size or by type, up or down. What has no value in that order goes last either way, and names settle ties. “Folders first” can be turned off (set_folders_first). The selection and the focus stay on their entries. A mode that orders by time on its own (ModeNeeds::time, the agenda) shows no menu. - Groups. With the application’s groupings
(
FileBrowser::with_grouping, overfiles::groups, as the picker’s), files that go together are one entry: a RAW with its sidecars and its JPEG shows as the RAW, its members’ badges on it (+XMP +JPEG, or how many past two), said to screen readers with its members (“Grouped with a.cr3.xmp, a.jpg”), and with its first member’s thumbnail when it has none of its own. The members leaveFileBrowser::entries, andFileBrowser::group_ofgives an entry’s group. The groups are found as the listing’s pages come, a place past 2,048 files on a thread of its own (FileBrowser::groups_pendingwhile it works). The sort menu turns grouping off and on (set_grouped); a member selected or focused then leaves it for its group’s entry. egui-pop declares no grouping: what goes together is the application’s rule. - Agenda.
agendafiles the entries by day, the newest first: one heading per day (a screen reader’s heading,2026-11-08), its entries under it in a grid, the newest of the day first, and the entries without a time last, under “No date”. The day is the one an entry was taken (SourceEntry::taken, which an application’s source gives, a photo’s capture time), else the one it last changed, in UTC. Left and Right go in that order, across days; Up and Down go a row up or down, into the previous or next day, in the same column as near as it goes; Home and End go to the newest and the oldest entry. - Quick look.
Ctrl+Y, or Space while the entries hold the keyboard (and no type-ahead prefix is being typed), opens a large view of the focused entry over the entries, in every mode; the arrows move to the previous or next entry behind it, and Escape, Space orCtrl+Ycloses it (FileBrowser::set_quick_look,quick_look). - Columns.
columnsis Finder’s column view: one column per folder of the path, from the browser’s root (with_root, else the file system’s) down to the place, then the focused entry looked into (a folder’s entries, a file’s thumbnail and size). Up and Down move in the place’s column, Right enters the focused folder (its first entry focused), Left goes back to the parent (the folder left focused); a click in another column goes to that folder.ViewModes::folders()is the folder chooser’s set,detailsandcolumns;ViewModes::built_in()has every built-in mode (details, thumbnails, filmstrip, columns, carousel, agenda). A mode that needs the path says so (ModeNeeds::hierarchy): the browser then lists the ancestors and the focused folder too and hands them over inModeContext::ancestorsandModeContext::peek; the mode answers aReach(a place and the entry to focus) and names the keys that leave the place withViewMode::travel. - Keys, while the entries hold the focus: the arrows, Page Up and Page
Down, Home and End as the mode’s layout says; Enter opens; Ctrl+A and
Ctrl+Space select; typed letters jump to the first name that starts with
them, one letter again goes round them, and a pause of a second starts
again.
Ctrl+1toCtrl+9show the switcher’s modes in order (browser::request_modeis what the keymap’s commands do). - The switcher is a segmented control up to four modes (
SEGMENTED_MAX), a menu beyond; each mode’s label is translated underegui-pop-files-mode-<id>(mode_label), its icon drawn from the icon registry when the name resolves. - The mode is kept per dialog in the host’s store when the browser is
drawn with
FileBrowser::show_in(ui, app, dialog); withshow, it lasts as long as the browser. - Thumbnails come from a
ThumbnailProvider: each frame, the mode asks for what it shows (Visible) and the next row (Near), and what is not asked again is cancelled.PreviewThumbnailsmakes them with the preview providers below.
Previews
Previews come from providers (files::preview::PreviewProvider) that
plugins register on the files service:
use std::sync::Arc;
use egui_pop::api::files::preview::{Body, Handles, Preview, PreviewProvider, PreviewRequest};
#[derive(Debug)]
struct Notes;
impl PreviewProvider for Notes {
fn id(&self) -> &str {
"my_app.notes"
}
fn handles(&self) -> Handles {
Handles::new().extensions(&["note"]).magic(b"NOTE1")
}
fn priority(&self) -> i32 {
10
}
fn preview(&self, request: &PreviewRequest) -> Result<Option<Preview>, String> {
let bytes = request.read()?;
let text = String::from_utf8_lossy(&bytes[5.min(bytes.len())..]).into_owned();
Ok(Some(Preview::new(Body::Text { text, truncated: false }).fact("Format", "Note 1")))
}
}
// In a plugin's `connect`, after the files plugin's:
// ctx.app().service(&FILES).unwrap().previews().register(Arc::new(Notes));
let _ = Arc::new(Notes);
- Which provider. A provider’s
Handlesname file extensions, MIME types (from the extension:image/png, a familytext/*, any file*/*), magic bytes a file starts with, and folders. The providers that handle a path are tried from the highestprioritydown;acceptsmay refuse a path its handles match. The first to give a preview wins; one may pass (Ok(None)) to the next. - A failure is a reason. An error, or a panic in the provider, shows as “no preview” with its reason; nothing crashes.
- Off the interface thread.
Previews::getanswers from the cache, else hands the path to a worker thread and saysLoading; the frame never waits, and the context is woken when the preview is ready. Asking for another path cancels the one asked before (a long provider checksPreviewRequest::cancelled). On the web, which has no threads, previews are made in the frame.Previews::computemakes one at once (agents, tests). - Cached and capped. Previews are kept by path, size and
modification time, up to 64 MiB (
Previews::set_cache_bytes; the oldest go first); a provider reads at most 64 MiB of a file (PreviewRequest::readrefuses more,set_max_bytes) and draws images at most 256 pixels long (set_max_side). - Built in (
files::providers, registered by the files plugin unlessFilesPlugin::without_builtin_previews):- images: PNG and JPEG decoded with the
imagecrate and scaled down, with their dimensions (featureimage-previewsof the facade, on by default;imageis MIT OR Apache-2.0 and eframe already uses it); - Markdown, drawn simply: headings, paragraphs, items, quotes, code and rules, emphasis and links as plain text. No Markdown renderer is in the tree; this small one is egui-pop’s own, until the renderer the in-app viewer will use is chosen;
- text and code: the first 40 lines in a monospace font (any file that reads as UTF-8 text, at the lowest priority);
- folders: how many items, and the first images as the providers preview them (four at most, among the first sixteen files that are images or of no known type).
- images: PNG and JPEG decoded with the
- The system’s thumbnails (feature
platform-thumbnailsof the facade, part ofplatform;egui_pop::platform::thumbnails, an opt-inThumbnailsPlugin): for what egui-pop’s providers do not preview (PDF, office documents, videos, fonts…), at the lowest priority and on the system’s file system only. On Linux and the BSDs it reads the freedesktop thumbnail cache (a thumbnail whoseThumb::MTimeis the file’s), else runs the installed thumbnailer for the file’s MIME type (the shared MIME database’s globs) into a temporary file, stopped after 10 s (ThumbnailsPlugin::timeout) or when the selection moves; it reads the cache and does not write it. The Windows shell’s thumbnails and macOS’s QuickLook are not done yet: the provider gives that as its reason. The web has none. - What a preview holds. A body (an image, a text’s first lines, a document drawn simply, a folder’s counts and first thumbnails, or nothing) and facts: dimensions, pages, a photo’s facts, and labelled facts of the provider’s own.
- A photo’s facts (
PhotoFacts, given withPreview::photo): when it was taken, the camera, the lens, the exposure, the focal length and the rating. The pane shows them in that order whichever provider read them, as Dolphin’s information panel and a photo application’s loupe do, after the dimensions and before the file’s time: the exposure on one line (1/250 s f/5.6 ISO 200), the focal length in millimetres, the rating as five stars (read as “3 of 5” by a screen reader). The time taken is the camera’s, without a zone; EXIF’s2026:01:15 10:04:00reads as a date. egui-pop reads no EXIF itself: an application’s provider of raws fills them, and agents read them asphotoin the preview’s metadata.
use egui_pop::api::files::preview::{Body, PhotoFacts, Preview};
let preview = Preview::new(Body::Empty).dimensions(6000, 4000).photo(
PhotoFacts::default()
.taken("2026:01:15 10:04:00")
.camera("Canon EOS R6")
.shutter(1.0 / 250.0)
.aperture(5.6)
.iso(200)
.rating(3),
);
let _ = preview;
A grid asks differently from the pane: Previews::want says each frame which
paths it has in view, in order and with their facts, and Previews::thumbnail
reads what is made, neither touching the file system in the frame. The worker
makes them one at a time, behind the preview asked with get, which a thumbnail
in the making gives way to; a path that left the view leaves the queue, and is
cancelled in the making. They share the cache and its key with the pane, so the
highlighted cell’s preview is there at once; what is in view is kept over the
cache’s cap, rather than made again for ever.
Steps
| Step | Arguments | Default |
|---|---|---|
file.choose | { "id", "request" } | opens the system’s chooser or the in-app picker |
file.chosen | { "id", "request", "paths", "origin" }, and "groups" when some are | remembers the places and the purpose’s last folder, gives the paths and their groups |
For agents, the file.preview command ({ "path" }, kept out of the
palette) gives a path’s preview metadata as the pane shows it, made at
once if it is not in the cache: whether it is a folder, its size and
modification time, the provider, the kind of preview, dimensions,
pages, a folder’s counts, the provider’s facts, or the state and the
reason when there is none. No pixels and no text. The files
collector shows the providers, the cache, and the highlighted entry’s
preview state in each open picker.
A run-hook on file.choose replaces the whole chooser: it answers
{ "paths": [...] } or { "cancelled": true } at once, or later
through Files::deliver. A before-hook on file.chosen refuses a
choice (the Pending gives the reason as an error) or redirects it to
other paths. The journal says file.cancelled. The debug bridge’s
files collector shows the choices open, the in-app picker’s folder,
field and entries, and answers a choice (answer: the user’s, unless
the application offers it to agents, see Agents). Who
answered goes with the choice: files::chosen_origin on its result
(Origin::User for the picker, the system’s chooser or a plugin’s
Files::deliver; the agent’s for files.answer or
Files::deliver_as), origin in the file.chosen step’s arguments
and by in the collector’s last choices. A consumer that should act
only on a person’s choice checks it, or vetoes file.chosen for others.
The commands file.new_folder ({ "name" }, optional) and
file.replace ({ "id", "path" }, hidden) are the picker’s new folder and
the yes to its question. The when key filePickerNewFolder says that an
open picker offers a new folder. file.select_all and
file.toggle_selection answer { "selected": n }, and the files collector
lists the picker’s selected, its sort and folders_first, its grouped and
groups, and the groupings declared.
The gallery’s files page opens each kind of choice in a demo folder
whose files are made by code at start (the repository holds no binary
file): PNG and JPEG images drawn with the image crate, a text file, a
Markdown document and a CSV table, written to the temporary folder on
the desktop and given to the picker as a MemoryFs on the web, so the
previews show there too. Open an image and Save as each have a purpose:
each comes back to its own last folder, the others stay where they were.
Photos/2026 holds a pretend RAW and a JPEG with sidecars, grouped by a rule the
page declares for itself.
Sliders
egui-pop’s sliders (egui_pop_core::slider) follow darktable’s bauhaus
sliders: one compact row with the label and the value inside the bar,
built for panels of many parameters edited with precision.
The compact row
use egui_pop::egui;
use egui_pop::core::icon::Icon;
use egui_pop::core::slider::Slider;
fn exposure(ui: &mut egui::Ui, ev: &mut f64, on: &mut bool) {
ui.add(
Slider::new(ev, "Exposure", -3.0..=4.0) // the soft range: what the bar spans
.hard(-18.0..=18.0) // what a typed value may reach
.step(0.01) // arrows and the wheel; sets the precision
.unit("EV")
.signed() // "+1.50 EV"
.default(0.0) // a double click goes back to it
.quad_toggle(Icon::Visible, "Exposure on", on),
);
}
| Gesture | What it does |
|---|---|
| Drag anywhere on the bar | The value follows the pointer’s motion over the soft range; a click never makes it jump. One gesture: one undo step when bound to the store |
| Ctrl (Cmd) / Shift held | Ten times finer / coarser, for drags, arrows and the wheel (the pointer profile’s modifiers: Blender’s swaps them, Photoshop’s is Alt finer and Shift coarser; Lightroom Classic’s Shift drag is finer while its arrows are Alt finer and Shift coarser) |
| Escape during a drag | Puts the value back, with no trace |
| Arrows, Page Up, Page Down | One step, one coarse step (when focused) |
| Home, End | The soft range’s ends |
| Enter | The typed entry: a number or an expression, then Enter or a click elsewhere commits it (Escape leaves it with nothing). While open it owns Escape and Enter: key bindings never see them. Only a real blur commits it (a click elsewhere, Tab, the focus taken by another widget), not a frame where the panel is redrawn and nobody holds the focus |
| Wheel | Scrolls the panel; steps the slider only when it has the focus or Alt is held over it. As the pointer profile says (pointer-gestures.md): under darktable’s it changes the slider under the pointer, Ctrl+Alt and the wheel scrolling the panel |
| Double click | Back to the default |
The keys are data (slider::Gestures, slider::set_gestures), for input
profiles.
Hosts with a key dispatcher of their own. egui-pop’s dispatcher
leaves Escape and Enter to a text input that owns the keyboard. A host
that reads keys before its widgets are drawn asks
egui_pop_core::focus::text_input_owns_keyboard(ctx) first: it is true
while a text field has the focus and while a typed entry is open (the
entry claims the keyboard each frame, and egui lets go of the focus on
Escape before the frame is drawn, so the claim is what still holds on
that frame).
Typed values. A number or an expression: + - * /, ^,
parentheses, a sign, and x, the current value (x * 2, x - 0.5).
The decimal separator is a point or a comma; when a text has both, the
last one is the decimal separator (1.234,5, 1,234.5). A unit after
the expression is ignored (1,5 EV). A value past the soft range is
kept up to the hard one, and shown in the warning colour.
Values in the interface’s language. The value is written by
egui_pop_core::strings::number, which asks the installed strings
provider: with the egui-pop-i18n plugin, French reads 1,50 EV and
1 234 K. The space before the unit is the language’s too
(egui_pop_core::strings::quantity): a narrow no-break space (U+202F)
in French, a plain space in English. The typed entry starts from the
number and reads it back.
The quad button. quad(icon, label) adds a square button at the
bar’s end (a colour picker: Icon::Picker), whose click is in
SliderOutput::quad_clicked; quad_toggle(icon, label, &mut on) turns
it into a toggle, lit when on. Either is named for assistive
technologies by its label.
The scrub field
Slider::scrub() draws the label and the value in a plain field, with
no fill and no thumb, for a dense row (a HUD’s card, a property sheet)
where the value matters more than where it sits in its range. Every
gesture, key, menu and name stays the slider’s: a drag along the field
scrubs the value over the soft range, a double click resets it, Enter
types a value. Too narrow for its label, it shows the value alone. The
gallery’s “Compact controls” page shows it beside the compact cells
(Input::cell, compact::ChoiceCell) and the menu rows
(compact::MenuRow).
Variants
- Logarithmic:
.logarithmic()gives equal ratios equal lengths (ISO, a radius); arrows and the wheel step by a hundredth of the bar. It needs a soft range above zero; otherwise the bar stays linear. - Gradient track:
.gradient(Gradient::hue()),.gradient(Gradient::temperature(2000.0, 12000.0))(the illuminant’s colour;.reversed()shows the correction instead), or anyGradient::neworGradient::sampled. The colours are a strip along the bottom of the bar, so the label and the value keep their contrast. - Range:
RangeSlider::new(&mut low, &mut high, "ISO", 50.0..=25600.0)has two thumbs that never cross. Each thumb is its own widget: it takes the focus (Tab goes from one to the other), steps, opens the typed entry, and is named “ISO, minimum” and “ISO, maximum”. A press takes the nearer thumb. A double click resets both.
Both slider types share the builder methods (hard, step, coarse,
unit, precision, display_scale, integer, signed,
logarithmic, gradient). Slider::from_descriptor reads a value
descriptor, and the parameter widget (egui_pop_core::param) uses it.
Field states
.state(FieldState) gives a slider (or a range) the state every input
shows (inputs): modified, required, invalid,
pending, read-only or disabled with a reason. The bar gets the state’s
edge and markers after its label, and assistive technologies the state.
A read-only slider keeps the focus and refuses every change; a disabled
one is greyed, skipped by Tab, and says its reason on hover.
Hooks and the slider.change step
on_change sees every change before it is written: a Change (the
thumb, from, to, the cause, and whether the gesture is done), and
answers Verdict::Go, Verdict::Veto or Verdict::Redirect(value). A
drag’s frames come with done: false. Its end comes once more, from the
value before the drag, with done: true, and a veto then puts the value
back. show(ui) returns a SliderOutput with the changes written in
the frame.
In an application, egui_pop_api::sliders::hook(app, "exposure") makes
each finished change run the slider.change step (ADR 0011):
| Step | Arguments | Default |
|---|---|---|
slider.change | slider, thumb (value, low, high), from, to, cause (drag, key, wheel, typed, reset, access) | writes to |
A before-hook vetoes the change or redirects it (snap, clamp), a
run-hook gives the value to write, an after-hook follows it, and every
run publishes slider.change on the journal. The gallery’s sliders page
snaps one slider to halves this way.
use egui_pop::egui;
use egui_pop::api::sliders;
use egui_pop::core::slider::Slider;
fn stepped(ui: &mut egui::Ui, app: &egui_pop::api::AppHandle, v: &mut f64) {
ui.add(Slider::new(v, "Radius", 0.0..=10.0).on_change(sliders::hook(app, "radius")));
}
Accessibility
Each bar (each thumb of a range) is an AccessKit slider named by its
label, with its numeric value, its value text (unit included), its
range and step, and the increment, decrement and set-value actions;
the actions go through the hook like any change (cause access).
Why its own
egui’s Slider and DragValue have no soft and hard range, no label
inside the bar, no fine adjustment, no reset, no quad button, no
gradient and no range; the crates checked have no more. See
the survey.
Compact controls
Part of the family “Controls” (ADR 0027): controls for dense rows, where a control has a slot of a given size and no label beside it (a HUD’s parts, a property sheet, a card’s fold).
| Item | What it is |
|---|---|
egui_pop_core::compact::ChoiceCell | One of a few words in a slot: egui-pop’s combo_box sized to it |
egui_pop_core::compact::MenuRow | A row the width of its room in the look of a menu’s items, with a muted note at its end |
egui_pop_core::compact::RowButton | A button small enough for a list’s row: the kit’s button around its words, no taller than a row |
egui_pop_core::slider::Slider::scrub | The slider as a scrub field: label and value, no fill, no thumb |
egui_pop_core::input::Input::cell | The decorated input sized exactly to a slot |
Owns: these five looks, and the rule that a compact control keeps every behaviour of its full-size version (keys, typed entry, history, name).
Refuses: a second set of widgets: a compact control is a size of an existing one, never a new behaviour; layout of the row itself (the caller’s, or list items and property rows).
The API
use egui_pop_core::compact::{ChoiceCell, MenuRow, RowButton};
use egui_pop_core::slider::Slider;
fn row(ui: &mut egui::Ui, mode: &mut usize, exposure: &mut f64) {
let size = egui::vec2(120.0, 22.0);
ChoiceCell::new("Blend mode", mode, &["Normal", "Multiply", "Screen"])
.size(size)
.show(ui);
ui.add(Slider::new(exposure, "Exposure", -3.0..=3.0).scrub());
if ui.add(MenuRow::new("Show Contrast").note("hidden")).clicked() {
// reveal it
}
if ui.add(RowButton::new("Cancel")).clicked() {
// cancel the row's job
}
}
ChoiceCell::new(name, &mut selected, choices):size(default: the available width and a row’s height),id_saltfor cells of the same name in one place;showmarks the response changed when the choice changed.MenuRow::new(text):note(a count, a key),height(default: the kit’smenu-item.height, at least a row).RowButton::new(text):tone(the kit’sbutton.tone.*),height(default: its words withspace.xsabove and below, no taller thansize.row.height); its words are centred withspace.sat each side.Slider::scrub: a drag along the field scrubs over the soft range whatever the field’s width; too narrow for its label, it shows the value alone. Horizontal only: a vertical slider keeps its track.Input::cell(size): exactlysizewith its attached buttons, the small padding step, none of the room an input keeps for its text.
States and keys
ChoiceCell: while focused with its list closed, Up and Down choose the previous and next word, Home and End the first and last (as a native drop-down); Space or Enter opens the list. Its look in each state is the combo box’s, from the kit.MenuRow: focused by Tab, pressed with Space or Enter; hover and focus from the kit’smenu-item.RowButton: a button named by its words, focused by Tab, pressed with Space or Enter; its look in each state is the kit’sbutton’s.- The scrub field and the cell keep their full-size versions’ states, keys, menus and history.
Accessibility
ChoiceCell is named by its name, which also shows in its tooltip (no
label beside it); its value is the word chosen. MenuRow is a button
named by its text, its note read after it. The scrub field and the cell
keep their full-size names.
Tier
From API stability: Experimental (“Compact controls
for dense rows (egui_pop_core::compact, Slider::scrub): new, not yet
released”).
Tests
crates/egui-pop-gallery/tests/it/gallery.rs(compact_controls_scrub_choose_mark_and_reveal_from_their_slots) drives the gallery’s compact page; its snapshots arecompact-pop-dark.pngandcompact-pop-light.png.crates/egui-pop-core/tests/compact.rs: the choice cell keeps its slot whatever the word, its name and value, the arrows, Home and End while closed, Space opening the list, no words; the menu row’s name and note, its width and height, Tab, Space and Enter, disabled.
Inputs, field states and Tab order
egui-pop’s inputs are one component, the decorated input
(egui_pop_core::input), around a text, masked, multi-line, number,
path or search field;
one field state model (egui_pop_model::field) that every input
shows the same way, the sliders included; and a Tab order decided
per focus scope (egui_pop_core::tab), with F6 between the window’s regions.
The decorated input
use egui_pop::egui;
use egui_pop::core::icon::Icon;
use egui_pop::core::input::{Attached, Input};
use egui_pop::model::field::FieldState;
fn export_row(ui: &mut egui::Ui, folder: &mut String, size: &mut f64, name: &mut String) {
let out = Input::path(folder, "Folder")
.leading_icon(Icon::Folder)
.button(Attached::text("Browse…", "Browse for a folder"))
.state(FieldState::new().required())
.show(ui);
if out.button == Some(0) { /* open the file chooser */ }
Input::number(size, "Long edge") // a number or an expression
.unit("px")
.choices(["1024", "2048", "4096"]) // a dropdown chevron
.show(ui);
let out = Input::text(name, "Export name")
.placeholder("File name")
.clearable(true)
.button(Attached::icon(Icon::Save, "Export").menu(["Export as…", "Export settings…"]))
.show(ui);
if let Some((_, item)) = out.menu { let _ = item; /* a split button's item */ }
}
| Decorator | How | What it does |
|---|---|---|
| Placeholder | .placeholder(text) | Shown while the field is empty, in field.tone.muted.text; assistive technologies read it as the placeholder |
| Leading, trailing slots | .leading_icon, .prefix, .suffix, .unit, .trailing_icon | Icons and texts inside the field, before or after the value, never edited |
| Clear ✕ | .clearable(true) (on for Input::search) | Shown while there is a value and the field can be edited; Tab reaches it, Enter or Space presses it, the focus goes back to the field. One change: one undo step when the field is bound to a store, one step in the field’s own Ctrl+Z history |
| Reset | from the state | Shown while the state offers “reset to default”; puts back .default_value(text) |
| Attached buttons | .button(Attached::text(..)), Attached::icon(..) | Joined to the field’s end, each a button of its own; its click is InputOutput::button |
| Split button | Attached::..(..).menu(items) | The action and a chevron opening a menu (InputOutput::menu); input::split_button draws one on its own |
| Dropdown chevron | .choices(items) | Opens a list of values; choosing one sets the field (InputOutput::choice) |
The field is egui’s TextEdit, so it follows the focus rules of every
text input: while it has the focus, Escape and Enter are its own
(Escape leaves the field, Enter commits it) and no key binding fires on
them. A number field (Input::number) reads what is typed as a slider’s
typed entry does (+ - * / ^, parentheses, either decimal separator,
a unit ignored) and commits it when it loses the focus: Enter, Tab, a
click elsewhere. Escape leaves it with nothing: what was typed is
dropped and the value stays.
Masked and multi-line fields
Experimental, as the whole input.
use egui_pop::egui;
use egui_pop::core::input::Input;
fn account(ui: &mut egui::Ui, token: &mut String, notes: &mut String, chat: &mut String) {
Input::masked(token, "API token").show(ui);
let out = Input::multiline(notes, "Notes")
.rows(3) // its height while the text is short (2 by default)
.max_rows(6) // it grows with its text up to 6 lines, then scrolls (8 by default)
.show(ui);
if out.submitted { /* Ctrl+Enter (Cmd+Enter on macOS) */ }
let out = Input::multiline(chat, "Message").submit_on_enter(true).show(ui);
if out.submitted { /* Enter; Shift+Enter starts a new line */ }
}
A masked field (Input::masked: a password, a token, a key) draws
each character as a bullet and cannot be copied or cut from. Assistive
technologies get its name and the password-input role, never its value:
the value and the text runs they read are bullets too, and agents read
its kind (masked), not its value. A read-only masked field stays
masked.
A multi-line field (Input::multiline) is rows lines tall while
its text is short, grows line by line with its text (wrapped lines
count) up to max_rows, then scrolls; assistive technologies read it as
a multi-line text input. Its keys:
| Key | Default | With .submit_on_enter(true) |
|---|---|---|
| Enter | a new line | submits (InputOutput::submitted) |
| Shift+Enter | a new line | a new line |
| Ctrl+Enter (Cmd+Enter) | submits | submits |
| Tab, Shift+Tab | the next or previous stop | the same |
Submitting keeps the focus in the field. The key dispatcher leaves only Escape and Enter without Ctrl or Alt to a text field: when the keymap binds Ctrl+Enter, the binding runs instead. The slots, the clear ✕, the markers and attached buttons stay on the field’s first line.
Every part has an accessible name: the field its label, the ✕ “Clear label”, the reset “Reset label to default”, the chevron “label, choices” (a list box popup, expanded or not), a split button’s chevron “label, more” (a menu popup).
Field states
use egui_pop::model::field::{Baseline, FieldState};
let saved = "Sunset".to_string();
let title = "Golden hour".to_string();
let state = FieldState::new()
.compare(&title, Some(&saved), &"Untitled".to_string()) // modified against saved
.required()
.validated(None); // or Some(message)
assert!(state.is_editable());
let off = FieldState::new().disabled("Needs an open image");
assert!(!off.is_focusable());
| State | Builder | Edge | Marker | Assistive technologies |
|---|---|---|---|---|
| Disabled | .disabled(reason) | muted | an “i”; the reason is the tooltip | disabled, the reason as the description |
| Invalid | .invalid(message), .validated(Option) | field.tone.danger.border-color, and an outline | a crossed circle; the message is the tooltip | invalid, the message as the description |
| Pending | .pending() | field.tone.info.border-color, and an outline | a clock | busy |
| Modified | .modified(Baseline::Saved / Default), .compare(value, saved, default) | field.tone.accent.border-color | a dot; a reset arrow when it differs from its default | “changed since saved” or “from the default” in the description |
| Required | .required() | none | an asterisk (field.tone.warning.border-color) | required |
| Read-only | .read_only() | none, and the field.tone.muted.fill fill | a lock | read-only |
The edge is a strip along the field’s leading side in the colour of its
first state, in that order of precedence; every state also has its
marker, so none rests on colour alone. A disabled field cannot take the
focus and is greyed; a read-only field takes the focus, its text can
be selected and copied, never changed. The colours are the field.*
component tokens, each an alias of a system role (danger, info,
accent.default, warning), checked for contrast over the field.
Sliders take the same states: Slider::new(..).state(state) and
RangeSlider::new(..).state(state) draw the edge on the bar and the
markers after the label, and give the state to assistive technologies.
A read-only slider takes the focus and refuses every change (drag,
keys, wheel, typed entry, reset); a disabled one is greyed, skipped by
Tab and says its reason on hover. Without a state, a slider is drawn as
before.
Agents read every field drawn in the last pass through the debug
bridge’s fields collector (and egui_pop_core::field::describe): its
label, kind (text, masked, multiline, number, path, search,
slider, range), its
marks, whether it can be focused and edited, the disabled reason and the
invalid message. The same snapshot lists the Tab scopes and their
stops.
Any widget can show a state: field::paint_edge,
field::paint_markers, field::hover (the tooltips), field::access
and field::record.
Tab order
use egui_pop::egui;
use egui_pop::core::input::Input;
use egui_pop::core::tab::{self, ScopeKind, TabStop};
fn options(ui: &mut egui::Ui, tags: &mut String, quality: &mut String) {
tab::scope(ui, "export-options", ScopeKind::Panel, |ui| {
Input::text(tags, "Tags").tab(TabStop::new().group("export")).show(ui);
Input::text(quality, "Quality").tab(TabStop::new().group("export")).show(ui);
let r = ui.button("Export");
tab::stop(ui, &r, TabStop::new()); // any widget joins the order
});
}
- Reading order by default inside a scope: rows from top to bottom, in a row from left to right, whatever order the widgets were drawn in (two columns drawn one after the other still read row by row).
- Explicit order: stops with
TabStop::index(n)come first, by index; groups (TabStop::group(name)) keep their stops together, at the place of the group’s first stop. The parts of one input (the field, its ✕, its buttons) are a group of their own. - Disabled fields are skipped, read-only ones are not.
- Focus scopes: in a
ScopeKind::Modalscope Tab cycles (after the last stop comes the first); in aScopeKind::Panelscope, Tab past its ends goes on in egui’s order. F6 and Shift+F6 move to the next or previous panel scope, to the stop focused there last (its first the first time); F6 does nothing while a modal is open. In an application, F6 goes through the window’s regions, and a region’s panel scopes take its turn.
| Key | What it does |
|---|---|
| Tab, Shift+Tab | The next or previous stop of the scope |
| F6, Shift+F6 | The next or previous panel, or region |
| Enter, Space on a ✕ or a button | Presses it |
The order is computed from the stops drawn in the previous pass
(egui_pop_model::tab::order, pure and tested), and egui-pop moves the
focus before anything is drawn. The focus on a widget that is not a
stop is left to egui, whose Tab order is the order of drawing; a
focused widget that takes the keys itself (a terminal) keeps Tab and
F6.
F6 through the regions
In an application, workbench.next_region (F6) and
workbench.previous_region (Shift+F6) go through the parts of the window: the
activity bar, the start side area, the end side area, the bottom area, the
centre, each palette, an open flyout, the status bar. Tab stays as it is: a
region is a focus scope (focus::region), not a Tab scope. They are commands
like others, in the palette’s list and rebindable.
- Where it lands: the widget focused there last; else the one named with
focus::prefer; else the first focusable widget of what the region holds (a panel before its dock’s tab, a palette’s field before its band); else, in an area, the panel itself, asworkbench.focusdoes; else whatever else there can take the focus. A region with nothing to land on is passed over. - From nothing: the first region, or the last with Shift. After Escape or a press, from the region the user was in, which the focus chain still names.
- A panel
tab::scopetakes its region’s turn, one stop of the round each, and F6 goes on out of them. What lies around them in the region is reached by Tab. - It does nothing behind a modal, with a menu or a popover open (Escape comes first: F6 would leave it open behind the focus), and for an agent while someone is typing. A flyout stays open as F6 leaves it, like a palette.
- A focused terminal keeps F6, like every key, for its program; Shift+Escape leaves it.
- Hidden palettes are no region. Where palettes float and nothing has the focus, Tab still hides them: F6 is the way in, and Tab moves from there.
- Each window has its own: a detached panel’s window draws no region, so F6 stays there, for the panel scopes it may have.
- Without an application,
focus::regiondraws a region andregions::nextsays where F6 goes; a window with no region keepstab::scope’s F6.
What is no stop
A widget that would show nothing focused and answers no key senses without
FOCUSABLE: Sense::CLICK | Sense::DRAG or Sense::DRAG rather than
Sense::click_and_drag() or Sense::drag(). egui-pop’s window caption and its
flyout’s edge do so. With the focus plugin, Tab passes over the frame
of a popup (a menu, a context menu, a combo box’s list), which egui 0.36 makes a
stop. A side area’s resize line is still one, as egui draws it.
Keys on a scroll area
UiPop::scroll_area answers the keys egui’s own scroll area does not, and every
scroll area of egui-pop’s own goes through it: its panels, dialogs and lists, and
the views (scroll_area_viewport and scroll_area_rows are its forms for a view
drawing only what is in view). An application’s area on egui::ScrollArea
directly has none of this.
| Key | Moves it |
|---|---|
| Page Up, Page Down | By its height less a row |
| Home, End | To its start, to its end |
| The arrows | By a row, unless a widget inside holds the focus (below) |
Pages, Home and End go down the area, or along it when it scrolls only sideways. A move is not animated, whatever the motion setting, and a held key goes on.
- Which area: the one holding the focus. With nothing focused, the one under the pointer, unless a popup is open. With the focus elsewhere, a key goes nowhere new, as a widget there may be reading it. The innermost goes first; at its end the key goes on to the area around it, as the wheel does.
- A binding goes first: the dispatcher takes a key that resolves, in whatever scope it is bound, along with what it sends while held.
- A widget inside goes first: a text input, or a focused widget sensing drags (a
slider, a canvas, an editor, a terminal), keeps these keys. So does one naming
itself with
focus::takes_keys(each pass, as it is drawn): a list, a grid, a row of stars. A view whose focusable widget lies around its area (the list, the tree, the library’s grid) calls it inside the area, which then makes the view the Tab stop rather than itself. Another focused widget (a button, a link) leaves the pages, Home and End to the area, and the arrows to egui, which moves the focus. - A Tab stop only when nothing else can be, as a browser’s scroller: an area
overflowing, with nothing focusable inside, takes the focus (role
ScrollView, named “Scrollable content”), shows thefocus.ringaround it and has the arrows. An area with nothing to scroll is no stop, and neither is one starting to fit. A click does not focus it; the pointer over it is enough. - Not there: an area with hidden bars (
ScrollBarVisibility::AlwaysHidden), or scrolling without them (ScrollSource), has no keys, as it has no bar to say which ways it goes. A key with a modifier is not the area’s.
The wheel at a scroll area’s end
At its end a scroll area leaves the wheel to the area around it, as egui does. That suits a plain body, as a sizeable text in a panel should not trap the wheel, but in a list a notch too many moves the panel under the pointer, and the next lands on another widget. So what nests keeps it:
- The views do so themselves: the list, the tree, the library’s grid, the thumbnail grid, the table, the editor, a section’s body. The terminal takes every wheel over it.
- An area of yours:
ui.scroll_area_contained(area, add)in place ofui.scroll_area, orui::contain_wheel(ui, &out)afterscroll_area_viewport,scroll_area_rowsor one you show yourself. - Only the ways it can go. A list with nothing to scroll hands the wheel on, and a sideways wheel goes on past an area that only scrolls down. An area with its bars hidden holds nothing, as it has no bar to say which ways it goes.
- Popups and dialogs need none of this: each is a layer of its own, and what scrolls under it does not see the wheel.
- A trackpad too: egui 0.37 hands a trackpad at an area’s end on to the area around it rather than stretching the area, and containment keeps it there all the same.
A strip that scrolls only sideways
egui-pop’s themes turn on egui’s always_scroll_the_only_direction: an area that
scrolls one way only takes the plain wheel that way, so a strip of tabs or a
filmstrip scrolls sideways without Shift, which nobody finds on a strip with no bar.
At its end the wheel goes on to the area around it, as for any area. Shift still
works.
Trackpads and touch screens
egui 0.37 scrolls a trackpad and a touch drag with momentum: a touch drag coasts
after the release, and a trackpad or a touch drag stretches an area past its end and
springs back (KineticScrollStyle). A mouse wheel does neither. Under reduced
motion (ThemeSpec::reduced_motion) the theme turns both off: an area stops where
the finger leaves it, and at its ends. A panel that wants no stretch even with
motion on (a column of sliders, say) sets
ui.spacing_mut().scroll.kinetic.rubber_band = false before its area.
Arrows stay in their region
With the focus plugin, a plain arrow on a widget that does not read it moves the focus as egui has it, to the nearest widget that way, but not out of the region holding the focus (the parts F6 goes through: a side area, the centre, a palette, the status bar): such a move is undone in the next pass, and the focus stays where it was. Tab and F6 cross regions; a widget outside every region keeps egui’s rule.
A roving group is one stop
tab::roving(ui, name, axis, add) makes what add draws one Tab stop, as ARIA’s
toolbar pattern has it: egui-pop’s toolbars are drawn in one.
- Tab from any of its widgets leaves the group, past its last widget, and Shift+Tab before its first. After Escape, Tab goes on past it too.
- Tab coming in, either way, lands on the widget focused there last; on the first the first time.
- The arrows along it (Left and Right in a row,
Axis::Horizontal; Up and Down in a column,Axis::Vertical) go to the widget placed before or after, round from one end to the other; Home and End go to its ends. The other arrows are egui’s, and stay in their region. - Its widgets are those drawn inside it that can take the focus: a disabled one is passed over. An open menu or popup keeps the arrows, and a focused text field every key.
- It needs the focus plugin;
tab::rovingslists the groups the last pass drew.
A popover keeps Tab
With the focus plugin (focus::install; an application has it), Tab does not walk
the window behind an open popover.
- Past its last stop, Tab comes back to its first, and Shift+Tab from its first goes to its last, as in a dialog. Escape or a click outside is the way out, and the focus goes back to what opened it.
- From outside it, whether the widget that opened it, another or nothing, Tab goes in at its first stop and Shift+Tab at its last. The widget that opened it is not one of the stops.
- With no stop in it, it closes, and Tab goes on from where it was.
- A focused widget taking Tab itself (a terminal, an editor, a text field with
lock_focus) keeps the key; Escape or Shift+Escape leaves it first, as anywhere. - Which: an overlay of
Kind::Popoveron top of the stack, the status bar’s popovers and its jobs popover. Anegui::Popupused as a popover asks for it withfocus::keep_tab(ui)at the end of its content. A menu has its own keys, and a flyout (overlay::hold) stays open as the focus leaves it, like a palette.
The focus keeps its place
With the focus plugin (focus::install; an application has it), the focus
remembers the widget it was last on and that widget’s rectangle.
- Escape, then Tab or Shift+Tab: goes on from that widget. Escape itself still leaves nothing focused. So does a widget disabled while focused.
- The focused widget is removed: the focus goes to the stop nearest to where it was, in the innermost scope around it that still holds one, else in its layer: the row taking its place, the row before if it was the last, the next tab. A button opening or closing panels may be rebuilt under a new id; it keeps the focus if it stands in the same place.
- The focused widget scrolled away, or removed by the pointer: the focus goes to nothing and stays out of the way of the wheel, and Tab goes to the visible stop nearest to the place. If the widget is back by then, Tab goes on from it.
- A key binding on Tab goes first: nothing is focused, so the palettes’ toggle still takes Tab after Escape, and the place waits.
- Inside a
tab::scope, going on from the place follows the order of drawing, not the scope’s reading order. - Forgotten: a press on nothing forgets the place; a place under a modal or in a layer now gone (a closed menu) is not used. Tab then does what egui does, from the window’s first stop or its last.
The focus comes into view
With the focus plugin (focus::install; an application has it), a widget
the keyboard focuses comes into view in the scroll areas around it, nested
ones included, whatever panel it lies in. A widget has nothing to do for it.
- By anything but the pointer: Tab, an arrow, a command, a screen reader. A click on a half-visible row does not make it jump, in click mode or as the pointer hands the focus over in hover mode.
- Once per move: the wheel can then take the focused widget away.
- By the least that shows it, with the item spacing around it. A widget longer than the view stays where it is.
- Never animated, whatever the motion setting: a key held down has no moving target to chase, and reduced motion asks for nothing more.
- Windowed rows (
show_rows): a row not drawn is no stop. Each row reached scrolls the next one into the drawn window, so Tab goes through them all, one by one, both ways. A list, a tree or a grid fromegui-pop-viewsis one stop and scrolls to its own cursor. - Not found: an area with
ScrollBarVisibility::AlwaysHiddenshows no bar to read its reach from: what it holds callsResponse::scroll_to_meon gaining the focus, as the stack of sections does.
How it finds the areas, and why a widget’s own scroll_to_me would not do, is
in the upstream register.
A focus you can see
With the focus plugin, the widget the keyboard focused gets a ring of the
focus.ring token, painted at the end of the pass on the widget’s layer.
egui’s own widgets draw none: a focused button looked like a pressed one.
- Only by the keyboard: Tab, an arrow, F6, a command, a screen reader. A
click focuses without a ring, as GTK’s and Qt’s focus flags and the web’s
:focus-visiblehave it, and the next press of the pointer takes the ring away.focus::ring_shownsays which case holds now. - Inside the widget: the ring is drawn inside the part of the widget that shows, so it never spills over a panel’s or a scroll area’s edge.
- Not twice: a widget showing its focus itself calls
focus::own_ringeach pass it has the focus. One painting a kit state fromState::from_responsehas it said for it, and egui’s text fields, which outline themselves, are left alone. egui-pop’s sliders, fields, views, editors, graph and viewport show their own.
Not yet
- A formal form layout (labels in a column, sections, help text,
inline errors and an error summary, built from value descriptors) and
the
Formdialog on it come next, with the decision on how components are mounted in hosts. - The application shell’s own panels are not Tab scopes: an application
wraps a panel’s content in
tab::scopefor reading order inside it.
Why its own
egui’s TextEdit is the field (with its hint text); nothing in the
egui ecosystem draws decorated inputs from tokens, carries a shared
field state, or orders Tab per scope. See
the survey.
The tree
egui-pop-views (the facade’s views feature, re-exported as
egui_pop::views) has a live tree over data the application owns:
cargo add egui-pop --features views
- branches are loaded on demand, the first time they are opened, from any thread, with a loading row meanwhile and the reason and a retry button when loading fails;
- the application changes the tree at any time (insert, remove, move, rename, reload) and the view follows, keeping the selection and the open branches;
- single or multiple selection, the keyboard, drag and drop and rename in place;
- virtualised: 100 000 nodes cost a screenful.
The source
The application implements TreeSource: given a branch (None for the
roots), it answers through the Sink now or later, from any thread. A
node has a key (any type that is cloned, compared, hashed and
serialised), a label, and whether it is a branch.
use egui_pop::egui;
use egui_pop::views::tree::{Node, Sink, TreeSource, TreeState, TreeView};
/// Folders `0` to `2`, each with three files.
struct Folders;
impl TreeSource<String> for Folders {
fn load(&self, parent: Option<&String>, sink: Sink<String>) {
let children = match parent {
None => (0..3).map(|i| Node::branch(format!("{i}"), format!("Folder {i}"))).collect(),
Some(p) => (0..3).map(|i| Node::leaf(format!("{p}/{i}"), format!("File {p}.{i}"))).collect(),
};
// A disk or a network answers from a thread: `sink` is `Send`.
std::thread::spawn(move || sink.deliver(children));
}
}
let ctx = egui::Context::default();
let mut state = TreeState::<String>::new();
state.set_expanded(&"1".to_string(), true);
for _ in 0..50 {
// An application runs eframe; a bare context drops its textures.
let mut frame = ctx.run_ui(egui::RawInput::default(), |ui| {
TreeView::new("folders").label("Folders").show(ui, &mut state, &Folders);
});
frame.textures_delta.clear();
if state.model().loaded(Some(&"1".to_string())).is_some() {
break;
}
std::thread::sleep(std::time::Duration::from_millis(5));
}
// The roots, then the open folder's files.
assert_eq!(state.model().rows_now().len(), 6);
A branch is asked for once; TreeHandle::reload asks again (its
children stay on screen until the new ones come). An answer to a
request that was superseded is dropped.
Changes at any time
TreeState::handle gives a TreeHandle: cloned, sent to any thread,
its edits are applied at the next pass, which they wake.
use egui_pop::views::tree::{Node, TreeState};
let state = TreeState::<String>::new();
let edit = state.handle();
std::thread::spawn(move || {
edit.insert(Some("photos".into()), Some(0), Node::leaf("photos/new.jpg".into(), "new.jpg"));
edit.rename("photos/old.jpg".into(), "older.jpg");
edit.move_to("photos/2023".into(), Some("archive".into()), None);
edit.remove("photos/tmp".into());
edit.reload(Some("documents".into()));
})
.join()
.unwrap();
The selection and the open branches are kept by key: a renamed or moved node stays selected; a removed one leaves the selection (the cursor stays where it was). A node inserted or moved under a branch that was never loaded is left out: it comes with the branch.
What a row shows
A row is a list item: its triangle, an icon, its label,
weak trailing text, action buttons and widgets of the application’s at
its right end. TreeView::guides(true) draws indent guides,
TreeView::trailing gives each node’s weak text (a count, a type), and
TreeView::actions its action buttons (a visibility eye, remove), shown
on the row under the pointer, the selected rows and the cursor’s row
while the tree has the focus (Tab from the tree reaches them); a click
runs tree.action, then TreeView::on_action, and does not select the
row. TreeView::icon gives each node’s icon
(an Icon by role, a glyph or an image, egui_pop::core::icon::Source),
drawn in the row’s text colour. TreeView::row_widgets adds widgets
right to left in the row (a visibility toggle, a lock): they act on
their row and never select it, and the label is cut before them. Both
are called for the rows in view only.
use std::collections::HashSet;
use egui_pop::egui;
use egui_pop::core::icon::Icon;
use egui_pop::views::tree::{Node, Sink, TreeSource, TreeState, TreeView};
struct Layers;
impl TreeSource<String> for Layers {
fn load(&self, _: Option<&String>, sink: Sink<String>) {
sink.deliver(vec![Node::leaf("sky".into(), "Sky"), Node::leaf("ground".into(), "Ground")]);
}
}
fn layers(ui: &mut egui::Ui, state: &mut TreeState<String>, hidden: &mut HashSet<String>) {
TreeView::<String>::new("layers")
.icon(|_| Some(Icon::File.into()))
.row_widgets(|ui, node| {
let shown = !hidden.contains(&node.key);
let icon = if shown { Icon::Visible } else { Icon::Hidden };
let name = format!("{} {}", if shown { "Hide" } else { "Show" }, node.label);
if ui.add(icon.label(&name).sense_click()).clicked() && !hidden.remove(&node.key) {
hidden.insert(node.key.clone());
}
})
.show(ui, state, &Layers);
}
The closures take the node: name the key’s type (TreeView::<String>)
when the builder comes before show.
A right click opens a row’s context menu for that row, whatever is
selected (the selection does not change; the row is outlined while its
menu is open). TreeView::context_menu(app, menu) opens a declared
menu (Ctx::menu_item or CommandSpec::menu): {"tree": id, "key": key} is merged into its commands’ arguments, so a command acts on
args.key. TreeView::context_ui opens a menu the application draws,
given the row’s node. Either way the tree.context step runs first
(a veto keeps the menu closed) and Signal::Context names the node.
use egui_pop::egui;
use egui_pop::prelude::*;
use egui_pop::views::tree::{Sink, TreeSource, TreeState, TreeView};
const ROW: MenuId = MenuId::from_static("files.row");
const DELETE: CommandId = CommandId::from_static("files.delete");
struct Files;
impl TreeSource<String> for Files {
fn load(&self, _: Option<&String>, sink: Sink<String>) {
sink.deliver(Vec::new());
}
}
/// Declares the row menu's command: it deletes `args.key`.
fn connect(ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.command(
CommandSpec::new(DELETE, "Delete", "Files").hidden().menu(ROW, "9_edit", 0),
|call| {
let key = call.args["key"].as_str().ok_or("no row")?;
Ok(serde_json::json!({ "deleted": key }))
},
)?;
Ok(())
}
fn files(ui: &mut egui::Ui, app: &AppHandle, state: &mut TreeState<String>) {
TreeView::new("files").app(app).context_menu(app, ROW).show(ui, state, &Files);
}
Selection, keys, pointer
TreeView::mode sets the selection: Mode::Single (the default),
Mode::Multiple (Ctrl toggles, Shift extends a range, Ctrl+A) or
Mode::None. The tree takes the keyboard focus as one widget; its keys
come after the application’s key bindings (a key bound to a command
runs the command):
| Key | What it does |
|---|---|
| Up, Down, Page Up, Page Down, Home, End | Move the cursor and select; with Shift, extend the selection; with Ctrl, move the cursor alone |
| Left | Close the branch, or go to the parent |
| Right | Open the branch, or go to its first child |
| Space, Ctrl+Space | Select the cursor’s node, toggle it |
| Enter | Open or close a branch, open a leaf (tree.activate) |
| F2 | Rename in place (with TreeView::rename(true)); Enter keeps, Escape cancels |
| Letters | Type-ahead: the next node whose name starts with what was typed in the last second |
Ctrl+F, / | With a filter field: go to it (Filter) |
A label may carry decorations (a size, a count, a state): the source
then gives the node its plain name apart, Node::with_name. A rename
starts from the name and type-ahead searches names; tree.rename and
Signal::Rename carry names, and the view keeps the decorated label
until the application sends the node again (TreeHandle::update).
use egui_pop::views::tree::Node;
let node = Node::leaf("notes".to_string(), "notes.txt · 2 KB").with_name("notes.txt");
assert_eq!(node.name(), "notes.txt");
TreeState::set_selection sets the selection without a step (a saved
state, another view following this one). Nodes the view has not loaded
yet are queued: the selection takes each as its branch loads, then
brings the cursor’s row into view. Open the ancestors so that they
load; the user selecting drops what is queued, and
TreeState::pending_selection tells what still waits.
use egui_pop::views::tree::TreeState;
let mut state = TreeState::<String>::new();
// "2024/0005.raw" is under "photos/2024", not loaded yet.
state.set_expanded(&"photos".into(), true);
state.set_expanded(&"2024".into(), true);
state.set_selection(["2024/0005.raw".to_string()], Some("2024/0005.raw".to_string()));
assert!(state.selection().is_empty());
assert!(state.pending_selection().is_some());
TreeState::reveal brings a node’s row into view at the next pass.
TreeView::activate_on_click makes a click act as Enter does, for a tree
whose rows are links (the gallery’s list of pages): with Mode::None, the
selection set by set_selection marks the page shown while the cursor
moves on its own, and Enter or a click opens.
A click on the triangle or a double click opens a branch. With
TreeView::drag_drop(true), nodes (the selection, when the dragged node
is in it) are dragged before, after or inside a node; a node never goes
into itself, and the view scrolls near its edges.
A drop is refused, with its reason, in three places: by the source
(TreeSource::can_drop, what the data cannot take), at the call site
(TreeView::can_drop, what this view does not allow: a locked node),
and by a plugin’s before-hook on tree.drop (below). The first two are
asked while dragging, where a refused target is marked in the danger
colour under a “not allowed” pointer, and again by tree.drop’s
default (after the hooks, so a redirected drop is checked too); a drop
they refuse leaves the nodes where they were and comes back as
Signal::Vetoed with the reason.
use std::collections::HashSet;
use egui_pop::egui;
use egui_pop::views::tree::{Position, Sink, TreeSource, TreeState, TreeView};
struct Layers;
impl TreeSource<String> for Layers {
fn load(&self, _: Option<&String>, sink: Sink<String>) {
sink.deliver(Vec::new());
}
/// The data's own rule: a layer holds no layers.
fn can_drop(&self, _: &[String], target: &String, position: Position) -> Result<(), String> {
match position {
Position::Inside if !target.starts_with("group") => Err("only groups hold layers".into()),
_ => Ok(()),
}
}
}
fn layers(ui: &mut egui::Ui, state: &mut TreeState<String>, locked: &HashSet<String>) {
TreeView::new("layers")
.drag_drop(true)
// This view's rule: a locked layer stays where it is.
.can_drop(|keys: &[String], _: &String, _| match keys.iter().find(|k| locked.contains(*k)) {
Some(k) => Err(format!("{k} is locked")),
None => Ok(()),
})
.show(ui, state, &Layers);
}
Filter
TreeState::set_filter filters the tree; a FilterField, drawn above
it, types the filter. While the query is not empty:
- a node shows when every word of the query is in its match text,
as a substring, ignoring case and the accents of Latin letters
(
ecranfindsÉcran,boardfindsKeyboard); - the nodes that match show with their ancestors, which open for them without touching the fold the tree keeps; the rest is hidden, and a “No match” row says when nothing is left;
- the part of a label that matches is drawn in the row’s accent tone,
underlined (the kit’s
list-row, as the command palette marks it); - a branch opened or closed meanwhile (a click, Left, Right) is opened
or closed for the filter only, without
tree.expand, until the query changes; cleared, the tree is as it was, the cursor’s row in view; - the cursor goes to the first match when its row hides;
- only the nodes loaded are searched: a lazy branch never opened is not
asked for. A source whose nodes are all known at once may set every
branch’s children up front (
TreeHandle::set_children) so that the filter finds them in folded branches too.
Substrings rather than the palette’s fuzzy match: a filter hides what does not match, and a few letters in order are in almost any long text, so a fuzzy filter would hide little. Substrings rather than word starts, so that a word inside a name is found. VS Code’s tree filter does the same in its contiguous mode.
The match text is the node’s plain name (Node::name); the source adds
words the label does not show with TreeSource::match_text:
use egui_pop::egui;
use egui_pop::views::tree::{FilterField, Node, Sink, TreeSource, TreeState, TreeView};
/// Photos found by their name and by their tags.
struct Photos;
impl TreeSource<String> for Photos {
fn load(&self, _: Option<&String>, sink: Sink<String>) {
sink.deliver(vec![Node::leaf("p1".to_string(), "IMG_0001.raw")]);
}
fn match_text(&self, node: &Node<String>) -> String {
format!("{} beach sunset", node.name())
}
}
fn photos(ui: &mut egui::Ui, state: &mut TreeState<String>) {
FilterField::new("photos").show(ui, state);
TreeView::new("photos").label("Photos").show(ui, state, &Photos);
}
The field shows how many nodes match of how many are loaded (“3 of 57”, or “No match”) and announces it to screen readers. Its keys:
| Key | Where | What it does |
|---|---|---|
Ctrl+F, / | the tree | Goes to the field (tree.filter, on the treeFilter surface; rebindable) |
| Escape | the field | Clears it; empty, gives the keyboard back to the tree |
| Down | the field | Goes to the tree, its cursor on the first match |
tree.filter is declared by ViewsPlugin; without it (no application)
the field still filters, and is reached with the pointer or Tab.
TreeState::filter_count says how many nodes match. Agents read every
tree’s filter and the rows shown in the trees debug collector
(tree::filter::drawn): the query, the matches, the nodes loaded, and
the first 200 rows with their key, label, depth, whether each matches
and whether a branch is open.
Steps and signals
Each moment is a step (ADR 0011) when
the tree is given the application (TreeView::app) and ViewsPlugin
is connected; a plugin may veto, redirect, replace or follow it. The
same moments come back as Signals in TreeOutput::signals, with
Signal::Vetoed when a step was stopped.
| Step | Arguments | Default |
|---|---|---|
tree.load | tree, key (null: the roots) | asks the source; vetoed, the branch shows the reason |
tree.expand | tree, key, expanded | opens or closes the branch |
tree.select | tree, keys, cursor | sets the selection |
tree.drop | tree, keys, target, position (before, after, inside) | asks the source and the view (can_drop), then moves the nodes in the view |
tree.rename | tree, key, from, to | renames the node in the view |
tree.activate | tree, key | nothing: the application opens the leaf |
tree.context | tree, key | opens the row’s context menu, for that row (a redirect changes the node it is for) |
tree.action | tree, key, action | nothing: TreeView::on_action follows (a veto ignores the click) |
The view changes what it shows; the application changes its data, from the signals or from an after-hook. A before-hook refuses what the application cannot do:
use egui_pop::egui;
use egui_pop::prelude::*;
use egui_pop::views::ViewsPlugin;
use egui_pop::views::steps::TREE_DROP;
struct ReadOnlyArchive;
impl Plugin for ReadOnlyArchive {
fn id(&self) -> PluginId {
PluginId::from_static("read_only_archive")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.before(TREE_DROP, |_, args| {
if args["target"] == "archive" {
Before::Veto("the archive is read-only".into())
} else {
Before::Go
}
});
Ok(())
}
}
let app = App::builder()
.plugin(ViewsPlugin)
.plugin(ReadOnlyArchive)
.build(&egui::Context::default())
.unwrap();
let out = app.handle().step(
&TREE_DROP,
serde_json::json!({ "tree": "files", "keys": ["a.jpg"], "target": "archive", "position": "inside" }),
|_, _| Ok(serde_json::Value::Null),
);
assert_eq!(out.vetoed(), Some("the archive is read-only"));
The gallery’s tree page shows a simulated drive answered from a
thread, edits made while branches are open, drops refused by a hook,
by the source and by the page (a locked node), icons and an eye and a lock on every row, a context menu
acting on the row right-clicked, files named apart from their decorated
labels, a photo selected before its folder loads, and a branch of
100 000 files.
List items and property rows
egui-pop-views (the facade’s views feature) draws one dense row
everywhere: the tree’s rows, the list’s rows, and rows of their own in a
panel. Its parts, left to right:
- a drag handle, shown with the actions (
ListItem::drag_handle); - indent guides, a line down the row for each level of its
ancestors (
ListItem::guides,TreeView::guides); - the collapsing arrow’s column (
ListItem::collapsing, orDisclosure::Leaffor a leaf aligned with branches); - an icon in the row’s text colour;
- the label, cut before what follows;
- weak trailing text in the row’s muted tone (a count, a type);
- action buttons (a visibility eye, remove): shown while the row is
hovered, focused or selected, or always (
Reveal::Always); an action markedpinnedalways shows (a hidden layer’s closed eye).
A row is selected, hover, active (pressed, or ListItem::active),
focus and disabled, the kit’s states.
use egui_pop::egui;
use egui_pop::core::icon::Icon;
use egui_pop::views::item::{ItemAction, ListItem};
fn layers(ui: &mut egui::Ui, hidden: &mut [bool; 2], selected: &mut usize) {
for (i, name) in ["Sky", "Ground"].into_iter().enumerate() {
let eye = if hidden[i] {
ItemAction::new("visibility", Icon::Hidden, format!("Show {name}")).pinned(true)
} else {
ItemAction::new("visibility", Icon::Visible, format!("Hide {name}"))
};
let out = ListItem::new(name)
.icon(Icon::File)
.depth(1)
.guides(true)
.trailing("layer")
.selected(*selected == i)
.action(eye)
.id_salt(name)
.show(ui);
if out.action() == Some("visibility") {
hidden[i] = !hidden[i];
} else if out.response.clicked() {
*selected = i;
}
}
}
ItemResponse says what happened: the row’s response (clicked, double
clicked, right clicked), toggled (the arrow, Right, Left, or a screen
reader’s expand or collapse), the action clicked, and the drag
handle’s response.
The row height
Rows are size.row.height high, a token of their own: by default an
alias of size.control.height, so rows follow the density (24 points
comfortable, 20 compact) and the text size, as they did. A theme or a kit
makes rows denser or roomier than its buttons by giving the token a value
(item::row_height reads it). The tree, the list and the items all use it.
In the tree and the list
The tree’s rows are list items: TreeView::icon, TreeView::trailing,
TreeView::guides and TreeView::actions (with TreeView::on_action)
give their parts, TreeView::row_widgets keeps adding the application’s
own widgets at the right end. An action’s click runs the tree.action
step (tree, key, action; a veto ignores it), then on_action; it
does not select the row. The list’s rows take an icon and trailing text
from ListRows::icon and ListRows::trailing, before what
ListRows::ui draws.
The keyboard
- A standalone item takes the focus with Tab. Enter or Space clicks it; Right and Left open and close a collapsing one.
- Its action buttons follow it in the Tab order. They show while the item or one of them has the focus, so Tab walks from the item through its buttons to the next widget, and Shift+Tab walks back. Enter or Space on a button runs its action.
- In the tree, the cursor’s row shows its actions while the tree has the focus, and they come right after the tree in the Tab order: Tab from the tree reaches the cursor’s buttons, Tab from the last leaves the tree, Shift+Tab goes back to it. The arrows move the cursor as before; its new row’s buttons follow.
- The drag handle is for the pointer: an application offers the same move through its commands (move up, move down) for the keyboard.
Accessibility
A standalone item is a ListItem node (ListItem::role changes it)
named by its label, with its selected state, expanded and the expand or
collapse action when it collapses, and its level when nested. Each
action is a button named by its label, and also a custom action of the
row, so a screen reader offers it on the row itself. The tree’s rows keep
their role and names; rows with actions list them as custom actions.
Property rows
PropertyRow splits the same row in two: the property’s name, in the
muted tone, and its value, any widget. The names of rows sharing a column
id (PropertyRow::column; by default the rows of one Ui) take the
width of the widest, so their values line up; the column never takes more
than half the row. A value is editable unless the row is read_only
(its widgets disabled).
use egui_pop::egui;
use egui_pop::views::property::PropertyRow;
fn points(ui: &mut egui::Ui, radius: &mut f32, visible: &mut bool, locked: bool) {
PropertyRow::new("Path").text(ui, "world/points");
PropertyRow::new("Archetype").text(ui, "Points3D");
PropertyRow::new("Radius")
.read_only(locked)
.widget(ui, egui::DragValue::new(radius).speed(0.05));
PropertyRow::new("Visible").widget(ui, egui::Checkbox::without_text(visible));
}
text shows plain, selectable text; widget adds a widget named by the
property for screen readers; show takes any content.
The kit
list-item, based onlist-row(a kit restyling rows restyles items and the tree’s and list’s rows), adds a fill whileactive, muted text whiledisabled, and themutedtone for trailing text and property names.list-guide: an indent guide, theoutlinehandler’s line along a part with no width (list-guide.rest.border-color,border.default, andlist-guide.rest.border-width, one point). Itshoverstate (list-guide.hover.border-color,text.muted) is the lit guide of the hovered row’s parent, in a places panel that asks for it (PlacesPanel::indent_guide_highlight).- The action buttons are
icon-buttons; their icon is in the row’s muted tone until hovered or focused. The arrow is the kit’s disclosure glyphs.
The gallery’s list-items page shows items, the same rows in a tree, and
a property panel like a viewer’s selection panel.
Lists and tables
egui-pop-views (the facade’s views feature, re-exported as
egui_pop::views) has a list and a data table, both virtualised (only
the rows in view are built) over rows the application owns and draws.
cargo add egui-pop --features views
Both keep the selection by key, so it survives the rows being sorted, filtered or changed (rows that are gone leave it), take the keyboard focus as one widget and run each selection as a step.
| Key | What it does |
|---|---|
| Up, Down, Page Up, Page Down, Home, End | Move the cursor and select; with Shift, extend the selection; with Ctrl, move the cursor alone |
| Space, Ctrl+Space | Select the cursor’s row, toggle it |
| Ctrl+A | Select every row (Mode::Multiple) |
| Letters | Type-ahead: the next row whose label starts with what was typed in the last second |
A click selects, Ctrl+click toggles, Shift+click extends. Key bindings of the application come first: a key bound to a command runs the command.
The list
The application implements ListRows: how many rows, each one’s key
and label (its accessible name, what type-ahead searches), and,
optionally, how a row is drawn (by default, its label). A row is a
list item: ListRows::icon and ListRows::trailing
give it an icon before what ListRows::ui draws and weak text on its
right.
use egui_pop::egui;
use egui_pop::views::Mode;
use egui_pop::views::list::{ListRows, ListState, ListView, Signal};
struct Keywords(Vec<String>);
impl ListRows<usize> for Keywords {
fn len(&self) -> usize {
self.0.len()
}
fn key(&self, row: usize) -> usize {
row
}
fn label(&self, row: usize) -> String {
self.0[row].clone()
}
fn ui(&mut self, ui: &mut egui::Ui, row: usize, _selected: bool) {
ui.label(format!("#{}", self.0[row]));
}
}
fn keywords(ui: &mut egui::Ui, state: &mut ListState<usize>, rows: &mut Keywords) {
let out = ListView::new("keywords").label("Keywords").mode(Mode::Multiple).show(ui, state, rows);
for s in out.signals {
if let Signal::Select { keys, .. } = s {
let _ = keys; // Filter the photos by these keywords...
}
}
}
let mut state = ListState::new();
let mut rows = Keywords(vec!["beach".into(), "snow".into()]);
let ctx = egui::Context::default();
// An application runs eframe; a bare context drops its textures.
let mut frame = ctx.run_ui(egui::RawInput::default(), |ui| keywords(ui, &mut state, &mut rows));
frame.textures_delta.clear();
The data table
DataTable wraps Rerun’s egui_table (sticky header, resizable
columns, rows in view only) and adds the selection, the keyboard,
sorting from the header and the value store. Columns are declared
with Column; the application implements TableRows and draws each
cell.
A click on a sortable header sorts up, then down, then not at all. The
table only says so: the application sorts its rows as
TableState::sort says, when TableOutput::sorted is set. With
DataTable::store, the sort (<prefix>/sort: name, -name or empty)
and the widths (<prefix>/widths) live in the host’s value store, so
they are saved with the settings, read by agents, and set from
anywhere; table::declare declares them once. Without a store, an
order the application decides elsewhere (a sort command) shows in the
header with TableState::set_sort, and TableState::set_widths sets the
columns’ widths; neither runs a step.
use egui_pop::egui;
use egui_pop::model::ids::OwnerId;
use egui_pop::prelude::*;
use egui_pop::views::table::{self, Column, DataTable, Sort, TableRows, TableState};
use egui_pop::views::{Mode, ViewsPlugin};
struct Files(Vec<(u64, String, u64)>);
impl Files {
fn sort(&mut self, sort: Option<&Sort>) {
match sort.map(|s| s.column.as_str()) {
Some("size") => self.0.sort_by_key(|f| f.2),
_ => self.0.sort_by(|a, b| a.1.cmp(&b.1)),
}
if sort.is_some_and(|s| s.descending) {
self.0.reverse();
}
}
}
impl TableRows<u64> for Files {
fn len(&self) -> usize {
self.0.len()
}
fn key(&self, row: usize) -> u64 {
self.0[row].0
}
fn label(&self, row: usize) -> String {
self.0[row].1.clone()
}
fn cell(&mut self, ui: &mut egui::Ui, row: usize, column: usize, _selected: bool) {
match column {
0 => ui.label(&self.0[row].1),
_ => ui.label(format!("{} KB", self.0[row].2)),
};
}
}
fn columns() -> Vec<Column> {
vec![Column::new("name", "Name").width(200.0), Column::new("size", "Size").width(80.0)]
}
let ctx = egui::Context::default();
let app = App::builder().plugin(ViewsPlugin).build(&ctx).unwrap();
let h = app.handle();
let store = h.store();
table::declare(&store, &OwnerId::FRAMEWORK, "files", &columns()).unwrap();
// Sorted by size, descending, from anywhere (an agent, a saved setting):
store
.lock()
.unwrap()
.set(egui_pop::model::values::Set::new(
"files/sort",
egui_pop::model::values::Change::To(egui_pop::model::values::Value::Text("-size".into())),
Origin::User,
))
.unwrap();
let mut state = TableState::new();
let mut files = Files(vec![(1, "a.txt".into(), 3), (2, "b.txt".into(), 9)]);
let mut frame = ctx.run_ui(egui::RawInput::default(), |ui| {
let columns = columns();
let out = DataTable::new("files", &columns)
.mode(Mode::Multiple)
.app(h)
.store(&store, "files")
.show(ui, &mut state, &mut files);
let _ = out.sorted;
});
frame.textures_delta.clear();
files.sort(state.sort());
assert_eq!(files.0[0].1, "b.txt");
Rows: their look, their heights, the tail
A table’s rows are the kit’s table-row component: selected, hover
(never while selected: the selection stays under the pointer) and
focus for the cursor of a focused table. It is based on list-row, so
a table looks like a list until a kit gives table-row tokens of its
own; the Rerun-like kits select quietly, a faint fill and a thin marker
on the left, and outline the row under the pointer. Whatever the state,
the content keeps its place: the first cell keeps the room of the
row’s widest border (Component::border_room).
TableRows::row_top(row, row_h) gives rows of several heights (a row
unfolded to several lines): where each row starts, 0.0 for the first
(by default row * row_h). DataTable::stick_to_bottom(true) keeps the
last row in view as rows come in, until the user scrolls up, and again
once back at the end. TableOutput::visible_rows says which rows were
in view.
The text log
egui_pop::views::text_log is a log view on the data table, after the
Rerun viewer’s text log view (re_view_text_log, MIT OR Apache-2.0: its
design, none of its code): a row per entry, with its time, entity path,
level and body.
| Part | What it does |
|---|---|
| Time | written in a timeline’s scale (TextLog::time_scale, or a bound timeline’s: 1:02.500, a timecode, bars and beats), else as a plain number (a frame) |
| Entity | the entity path, tinted where it is the one highlighted elsewhere (TextLog::highlight_entity) |
| Level | a chip in the level’s colour (palette.log.*, six levels from trace to critical) |
| Body | its first line; a multi-line body shows how many lines it hides and unfolds with its arrow (TextLogState::set_expanded) |
| Level chips | a toggle chip per level, with how many lines of it match the text (TextLogState::set_level_shown) |
| Filter | shows the lines whose body or entity path holds the text, case aside (TextLogState::set_filter) |
| Follow | on by default: the last line stays in view as lines come in, until the user scrolls up; scrolled back to the end it follows again (TextLogOutput::following) |
| Time cursor | the rows at the latest time not after the cursor are the table’s selection, drawn by table-row, and come into view when the cursor moves elsewhere; a click or the arrow keys move the cursor to a row’s time (TextLogOutput::cursor_moved) |
The application owns the entries: LogSource (implemented for a slice
of LogEntry), in time order. The filter keeps its result between
passes and scans only the entries added at the end, so a log of a
hundred thousand lines costs a screenful of rows a pass;
TextLogState::refilter starts it over (the entries changed otherwise,
or the application’s own filter, TextLog::keep, did). Its strings
(the columns, the chips’ names, the count, the disclosure) are
translated.
use egui_pop::egui;
use egui_pop::views::text_log::{Level, LogEntry, TextLog, TextLogState};
use egui_pop::views::timeline::{TimeScale, TimelineState};
fn show_log(ui: &mut egui::Ui, log: &Vec<LogEntry>, state: &mut TextLogState, timeline: &mut TimelineState) {
// The timeline's playhead is the time cursor: a row picked moves it.
let out = TextLog::new("robot.log", log)
.label("Robot log")
.timeline(timeline)
.show(ui, state);
if let Some(entry) = out.picked {
let _ = &log[entry].entity;
}
}
let log = vec![
LogEntry::new(0.0, "/robot", Level::Info, "started"),
LogEntry::new(1.5, "/robot/arm", Level::Warn, "joint 2 near its limit"),
LogEntry::new(2.0, "/robot", Level::Critical, "emergency stop\nreason: no answer"),
];
let mut state = TextLogState::new();
let mut timeline = TimelineState::new(TimeScale::Seconds, 10.0);
let ctx = egui::Context::default();
let mut frame = ctx.run_ui(egui::RawInput::default(), |ui| {
show_log(ui, &log, &mut state, &mut timeline)
});
frame.textures_delta.clear();
assert_eq!(state.shown().len(), 3);
The gallery’s text-log page shows a robot’s minute under a timeline,
and its playground streams lines in or swaps in a hundred thousand; the
Rerun-like viewer’s text log is this view.
Columns
A table can select columns as well as rows, opt-in with
DataTable::select_columns(true), as in a spreadsheet:
| Gesture | What it does |
|---|---|
| Click a header | Selects its column alone |
| Ctrl+click a header | Adds or removes its column |
| Shift+click a header | Selects the columns from the last one clicked to it (with Ctrl, adds them) |
| Right-click a header | Its menu: Sort ascending, Sort descending, Unsorted, then the application’s entries |
A header click then selects instead of sorting: the sort is in the
header’s menu, which is there whether columns are selected or not.
Without select_columns, a click sorts as before.
Each change runs the table.select_columns step; the output’s
columns_selected is set and TableState::selected_columns gives the
columns’ ids, in the columns’ order (set_selected_columns sets them
without a step). A selected column is tinted from its header to its last
row, and so is the column under the pointer, over its header or any of
its cells: the table row’s selected and hover fills at half strength
(table-row in the kit), so a selected row shows through.
TableOutput::hovered_column names the column under the pointer and
header_clicked a header clicked this pass (with or without column
selection). DataTable::header_menu(|ui, column| …) adds the
application’s entries to every header’s menu.
DataTable::shared_columns(&service) binds the column selection to the
application-wide selection (egui_pop_api::selection): a column is the
item column:<id> (table::column_item), selected and hovered there
like any other, so a column chosen in a table shows in a panel
listening to the selection, and a column selected elsewhere is tinted
here. A plain click replaces the whole selection, Ctrl changes only the
table’s columns.
use egui_pop::egui;
use egui_pop::views::table::{Column, DataTable, TableRows, TableState};
struct Rows;
impl TableRows<u32> for Rows {
fn len(&self) -> usize { 0 }
fn key(&self, row: usize) -> u32 { row as u32 }
fn label(&self, row: usize) -> String { row.to_string() }
fn cell(&mut self, _: &mut egui::Ui, _: usize, _: usize, _: bool) {}
}
fn ui(ui: &mut egui::Ui, state: &mut TableState<u32>, rows: &mut Rows) {
let columns = [Column::new("time", "Time"), Column::new("speed", "Speed")];
let out = DataTable::new("samples", &columns)
.select_columns(true)
.header_menu(|ui, column| {
if ui.button(format!("Plot {column}")).clicked() {
ui.close();
}
})
.show(ui, state, rows);
if out.columns_selected {
let _plotted: &[String] = state.selected_columns();
}
}
Steps and signals
Given the application (.app(…)) with ViewsPlugin connected, each
moment is a step (ADR 0011) a plugin may
veto, redirect, replace or follow; the selection also comes back as
Signal::Select in the output, and a stopped step as Signal::Vetoed.
Enter on the cursor’s row, or a double click on a row, signals
Signal::Activate { key } (open it), in a list as in a table. Built with
drag_out(true), a drag starting on a row signals
Signal::DragOut { keys }: the selection when the row is in it, else
that row alone, the selection left as it is. The application sets its
payload (egui::DragAndDrop::set_payload) for its drop targets; while
the drag lasts the cursor shows a carry and the pointer how many rows go.
| Step | Arguments | Default |
|---|---|---|
list.select | list, keys, cursor | sets the selection |
table.select | table, keys, cursor | sets the selection |
table.sort | table, column (null: unsorted), descending | writes the sort to the store; the output’s sorted is set |
table.resize | table, widths | writes the widths to the store (when a resize ends); vetoed, the columns go back |
table.select_columns | table, columns | sets the column selection (a header clicked, select_columns); the output’s columns_selected is set |
The gallery’s table page shows 10 000 photos sorted and resized
through the store, cells drawn by the page (stars for the rating), a
veto on sorting by one column, columns selected from their headers
(shared with the application-wide selection), a header menu, and a list
of keywords; both open a row on Enter or a double click and carry rows
out by a drag, said in its signals.
Charts
egui_pop::views::plot draws time series, scatters and bars. It wraps
egui_plot (MIT OR Apache-2.0),
which draws the axes, the grid, the legend and the series, and takes the
pan, the zoom and the box zoom; egui-pop adds its look, an accessible
summary, the point under the pointer, time (an axis in a timeline’s
scale, a time cursor dragged both ways with a timeline, its range),
stepped lines, error bands, the values at the pointer, decimation for
series of millions of points and a collector for agents.
cargo add egui-pop --features views
use egui_pop::egui;
use egui_pop::views::plot::{Plot, Series};
fn ui(ui: &mut egui::Ui, now: f64) {
let series = [
Series::line("Left wheel", (0..200).map(|i| [i as f64 / 10.0, (i as f64 / 20.0).sin()])),
Series::points("Samples", [[2.0, 0.4], [7.5, -0.6]]),
Series::bars("Errors", [[5.0, 0.3], [12.0, 0.8]]),
];
let out = Plot::new("wheels", &series)
.label("Wheel speeds")
.x_label("seconds")
.time_cursor(Some(now))
.height(200.0)
.show(ui);
if let Some(h) = out.hovered {
// The point under the pointer: `h.series`, `h.index`, `h.x`, `h.y`.
let _ = (h.name, h.x, h.y);
}
}
Series
A Series has a name (the legend’s, the summary’s and the collector’s),
a kind (Kind::Line, Kind::Points, Kind::Bars, Kind::Steps) and
its points, [x, y]. A stepped line (Series::steps) holds each value
until the next point’s x: a state, a gear, a count that changes at
instants. Bars stand from 0 to each y at their x; several bar series
stand side by side, sharing Plot::bar_width (0.8 of the space between
two x values by default).
Each series takes its slot of the categorical palette
(palette.category.*, tokens): by
default its place among the plot’s series, or Series::slot(n). Give
an entity the same slot in every plot, so its colour follows it;
Series::entity(path) does it for you: the slot is a stable hash of the
path (FNV-1a, entity_slot), the same in every plot, run and platform,
after Rerun’s automatic colour by entity path (two paths may share a
slot: give one its own). Series::color sets a colour of its own.
An error band (Band::new(series, [[x, min, max], ...]), given with
Plot::bands) fills between a minimum and a maximum in a quarter of its
series’ colour, under the lines. The legend shows with two
series or more (Plot::legend to choose).
The look
The plot area is the kit’s plot component (kit.md): its
background and frame, its axis text and crosshair in text (hover
while the pointer is over it), its grid in grid-color, the denser lines
fainter by grid-fade (0: as strong as the sparsest, 1: much fainter;
egui_plot’s grid_fade). The time cursor is the plot-cursor
component, a line across the area (width thick, in fill, hover’s
under the pointer and while dragged) with a head at its top (none, or
a triangle pointing down, head-size wide). The default kit draws the
area on surface.canvas in border.default, the axis text and the grid
muted (fade 0.5), and the cursor in the accent without a head; the
Rerun-like kit gives the grid Rerun’s colour and fade (0.3) and the
cursor its triangle, turning to the strong text under the pointer.
GridLook::of(ctx) and CursorLook::of(ctx) read them.
Time
use egui_pop::egui;
use egui_pop::views::plot::{Plot, Series};
use egui_pop::views::timeline::{Timeline, TimelineState};
fn ui(ui: &mut egui::Ui, recording: &mut TimelineState, series: &[Series]) {
Timeline::new(recording).id("recording").show(ui);
// The playhead is the cursor; dragging the cursor moves the playhead.
Plot::new("speeds", series).timeline(recording).show(ui);
}
Plot::time_scale(TimeScale) puts the x axis in a timeline’s scale:
x values are seconds, and the ticks and labels are the timeline ruler’s
for the span in view and the plot’s width (0:05, 00:00:02:10, 17.2),
the finer ones as grid lines.
Plot::time_cursor(Option<f64>) draws a vertical line at an x value the
application gives at every pass; None draws none. With
Plot::drag_cursor(true) it follows the pointer when dragged, and
PlotOutput::cursor_dragged says where it went (on the scale’s units:
whole frames on frames); cursor_hovered says the pointer is on it.
Plot::timeline(&mut TimelineState) does all of it for a timeline: its
scale on the axis, its playhead as the cursor, dragging the cursor
moves the playhead (inside the bounds), and its range shaded under the
series in the timeline’s timeline.range.* colours (the edges in
range.edge while it loops, range.idle otherwise). Draw the timeline
in the same pass, before or after the plot: each shows what the other
did. Plot::highlight_range shades a range without a timeline.
Plot::link_cursor(group) shows the pointer’s x in the other plots
of a group, and Plot::link_x(group) zooms and pans their x axes
together (egui_plot’s linked cursors and axes).
The pointer
PlotOutput::hovered is the point nearest the pointer within
HOVER_RADIUS (16 points on screen), or the bar under it: its series,
its index and its values. It is marked with a ring on the plot.
PlotOutput::pointer is the pointer in the plot’s values, and
PlotOutput::bounds what is in view. Plot::interactive(false) leaves
the pan and the zoom out (a plot in a scroll area that should scroll).
PlotOutput::values is every line’s and stepped line’s value at the
pointer’s x while it is over the plot, else at the time cursor
(values_at): a line’s between its two points around x, a stepped
line’s the last point’s at or before it, none outside a series’ x
range. With Plot::values_tooltip(true) (the default with a time scale
or a timeline) a tooltip beside the pointer lists them under the time,
each by its series’ colour, and dots mark them on the lines.
Plot::emphasize(Some(index)) draws a series thicker (the one selected
or hovered elsewhere).
Many points
A time series may hold millions of points; a plot draws only what its
pixels can show. A line, a stepped line or an error band with more than
DECIMATION_THRESHOLD points in view (1000) is decimated per pixel
column: each column keeps its first, its lowest, its highest and its last
point, in order (the M4 scheme), so the line covers the same pixels as
the full series at the current zoom, and the segment joining two columns
is the full series’ own. A band keeps each column’s first and last rows
and, between them, its lowest minimum and highest maximum, over the same
columns as the lines. At most four points a column are drawn, whatever
the series’ length. Scatters and bars are drawn whole.
Plot::decimation(None) draws every point; Plot::decimation(Some(n))
sets the threshold. The approach follows Rerun’s time series view, which
reads the visible time range only and aggregates the points of a pixel
column.
Sorted by x, the common time series, a series is read in the x range in view only, found by binary search, with a point past each edge so the lines run off the plot: a pass costs the points in view, not the series’ length. While egui_plot fits the bounds to the data (before a pan or a zoom, and after a double click), the range in view is the whole series. A series not sorted by x (a path, a Lissajous figure) cannot be cut into columns: it is drawn whole, as egui_plot draws it, correct but at the cost of every point.
The point under the pointer (PlotOutput::hovered) and the values at the
pointer are read in the full series, never in the points drawn: the true
nearest sample, found by binary search within the hover radius on a sorted
series. The accessible summary and the collector count every point; the
collector adds each series’ drawn, the points handed to egui_plot this
pass. A series of more than 4096 points keeps its order and ranges
between passes while its points look the same (the same buffer and length,
and 64 points spread along it unchanged); one edited in place where none
of these change keeps its last ranges in the summary until one does.
Accessibility
A plot is one node, a figure named by Plot::label (“Chart” by
default), described by its series: each one’s name, kind, point count
and x and y ranges, then the time cursor, as in “Left wheel (line):
200 points, x from 0 to 19.9, y from -1 to 1. Time cursor at 4” (the
time in the scale’s text with a time scale, “Time cursor at 0:06.000”).
A draggable cursor is a slider named “Time cursor”, its value the time.
The legend’s entries are egui_plot’s checkboxes, which hide a series.
For agents
PlotPlugin declares the plots collector: every plot drawn in the
last two passes, by id, with its label and summary, its series (name,
kind, point count, ranges, colour), the bounds in view, the hovered
point, the time cursor, the time scale (seconds, frames, beats)
and the x axis’ labels, the highlighted range and the values at the
pointer or the cursor (Plots::of(ctx).describe()).
The gallery
The Charts page shows a time series with a time cursor, a scatter and
bars. The Plot over time page puts a timeline and a plot on one
TimelineState: twenty seconds of a robot’s speed (an entity colour and
its error band), a stepped target and a stepped gear, the looping range
shaded, the playhead the plot’s cursor; then kicks on a bars and beats
axis. Its playground switches the recording to frames or bars and beats,
and swaps the speed for two million samples (a hundred thousand a
second, with a vibration and noise), drawn decimated, or whole when the
decimation is turned off.
Why egui_plot
The survey (widgets.md) found egui_plot on egui 0.37 (0.38.0, 2026-10-19), maintained in egui’s organisation, under MIT OR Apache-2.0: lines, points, bars, box plots, a legend that hides series, axes with formatters, linked axes and cursors, pan, zoom and box zoom. It has no accessible description of a plot, no theme beyond egui’s visuals and no notion of a time given from outside: those are egui-pop’s part above, and nothing of egui_plot is redone.
Video
egui_pop::views::video::Video plays a local video file in place: a
tutorial with full controls, a clip in a library with compact ones, a
preview that loops without sound and without controls. The in-app viewer’s
video page (Links) is this widget. The choices
behind it are in the video survey.
use egui_pop::views::video::{Controls, Fit, Video};
// A tutorial: every control, an id for agents.
Video::new(&tour).id("tour").app(app).show(ui);
// A clip in a list: Play or Pause, the position and the time on one row.
Video::new(&clip).controls(Controls::Compact).size(egui::vec2(320.0, 220.0)).show(ui);
// A preview: no controls, playing at once, again and again, silent.
Video::new(&gesture)
.controls(Controls::None)
.autoplay(true)
.looping(true)
.muted(true)
.fit(Fit::Cover)
.size(egui::vec2(240.0, 135.0))
.show(ui);
| Builder | Default | What |
|---|---|---|
controls(Full | Compact | None) | Full | Full: the position on its own row, then Play or Pause, the time and the volume. Compact: Play or Pause, the position and the time on one row. None: the picture only, not a Tab stop |
autoplay(bool) | off | plays as soon as it opens, and again when drawn after being out of view |
looping(bool) | off | starts again at the end; read every pass |
muted(bool) | off | starts without sound; the volume slider or video.mute gives it back |
volume(f32) | 1 | the volume it opens with, 0 to 1 |
fit(Contain | Cover) | Contain | all of the picture with bars, or all of the room with the picture cropped |
poster(texture) | its first frame | a picture shown until it first plays or moves |
size(Vec2) | the available width, the picture as high as its shape asks | its whole size, controls included |
id(name) | none | its name for agents, and its key in the context |
label(text) | “Video: “ and the file’s name | its accessible name |
backend(Option<Arc<dyn VideoBackend>>) | the build’s | another player; None draws the placeholder |
app(&AppHandle) | none | Open outside goes through the links service |
surface(name), take_focus(bool) | video, off | the focus surface around the picture, for key bindings; the picture takes the focus |
show returns a VideoOutput: the picture’s response, the state, the
position, the length, the volume, whether it is muted, an error, whether
there is no player, and whether Open outside was clicked.
How it plays
- One player per widget, opened when it is first drawn and paused on its
first picture (unless
autoplay). Several videos on one page each have their own pipeline. - Off the interface’s thread: GStreamer’s threads decode and convert; each pass takes only the last picture and uploads it. A playing video asks for a repaint a few times a second, for the time; paused, ended or loading, nothing keeps the application awake.
- Out of view: a widget no longer drawn (a page left, a panel closed, a
tab behind another) has its player stopped after a few passes. Drawn again,
it opens the file at the same place, paused (playing with
autoplay). - Keys, while the picture has the focus: Space plays or pauses, Left and Right move by five seconds, Up and Down change the volume. A click on the picture plays or pauses and gives it the focus. A key the application binds on the picture’s surface runs its command instead (the viewer binds its own).
- Accessibility: the picture is a
Videonode named after the file (orlabel); Play or Pause is a button named for what it does; the position and the volume are sliders.
Loops
GStreamer’s player loops by itself, without a gap: with looping on, it
seeks with GStreamer’s SEGMENT flag, so the end of the file posts a
“segment done” message instead of ending the stream, and from there a
second segment seek back to the start, without a flush, carries the decoders
and the sinks straight on. Measured headless on a generated clip at ten
pictures a second (100 ms apart), the longest wait between two pictures
across loops was 102 to 112 ms: no gap
(crates/egui-pop-views/tests/video_gstreamer.rs).
A host’s own player can do the same (VideoPlayer::set_looping answers
whether it does). One that cannot (the default) is looped by the widget: at
the end it seeks back to the start and plays, a flushing seek that leaves a
short gap, the time the pipeline takes to pre-roll again: about 150 ms
between two pictures on the same clip, half a frame more than playing on.
The picture’s path, and its cost
playbin opens the file and picks the decoders; a videoconvert turns each
picture into RGBA on every core (n-threads 0), and the player makes egui’s
picture of it in one pass. With a hardware decoder (VA-API here), the decoded
picture is copied back to memory before that conversion, which on one core
(playbin’s default) cannot keep up with 4K.
Measured headless on 2026-11-04 (Fedora 44, GStreamer 1.28, an AMD Radeon 680M with Mesa’s VA-API, twelve threads, a machine shared with other work), on 10 s of 4K VP9 at 30 pictures a second:
| What | Converting on one core | On every core |
|---|---|---|
gst-launch-1.0, decode and convert only, unsynchronised | 24 a second (12.3 s) | 62 a second (4.9 s) |
| The player, unsynchronised, pictures as egui’s | 17 to 20 a second | 38 to 41 a second |
| The player, playing in time | 17 to 23 a second, the 10 s taking 13 to 18 s (before this change) | 30 a second, in time (4 runs out of 4) |
Converting on every core with the old two-pass copy was no better (12 to 15 a second): the copy, then 15 to 55 ms a picture, was the other half; in one pass it takes about 4 ms. Uploading the YUV planes and converting on the GPU is a later step (survey).
Without a player
Without the video feature, on the web, or with backend(None), the widget
draws a placeholder saying that the application has no video player, with
Open outside. A player that fails (a missing plugin, a file it cannot
read) is replaced by the failure and Open outside; the viewer turns it
into its error page.
What it needs with the feature: to build, GStreamer’s development
packages (libgstreamer1.0-dev and libgstreamer-plugins-base1.0-dev on
Debian and Ubuntu); to run, GStreamer’s libraries, its base plugins, and the
plugins for the files to play. The binary links GStreamer’s libraries, so an
application declares them as a dependency of its package.
Agents
VideoPlugin declares the commands and the videos collector; the widgets
play without it.
| Command | Arguments | Does |
|---|---|---|
video.toggle | video | plays or pauses; from the end, plays from the start |
video.play, video.pause | video | plays, pauses |
video.seek | video, seconds or by | moves to a position, or by an amount, kept within the video |
video.volume | video, volume (0 to 1) or by | sets or changes the volume, and gives the sound back |
video.mute | video, muted (else switched) | mutes or gives the sound back |
video is a widget’s id; without it, the one whose picture last had the
focus, else the only one with an id. The videos collector shows each video
with an id: its file, backend, controls, state (loading, paused,
playing, ended), playing, position_ms, duration_ms, volume,
muted, looping, loops, the picture’s size, a note or an error,
and whether it is stopped out of view. Videos::of(ctx) gives the same
from code.
Tests
Tests give a pretend VideoBackend (crates/egui-pop-views/tests/video.rs);
write_test_clip writes a small clip from GStreamer’s test sources for the
tests that run the real player (viewer_gstreamer.rs, CI’s video job) and
for the gallery’s Video page (cargo run -p egui-pop-gallery --features video).
Timeline
egui_pop::views::timeline::Timeline is a ruler of time: a playhead to
scrub, a range that loops, markers and cue points, snapping, and the
transport keys of video editors and DJ software. One widget serves a data
viewer’s time panel (seconds), a video editor (frames and timecode) and a
DJ application (bars and beats): only its TimeScale
changes.
Under the ruler, tracks hold clips (a start, a length, an offset into a source) that an application’s painter draws: a video’s thumbnails, an audio waveform, a data plot. They are selected, moved within and across tracks and trimmed by their edges.
use egui_pop::views::timeline::{Marker, MarkerKind, TimeScale, Timeline, TimelineState};
// The application keeps the state (serializable)...
let mut song = TimelineState::new(TimeScale::beats(128.0), 240.0);
song.add_marker(Marker::new(0, 30.0, "Drop").kind(MarkerKind::Cue));
// ...moves the time while it plays...
song.advance(dt);
// ...and draws it each frame.
let out = Timeline::new(&mut song)
.id("song")
.app(app)
.history("doc/song/timeline")
.show(ui);
if out.transport_changed {
player.set_speed(if song.is_playing() { song.speed } else { 0.0 });
}
Time
Time is an f64 in seconds, everywhere: the playhead, the range, the
markers, the view. A scale only reads it in its own units.
Why not integer ticks: no tick rate divides every scale. Frame rates such
as 29.97 (30000/1001) are not a whole number of any common tick, a tempo
of 128.5 BPM gives beats that are not either, and a timeline may change its
scale while its markers stay where they are. An f64 keeps about 15
significant digits: at 24 hours it still tells apart times a hundred
nanoseconds apart, far finer than an audio sample at 192 kHz. Where whole
units matter the scale rounds: on frames, the playhead, markers and ranges
always land on a whole frame (TimeScale::quantize), and snapping lands
on the grid’s exact lines.
Time scales
| Scale | Text | Ruler | ←/→, Shift+←/→ |
|---|---|---|---|
Seconds | 1:02.500, 1:02:03.250 | 1 ms to days, labels as precise as their step (0:05, 0:05.5) | 1 s, 10 s |
Frames(FrameRate) | timecode HH:MM:SS:FF (counted without dropping frames: 29.97 counts 30 to a second) | 1, 2, 5, 10 frames, then timecode seconds and minutes | a frame, a timecode second |
Beats(Tempo) | bar.beat.tick from 1.1.000 | sixteenths of a beat to bars, then 2 to 1024 bars | a beat, a bar |
Tempo::new(bpm, beats_per_bar, beat_unit) counts 960 ticks to a beat
(ticks_per_beat), and offset puts bar 1 where a track’s first downbeat
is. A scale converts (to_units, from_units), writes (format, and
label at a ruler step’s precision), reads (parse, which also takes the
shorter forms 1:02, 12.5, 17.2), gives its ruler’s steps (steps)
and the grid (round_to).
The ruler
ruler::ticks picks, for the view and the width, the finest step whose
labels fit: each label is measured (its widest, at the view’s ends and
middle) and needs its width plus LABEL_GAP (10 points) between two
ticks. Under it, the minor step is the finest one that divides it and
keeps MIN_TICK_GAP (6 points). Labelled ticks draw a grid line down the
lanes; the minor ticks are the grid snapping lands on. ruler::marks
lists the ticks in view, and the widget still skips a label that would
touch the one before it.
State
TimelineState is everything the timeline shows, serializable with serde:
| Field | What |
|---|---|
scale | the time scale |
view | the part in view: start and duration |
bounds | the document’s span (TimelineState::new(scale, length) gives 0..length): the playhead stays inside, the view near it |
playhead | the current time |
range, looping | the selected range, and whether playing goes round it |
markers | Marker { id, time, label, kind, color }, in time order; kind is Marker (a flag) or Cue (a pin), color the theme’s when None |
selected | the marker the keys act on |
tracks | rows of clips, from the top |
selected_clips | the clips selected, the last one the keys act on |
play, speed | what the user asked: Paused or Playing, and the speed (negative backwards) |
Its document part, TimelineDoc (doc, set_doc), is the markers, the
range, the loop and the tracks with their clips: what the history keeps.
Playing is the application’s job. The widget only says what was
asked: play and speed in the state and the output, and
transport_changed the pass it changes. The application moves the time,
from its player’s clock or its own; TimelineState::advance(dt) does it
the usual way (round the range when looping, otherwise stopping and
pausing at the bounds), and the application repaints while it plays.
While it plays, the view follows the playhead a page at a time
(Timeline::follow), or keeps it in place (Follow::Fixed,
below).
The widget
| Builder | Default | What |
|---|---|---|
id(name) | none | its name for agents, and its key in the context |
label(text) | “Timeline” | its accessible name |
lanes(height) | a control’s height, none with tracks | the lanes under the tracks |
track_height(points) | twice a control’s height | a track’s height, unless the track says |
clips(&mut painter) | PlainClips | what draws the clips’ content (below) |
width(points) | the width available | |
snap(Snap) | all on | what snapping goes to: grid, markers (and the range’s ends), playhead, clips (their edges); Snap::OFF for none |
app(&AppHandle), history(path) | none | each change of the document a step of the history (below) |
surface(name) | timeline | its focus surface, for key bindings |
take_focus(bool) | off | takes the keyboard focus this pass |
follow(bool) | on | the view follows the playhead while it plays |
follow_mode(Follow) | Follow::Page | how: Off, Page (a page at a time while it plays) or Fixed(at) (the playhead kept at at of the width, below) |
scrub_on_drag(bool) | off | a drag on a clip scrubs instead of moving or trimming it: the clips are locked to the pointer |
nudge_on_drag(bool) | off | while it plays, a drag nudges instead of scrubbing |
show(ui) draws it; show_with(ui, |ui, lanes| ...) draws what goes in
the lanes too (rows of data, a beat grid), before the clips, the markers
and the playhead are drawn over it: Lanes::x_of and time_at map time and
points. Rerun-like time panels draw their rows of data ticks this way.
A plot follows a timeline with Plot::timeline(&mut state): its x axis
in the scale, the playhead as its time cursor (dragging it moves the
playhead) and the range shaded (Charts).
TimelineOutput says what happened: playhead_moved, scrubbing,
transport_changed, play, speed, view_changed, and edits, the
document’s changes (Edit::MarkerAdded, MarkerMoved, MarkerRemoved,
RangeSet, LoopSet, ClipAdded, ClipMoved, ClipTrimmed,
ClipRemoved, ClipSplit, and Restored when the history put the document back;
Edit is non-exhaustive), and tracks, each track’s id and row on
screen, for what an application draws beside them.
Pointer
| Gesture | Does |
|---|---|
| Press on the ruler or the lanes | moves the playhead there (snapped) and takes the focus |
| Drag | scrubs |
| Shift+drag | selects a range (snapped) |
| Ctrl+drag, middle drag | pans |
| Wheel (either axis) | pans |
| Ctrl+wheel, pinch | zooms around the pointer |
| Click on a marker | selects it, the playhead goes there |
| Drag a marker | moves it: one step of the history when dropped |
| Double click on the markers’ lane | adds a marker there |
| Alt held | no snapping (frames still land on whole frames) |
A fixed playhead: DJ decks
With follow_mode(Follow::Fixed(at)) (Follow::CENTRE is Fixed(0.5)),
the playhead stays at at of the width, playing or not, and the content
scrolls under it; the view may reach past the bounds (the song’s start
in the middle of a deck). The pointer then moves the content rather than
the playhead:
| Gesture | Does |
|---|---|
| Press | nothing yet (the playhead does not jump) |
| Click on the ruler or the lanes | moves the playhead there (snapped) |
| Drag, Ctrl+drag, middle drag | the content follows the pointer, the playhead moving with it (snapped): a drag to the left goes on in time |
| Wheel, paused | steps the playhead a unit (a beat, a frame, a second) per notch, onto the grid first (Alt: from where it is); wheel up goes back |
| Ctrl+wheel, pinch | zooms, the playhead kept in place |
scrub_on_drag(true) locks the clips to the pointer: a drag on a clip
scrubs (moves the content, under a fixed playhead) instead of moving it,
and its edges do not trim; a click still selects it, and the keys still
edit it. nudge_on_drag(true): while it plays, a drag adds
NUDGE_GAIN (a quarter) of its own speed to the playing, as a jog
wheel’s edge does: the content dragged forward (to the left) speeds the
deck up, dragged back slows it down; released, it plays on at its speed.
The play state and the speed are left as they were; the playhead moves
(playhead_moved), not quantized, as playing does not.
Over the lanes the pointer is an open hand, closed for the whole drag
(the scrub drag kind, pointer-gestures.md),
even once it leaves the timeline.
Snapping pulls a time to a marker, the range’s ends, the playhead or a
clip’s edge within 8 points (SNAP_REACH), the nearest first; otherwise
onto the grid (the ruler’s small ticks). A scrub does not snap to the
playhead it moves, a dragged marker or clip not to itself. A clip moved
snaps by whichever of its edges is nearer a point (ruler::snap_span),
else its start onto the grid.
Keys
While the timeline has the focus (it is one Tab stop). A key an application binds on the timeline’s surface runs its command instead.
| Key | Does | Convention |
|---|---|---|
| Space | plays forward at 1, or pauses | everywhere |
| L | plays forward; again: twice as fast (up to 32×) | NLE J/K/L shuttle |
| J | plays backward; again: twice as fast | NLE |
| K | pauses (the speed back to 1) | NLE |
| K held + J or L | one unit back or forward | NLE |
| ← / → | one unit back or forward (pauses) | |
| Shift+← / Shift+→ | a bigger step (10 s, a timecode second, a bar) | |
| Home / End | the bounds’ start / end | |
| I / O | the range’s in / out point at the playhead | NLE |
| Shift+I / Shift+O | goes to the in / out point | Premiere |
| Alt+X | clears the range | Premiere, Resolve |
| Ctrl+L | loops the range, or no longer | Ableton |
| M | adds a marker at the playhead, “Marker 3” | Premiere, Resolve |
| ↑ / ↓ | selects the previous / next marker, the playhead goes there (announced) | Resolve’s Shift+↑/↓ |
| Ctrl+← / Ctrl+→ (Shift: bigger) | moves the selected marker, else the selected clips, one unit | |
| Page Up / Page Down | selects the previous / next clip on the selected one’s track (else the first track’s, from the playhead), the playhead goes to its start (announced) | Premiere’s edit points |
| Shift+↑ / Shift+↓ | selects the clip at the playhead (else the nearest) on the track above / below (announced) | egui-pop’s |
| Ctrl+↑ / Ctrl+↓ | moves the selected clips a track up / down, where they fit | egui-pop’s |
[ / ] | trims the selected clip’s start / end to the playhead | Resolve’s Shift+[ / ] |
| Delete, Backspace | removes the selected marker, else the selected clips | |
| Shift+Delete, Shift+Backspace | removes the selected clips and closes their gaps (ripple delete) | Premiere |
| Ctrl+K | splits the selected clips at the playhead; none selected: every clip there | Premiere’s Add Edit |
| Escape | lets the selected marker and clips go | |
+ / - | zooms in / out around the playhead |
Each transport key has its timeline.* command (Space toggle_play, L
and J shuttle_forward and shuttle_backward, K pause, → and ←
step_forward and step_backward, Home and End go_to_start and
go_to_end, Ctrl+L toggle_loop): the palette, agents and the
transport’s buttons run the same thing as the key.
Transport
Transport is a row of buttons over a TimelineState, the playhead’s
text beside them:
use egui_pop::views::timeline::{Timeline, Transport, TransportButton};
// Each button runs its key's command on the timeline `sequence`.
Transport::new(&mut seq).app(app).timeline("sequence").show(ui);
Timeline::new(&mut seq).id("sequence").app(app).history("doc/seq").show(ui);
// A deck: play or pause only, no timecode.
Transport::new(&mut deck)
.app(app)
.timeline("deck-a")
.buttons(&[TransportButton::PlayPause])
.timecode(false)
.show(ui);
| Button | Key | Command |
|---|---|---|
Start | Home | timeline.go_to_start |
StepBack | ← | timeline.step_backward |
PlayBackward | J | timeline.shuttle_backward (shown on while playing backward) |
Stop | K | timeline.pause |
PlayPause | Space | timeline.toggle_play (Play, or Pause while playing) |
StepForward | → | timeline.step_forward |
End | End | timeline.go_to_end |
Loop | Ctrl+L | timeline.toggle_loop (shown on while looping) |
buttons(&[...]) picks them, in order (TransportButton::ALL by
default); timecode(false) leaves the text out. With app and
timeline (the timeline’s id, the TimelinePlugin connected) a click
runs the command, applied at the timeline’s next pass (a loop toggled is
a step of the history, as Ctrl+L’s); without them it changes the state
directly. Each button is an accessible button named by what it does
(“Play backward”), its tooltip naming its keys (“Play backward (J)”);
the glyphs are painted in the theme’s button colours. TransportOutput
gives the row’s response and the button clicked.
Tracks and clips
use egui_pop::views::timeline::{Clip, TimeScale, Timeline, TimelineState, Track};
let mut edit = TimelineState::new(TimeScale::frames(25), 120.0);
let v1 = edit.add_track(Track::new(0, "V1").kind("video"));
let a1 = edit.add_track(Track::new(0, "A1").kind("audio").height(40.0));
edit.add_clip(v1, Clip::new(0, 0.0, 12.0, "Wide shot")
.source("wide.mov") // what it plays: the application's
.offset(3.0) // the source read from 3 s in
.source_length(20.0))?; // trimming stops at its ends
Timeline::new(&mut edit).clips(&mut my_painter).show(ui);
A Track (id, name, kind, height, clips) is a row under the
markers’ lane; its kind is free text for the application’s painter
(video, audio, data). A Clip is id (unique in the timeline),
start and length on the timeline, offset into its source, label,
source (what it plays, which the timeline never reads),
source_length (None: a source without ends, a still or a generator)
and color. Time is in seconds, as everywhere in the timeline; on frames
a clip’s start, length and offset are whole frames. source_at(time)
and time_of(source_time) map the timeline and the source.
The rules, kept by TimelineState (each method usable without the
widget, for an application’s own commands):
- A track’s clips are in time order and never overlap (touching end to start is fine), and stay inside the bounds.
add_clip(track, clip)andmove_clips(&[ClipMove])(several at once, across tracks) are refused where they would overlap or leave the bounds (ClipError): nothing changes.trim_clip(id, ClipEdge, time)stops at the source’s ends, the neighbours, the bounds and the shortest a clip can be (min_clip_length: a frame, else the ruler’s finest step); trimming the start moves the offset with it, so the picture stays where it was.split_clip(id, time)cuts a clip in two attime(a whole frame on frames): it keeps its id and ends there, a new clip (the next id, returned) starts there and reads its source on; refused unless both parts are at leastmin_clip_lengthlong.ripple_remove_clips(&ids)removes clips and closes the gaps they leave: the clips after each on its track move back by its length (other tracks stay).remove_clips(&ids);clip,clip_track,clips()find them;neighbour_clipandclip_acrossare what the keys walk.
With the pointer:
| Gesture | Does |
|---|---|
| Click on a clip | selects it alone; Ctrl: in or out of the selection; Shift: added |
| Drag a clip | moves the selection along its track or to others, snapped; where it does not fit, it lands against the nearest edge that lets it (another clip’s, the bounds’); one step when dropped |
| Drag a clip’s edge | trims it (the cursor turns to a resize arrow over an edge) |
| Hover or drag a clip | the move cursor, kept for the whole drag (drag cursors) |
| Press on a track, off the clips | lets the clips go, and moves the playhead as anywhere |
| Middle drag on a clip | pans |
| Alt held | no snapping |
The playhead stays where it is when a clip is clicked or dragged. Each clip is an accessible button, “Clip Wide shot on V1, 00:00:00:00 to 00:00:12:00”, selected or not; a screen reader’s click selects it.
Painting clips
The timeline draws each clip’s box (its colour, else
timeline.clip.fill), its outline, its selection and the edge the
pointer would trim; a ClipPainter draws what is inside, clipped to the
clip in view:
impl ClipPainter for MyPainter {
fn paint(&mut self, painter: &egui::Painter, clip: &ClipPaint<'_>) {
if clip.track.kind == "audio" {
let (from, to) = clip.source_in_view(); // seconds of the source
// ... a waveform across clip.content, x by clip.x_of_source(t)
}
clip.paint_label(painter); // what PlainClips draws
}
}
ClipPaint gives the clip and its track, rect (the whole clip, often
wider than the lanes when zoomed in), visible (the part in view),
content (under the label when the track is tall enough), the lanes
and the scale for mapping, selected, hovered and the tokens. A
closure |painter, clip| ... is a painter too. PlainClips, the
default, draws the labels only, each kept in sight at the left of the
part in view.
History
With app(app).history(path), the document (markers, range, loop, tracks
and clips) is kept
as text at path of the application’s value store (declared there if it is
not), and each change is one step of egui-pop’s history (History):
adding, moving (a drag is one step, from where it was to where it lands),
removing a marker, setting or clearing the range, looping, adding,
moving, trimming, splitting and removing clips (clips moved, split or
removed together are one step; a ripple delete, its removals and moves,
is one). Selecting is not a step. Ctrl+Z undoes it
and the timeline takes the document back at its next pass
(Edit::Restored). The playhead, the view and playing are not steps. An
agent’s change is a step named as the agent’s.
Without it, the edits are in the output for an application keeping its own history.
Accessibility
The timeline is a slider: its value is the playhead’s text in the scale
(00:01:02:12), with its numeric value in seconds, the bounds as its range
and a unit as its step; a screen reader’s Increment, Decrement and Set
Value move the playhead. Each marker is a named node, “Marker Drop at
1:02.500” (“Cue …” for a cue point); ↑ and ↓ reach them from the
keyboard and announce the one reached.
Look
Tokens only, each timeline.* path falling back on the system token it
aliases (TimelineTokens), so a theme restyles it with data:
| Token | Fallback | What |
|---|---|---|
timeline.background | surface.sunken | behind the lanes |
timeline.ruler.fill, .border, .tick, .text | surface.raised, border.default, text.muted, text.muted | the ruler |
timeline.grid | border.default | lines down the lanes at the labels |
timeline.range.fill | accent.subtle | the range down the lanes |
timeline.range.edge, timeline.range.idle | accent.default, text.muted | its band and edges, looping or not |
timeline.playhead | accent.default | the playhead |
timeline.marker | info | a marker without a colour of its own |
timeline.marker.text, .selected | text.default, focus.ring | its label, the selected one’s outline |
timeline.track.border, .text | border.default, text.muted | the line under a track, its name |
timeline.clip.fill, .border, .text | surface.raised, border.strong, text.default | a clip without a colour of its own, its label |
timeline.clip.selected | accent.default | a selected clip’s outline, the edge being trimmed |
The ruler’s height is size.control.height, its labels font.scale.xs in
the monospace font; a track is twice size.control.height high unless it
or the timeline says.
For agents: timeline.*
TimelinePlugin declares the commands and the timeline collector; the
widgets work without it. A timeline is reached by its id.
| Command | Arguments | Does |
|---|---|---|
timeline.set_time | timeline, seconds, time (text in its scale) or by | moves the playhead |
timeline.set_range | timeline, start and end, or clear; loop | sets or clears the range, loops it |
timeline.add_marker | timeline, seconds or time (else the playhead), label, kind (marker, cue), color (#rrggbb) | adds a marker, answers its id in added |
timeline.remove_marker | timeline, id | removes a marker |
timeline.play | timeline, speed | asks to play |
timeline.pause | timeline | asks to pause (K) |
timeline.toggle_play | timeline | plays forward at 1, or pauses (Space) |
timeline.shuttle_forward, timeline.shuttle_backward | timeline | plays that way, twice as fast when it already does (L, J) |
timeline.step_forward, timeline.step_backward | timeline, big | one unit on or back, pausing (→, ←; big: Shift’s step) |
timeline.go_to_start, timeline.go_to_end | timeline | the bounds’ start or end (Home, End) |
timeline.toggle_loop | timeline | loops the range, or no longer (Ctrl+L), a step of the history |
timeline.add_clip | timeline, track, seconds or time (else the playhead), length, offset, label, source, source_length, color | adds a clip, answers its id in added; refused where it would overlap |
timeline.move_clip | timeline, id, seconds or time, track | moves a clip (what is not given stays); refused where it would overlap or leave the bounds |
timeline.trim_clip | timeline, id, start, end | moves a clip’s start or end (seconds on the timeline), stopping as a drag does |
timeline.remove_clip | timeline, id or ids | removes clips, one step together |
timeline.split_clip | timeline, id or ids, seconds or time (else the playhead) | splits clips there, one step together; answers the new clips’ ids in added; refused unless the time is inside each |
timeline.ripple_delete | timeline, id or ids | removes clips and closes their gaps, one step |
timeline.select_clips | timeline, ids | selects clips ([]: none); not a step |
Without timeline, the one that last had the focus, else the only one
drawn. A command is checked at once (a refusal says why: it would overlap clip 4, no clip 9) and answered with the timeline as the collector shows it; the widget applies it at its next pass, as a step of
the history made by the agent.
The timeline collector lists each timeline drawn with an id: its scale,
view, bounds, playhead (seconds and text), range (and its text), loop,
markers (id, seconds, text, label, kind, colour), the selected marker, the
tracks (id, name, kind) with their clips (id, seconds, end, length,
offset, text, label, source, source length, colour), the clips selected,
the play state and speed; and the one that last had the focus.
The gallery
The Timeline page shows one timeline per scale: a 90-second recording in seconds (its lanes a data viewer’s rows of events, no grid snapping), two minutes of video at 25 frames per second with a looping range, and a track at 128 BPM with coloured cue points, a loop of four bars and a kick drawn on every beat. A pretend player moves each playhead while it plays, on the motion clock (frozen in the tests, so the snapshots stand still).
The Tracks and clips page is a forty-second edit at 25 frames per
second: a titles track, two video tracks and two audio tracks, drawn by
a painter of the gallery’s (pretend thumbnails, one per second of the
source, and a waveform, both from the source’s time, so a clip trimmed
or moved keeps its picture and its sound in place; the titles with
PlainClips).
The DJ decks page puts two decks on bars and beats (128 and 124 BPM),
each a timeline with one track holding its song, drawn by a painter of
the gallery’s: a pretend waveform, louder on the beats and in the drop,
under a beat grid with the bars brighter. Hot cues 1 to 8 are cue points
coloured per pad (set on the nearest beat, or jumped to), the loop is the
range (I and O, halved and doubled from its start), the pitch fader
scales the pretend clock, and Sync gives a deck the other’s tempo and
moves it by less than half a beat onto the other’s phase. Each deck keeps
its playhead in the middle (Follow::CENTRE) with its song locked to the
pointer (scrub_on_drag) and nudged while it plays (nudge_on_drag):
dragging the waveform moves it under the playhead, or nudges a playing
deck; the wheel steps by beats. A Transport with the play button only
plays and pauses it (timeline.toggle_play), beside the page’s Cue
(playing: back to the cue point and paused; paused: the cue point set on
the nearest beat). The deck’s keys
(1 to 8, Shift with them, [, ], S) are commands of the page bound on
the decks’ surface (Timeline::surface); J/K/L, I, O and Ctrl+L stay the
timeline’s.
The Video editor page is a minute at 25 frames per second: a titles
track, two video tracks and two audio tracks drawn by the tracks page’s
painter, and a pretend program monitor showing the frame of the topmost
video clip under the playhead (its source and source timecode) with the
title over it. Ctrl+K splits, Shift+Delete ripple deletes, I and O mark
the in and out points (their duration beside the monitor), J/K/L
shuttle; its buttons run the same edits through the timeline.*
commands, so each is one step of the history either way. Under the
monitor, a Transport row (start, step back, play backward, stop, play,
step forward, end, loop) runs the transport keys’ commands.
What comes next
What the DJ decks needed that the timeline does not give, worked around by the page:
- Locked tracks or clips:
scrub_on_draglocks the clips to the pointer, but the keys (Delete, Ctrl+K) still edit a deck’s song; the page puts it back after each pass. - A main cue point: CUE is the page’s own (a time of the deck’s); the timeline has cue points as markers but no transport cue.
- Which timeline a surface key is for: a command bound on a surface two timelines share is not told which one has the focus; the page remembers the deck whose timeline had it last.
- An application’s data on a marker: a hot cue’s pad lives in its label; a marker has no field of the application’s (a slot, a type).
- An application’s own edits as steps: changing
TimelineStatedirectly is not a step of the history; only the widget’s gestures and thetimeline.*commands are (the decks keep no history, as DJ software does not).
What the video editor lacks (not worked around: its edits stay simpler than an editor’s):
- Linked clips: a shot’s video and its sound are separate clips; selecting, moving, trimming or ripple deleting one leaves the other (Ctrl+K without a selection splits both, as it splits every clip at the playhead).
- Track targeting and locks: no track header to choose the tracks a split or an edit acts on, nor to lock, mute or hide one.
- Three-point editing: the in and out points are only a range; there is no source monitor nor insert and overwrite edits into them.
- Ripple, roll, slip and slide trims, and ripple delete of a gap (a gap cannot be selected).
Not in the timeline yet: drop-frame timecode, tempo changes along a
track, a range’s edges dragged directly (Shift+drag draws a new one);
for clips, roll edits, overwriting
a clip by dropping another on it (a drop lands beside it instead), a
rubber band selection, track headers (the output’s tracks rows leave
room for the application’s), and adding or removing tracks by agents.
Thumbnails
The contract of the family “Thumbnails” (ADR 0027): a thumbnail from an image the application supplies, and a virtualised grid of them.
| Module | What it does |
|---|---|
egui_pop_core::thumbnail | Thumbnail, thumbnail_grid and ThumbnailGrid, fitted, caption_height |
egui_pop_viewport::thumbnail | The same items, re-exported for the image tools |
The drawing lives in egui-pop-core so that both the image tools and
the application API’s file picker (egui_pop_api::files) draw them
(ADR 0001); the viewport crate only re-exports it. The photo library’s
grid and filmstrip (The photo library) are a view over
the application’s catalogue, built on their own; this page is the
plain widget.
Owns: a thumbnail’s drawing (the image fitted, a placeholder colour until it is there, a sign, a caption, the selection), and a grid that builds only the rows in view.
Refuses: generating thumbnails from files (the application or the
platform services’ thumbnails do); a spinner per thumbnail; a
catalogue’s storage.
The API
use egui_pop_core::thumbnail::{Thumbnail, ThumbnailGrid};
fn ui(ui: &mut egui::Ui, selected: &mut usize, reveal: Option<usize>) {
ThumbnailGrid::new(10_000, egui::vec2(96.0, 72.0))
.id_salt("results")
.reveal(reveal)
.show(ui, |ui, i| {
let r = ui.add(
Thumbnail::new(format!("Image {i}"))
.placeholder(egui::Color32::from_gray(90))
.caption(format!("IMG_{i:04}.jpg"))
.selected(i == *selected),
);
if r.clicked() {
*selected = i;
}
});
}
Thumbnail::new(label):image(texture, [w, h])(drawn fitted, keeping its aspect),placeholder(colour)(the image’s average, shown until the image is there),icon(a sign for what has no image: a folder, a broken file),caption(cut to the width),selected,size(default: the grid cell, or 96 × 72).thumbnail_grid(ui, count, cell, item)isThumbnailGrid::new(count, cell).show(ui, item).ThumbnailGrid::showreturns the number of columns;max_heightbounds it,revealscrolls by the least that shows a cell (one not drawn yet included),id_salttells two grids’ scrolling apart in oneUi.fitted(outer, [w, h]): the largest rectangle of that aspect insideouter, centred;caption_height(ui): the room a caption takes.
States and failure
- No image: the placeholder colour, the sign over it if any. There is no loading state of its own: the application gives the image when it has it.
- An image of a different aspect than the cell is letterboxed, never stretched; a caption and a sign stay inside the thumbnail.
- The grid’s rows stay where they are as it scrolls; at its end the grid keeps the wheel, so the page around it does not scroll on.
Accessibility
A thumbnail is a selectable button named by its label (give a label even when the caption is hidden). The grid is a scroll area; keyboard moves between cells are the caller’s (the photo library has its own keymap).
Tier
From API stability: Experimental (“Thumbnails and
their grid (egui_pop_core::thumbnail, re-exported by
egui_pop_viewport::thumbnail), with the photo library”).
Tests
crates/egui-pop-viewport/tests/images.rs: a thumbnail named, selectable and clicked; only the rows in view built; a cell not drawn brought into view and the columns said; rows steady while scrolling; caption and sign inside; aspect kept.crates/egui-pop-core/tests/wheel.rs: the grid keeps the wheel at its end.- The file picker’s thumbnails:
crates/egui-pop-api/tests/it/files.rs.
The photo library
egui_pop::views::library (crate egui-pop-views) holds the widgets of
a photo library, the kind of view used to import, cull and sort images:
- a thumbnail grid, virtualised (a hundred thousand images cost what a screenful does), and a filmstrip, the same view in one row, sharing the grid’s selection;
- ratings (0 to 5 stars), colour labels and pick or reject flags, drawn over the thumbnails and edited with the mouse, the keys of a culling keymap (Lightroom’s), or their own widgets;
- stacks, collapsed to their top image with a count, or expanded;
- a comparison of one to many images (a loupe, a survey), zoom and pan synced, images dragged in and out;
- tag chips and a tag input completing from the application’s tags;
- a search field with filter chips, giving the application a structured filter.
The application owns its images, their marks, their tags and the filtering. The widgets show what the application gives them and say what the user asked for, in their output and as steps (ADR 0011) a plugin may veto, redirect or follow. Agents drive them through commands.
The gallery’s library page shows all of it on 10 000 synthetic
images.
The grid and the filmstrip
The application implements two traits:
use egui_pop::views::library::{Badge, LibraryItems, Marks, Stack, Thumb, ThumbSource};
struct Shoot { /* the application's images */ }
impl LibraryItems<u64> for Shoot {
fn len(&self) -> usize { todo!() }
fn key(&self, index: usize) -> u64 { todo!() } // the selection is kept by key
fn label(&self, index: usize) -> String { todo!() } // accessible name and caption
fn marks(&self, index: usize) -> Marks { todo!() } // rating, labels, flag
fn stack(&self, index: usize) -> Option<Stack<u64>> { None }
fn badges(&self, index: usize) -> Vec<Badge> { Vec::new() }
fn revision(&self) -> u64 { 0 } // changes when stacks change at the same count
}
struct Thumbs { /* a cache, a loader thread */ }
impl ThumbSource<u64> for Thumbs {
fn thumb(&self, key: &u64, size: u32) -> Thumb {
// Ready { texture, size }, or Pending { average } while it loads
// (and start loading it), or Failed.
todo!()
}
fn wanted(&self, keys: &[u64], size: u32) {
// The images in view this pass: load these first.
}
}
An application that already feeds the file browser’s thumbnails
(files::browser::ThumbnailProvider) needs no second source: wrap it
for the frame with library::thumbs::ProviderThumbs, saying which file
each key is. It begins the provider’s frame when made and ends it when
dropped, so draw the views between the two:
use egui_pop::views::library::thumbs::ProviderThumbs;
let thumbs = ProviderThumbs::begin(ui.ctx(), provider, |key: &u64| shoot.entry(*key));
grid.show(ui, state, &shoot, &thumbs);
drop(thumbs);
Only the cells in view are built: LibraryItems is asked about those
alone, and ThumbSource::thumb too. A thumbnail not there yet is drawn
as a placeholder: the image’s average colour when the source knows it
(Pending { average: Some(..) }, from an embedded preview, a thumbhash
or a cache), else a skeleton block, never a spinner. The source loads
asynchronously and asks egui for a repaint when a thumbnail arrives.
When the application knows how many images a query gives before its
rows arrive, ThumbGrid::expected_len(total) lays out that many cells
at once, so the scroll bar and the layout are final and nothing moves
as rows come in. The cells the items still lack are pending cells,
after the real ones: a skeleton, said as “Loading image N of M”. They
are not items: no selection, focus, Enter, drag or signal, Ctrl+A and
the rubber band leave them out, and the keyboard stops at the last
real image. Each arriving image takes the next pending cell; items as
many as expected, or more, leave none.
use egui_pop::views::library::{CullKeymap, LibraryState, Signal, ThumbGrid};
fn ui(ui: &mut egui::Ui, app: &egui_pop::api::AppHandle, state: &mut LibraryState<u64>,
shoot: &Shoot, thumbs: &Thumbs) {
let keymap = CullKeymap::lightroom().auto_advance(true);
let grid = ThumbGrid::new("grid").app(app).keymap(keymap.clone()).height(400.0)
.show(ui, state, shoot, thumbs);
let strip = ThumbGrid::filmstrip("strip").app(app).keymap(keymap).height(96.0)
.show(ui, state, shoot, thumbs);
for signal in grid.signals.into_iter().chain(strip.signals) {
match signal {
Signal::Rate { keys, rating } => { /* rate them */ }
Signal::Label { keys, label, on } => { /* label them */ }
Signal::Flag { keys, flag } => { /* flag them */ }
_ => {}
}
}
}
LibraryState::new("shoot") names the library in steps and commands;
the grid and the filmstrip drawn over the same state share its
selection, its stacks and the cursor. The state also keeps the
thumbnails’ size (size, set_size).
Keys and pointer
The view takes the keyboard focus as a whole (a click on a cell gives it). Its keys, read after the key dispatcher (a key the application binds to a command never reaches it):
| Keys | Grid | Filmstrip |
|---|---|---|
| Left, Right | the previous, the next image | the same |
| Up, Down | the row above, below (same column) | nothing |
| Page Up, Page Down | a screenful of rows | a screenful of cells |
| Home, End | the first, the last image | the same |
| Shift with a move | extends the selection from the anchor | the same |
| Ctrl with a move | moves the cursor alone | the same |
| Space, Ctrl+Space | selects the cursor’s image, toggles it | the same |
| Ctrl+A | selects every image shown | the same |
| Enter (a double click) | Activate the cursor’s image | the same |
| Ctrl and the wheel, + and - | the thumbnails’ size | nothing |
The pointer: a click selects, Shift extends a range, Ctrl toggles; a drag across the cells draws a rubber band selecting what it touches (with Ctrl or Shift held at its start, added to the selection). A cell’s stars rate it (the star of its rating clears it; under the pointer they preview the value a click gives, Rating stars) and its stack chip expands or collapses the stack. Marks made on a selected cell apply to the whole selection.
The culling keymap
CullKeymap::lightroom() binds Lightroom Classic’s culling keys (also
Capture One’s for ratings):
| Keys | Action |
|---|---|
| 0 to 5 | the rating (0 clears it) |
| P, X, U | pick, reject, unflag |
| 6, 7, 8, 9 | toggle red, yellow, green, blue (purple has no key) |
| S | expand or collapse the stack under the cursor |
| +, -, = | larger, smaller thumbnails |
auto_advance(true) moves the cursor to the next image after a rating,
a flag or a label (Lightroom’s Caps Lock mode). bind(key, action)
changes one binding and CullKeymap::none() has none. A mark applies to
the selection, else to the cursor’s image.
These are view keys, like the arrows: they do not appear in the
shortcut editor. An application wanting them rebindable there declares
its own commands and runs library.rate and the other steps through
change.
Overlays and stacks
Over each thumbnail (from 64 points up): the flag (a pennant, or a
cross, the image dimmed when rejected) in the top left corner, the
labels in the top right one, the stars in the bottom left one (empty
stars as outlines under the pointer, or on every cell with
ThumbGrid::empty_stars(EmptyStars::Always)), the badges (a short text, Badge::new("RAW"), or an icon
of the registry, Badge::icon("phosphor:plugs", "offline"), toned with
Tone) in the bottom right one, drawn as indicators the way the file
browser draws its marks (MarkChip::from(badge) gives the browser’s
chip; agents read them as library.badge:<image>:<text>, an icon badge
by its name). A cell’s accessible name says its badges after the image’s
name (IMG_0001.CR3 · offline); Badge::named names a terse text. Colour labels are same-shape
swatches, as in Lightroom and darktable; LabelStyle::Shape gives them
a shape each (circle, triangle, square, diamond, hexagon), so they
never read by colour alone, for colour-blind users. The application’s
choice (LabelStyle::set(ctx, Some(LabelStyle::Shape)), from a setting
say) wins over the theme’s (library.label-style: swatch or
shape); the marks bar and the grid’s badges both follow it.
A stack’s members follow their top image in the application’s order,
each saying Stack { top, count }. Collapsed, the top image shows with
its count and a chevron; expanded, the members follow it with a bar on
their left. library.stack expands or collapses one (the chevron, S, a
command); LibraryState::set_expanded does it without a step.
Colours
The stars are the kit’s rating-star (Rating stars).
The other marks’ colours come from the theme, through optional component
tokens falling back on system ones: library.pick (text.strong), library.reject (status.danger),
library.label-red, -yellow, -green, -blue (the status colours)
and -purple, library.band. LibraryTokens::of(ctx) reads them.
The boxes they sit on are the kit’s (docs/kit.md): thumb-cell,
thumb-layer (a rejected image’s veil, a stack member’s bar),
thumb-overlay-badge, pill (badges by tone), tag-chip,
mark-toggle, search-field and compare-pane.
The library grid in a file browser
LibraryGridMode (in library::mode, with the api feature) is the
grid as one of a FileBrowser’s view modes: a folder shown the way the
Library shows photos. It lays the entries out as the browser’s
thumbnails mode does, so the zoom (a count per row), the rubber band,
the arrows, Page Up and Page Down, Home and End, Enter and quick look
behave the same. Over each file’s cell it draws the overlays above: the
flag, the labels, the stars and a rejected image dimmed. A screen reader
hears the marks as the cell’s description (“Rated 4 of 5, Pick, Red”).
let signals = LibrarySignals::default();
let modes = ViewModes::built_in();
LibraryGridMode::new(move |entry| marks_of(&entry.path))
.keymap(CullKeymap::lightroom().auto_advance(true))
.signals(signals.clone())
.register(&modes)?;
let browser = FileBrowser::new("photos", source, folder).with_modes(modes);
// Each frame, after drawing the browser:
for signal in signals.drain() { apply(signal) } // Rate, Flag, Label by path
The application owns the marks: new takes what gives each entry’s
Marks. The culling keys (0 to 5, P, X, U, 6 to 9) act on the
selection, else on the focused entry, and the browser does not type
them ahead. They do not change the marks. They give Signal<PathBuf>
(Rate, Flag, Label) into the LibrarySignals queue, and the
application applies them. With auto-advance, the focus then moves on to
the next file.
The mode draws over the browser’s own cell, so the browser’s badges,
chips and groups stay. A grouping (FileBrowser::with_grouping) stands
for stacks: a RAW with its JPEG is one entry with its members’ chip.
What it leaves to ThumbGrid: expanding a stack, clicking a cell’s
stars, the stack and zoom keys (S, + and -: the browser has its own
zoom), and running the marks as library.* steps an application can
veto. An application that needs those draws a ThumbGrid.
Marks outside the grid
RatingStars, ColorLabels and FlagToggle edit one image’s marks
(a metadata panel, a loupe): each takes the current value and returns
the one asked for in changed. Focused, the stars take 0 to 5, the
arrows, Home and End; each label and flag is a toggle button, named
for assistive technologies, its tooltip saying what it is (“Red
label”, “Pick”). keys(&keymap) adds the key a CullKeymap binds to
it (“Red label (6)”, “Pick (P)”); tooltip(label, text) puts the
application’s own text instead (its own commands’ keys, say). The
stars are the shared egui_pop::core::rating::RatingStars
(Rating stars), as on the cells.
To run such a change through the library’s steps (so hooks see it as
they see the grid’s), call change:
use egui_pop::views::library::{Change, Signal, change};
let signal = change(Some(app), "shoot", Change::Rate { keys: vec![12], rating: 4 });
if let Signal::Rate { keys, rating } = signal { /* apply */ }
Tags
TagChip::new("beach").removable(true).show(ui) draws a chip and says
whether its remove button was clicked. TagInput shows the tags as
removable chips and a field: Enter, a comma or Tab adds a tag, Up and
Down move in the completions, Backspace in the empty field removes the
last tag. Completions come from a TagSource (a Vec<String> is one,
matching fuzzily); the output’s added and removed say what changed.
Search and filter chips
SearchField::new("shoot").app(app).show(ui, &mut search) returns the
filter whenever it changes, as a Filter:
pub struct Filter {
pub text: String, // words, in the name or a tag
pub min_rating: Option<u8>, // at least this many stars
pub labels: Vec<ColorLabel>, // one of these labels
pub flags: Vec<Flag>, // one of these flags
pub tags: Vec<String>, // all of these tags
pub from: Option<String>, // YYYY-MM-DD, included
pub to: Option<String>,
}
Criteria typed in the field (rating>=3 or rating:3, label:red,
flag:pick, tag:beach or #beach, date:2024-06-01..2024-06-30,
from:…, to:…) filter as they are typed and become chips on Enter;
the + menu adds a rating, a label or a flag; each chip has its remove
button, and the clear button removes everything (the + button, the
clear button and each chip’s remove button show their name as a
tooltip). Filter::matches
does the usual matching on a Candidate (name, marks, tags, date);
Filter::parse, chips and remove are there for the application’s
own fields.
The comparison
CompareView::new("compare").synced(true).best(best).active(active).show(ui, &mut state, &panes, &thumbs) shows the Panes the application lists:
one is a loupe filling the surface, two to four sit side by side (four
in a square), more tile in the grid that shows them the largest (six in
three columns), up to max_panes (four by default, PANE_LIMIT at
most). Each pane is an image canvas with the image viewport’s own
gestures (egui_pop_core::pointer::view, one implementation for both):
the wheel, a scroll and a pinch zoom or pan as the pointer profile says,
a drag pans (any drag with Space held), a click and a double click run
the profile’s view action (Intent::Leave for darktable’s double
click), and +, -, 0, 1 and 2 zoom the active pane. The zoom
counts physical pixels per image pixel against Pane::size (by default
the thumbnail’s); synced, every pane shows the same View, its centre
at the same place of each photo. Each pane has a
“best” toggle; the output’s best is the image the user marked, and the
application says which one is (best) and which one is active
(active, outlined).
The application owns the list; the surface says what the user asked, in
the output’s intents: Intent::Active (a click, the arrows, Home and
End), Intent::Remove (with removable(true): each pane’s close
button, Delete or Backspace on the active one), Intent::Add,
Intent::Move and Intent::Leave. With carry(kind, pack, unpack),
the surface is a target of the application’s drag session
(egui_pop_api::bus::drag),
in any of its windows: a payload unpack reads images from, let go on
it, gives Intent::Add with the place shown by a bar while over it; a
pane’s name drags its image out as pack makes it, let go over nothing
it gives Intent::Remove, let go on the surface Intent::Move. Keep
the state’s per-pane views with the list through CompareState::removed,
inserted and moved. The output’s panes says where each pane was
drawn (compare::layout gives the same places).
Steps
LibraryPlugin declares them; connect it when the views run with an
application (.app(app)). Each runs from the grid, the filmstrip, the
search field, change, or a command.
| Step | Arguments | Default |
|---|---|---|
library.select | library, keys, cursor | sets the selection |
library.rate | library, keys, rating | reports it: the application rates its images |
library.label | library, keys, label, on | reports it |
library.flag | library, keys, flag (pick, reject, none) | reports it |
library.tag | library, keys, add, remove | reports it |
library.stack | library, stack (the top image’s key), expanded | expands or collapses the stack |
library.filter | library, filter | sets the search field’s filter |
A before-hook vetoes a mark (the view’s output then holds
Signal::Vetoed) or redirects it (Redirect with other arguments: a
rating capped, other keys); the signal carries what ran. An after-hook
follows them, for example to write the marks to the application’s
catalogue.
ctx.before(egui_pop::views::library::plugin::LIBRARY_FLAG, |_, args| {
if args["flag"] == "reject" && read_only() {
Before::Veto("this collection is read-only".into())
} else {
Before::Go
}
});
Commands (agents)
Each acts on library (else the library that last had the focus) and
on keys (else its selection), and queues its step for the view, which
runs it at its next pass as if the user had asked:
| Command | Arguments |
|---|---|
library.select | keys, cursor |
library.rate | rating (0 to 5) |
library.label | label, on (else toggled from the cursor’s image) |
library.flag | flag |
library.tag | add, remove |
library.filter | filter ({} clears it) |
The debug bridge’s libraries collector lists the libraries drawn,
their count, selection, cursor, filter and waiting requests.
What was checked (2026-10-13)
| Crate | Version, licence | What it has | Decision |
|---|---|---|---|
| egui_virtual_list | 0.12.0, MIT, egui 0.36 | A list of items of varying height, measured as they are drawn and cached; a row may hold several items (a custom layout); no scrolling to an item, no keys, hides itself while resizing | Own the grid: its cells are all the same size, so the cells in view, a row’s position and the cursor’s are arithmetic, and End reaches the hundred-thousandth image at once without measuring the rows before it. egui_virtual_list stays the candidate for lists of rows of varying height (a history, a log) |
| egui_extras | 0.36.2, MIT OR Apache-2.0 | TableBuilder, StripBuilder, image loaders, a date picker | Skip: nothing for a grid of thumbnails; its image loaders are the application’s business (the grid takes textures from a ThumbSource) |
egui ScrollArea::show_viewport | egui 0.36, MIT OR Apache-2.0 | The visible part of a scrolled area | Used: the grid lays its cells out in it and builds those in view, as the list and the tree do |
No code was taken from either crate.
Gaps
- The culling keys are the view’s own (rebinding them is
CullKeymap::bind); they are not commands in the shortcut editor. - No drag and drop of images out of the grid (to a collection, to reorder); a drag draws the rubber band.
- The rubber band does not scroll the grid when it reaches an edge.
- The comparison draws the thumbnail it is given, whatever the zoom: the application gives larger ones for it.
- Stacks are one level deep, and their members must follow their top image in the application’s order.
Rating stars
A rating is zero to five stars. egui-pop draws every rating with one
widget, egui_pop::core::rating::RatingStars: a thumbnail’s overlay in
the library grid, the library’s marks panel
(views::library::marks::RatingStars, the same widget returning a
MarkResponse), a table’s column, the file dialog’s preview. This page
is the short study its behaviour comes from, then what egui-pop does
and how a kit restyles it.
How photo applications rate (2026-11-06)
Read from each application’s manual and support pages; the applications were not run for this study.
| Lightroom Classic | darktable | digiKam | Adobe Bridge | Apple Photos | |
|---|---|---|---|---|---|
| Unrated item | Five dots under the thumbnail; with “show clickable items on mouse over only”, under the pointer alone | The overlay’s stars show as outlines, always or on hover (the overlay setting) | Outline stars under the thumbnail, under the pointer | Five dots under a selected thumbnail, hidden in small thumbnails | No stars: a favourite (a heart) only |
| Under the pointer | The stars a click gives | The stars up to the pointer light | The stars up to the pointer light | The dots and stars, clickable | The heart, clickable |
| Setting | A click on the n-th star or dot | A click on the n-th star | A click on the n-th star | A click on the n-th dot | A click toggles the favourite |
| Clearing | A click on the star of the current rating (on a five-star photo, the fifth) | A click on the first star of a one-star image (the preference “rating an image one star twice will not zero out the rating” turns it off) | No click: the keys | The “no rating” icon left of the stars, or a filled star of a selected thumbnail | The same click, a toggle |
| Keys | 0 to 5 (0 clears), [ and ] step | 0 to 5, R rejects | Ctrl+0 to Ctrl+5 | Ctrl+0 to Ctrl+5 (0 clears) | . toggles the favourite |
| Read-only | The metadata panel, the list of a collection | The image information panel | The properties sidebar | The metadata panel | The heart badge on favourites |
What they share:
- An unrated item shows where its rating goes, as dots or outlines, at least under the pointer. digiKam’s bug tracker records the complaint the other way round: a blank area under a thumbnail that rates on a click is an accident waiting.
- The pointer previews: the stars up to it light before the click.
- A click on the current value clears it, in Lightroom without exception, in darktable for one star; Bridge and the keys give another way (an icon, the 0 key).
- The keys are 0 to 5, with or without Ctrl; 0 clears.
- The click area is the stars, not the row around them (digiKam narrowed it after accidental ratings).
Sources: Adobe’s “Flag, label, and rate photos” (Lightroom Classic) and “Label and rate files” (Bridge), darktable’s user manual (“star ratings & color labels”), digiKam’s bug tracker (bugs 192425, 228810, 238232), Apple’s Photos for Mac guide.
What egui-pop does
The recommendation, built:
- Empty stars are faint outlines (
EmptyStars):Alwaysin a panel, a row or a cell with room for them (the default),OnHoverover a thumbnail, where they show while the cell or the stars are under the pointer. The grid’s default isOnHover;ThumbGrid::empty_stars(EmptyStars::Always)shows them on every cell (the gallery’s “Empty stars on every cell”). - Under the pointer the stars up to it light in the preview look, the rest stay outlines; the outlines never go while the pointer is on the stars, gaps included. The star under the pointer is read from its position across the row, so the preview never flickers between two stars.
- Changing a value: over a lower star, the preview shows the smaller value and the current one stays as a ghost (3 stars, the pointer on the first: one star lit, two ghosts, two outlines).
- Clearing: a click on the star of the current value clears the rating (Lightroom’s rule); its preview is the current value all in ghosts. Each star’s tooltip, and its accessible name, says what a click does: “Set 2 of 5”, or “Clear rating” on the current star.
- Keys: a focusable rating takes 0 to 5 (0 clears), the arrows
step it, Home and End go to 0 and 5; it reads as a slider. A view with
its own keys turns focus off (
focusable(false)): the library grid rates with its culling keymap (Lightroom’s 0 to 5). - Read-only (
read_only(true), or a disabledUi): no preview, no click, no focus; the stars are drawn byrating-star-displayand read as “3 of 5”.
use egui_pop::core::rating::{EmptyStars, RatingStars};
use egui_pop::egui;
fn ui(ui: &mut egui::Ui, rating: &mut u8, hovered: bool, room: egui::Rect) {
// A panel: outlines always, focusable.
if let Some(r) = RatingStars::new(*rating).show(ui).changed {
*rating = r;
}
// A table's column: shown only.
let _ = RatingStars::new(*rating).read_only(true).size(14.0).show(ui);
// An overlay: laid out by the caller, outlines while its item is hovered.
let out = RatingStars::new(*rating)
.id(ui.id().with("stars"))
.focusable(false)
.empty(EmptyStars::OnHover)
.item_hovered(hovered)
.show_at(ui, room);
if let Some(r) = out.changed {
*rating = r;
}
}
RatingResponse holds the row’s response, the value asked for
(changed, never the current one), the value a click would give while
the pointer is on the stars (preview) and whether it is (hovered).
Not decided: whether the darktable pointer profile should clear only from one star, as darktable does. Pointer profiles do not touch the rating today, and Lightroom’s rule covers darktable’s case.
Kit components
The stars are the kit’s (docs/kit.md), drawn by the star handler
(the fill, then the outline, in a part one star wide):
| Look | rating-star | Default |
|---|---|---|
| Empty | rest: border-color, border-width | text.muted, 1 px, no fill |
| Given | selected: fill, border-color | warning |
| Preview | hover: fill, border-color | warning at 55 %, its outline full |
| Ghost | tone.muted.selected: fill, border-color | warning at 25 %, its outline at 60 % |
rating-star-display, a read-only rating’s star, is
based on rating-star: restyling
the rating restyles it too; its own empty outline is the quieter
border.strong. Every built-in theme takes these defaults from the
default kit; a kit package (Rerun-like, a flavour) restyles them with
data only, as the gallery’s library-kit snapshot does. The given star
and the empty outline are checked for contrast on the panel and the
raised surface (contrast::PAIRS, 3:1); the preview and the ghost are
lighter on purpose.
The library.star and library.star-empty tokens
(LibraryTokens) no longer colour the stars; library.star-empty
still colours the pick and reject toggles when off.
Text and code editors
egui-pop-editors (the facade’s editors feature, re-exported as
egui_pop::editors) has two editors over one state:
cargo add egui-pop --features editors
TextSurface: a multi-line text editor in the theme’s body font;CodeEditor: the same surface for code, with a gutter, highlighting, folding and code assist;EditorState: the text, the selection, the history, the marks, the search, as a handle the application, the widget and the commands an agent runs share.Terminal: a terminal over aTerminalState, fed by a program in a pseudo-terminal or by a read-only console of logs.
Both are virtualised (only the lines in view are laid out: 100 000
lines cost a screenful), take their colours from the theme
(editor.*, syntax.* tokens), behave as text inputs for egui-pop’s
focus rules, and run every edit as a step
(ADR 0011).
Survey: adopt, wrap or own
Checked on 2026-10-13 against egui 0.36.
| Crate | Licence | What it is | Decision |
|---|---|---|---|
egui_extras::syntax_highlighting | MIT OR Apache-2.0 | Highlights a whole text into one LayoutJob (syntect or a tiny built-in highlighter), cached by the text’s hash | Not used: every edit lays out and highlights the whole text again; no incremental state, no tokens |
egui_code_editor 0.4 | MIT | A code editor on egui::TextEdit: line numbers, a keyword-list highlighter, completion | Not used: one galley for the whole text (no virtualisation), no gutter markers, no folding, its own colours; reference for its API only |
syntect 5.3 | MIT | Sublime Text grammars and their bundled syntaxes; a line-by-line parser with a state per line | Wrapped as the default highlighter, with the regex-fancy engine (pure Rust: the gallery builds for the web); its scopes map to egui-pop’s token kinds, never to its themes |
tree-sitter / tree-sitter-highlight 0.27 | MIT | Incremental parsers (grammars in C) and highlight queries | Wrapped behind the tree-sitter feature (off: it compiles C, and the application brings the grammar crate) |
ropey 2 (beta) | MIT OR Apache-2.0 | A rope | Not used: a vector of lines is enough for the sizes targeted (an edit touches the lines it changes) and keeps line access trivial |
egui_term 0.1 | MIT | A terminal widget for egui over alacritty_terminal, with its own PTY backend | Not used: one release, pinned to egui 0.31 (egui-pop is on 0.36), its own colour scheme rather than tokens, no source trait (the PTY is the only backend), no steps; reference for its key bindings only |
alacritty_terminal 0.26 | Apache-2.0 | Alacritty’s emulator: grid, scrollback, selection, search, its own PTY and event loop | Not used: its PTY layer and event loop (polling, signal-hook, rustix) come along and do not build for the web, where the gallery and a log console must run; more than the widget needs |
vt100 0.16 | MIT (its parser vte: Apache-2.0 OR MIT) | A parser and a screen: cells with colours and attributes, scrollback, the modes programs set (application cursor, bracketed paste, alternate screen, mouse) | Wrapped as the emulator: pure Rust, builds for the web; selection, links, drawing and keys are egui-pop’s |
portable-pty 0.9 | MIT | WezTerm’s pseudo-terminals: Unix PTYs and Windows ConPTY, spawn, resize | Wrapped as PtySource, behind the pty feature (editors-pty on the facade): not for the web |
For the terminal, egui-pop owns the widget (drawing from tokens,
key routing and encoding, selection, links, steps) and the source
trait, and wraps vt100 and portable-pty.
So egui-pop owns the editing surface (input, selection, drawing,
gutter, folding, search) and wraps the highlighters behind its own
Highlighter trait. regex (MIT OR Apache-2.0) does search and replace.
The state
use egui_pop::editors::EditorState;
use egui_pop::editors::buffer::Pos;
use egui_pop::editors::selection::Selection;
let notes = EditorState::new("notes", "Shopping\n- bread");
notes.set_selection(Selection::caret(Pos::new(1, 7)));
notes
.insert(None, "\n- milk", egui_pop::editors::history::EditKind::Paste, "user")
.unwrap();
assert_eq!(notes.text(), "Shopping\n- bread\n- milk");
assert!(notes.is_dirty());
notes.undo(None, "user").unwrap();
assert_eq!(notes.line_count(), 2);
A position is a line and a column counted in characters, from 0. A
Change replaces the text between two positions; a list of changes is
applied in order, as one undo step. EditorState::load replaces the text
without a step or a history entry (a file opened); mark_saved says the
text is clean.
The text surface
use egui_pop::editors::{EditorState, Signal, TextSurface};
fn ui(ui: &mut egui_pop::egui::Ui, app: &egui_pop::api::AppHandle, notes: &EditorState) {
let out = TextSurface::new().label("Notes").app(app).status(true).show(ui, notes);
for s in out.signals {
if let Signal::Changed { version, .. } = s {
let _ = version;
}
}
}
| Key | What it does |
|---|---|
| Letters, Enter, Tab, Backspace, Delete (Ctrl: a word) | Edit; Tab indents (several lines selected: each), Shift+Tab outdents |
| Arrows (Ctrl or Alt: a word), Home (the indentation, then the line’s start), End, Page Up, Page Down, Ctrl+Home, Ctrl+End | Move; with Shift, select |
| Ctrl+A, Ctrl+C, Ctrl+X, Ctrl+V | Select all; copy, cut (the line when nothing is selected), paste |
| Ctrl+Z, Ctrl+Shift+Z, Ctrl+Y | Undo, redo the editor’s own history |
| Ctrl+F, Ctrl+H, F3, Shift+F3, Ctrl+G, Ctrl+S | Find, replace, next and previous match, go to line, save (commands, see below) |
| Escape | Leaves the editor (then Tab moves on); first closes a popup |
The pointer places the cursor, selects by dragging, selects a word with a double click and a line with a triple click.
Focus. The editor is a text input for egui and egui-pop: keys that
type stay with it while it has the focus (textInputFocus), the first
Escape leaves it (the focus stays in its surface), and it draws inside
the editor focus scope (editorFocus, editorKind = text or
code).
Keymap scopes. Its shortcuts are commands bound on the editor
surface, so a binding there wins over a global one while an editor has
the focus (Ctrl+S saves the editor, not the application), and the user
rebinds them in the shortcuts editor. An editor shown without an
application handles the same keys itself.
Undo. The application’s histories are its kernel’s
(Host::history, ADR 0014); the editor keeps its own history:
typing coalesces until a pause, a space or a move; every other edit is
one entry. Ctrl+Z in a focused editor undoes it (as in any text input,
the application’s edit.undo is !textInputFocus); each undo and redo
reaches the application as an edit.change with kind undo or
redo. An application wanting one history calls EditorState::undo
from its own History owner.
Search and replace. Ctrl+F opens the bar above the text (the
selection becomes the query), Ctrl+H with the replacement field: match
case, whole word, regular expression ($1 in the replacement), the
current match among all, Enter for the next one, Shift+Enter for the
previous, Replace and Replace all (one undo step). A match never spans a
line break. Ctrl+G opens a go-to-line field.
The code editor
use egui_pop::editors::markers::{Diagnostic, Diff, Severity};
use egui_pop::editors::{CodeEditor, EditorState};
let code = EditorState::new("main.rs", "fn main() {\n let x = 1;\n}").language("rs");
code.set_diagnostics(
None,
vec![Diagnostic::new(1, Severity::Warning, "unused variable `x`").columns(8, 9).source("rustc")],
)
.unwrap();
code.toggle_breakpoint(1);
code.set_diff(vec![(1, Diff::Modified)]);
assert_eq!(code.highlighter_name(), "syntect: Rust");
fn ui(ui: &mut egui_pop::egui::Ui, code: &EditorState) {
CodeEditor::new().label("main.rs").height(400.0).show(ui, code);
}
-
The gutter: breakpoints (a click sets or clears one; F9), line numbers (a click selects the line), diagnostics (the worst on the line, its message on hover; with columns, the text is underlined), fold arrows, and diff bars (added, modified, lines removed after). Marks follow the text: a line inserted above moves them, a deleted line drops them.
-
The cursor’s line is highlighted, the bracket at the cursor and its match are outlined, indentation guides are drawn at each level (a blank line takes the next line’s).
-
Folding by indentation: a line folds the lines under it indented further (Ctrl+Shift+[ folds the block at the cursor, Ctrl+Shift+] unfolds, a click on the arrow toggles, a click on the
⋯after a folded line opens it). The cursor never hides in a fold. -
Highlighting through a
Highlighter:use egui_pop::editors::highlight::{Highlighter, Kind, Run, Runs}; use egui_pop::editors::buffer::Buffer; /// Colours every line that starts with `#` as a comment. struct Hashes; impl Highlighter for Hashes { fn name(&self) -> String { "hashes".into() } fn edited(&mut self, _line: usize) {} fn highlight(&mut self, buffer: &Buffer, lines: std::ops::Range<usize>, _budget: usize) -> Vec<Option<Runs>> { lines .map(|i| { let l = buffer.line(i); let kind = if l.starts_with('#') { Kind::Comment } else { Kind::Plain }; Some(std::sync::Arc::from(vec![Run { bytes: 0..l.len(), kind }])) }) .collect() } } let state = egui_pop::editors::EditorState::new("config", "# a comment\nkey = 1") .highlighter(Box::new(Hashes)); assert_eq!(state.highlighter_name(), "hashes");A highlighter gives the lines in view their runs (byte ranges and a
Kind: keyword, string, number, comment, function, type…); the editor colours each kind from itssyntax.<kind>token. It is told from which line the text changed, and parses at mostbudgetlines a pass (CodeEditor::highlight_budget, 500 by default) to reach the lines in view: a jump to the end of a long file draws plain text for a few passes, never a frozen frame.EditorState::languagepicks syntect’s grammar by name, extension or file name (plain text when syntect knows none).TreeSitterHighlighter(featureeditors-tree-sitter) takes aHighlightConfigurationthe application builds from its grammar crate; it highlights the whole text again after a change.
Code assist
An AssistProvider (a language server client, an AI assistant, a word
list) answers requests modelled on the Language Server Protocol; every
method has a default answering nothing.
| Request | When | Surface |
|---|---|---|
complete | a word character typed (complete_while_typing), a trigger character (trigger_characters), Ctrl+Space | the completion list under the cursor, filtered as you type; Up, Down, Page Up, Page Down, Enter or Tab inserts, Escape closes |
hover | the pointer resting on code; Ctrl+K Ctrl+I | the hover card |
signature_help | a signature character typed ((, , by default) | the signature card above the cursor, the current parameter underlined; closed by ), Escape, or leaving the line |
code_actions | Ctrl+. | the actions list; Enter applies one (its changes as one undo step) |
definition | F12, Ctrl+click | the cursor goes there in this editor; elsewhere, Signal::Definition for the application to open |
inline_suggestion | after typing (suggests_inline) | ghost text after the cursor (its first line, … when there is more); Tab accepts, Escape or any other key dismisses |
Diagnostics are not requested: the application pushes them
(EditorState::set_diagnostics, the code.diagnostics step).
Every request is asynchronous: the provider gets a Request (its
RequestId, the editor’s state to read and its version, the position,
the trigger) and a Reply it answers now or later from any thread
(Reply::deliver wakes the interface). A newer request of the same kind
cancels the older one (Reply::is_cancelled, AssistProvider::cancel);
an answer for a text that moved on is dropped (completion keeps its
answer while the word is only being extended). A provider calls another
with assist::reply_here. A code editor with no provider completes with
the text’s words (WordCompletion); CodeEditor::assist(false) turns
assist off.
use egui_pop::editors::assist::{AssistProvider, CompletionItem, ItemKind, Reply, Request};
use egui_pop::editors::EditorState;
/// Completes colour names, answering from a thread as a server would.
struct Colours;
impl AssistProvider for Colours {
fn name(&self) -> String { "colours".into() }
fn complete(&mut self, _request: &Request, reply: Reply<Vec<CompletionItem>>) {
std::thread::spawn(move || {
reply.deliver(vec![
CompletionItem::new("crimson").kind(ItemKind::Constant).detail("#dc143c"),
CompletionItem::new("cyan").kind(ItemKind::Constant).detail("#00ffff"),
]);
});
}
}
let style = EditorState::new("style.css", "a { color: c }").language("css").assist(Box::new(Colours));
assert_eq!(style.assist_name().as_deref(), Some("colours"));
The completion list, the cards and ghost text are the editor’s own, drawn from the theme (overlay surface, strong border, the accent for the current parameter, muted italics for ghost text).
Steps, events and collectors
Connect EditorsPlugin and give the editor the application
(.app(&app)): its moments become steps, it registers for the
commands, and its keys go through the keymap.
| Step | Arguments | Default |
|---|---|---|
edit.change | editor, kind (typing, deletion, paste, cut, indentation, replace, completion, edit, undo, redo), origin, version, changes ([{from, to, text}]), selection | applies the changes |
edit.save | editor, version, lines, language, origin | nothing to write; once the step succeeds the text is clean |
code.diagnostics | editor, version, diagnostics | replaces the diagnostics |
code.insert_completion | editor, item, from, to, text | replaces from..to with text (an edit.change) |
code.accept_suggestion | editor, at, text | inserts the ghost text (an edit.change) |
A before-hook on edit.change refuses an edit (a read-only region) or
rewrites it; the application writes the file in a run-hook (or an
after-hook) of edit.save:
use egui_pop::prelude::*;
use egui_pop::editors::EditorsPlugin;
use egui_pop::editors::steps::{EDIT_CHANGE, EDIT_SAVE};
struct Files;
impl Plugin for Files {
fn id(&self) -> PluginId {
PluginId::from_static("files_demo")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
// The licence header (line 0) stays as it is.
ctx.before(EDIT_CHANGE, |_, args| {
let touches_header = args["changes"]
.as_array()
.is_some_and(|c| c.iter().any(|c| c["from"]["line"] == 0));
if touches_header { Before::Veto("the header is generated".into()) } else { Before::Go }
});
ctx.replace(EDIT_SAVE, |_, args| {
// Write the editor's text (EditorState::text) where it belongs.
Ok(serde_json::json!({ "written": args["editor"] }))
});
Ok(())
}
}
let app = App::builder()
.plugin(EditorsPlugin)
.plugin(Files)
.build(&egui_pop::egui::Context::default())
.unwrap();
let state = egui_pop::editors::EditorState::new("lib.rs", "// header\nfn f() {}");
let refused = state.set_text(Some(app.handle()), "", "user");
assert_eq!(refused, Err("the header is generated".into()));
state.save(Some(app.handle()), "user").unwrap();
assert!(!state.is_dirty());
Events on the journal, from code editors shown with an application:
code.cursor_moved (editor, line, col), code.selection_changed
(editor, anchor, head), code.completion_requested (editor,
id, trigger, at) and code.completion_accepted (editor,
label, text); each change is the edit.change step’s own signal,
with its ranges.
Collectors on the debug bridge: edit_changes (the open editors, with
their lines, version, selection, highlighter, history, assist and
completion list, and the last changes), edit_saves (the last saves
and their results) and code_diagnostics (each editor’s diagnostics).
Driving an editor (agents)
The buffer is read and written through commands, offered to agents
(editor names one; without it, the editor that last had the focus):
| Command | Arguments | Result |
|---|---|---|
editor.read | editor, from_line, to_line | text, version, selection, dirty, lines… |
editor.write | editor, and text (all of it), or from, to, text, or changes | version (through edit.change: hooks apply) |
editor.select | editor, anchor, head | the selection |
editor.find | editor, query, case_sensitive, whole_word, regex | matches, current, the first matches |
editor.replace | editor, query, replacement, all | replaced |
editor.find_next, editor.find_previous, editor.goto_line, editor.save, editor.undo, editor.redo | editor (line from 1 for go to line) | |
code.fold, code.unfold, code.unfold_all, code.toggle_breakpoint | editor, line | |
code.set_diagnostics | editor, diagnostics | diagnostics (their count) |
code.complete, code.actions, code.definition, code.hover | editor | the request is made; its answer shows at a later pass |
use egui_pop::prelude::*;
use egui_pop::editors::EditorsPlugin;
use egui_pop::editors::steps::{CMD_READ, CMD_WRITE, EDITORS};
use egui_pop::model::commands::Origin;
let mut app = App::builder()
.plugin(EditorsPlugin)
.build(&egui_pop::egui::Context::default())
.unwrap();
// An editor registers itself when drawn with `.app(...)`; here by hand.
let notes = egui_pop::editors::EditorState::new("notes", "hello");
app.handle().service(&EDITORS).unwrap().attach(¬es);
let agent = || Origin::Agent("session-1".into());
app.run(&CMD_WRITE, serde_json::json!({ "editor": "notes", "from": { "line": 0, "col": 5 }, "text": " world" }), agent());
let read = app.run(&CMD_READ, serde_json::json!({ "editor": "notes" }), agent()).now().unwrap().unwrap();
assert_eq!(read["text"], "hello world");
The terminal
Terminal draws a TerminalState: an emulator (vt100’s screen, its
scrollback, the modes the program sets) fed by a TerminalSource the
application picks, and owns:
PtySource(featurepty,editors-ptyon the facade): a program in a pseudo-terminal, the user’s shell by default; ConPTY on Windows, not for the web. Dropping it, or closing the session, kills the program;Console: a read-only source the application writes to from any thread: build logs, a job’s output, an agent’s transcript (a later jobs console reuses it). What is written before a terminal starts it is kept and shown then; a lone\nbecomes\r\n;finishends it;- its own: a source starts (giving its output to a
Sink, from any thread), takes input, is resized and stopped. An application whose kernel runs programs elsewhere replacesterminal.spawnandterminal.input(below) and feeds the output withTerminalState::feed, the end withTerminalState::finished.
use egui_pop::editors::terminal::{Console, Terminal, TerminalState};
let log = Console::new();
log.line("\x1b[1;32mCompiling\x1b[0m demo v0.1.0");
let term = TerminalState::new("build-log", log.clone());
fn ui(ui: &mut egui_pop::egui::Ui, app: &egui_pop::api::AppHandle, term: &TerminalState) {
Terminal::new().label("Build log").app(app).height(240.0).show(ui, term);
}
// From any thread, while the build runs:
log.line("\x1b[1;33mwarning\x1b[0m: unused variable");
log.finish(Some(0));
let _ = term;
// Feature `editors-pty`: a shell, or a program.
use egui_pop::editors::terminal::{CommandLine, PtySource, TerminalState};
let shell = TerminalState::new("shell", PtySource::shell());
let tests = TerminalState::new(
"tests",
PtySource::new(CommandLine::new("cargo").arg("test").cwd("/path/to/project")),
);
Drawing. The 16 ANSI colours are the theme’s terminal.ansi.0 to
terminal.ansi.15 (0 the colour furthest from the text, 7 the text’s,
1 to 6 the status roles and the accent, a bold 0 to 7 their stronger
form); the 256-colour cube and RGB colours are the program’s own.
Bold, dim, italics, underline and inverse are drawn; the cursor is a
block while focused, an outline otherwise (none for a read-only source).
The terminal fills the width it is given and the height asked
(height), and tells the source its rows and columns as they change
(a PTY tells the program: SIGWINCH).
Scrollback. 10 000 lines by default (TerminalState::scrollback);
the wheel and Shift+Page Up, Shift+Page Down scroll back, typing comes
back to the screen. Output keeps the view where it is while scrolled
back.
Selection, copy and links. Dragging selects (a double click a word,
paths and addresses included; a triple click a line); Ctrl+Shift+C, or
Ctrl+C while something is selected, copies (soft-wrapped lines joined).
http://, https:// and file:// addresses are links: underlined
under the pointer, opened by Ctrl+click through the links service
(links) as content found in a program’s output: a web page
asks first while its host is not trusted, a file:// link is a
confirmed open (never a browser’s), a program is refused.
Keys and focus (decided 2026-10-13). A program in a terminal needs Escape (vi, less, readline) and Tab (completion), so the terminal does not follow the text inputs’ rule that Escape leaves:
| Key | Goes to |
|---|---|
| Every key, Escape and Tab included, Ctrl and Alt chords | the program, encoded as xterm does (application cursor mode honoured; Alt sends Escape first) |
| Shift+Escape | leaves the terminal: the focus stays in its surface (terminalFocus), as for a text input after Escape; then Tab moves on |
| Ctrl+Shift chords (but Ctrl+Shift+C), Command chords on macOS | the application’s keymap: a terminal cannot tell Ctrl+Shift+K from Ctrl+K, so nothing is lost. terminal.clear is bound to Ctrl+Shift+K on the terminal surface |
| Ctrl+C | copies when text is selected, else interrupts the program |
| Ctrl+Shift+C | copies the selection; with nothing selected, does nothing |
| Ctrl+V (Command+V on macOS), the Paste key; Shift+Insert on Windows only (egui-winit’s mapping) | pastes (bracketed when the program asked) |
| Shift+Page Up, Shift+Page Down | scroll back |
The keys are taken before the application’s key dispatcher reads them (an input hook), so global shortcuts do not fire while a terminal has the focus; the application’s own escape hatch is a Ctrl+Shift chord.
Steps, collectors and commands
Connect TerminalPlugin and give the terminal the application
(.app(&app)): its moments become steps, it registers for the
commands, and a program that ends runs terminal.exit even in a
terminal not drawn.
| Step | Arguments | Default |
|---|---|---|
terminal.spawn | terminal, source, command ({program, args, cwd, env} or null), rows, cols, origin | starts the source with command |
terminal.input | terminal, text, kind (keys, paste, agent), origin | writes text to the source |
terminal.exit | terminal, reason (exited: the program ended; close: asked), code, origin, notice, restart | close stops the source; both write notice dimmed, and start again when restart |
A before-hook on terminal.spawn refuses a program (the terminal shows
why) or redirects its command; on terminal.input it refuses input
or rewrites text; on terminal.exit it keeps a session open (close)
or, for exited, changes the notice or sets restart. A run-hook does
the step its own way (the application’s kernel runs the program).
use egui_pop::prelude::*;
use egui_pop::editors::TerminalPlugin;
use egui_pop::editors::terminal::steps::{TERMINAL_INPUT, TERMINAL_SPAWN};
struct Policy;
impl Plugin for Policy {
fn id(&self) -> PluginId {
PluginId::from_static("terminal_policy")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
// Shells only in the "dev" terminal.
ctx.before(TERMINAL_SPAWN, |_, args| {
if args["source"] == "pty" && args["terminal"] != "dev" {
Before::Veto("shells run in the dev terminal".into())
} else {
Before::Go
}
});
// An agent's commands are logged before they run.
ctx.after(TERMINAL_INPUT, |_, args, _| {
if args["kind"] == "agent" {
let _ = &args["text"];
}
});
Ok(())
}
}
let app = App::builder()
.plugin(TerminalPlugin)
.plugin(Policy)
.build(&egui_pop::egui::Context::default())
.unwrap();
let _ = app;
Collectors on the debug bridge: terminal_sessions (each terminal: its
source, size, session, cursor, scrollback, title, modes, and its last 20
lines) and terminal_io (the last runs of the three steps).
Driving a terminal (agents). terminal names one; without it, the
terminal that last had the focus:
| Command | Arguments | Result |
|---|---|---|
terminal.read | terminal, from_line, to_line (from 0, end excluded), or screen | text (scrollback then screen, one line per row), lines, cursor, rows, cols, running, exit_code… |
terminal.send | terminal, text, enter | bytes (through terminal.input, kind agent: hooks apply); not offered to agents unless the application offers it (below) |
terminal.clear | terminal | clears the screen and the scrollback (Ctrl+Shift+K) |
terminal.copy | terminal | copied: the selection, put on the clipboard |
terminal.close, terminal.restart | terminal | the state (through terminal.exit, terminal.spawn) |
The same from code: TerminalState::text, lines, screen_text,
send, clear, close, restart, describe.
Letting an agent type. terminal.send writes to the terminal’s
program as if typed: in a shell in a pseudo-terminal (the pty
feature), that is any command the user could run, with the user’s
rights, files and credentials, and no confirmation. So it is not offered
to agents (no_agent): an agent’s terminal.send is refused
(“not offered to agents”, command.refused on the journal), the user’s
(keys, the palette, code with Origin::User) works. An application
whose agent should type offers it, knowing that risk:
use egui_pop::prelude::*;
use egui_pop::editors::TerminalPlugin;
use egui_pop::editors::terminal::steps::CMD_SEND;
let app = App::builder()
.plugin(TerminalPlugin)
.offer_command_to_agents(CMD_SEND)
.build(&egui_pop::egui::Context::default())
.unwrap();
assert!(app.handle().commands().iter().any(|(c, _)| c.id == CMD_SEND && c.agent));
The input still goes through terminal.input with kind agent and
the agent’s origin: a before-hook there can narrow what an offered
agent may type (one terminal, a read-only console, an allowed list of
commands) or veto it.
The contract
The families “Text and code editors” and “Terminal” (ADR 0027).
Owns: the line buffer, selection and history, virtualised drawing, search and replace, markers, folding, a pluggable highlighter, code assist providers, the editors’ steps and tokens; the terminal’s drawing over vt100’s emulator.
Refuses: a language server (the assist traits are shaped for a client, which is the application’s); an IDE’s project model; a shell or terminal multiplexing.
The modules a reader may not find above:
| Module | What it is |
|---|---|
egui_pop_editors::text | TextSurface, the text surface |
egui_pop_editors::code | CodeEditor, the code editor; HIGHLIGHT_BUDGET (500 lines a pass) |
egui_pop_editors::search | Search and replace over a Buffer, pure: what the bar and editor.find/editor.replace run |
egui_pop_editors::tokens | EditorTokens: the editor.* and syntax.* colours of the installed theme |
search is usable without a widget, on a buffer:
use egui_pop::editors::buffer::Buffer;
use egui_pop::editors::search::{self, Query};
let buffer = Buffer::from_text("let a = 1;\nlet b = a;");
let mut query = Query::new("a");
query.whole_word = true;
let found = search::find_all(&buffer, &query).unwrap();
assert_eq!(found.len(), 2);
A Query is its text with case_sensitive, whole_word and regex;
search::find_all lists the matches in order (at most MAX_MATCHES,
an empty query finds nothing, an invalid expression is an error with
its reason); next_from and previous_from wrap around;
replacement_for expands $1 and ${name}. EditorTokens::of(ctx)
reads the colours of the theme installed in a context, and
EditorTokens::kind the colour of a kind of code; a theme changes them
through its editor.* and syntax.* aliases (Design tokens).
States and failure: an edit vetoed by a before-hook on
edit.change is not applied; a highlighter past its budget leaves the
rest plain until a later pass; an invalid search expression finds
nothing and its reason is kept for the bar to show.
Accessibility: each editor is a text input named by its label
and follows egui-pop’s focus rules for text inputs; the status line
says the line and column.
Tier: Experimental (“The text and code editors and the terminal
(egui-pop-editors)”, API stability).
Tests: crates/egui-pop-editors/tests/editors.rs (typing, moving
and Escape; the clipboard refused; search and replace from the bar; the
gutter, folds, markers and virtualisation; steps, veto, save and
commands; every step declared; assist through its steps; the wheel at
the end), unit tests in search.rs and the other modules;
crates/egui-pop-editors/tests/terminal.rs and terminal_windows.rs.
Gaps
- No language server client yet: the assist traits are shaped for one (requests with ids, cancellation, late answers); the client itself is a follow-up.
- One cursor and one selection (no multiple cursors, no column selection).
- No soft wrap: long lines scroll horizontally, and a single very long line is laid out whole.
- The IME’s composition (preedit) is not drawn; committed text is inserted.
- Highlighting runs on the interface thread within its budget (a background parse is a follow-up); the tree-sitter highlighter re-highlights the whole text after a change and is not covered by the workspace’s tests (no grammar crate is a dependency).
- Folding is by indentation only (no grammar folds, no persisted folds); bracket matching ignores strings and comments.
- Search matches stay within a line.
- The cursor does not blink (steady, as with reduced motion).
- Edit > Undo in the menus undoes the application’s history, not the focused editor’s (the editor’s Ctrl+Z does).
- The terminal does not report the mouse to programs (mouse modes are
read but not sent: vim and htop see no clicks; in the alternate
screen the wheel does nothing), has no hyperlinks set by programs
(OSC 8) nor images (sixel, kitty), and draws no IME composition. Its
selection is anchored to lines and drifts once the scrollback is full
and drops its oldest lines. Alt is always Meta (on macOS, Option does
not compose characters in a terminal). The leave chord is fixed
(Shift+Escape). No screenshots of the terminal page in
docs/screenshots/yet.
Micro-indicators
Small marks that say a state in very little space, beside or on another
widget: a dot or an LED, a count badge, an activity pip, a flag, a
colour swatch, an icon that follows a state. They live in
egui_pop::core::indicator and are drawn by the visual kit
(kits) like every other component; the design note behind
them, with the survey, the owner’s decisions and where the kit changed
them, is design/indicators.md.
The kinds
| Kind | Built with | States, content | Shape cues |
|---|---|---|---|
| Dot | Indicator::dot(tone) | one tone | a filled circle; give it a name |
| LED | Indicator::led(Led::…) | Off, On, Busy, Warning, Error | hollow, filled, pulsing, a triangle, a square |
| Badge | Indicator::count(n), Indicator::text("NEW") | a count capped at 99+ (cap), hidden at zero (show_zero); a short text | a pill at least as wide as it is high |
| Activity pip | Indicator::pip(Pip::…) | Busy, Progress(f), Done, Failed; delayed follows motion::Busy | a turning arc, a ring, a tick, a cross |
| Flag | Indicator::flag(Flag::…), Indicator::flag_shape(shape) | Modified, Pinned, Required, Invalid, or the application’s | a corner triangle, a diamond, an asterisk, a triangle; a stripe, a square |
| Swatch | Indicator::swatch(color), Indicator::swatch_of(Swatch::None | Mixed) | a colour (egui’s checkerboard under alpha), none, mixed | an outlined square; a slash; a dash |
| Icon | Indicator::icon(icon), Indicator::toggle(on, when_on, when_off) | a built-in Icon, or one of two by a state | the glyph |
| Value mark | Indicator::mark(ValueMark::…) | Changed (from its default; interactive, the value’s reset), Held(by), Moved(by): “Changed from its default”, “Held by …”, “Moved by …” | a dot (accent), a square (warning), a diamond (accent) |
Every state has a shape, a glyph or a text, and a name: colour is never
the only carrier. The kit gives colours and sizes, and the shapes of
the LEDs and of the named flags as glyph roles (glyph.led-off…
glyph.flag-invalid), which it may map to any icon but never two
states of one kind to the same one. The tone (tone(Tone::…)) is the kit’s one
Tone: Neutral (the
component’s own box), Accent, Info, Success, Warning, Danger,
Muted and Record (recording, the danger colour unless a kit tells
them apart). Sizes come in steps (Size::Small, Regular, Large),
never points.
Icons by name from a registry (a plugin’s own icons, a command’s “on”
icon) come later; today the icon kind takes the built-in Icon roles.
Passive or interactive
A mark is passive by default: no click, no focus, no node of its own.
- On a widget (
response.with_indicator(ui, indicator, anchor), orindicator.on(ui, &response, anchor)), its meaning joins that widget’s accessible name: a button “Notifications” with a count badge of 3 reads “Notifications, 3”. A capped badge still says the real count. - Inline (
ui.add(indicator)), it is read as an image whose name is its meaning. - Its tooltip says the meaning (or
tooltip(..)).
The meaning is the name(..) given, else the kind’s: an LED’s state, a
flag, a pip (“Busy”, “42%”), a swatch’s colour (#3d8bd9), a count. A
plain dot has none until it is given one. indicator::annotate adds a
meaning to any widget by hand (a mark drawn inside a button’s own
layout).
interactive(action) makes it a button with egui-pop’s button rules:
- a target of at least
indicator-button.widthbyheight(24 points, never less: WCAG 2.5.8) around the mark, drawn by the kit’sindicator-buttonin its state (hover, active, focus, disabled, selected for a toggle that is on); - in the tab order, with the theme’s focus ring; Space and Enter activate it;
- a tooltip (the action, or
tooltip(..)); - an AccessKit node of its own: a button named by the action, the mark’s meaning as its description; a toggle is a check box with its state;
disabled(reason): greyed, no click, the reason on hover;command(id): an activation asks for the command, which an egui-popAppruns before the next frame, so it is a step agents can reach (indicator::take_commandshands them to any other host).
Anchoring
Anchor::TopStart, TopEnd, BottomStart, BottomEnd, Start, End
(centred vertically) and Center. Start and end follow the direction
(indicator::set_direction, left to right by default; egui has no
direction of its own yet).
- Badges and dots overhang a corner by half their height (a dot is
centred on the corner) and are drawn on a layer of their own just
above the host’s, never clipped, so a badge at a panel’s edge is
never cut.
overhang(false)keeps one inside. - The other kinds sit inside,
space.xsin from the edges; a corner flag is flush with its corner, a stripe onStartorEndtakes the host’s height. - A mark never changes its host’s size or layout.
Motion
A busy LED pulses; attention(since) makes any mark pulse
a few times from since (motion clock seconds), then
stay still (motion.pulse.period and motion.pulse.count). The pulse
runs on the motion clock, so a frozen clock gives
the same frame on every run; under reduced motion it is a still ring
around the mark, so the state is not lost.
In the kit
| Component | What it gives | Drawn by |
|---|---|---|
indicator-dot | width (the diameter), fill by tone, an LED that is off in border-color, border-width the ring of an off LED and of a pulse | egui-pop’s shapes (colours only) |
indicator-badge | height, padding-x, font-size, fill by tone, text (the panel on every tone), radius | the pill handler |
indicator-flag | width (a corner triangle’s legs), fill by tone | egui-pop’s shapes (colours only) |
indicator-swatch | width, the outline (border-*), radius, text the slash of no colour and the dash of mixed ones | the box handler, over the colour |
indicator-outline | ring-color and ring-width: the ring between an overhanging badge or dot and its host | colours only |
indicator-button | an interactive mark’s target: width and height (24 points at least), its states, text an icon mark’s colour by tone | the box handler |
Activity pips are the kit’s spinner and progress-ring, in their
tones. The badge’s text size is indicator-badge.font-size (egui’s
small text in the default kit). The contrast pairs (badge text on every tone, the
record dot and an LED that is off on the panel and menus, the swatch
outline, the outline against the accent and danger dots) are checked in
every built-in theme (tokens).
Symbols with tooltips, not redundant text
A guideline for applications built on egui-pop (2026-11-29): a state or a condition shows as a symbol, and its reason in plain words goes in the symbol’s tooltip, not in a line of text beside it.
- A symbol per kind of state, from the icon registry
(icons, section 4;
egui_pop_core::icon::registry): a plug for an unplugged disk (phosphor:plugs), a struck-through network glyph for an offline machine (phosphor:wifi-slash). Two kinds of state never share a glyph. - The reason in the tooltip, in plain words (“Unplugged: last seen
on 26 November”).
Indicator::namesets it, and the tooltip defaults to it; on any other widget,egui_pop_core::tooltip::TooltipExt::tip. - The accessible name is that reason: a screen reader and an agent read what the tooltip says. Colour is never the only carrier.
- Progress is the icon with a compact ring or bar
(
Indicator::pip(Pip::Progress(f))), the details (what, how far, how long) in the tooltip. - On-screen text is for actions and details: a Reconnect button, a path, a count. It does not repeat what the symbol says.
Agents and tests
Marks with an id(..) are recorded each pass. indicator::drawn(ctx)
(and find(ctx, id)) lists them, the debug bridge’s indicators
collector shows them as JSON, and the test kit has
egui_pop_test::indicators(&harness) and
assert_indicator(&harness, id, state):
{ "id": "unread", "kind": "badge", "state": "count", "value": 120.0,
"text": "99+", "tone": "danger", "name": "120", "host": "Notifications",
"interactive": false, "enabled": true, "shown": true, "pulsing": false }
Example
use egui_pop::core::icon::Icon;
use egui_pop::core::indicator::{Anchor, Flag, Indicator, IndicatorExt as _, Led, Pip, Tone};
fn status(ui: &mut egui_pop::egui::Ui, unread: u64, rendering: bool, visible: &mut bool) {
// Passive, inline: read as "On".
ui.add(Indicator::led(Led::On).id("node").tooltip("The render node's link"));
if rendering {
ui.add(Indicator::pip(Pip::Busy).name("Rendering"));
}
// On a button's corner: the button reads "Notifications, 3".
ui.add(Icon::Notification.label("Notifications").sense_click())
.with_indicator(ui, Indicator::count(unread).tone(Tone::Danger).id("unread"), Anchor::TopEnd);
// A flag in a tile's corner.
let tile = ui.button("IMG_0042");
Indicator::flag(Flag::Modified).on(ui, &tile, Anchor::TopStart);
// Interactive: a button of its own, then a check box.
if ui
.add(Indicator::dot(Tone::Accent).name("Changed").interactive("Reset exposure"))
.clicked()
{ /* reset */ }
if ui
.add(Indicator::toggle(*visible, Icon::Visible, Icon::Hidden).interactive("Mask visible"))
.clicked()
{
*visible = !*visible;
}
}
Not yet
- The status bar’s
strips::Indicatordraws its error and warning counts with these kinds’ icons (the status bar); its other parts move onto them later. Only status bar items are mutable by the user. - The library’s badges (the kit’s
pill) and the tree’s row marks move onto these kinds. - Workbench tabs get the modified dot that turns into the close button
on hover: it needs a modified state on panels and room in
egui_dock’s tab (egui_dockhas no decoration slot for a tab). - Dynamic icons by name, from the icon registry.
The gallery’s indicators page shows every kind in its states, marks on
an icon button, a tab, a row, a tile and a menu entry, a pretend status
bar, and a playground.
Notices
How egui-pop shows a message in sentences: an error, a warning, a success, a piece of information. This page starts with the widget that draws one inside a page, then the model behind messages: one notice, raised once on the bus, kept by egui-pop’s store, and shown by the views a routing policy picks (a note in its page, a toast, the status bar’s bell, the Notices panel); how notices outlive the session; then how a command’s failure becomes a notice.
Note: a message inside a page
A Note (egui_pop::core::note) is a message drawn where it belongs:
under a form’s field, at the top of a settings page, in a list. Use it
for sentences; a short state (NEW, Offline) stays a badge
(micro-indicators).
- Its severity (
Info,Success,Warning,Error) gives its symbol from the icon registry, named and tooltipped with the severity’s word, and its colour. - Its headline says what happened in plain words. An optional reason says why, and a hint what to do.
- Its details hold the technical chain (an error’s sources), folded under “Details” until opened.
- Every text wraps to the width given and can be selected.
- Copy copies the headline, the reason, the hint, the details and
the time the note was first shown (or the time given with
.time). - Its actions are buttons;
show_withadds widgets of your own after them. - For screen readers it is a group with the
Alertrole (an error, a warning) or theStatusrole, holding its text. It is announced when it appears or its text changes, at once for an error.
use egui_pop::core::note::Note;
fn page(ui: &mut egui_pop::egui::Ui) {
let r = Note::error("cloudy was not added")
.reason("The network found no route to it.")
.hint("Check that cloudy is on and on the same network.")
.details("cannot enrol with cloudy: connect: No route to host (os error 113)")
.action("Try again")
.show(ui);
if r.action == Some(0) {
// Try again.
}
}
Note::compact draws one line after the symbol: wrapped and
selectable, with no frame, no Copy button and no announcement (a toned
title in a list, a reason beside a button).
In admin forms
Admin forms (admin forms) draw their messages as notes: a callout, a status whose read-out is a sentence or whose read failed, a store’s errors, a list’s error, a wizard’s problems. A toned list title or table cell stays a badge while short, and becomes a compact note when it is a sentence.
The notice: one message, raised once
A Notice (egui_pop_model::notice::Notice) is the message as data,
without egui, so a background service or a node on another machine
raises the same fact as the interface:
- an id (
n42; a notice from another node carries the node’s name,cloudy/n42) and a time (at_ms, milliseconds since 1970, UTC); - a severity:
Info,Success,Warning,Error; - a kind: an
Event(it happened once), aCondition(a state that lasts until it is resolved: a node offline, a disk full) or anAsk(a question waiting for the user); - an origin:
User(their own action),Background,Node(with itsnode) orSystem; - a headline, and optionally a reason, a hint and
details (the technical chain, copyable;
details_fromwrites an error and its sources); - its actions: an id and a label each, and optionally the
arguments its command runs with (
.action_with(id, label, args), a JSON value: “Undo this restore” with{"restore": 7}); - a subject (what it is about:
node:cloudy,job:backup-7) and a place (where it happened in the interface:settings/storage/nodes).
Its JSON shape is stable: fields are added, never renamed, empty ones are
left out (an action without arguments writes no args), and v
(egui_pop_model::notice::VERSION) rises if a field changes meaning.
{
"v": 1,
"id": "n42",
"at_ms": 1796121723000,
"severity": "error",
"kind": "event",
"origin": "user",
"headline": "cloudy was not added",
"reason": "The network found no route to it.",
"details": "cannot enrol with cloudy: connect: No route to host (os error 113)",
"actions": [
{ "id": "nodes.add", "label": "Try again", "args": { "node": "cloudy" } }
],
"subject": "node:cloudy",
"place": "settings/storage/nodes"
}
On the bus
Notices are facts on the application’s bus, under egui-pop’s pop.
prefix:
| Point | Carries | Said when |
|---|---|---|
pop.notice.raised | a Notice | a notice is raised, by any module, plugin or node |
pop.notice.resolved | { "ids": [...] } | conditions ended |
pop.notice.seen | { "ids": [...] } | notices were read |
pop.notice.dismissed | { "ids": [...] } | the user put notices away |
egui-pop’s listener pop.notices.store keeps the last notices raised
(500 and 30 days, oldest out first, errors not seen yet kept until seen:
see Persistence), marks them seen or resolved and drops
the dismissed ones; it runs on any thread. A process holding the bus but no
application publishes on the same points by name
(egui_pop_model::notice::points); a notice raised without an id gets
one from the store.
Reporting
AppHandle::report is the one call for a message to the user: it gives
the notice an id and a time when it has none, says pop.notice.raised
and returns the id. resolve_notice, see_notice and dismiss_notice
say the other points; notices reads the store.
use egui_pop::api::AppHandle;
use egui_pop::model::notice::Notice;
fn add_failed(app: &AppHandle, err: &std::io::Error) {
let id = app.report(
Notice::error("cloudy was not added")
.reason("The network found no route to it.")
.hint("Check that cloudy is on and on the same network.")
.details_from(err)
.subject("node:cloudy")
.place("settings/storage/nodes")
.action("nodes.add", "Try again"),
);
// Later, when cloudy answers: app.resolve_notice(id);
let _ = id;
}
Note::from_notice draws a notice as a note inside a page: its
severity, headline, reason, hint, details, time and its actions’ labels.
Actions with arguments
An action names a command, and may carry the arguments it runs with: the
notice says which restore to undo, which photos to show, which failure a
bug report is about. The arguments are stored with the notice, saved with
it in notices.json, and given to the command when the action runs,
wherever it is shown: a toast’s button, a notice site’s or the Notices
panel’s note. An action without arguments runs its command with null.
use egui_pop::api::AppHandle;
use egui_pop::model::notice::Notice;
use serde_json::json;
fn restored(app: &AppHandle, restore: u64, photos: &[u64]) {
app.report(
Notice::success(format!("{} photos restored", photos.len()))
.action_with("restore.undo", "Undo", json!({ "restore": restore }))
.action_with("library.show", "Show them", json!({ "photos": photos })),
);
}
Routing: which views show a notice
egui-pop gives the mechanism, the application the policy. Each notice
raised is given to the routing policy, which answers a Route: the
surfaces that show it (egui_pop::api::notices, from
egui_pop_model::notice::route):
Inline(place): a note in the page or panel that drew the notice site of that place;Toast: a toast, transient for information, success and warnings, until closed for errors; it has a Copy button, and closing it marks the notice seen;StatusBadge: counted by the status bar’s badge until seen (or, for a condition, resolved);History: the history of notices;Decisions: a question for the user, handed to the application’s Decisions surface.
egui-pop’s listener pop.notices.route hears pop.notice.raised after
the store and shows the notice on its route; AppHandle::notice_route
reads the route a notice was given.
The default policy
default_route (installed until the application gives its own):
background work never pops up, and a user’s own failure shows where it
happened.
| Notice | Surfaces |
|---|---|
| an ask (any origin) | Decisions, history |
| a condition (any origin) | inline at its place when a site shows it, history; the badge when a warning or an error |
| a user’s error or warning | inline at its place when a site shows it, else a toast; history |
| a user’s information or success | a toast, history |
| a background, node or system error or warning | the badge, history; never a toast |
| a background, node or system information or success | history |
A site “shows” a place while it is drawn: in its window’s last pass or the current one.
An application’s own policy
A policy is a NoticeRouting: route picks the surfaces, ask hands a
question routed to Decisions to the application’s panel (egui-pop has
none; by default it does nothing). A closure
Fn(&Notice, &RouteCx) -> Route is a policy too. It runs on the thread
that raised the notice: it must be quick and must not raise notices.
use egui_pop::api::AppHandle;
use egui_pop::api::notices::{NoticeRouting, Route, RouteCx, default_route};
use egui_pop::model::notice::{Kind, Notice};
struct Policy;
impl NoticeRouting for Policy {
fn route(&self, n: &Notice, cx: &RouteCx) -> Route {
// egui-pop's table, but a node's notices only in the history.
match n.node {
Some(_) => Route::none().history(),
None => default_route(n, cx),
}
}
fn ask(&self, n: &Notice) {
// Hand the question to the application's Decisions panel.
let _ = (n.kind == Kind::Ask, &n.headline);
}
}
fn install(app: &AppHandle) {
app.route_notices(Policy);
}
Notice sites
A page or a panel calls notice_site(ui, app, place) where its notes
belong. While it is drawn, the policy may route the notices of that place
there; the site draws each as a Note (selectable, with Copy and
Details), the newest three, marks them seen, runs their actions that name
a command, and puts one away with its close button
(pop.notice.dismissed). Admin forms draw the site of each section’s page
under its title, at settings/<scope>/<section>.
The badge
AppHandle::notice_badge says what the status bar’s badge counts: the
notices routed to StatusBadge not seen yet (nor resolved), with the
errors and warnings among them, and the list of them. The bell shows it
(below).
The bell and the Notices panel
NoticesPlugin (egui_pop::api::notices, opt-in: add it to the
builder) brings the history of notices into view.
use egui_pop::api::App;
use egui_pop::api::notices::NoticesPlugin;
let app = App::builder()
.plugin(NoticesPlugin::default())
.build(&egui_pop::egui::Context::default())
.unwrap();
let _ = app;
The bell
An item of the status bar (the app.status-bar zone, block
egui_pop.notices.bell): the notification symbol, and on its corner the
count of the errors and warnings not seen yet (the badge’s), red when one
is an error, amber for warnings only, hidden at zero. Its tooltip says
them in words: “1 error, 1 warning not yet seen”, or “No new errors or
warnings”. A click opens the Notices panel, or gives it the keyboard when
it is open.
For screen readers it is a button named “Notices” with its count
(“Notices, 2”); when the count rises, its tooltip’s words are announced
politely. notices::bell(ui, app) draws it anywhere else
(NoticesPlugin::without_bell leaves the status bar alone).
The Notices panel
A workbench panel (PANEL_NOTICES, egui_pop.notices), closed until
the bell or the application opens it, docked at the bottom by default,
dockable and floatable like the others. It lists every notice the store
keeps: the unresolved ones first, newest first, then the conditions that
ended. Each row says the severity (its symbol, named), the time (UTC, to
the minute), the origin (the node’s name for a notice from another node)
and the headline, in bold while not seen. A resolved condition is dimmed,
with the “Resolved” symbol. A click on a row opens its Note under it
(Note::from_notice): the reason, the hint, the details folded under
“Details”, Copy, and the actions (those naming a command run it); a
second click closes it. Its close button dismisses the notice
(pop.notice.dismissed).
- Filters: severity, origin (you, background, other nodes, system),
node (when notices come from nodes) and a search over the headline,
reason, hint, details and node (case ignored).
notices::Filterandnotices::listedgive the same list in code. - Mark all seen marks every notice kept seen, listed or not.
- Copy all copies the notices listed, as each note’s Copy writes it
(headline, reason, hint, then under
---the details and the time), separated by a=====line: ready for a bug report (notices::copy_all_text). - Clear seen dismisses the notices seen, but a condition still going on.
Drawing the panel marks the notices it lists seen (pop.notice.seen):
opening it clears the bell’s count. notices::panel(ui, app) draws its
content anywhere; notices::panel_preview draws it without marking
anything seen.
Persistence
With a persistence directory (AppBuilder::persist), the notices kept
are saved in the notices document (notices.json, written about a
second after a change and by App::save, with the backup every
document has) and read back at the next start: each notice, whether it
was seen or resolved, the route it was given (so the bell counts the
same), and the next id, so new notices never take a saved one’s.
- Bounds: the store keeps at most 500 notices and none older than 30
days, whichever keeps fewer; the oldest leave first. An error not seen
yet stays past both until it is seen.
AppHandle::set_notice_limitschanges the two bounds. - Versions: the document has a
version(1) and akind(notices); a file without a version reads as version 1 (so does one written before actions had arguments: an action withoutargsruns withnull), a missing file is a first start, and a file that cannot be read (nor its backup) is logged and replaced at the next save: the application starts with no notices. - Notices raised before the file is read (a plugin’s, at start) come after the saved ones.
Commands that fail: CommandError
A command’s failure, structured (egui_pop_model::commands::CommandError,
also in egui_pop::api::notices): a headline, a reason, a hint,
details (the technical chain) and user, whether the headline is in
the user’s words.
CommandError::new(headline)is a failure told in the user’s words (useron), with.reason,.hintand.details.- A
String, a&str, anstd::io::Error, aserde_json::Erroror a boxed error (anyhow::Errorconverts to one with.into()) converts to one whose headline is its text and whoseusermark is off;CommandError::from_errorkeeps an error’s sources as its details. - Its
Displayis the headline, then:and the reason: one made from a text displays that text unchanged, andString::from(err)gives it back, so command results that are stillResult<Json, String>keep working.
A handler tells its failure in full with Call::fail, which keeps the
structured error for the run and returns its text:
use egui_pop::api::Call;
use egui_pop::api::notices::CommandError;
use serde_json::Value as Json;
fn add_node(call: &Call<'_>) -> Result<Json, String> {
Err(call.fail(
CommandError::new("cloudy was not added")
.reason("The network found no route to it.")
.hint("Check that cloudy is on and on the same network.")
.details("connect 192.168.1.12:7443: No route to host (os error 113)"),
))
}
The failure, for the code that ran the command
A command’s result is still Result<Json, String>: App::run and the
host’s dispatch give the failure’s text only. AppHandle::take_failure(&command)
gives the rest, once the result is in: the CommandError of the
command’s last failed run, as its handler told it with Call::fail
(headline, reason, hint, details, user on), or one made from the text
of any other failure (user off). It is taken: a second call returns
None, and a run of the command that succeeds clears it. An application
that reports failures itself (its own words, its own actions) reads it
instead of parsing the text:
use egui_pop::api::App;
use egui_pop::model::commands::Origin;
use egui_pop::model::ids::CommandId;
fn add_node(app: &mut App, add: &CommandId) {
if let Some(Err(_)) = app.run(add, serde_json::json!({}), Origin::User).now()
&& let Some(err) = app.handle().take_failure(add)
{
let notice = err
.to_notice("cloudy was not added")
.action_with("bug.report", "Report a bug", serde_json::json!({ "command": add }));
app.handle().report(notice);
}
}
A command run with AppHandle::run (before the next frame) or whose
reply comes later (Reply::Later) has its failure there once its result
arrived.
Reported where it was asked
AppHandle::run_reported(command, args, place) runs a command for the
user as run does; if it fails, the failure is reported, as a notice
from the user at place, and the policy shows it. A failure told in full
gives its headline, reason, hint and details; any other gives “Command
did not work” with its text under Details. Admin forms run their actions
and their rows’ fields this way, at their page’s place, and a wizard’s
Finish at settings/wizard/<id>: an admin action that fails is never
silent.
Collapsible sections
Status: sixth version (2026-11-04): the stack is egui_stack’s
(egui_stack::sections, from 0.22.2), egui-pop wrapping it with the kit,
its strings and its gestures (ADR 0022). Before: within one drag, what it
shrank stays shrunk, titles that drag, the pull and empty room, titles
that stay, windowed rows and the wheel contained, heights set by hand and
the push.
A stack of collapsible sections fills a panel: each section is a title
band (a disclosure mark, a title, a count) over its own scrolling body.
It is egui_pop::core::sections:
use egui_pop::core::sections::{Section, Sections};
fn sessions(ui: &mut egui_pop::egui::Ui, live: &[String]) {
Sections::new("sessions").show(ui, |stack| {
stack.section(Section::new("live", "Live").count(live.len() as u64), |ui| {
for name in live {
ui.label(name);
}
});
stack.section(Section::new("shut", "Shut").count(0).open(false), |ui| {
ui.weak("No shut session");
});
});
}
Sections::new(name): the stack’s name, unique in the application. Its layout is remembered under it, and agents read it by it.capitals(false)keeps the titles’ case on screen (their accessible names always keep it). Two options, off by default:grab_titles(true)makes the titles drag too andkeep_titles(true)leaves a title where it is when its section folds or opens.Section::new(key, title): the key is what the layout remembers;count(n)puts a count on the band (99+past 99),min_height(points)its body’s least height (two rows by default),row_height(points)its rows’ height (the theme’s by default,sections::row_height),open(false)folds it until the user opens it.- Three kinds of body:
stack.section(section, |ui| ...)draws anything in a scroll area,stack.rows(section, count, |ui, range| ...)draws windowed rows in one, andstack.bare(section, |ui| ...)leaves the scroll to an application’s own view. showreturns what the user did this pass (toggled,resized,reset) and the layout after it.
egui_stack’s stack, egui-pop’s look
The widget is egui_stack’s sections module (ADR 0022): the layout
arithmetic, the drag, the fold, the keyboard, the accessibility, the
windowed rows and the wheel live there, and run against the same tests.
egui_pop::core::sections wraps it, keeping its API:
- the kit paints the bands and the boundaries’ focus ring, as the kit’s
DockPainter(section_band,section_boundary; see The kit); - the boundaries are named from the strings provider
(
egui-pop-section-resize, egui_stack’sLabels::resize_section); - the pull’s keys come from the pointer map (
gesture.sections.pull, egui_stack’spull_when), the band’s height from the kit, and the stack’s own scroll bar, when it overflows, is the kit’s seen at rest (overflow_scroll); - every bar of the stack, the bodies’ included, is drawn as
UiPop::scroll_areadraws one: the kit’s thumb and track in aScrollBarscope (egui_stack’sbar_style) andscroll-bar.margin-track(bar_track_inset); Sections::fill(false)sizes the stack by its content (egui_stack’sfill): an open section sized by the list is never taller than what its body lays out, the folded bands follow right under the last open section, and the room left stays empty under the last band;- the debug bridge’s
core.sections.laidslot and the old layouts’ move (see Remembered) stay egui-pop’s.
Section, Stack, Laid, Remembered, laid_out and row_height are
egui_stack’s, re-exported; Laid is #[non_exhaustive] there. Layout
and SectionsResponse stay egui-pop’s, converting to egui_stack’s.
The heights’ arithmetic is egui_stack’s sections::plan, without egui
types, re-exported as egui_pop::core::sections::plan: fit lays a
stack out, plan_drag says what moving a boundary does (DragMode::Push
or Pull), keep_title what folding keeps. egui_pop::model::sections,
where it was, is deprecated: an unused copy kept for one release (the
model stays free of egui, so it cannot re-export egui_stack’s).
Behaviour
- Fold. A click on a band, or Space or Enter while it has the keyboard, folds or opens its section; Left folds it and Right opens it. A folded section keeps its band in place.
- Heights. A section’s height is set by hand, in points, or sized by the list. Sections never set by hand share what the others leave, equally, and the last open section always takes what is left: it never keeps a height of its own. The bands of folded sections below the last open one therefore sit at the panel’s bottom. Each body keeps its least height.
- Resize. The line above a band is a boundary when an open section
lies above it and another one below it. It resizes the first open
section above, past any folded ones: the line under a folded section
and the line above it do the same, and the folded bands between follow.
It follows the pointer in both directions and stays under it: it does
not drift. Each move starts from the stack as shown, as a fresh drag
would, so what a drag shrank stays shrunk: going back, the room goes
where a drag that way puts it, and a section at its least is not given
back what it lost. Nothing gives way in proportion:
- Down: the sections between the boundary and the last shrink, the nearest first, each down to its least; then the last does. The drag stops once the whole stack is at its least.
- Up: the section above shrinks to its least, then those above it, the nearest first. The first open section below takes all the room; nothing else moves.
- Folded sections are skipped. A section that gives way or moves gets a height of its own; one the list would not move stays in the list.
- Down, up and down again in one drag: down, the next section gives, to its least, then the last; up, the section above gives and the next one below takes all the room, the last keeping what it gave; down again, the next one gives first, back to its least, and only then the last, from what it has now. The stops are where they were, the border staying under the pointer, but the stack is not the one the first leg showed: the last is as small as the drag ever made it.
- Past a stop, nothing moves until the pointer is back on the boundary, which then follows it.
- Keyboard. A boundary takes the focus in reading order, after the open section above it; the lines under folded sections do not, as they would be a second stop for the same pair. Up and Down move it by a row, by the same rules: each press is a move from the stack as shown, as a drag’s, so a row down then a row up leaves the last as the first press left it. Enter drops the heights set by hand. With the keys of the pull held, they pull.
- Reset. A double click on a boundary drops the heights set by hand and any empty room.
- The pull. With the keys of
gesture.sections.pullheld (Ctrl with a drag by default, Cmd on macOS, in the pointer profile; rebindable in the shortcuts editor, pointer-gestures.md), a drag moves the sections below as a block, their heights kept; only the section above changes:- Up: it shrinks to its least, then those above it, the nearest first. The block follows, and empty room opens under the last section.
- Down: the block goes into the empty room, then the last section alone gives way, down to its least, and the drag stops.
- The keys pressed or released during a drag change the mode from there: the next moves give way as that mode does, from the stack as shown, and nothing jumps. The border keeps to the pointer through the change, a stop included: the keys alone move nothing, and no pass moves anything further than the pointer moved since the last. Where the new mode stops short of the pointer, nothing moves until the pointer is back on the boundary; where it lets a boundary stopped by the old mode go further, the boundary catches up as the pointer moves, never faster than it: closing in while the pointer comes toward it, keeping its distance while the pointer moves away.
- Empty room. A stack with empty room under its last section keeps it,
in
Layout::empty, until a drag takes it back or a double click drops it. A plain drag takes it after the sections between, as a pull takes it first. In one drag, room a plain drag took is not given back to the empty room when the pointer returns: the next section below takes it, as a drag up does; only a pull up opens empty room again. In a panel too short, it gives way after the sections sized by the list and before those set by hand, and comes back with the room. A line with only folded sections under it is a boundary while there is empty room: the bands follow, and up it opens more. - Titles that drag (
grab_titles(true)). A press on a title that moves is a drag, by the rules above, the title staying under the pointer; one that does not is a fold, anywhere on the band: the line above it takes only the section’s side of the border, and under a folded section, whose title does the same, there is no line. A title under a folded section resizes the first open one above, as the folded title does; with nothing open above it does not move. The keyboard does not change. - A double click on a title drops the heights set by hand and any empty room, with the option. Its first click has folded the section, which is seen folded until the second: nothing can tell a first click from a single one, and holding each fold back for the 0.3 s a second could take would slow every fold. What holds is that the second lands on the title even if the fold took it away (what moved under the pointer does not get the click), that the fold ends as it was, and that the shares come back.
- Titles that stay (
keep_titles(true)). Folding or opening a section leaves its title where it is, whatever does it, the keyboard included:- Folding: the open sections above keep their shown height, as if set by hand. Those below move up; with nothing open below, the room stays empty. A second click at the same place lands on the same title. The trade-off: those above no longer get the room a fold frees.
- Opening: the section takes its room below its title, from the sections below, then from the empty room (with nothing open below, all of it, or its own height when it has one). In a panel with no room for it, those above still give way, and the title moves.
- The shares back: a double click.
- A panel too short. Sections sized by the list give way first, down
to their least; then those set by hand, from the bottom up. The last
open section stays in view. The stored heights come back with the
room; the next drag first aligns them on what is shown. When even the
least heights do not fit, the whole stack scrolls, with a scrollbar
shown then only, thin and quiet at rest whatever the theme does for other
bars (
ScrollBarKit::seen_at_rest). - Scroll. Each body scrolls on its own.
- Windowed rows.
stack.rowsgoes through egui’sScrollArea::show_rows: its closure is given the rows in view and one past them, and draws those alone, each exactly the row’s height, with no spacing between them, as a list’s. The window is worked out again on every pass, so it follows the section’s size, its scroll and its count, with no blank row left: when the rows under a scroll shrink, the stack asks for a pass by itself. Nothing is kept around the window, as a row is cheap to draw on the pass it comes into view. - Least height with rows. Two rows, or all of them when there are
fewer (none: a band alone).
min_heightstill wins. - A body without scroll area.
stack.baregives an application’s own scrolling view the whole body, clipped to it, asviews::List, which in a scroll area would nest two scrolls. - The wheel. A wheel pushing past the end of a body’s scroll stops
there: neither the stack nor anything around it moves. So does one over
a bare body, always: the stack cannot see whether the view inside has
anywhere to go. Over a band, or a body with nothing to scroll, it
scrolls a stack too tall, which would otherwise have nowhere to take a
wheel; a stack with nowhere to go leaves it to what is around it, as
that is no section’s scroll. The contract is that nothing moves, not
that nothing is drawn: eframe repaints on every wheel event
(
egui-winitanswers each withrepaint: true), so a widget cannot promise a pass is saved. - Remembered. Which sections are folded, and the heights set by hand,
are kept in egui’s persisted memory under the stack’s name, so they
come back with the window’s layout.
Layout::loadandLayout::storeread and write them whole, for an application that keeps them with its own layout (Layout::heightandset_heightfor one section). A section’s height is kept while it is folded, so it opens again at its size. A layout stored with the shares of an earlier version keeps its fold state, and its sections read as sized by the list.Layout::emptyis the empty room kept, none in a layout stored before it. The memory key is egui_stack’s (egui_stack.sections); a layout stored by egui-pop 0.4 or earlier underegui_pop.sectionsmoves there the first time its stack is shown or loaded, unless egui_stack’s key already holds one.
Classic conventions, and where this departs
Compared, 2026-10-27 (within one drag, 2026-11-03), with VS Code’s side bar views (Explorer, Source
Control), JetBrains IDEs’ tool windows, the macOS Finder sidebar,
Windows Explorer’s navigation pane and Qt (QToolBox, QSplitter):
| Established apps | Here | |
|---|---|---|
| Fold | A click on the header (VS Code, Finder, QToolBox), Space or Enter on a focused header (VS Code) | The same |
| Folded header | Stays in place. VS Code pins the headers below the last open view to the bottom | The same as VS Code |
| Resize | A sash between two open views (VS Code), a splitter handle (QSplitter, JetBrains’ split tool windows). Finder and Explorer do not resize sections: their sidebar scrolls as one | A boundary on the line above a band, as VS Code |
| Who gives way | VS Code’s SplitView.resize: the views past the sash, the nearest first, each clamped in turn, to a hard stop. QSplitter the same by default | The same: the sections below going down, those above going up, and the first open section below takes the room going up |
| Back in the same drag | VS Code plans every move from the sizes saved when the sash was pressed (splitview.ts, onSashStart keeps sizes, onSashChange resizes from them by current - start), so a view pushed smaller grows back when the pointer returns. QSplitter moves from the widgets’ geometry as it is (qsplitter.cpp, moveSplitter and doMove read each widget’s rect): a handle pushed along stays where it was pushed, and the neighbour grows | As QSplitter, departing from VS Code: what the drag shrank stays shrunk, the next section takes the room |
| Keys during a drag | VS Code’s Alt pressed or released mid-drag starts the drag again from the sizes and the pointer then (resetSashDragState): a sash stopped short of the pointer stays that far from it | From the stack as shown, as VS Code, departing on the stop: the border keeps to the pointer, catching up no faster than it moves |
| Keyboard on the sash | VS Code has none; WAI-ARIA’s window splitter moves with the arrows and resets with Enter | The arrows and Enter, as WAI-ARIA |
| Left and Right on a header | VS Code folds and opens | The same |
| Panel too short | VS Code’s split view scrolls as a whole, its scrollbar when needed. Qt clips | Scrolls as a whole, the scrollbar then only |
| Double click on the boundary | VS Code gives the views equal sizes again. QSplitter does nothing | The heights set by hand dropped: equal again, as VS Code |
| Double click on the header | JetBrains maximises a tool window. VS Code folds then opens again | Two clicks, as VS Code: no maximise. With grab_titles, the heights set by hand dropped too, a departure |
| Drag on the header | VS Code’s headers drag to reorder views. No app surveyed resizes from one | Nothing by default. With grab_titles, it resizes, a departure, and closes off reordering for that stack |
| A modifier held on the sash | VS Code’s Alt resizes both sides symmetrically. No equivalent of a block found | gesture.sections.pull, a departure: the sections below as a block |
| Empty room under the last view | VS Code never leaves any (distributeEmptySpace) | Only after a pull or with keep_titles, a departure, until a double click |
| A title when its section folds | VS Code’s panes divide the room again, and the title moves | The same by default. With keep_titles, it stays, a departure |
| Wheel at the end of a view | VS Code’s lists keep it by default, even with nothing to scroll (alwaysConsumeMouseWheel in listView.ts). The web hands it to the page unless overscroll-behavior: contain | Kept, as VS Code, by a body with a scroll to end. A body with nothing to scroll hands it on, so that a stack too tall still takes a wheel over short sections |
| Remembered | Fold and sizes, per workspace (VS Code, JetBrains), and the folded sidebar sections (Finder) | Fold and heights set by hand, with the window’s layout |
| Count | VS Code shows a badge on a view’s header (Source Control’s changes) | A pill after the title |
| Titles | VS Code: capitals, small and bold | The same by default (capitals) |
Departures, on purpose or not yet done:
- No fold animation (egui’s
CollapsingHeaderhas one): the stack is laid out in one pass, so a test sees the same frame each time. - Sections are not reordered by dragging their bands (VS Code’s views are). Sections cannot be maximised or moved out of the stack either.
grab_titles,keep_titlesand the pull are not any app’s: they come from an application’s demand, so the two options stay off by default, and the pull needs its keys held. The table’s rows say what each departs from.
The kit
| Component | Part | Handler |
|---|---|---|
section-band | The band: height (28), padding-x (space.l) between its sides and its mark and count, font-size (font.size.s) at the section text role’s weight, align start; border-* the lines above and under it (two stacked bands share one line). hover under the pointer, active while pressed, focus (a ring inside the band, and around a focused boundary) | section, or plain |
section-disclosure | The mark: the disclosure-open or disclosure-closed glyph role in text (the accent), width across (10), in the band’s state | plain (a transparent box) |
section-count | The count: based on indicator-badge (its pill, height and tones), quieter at rest: the raised surface, a border.default outline, the default text | pill, or box |
The mark, the title and the count are space.inline apart.
Named and observable
- A band is a button named by its title and its count (“Live, 3”), expanded or not.
- A boundary is a splitter named after the section it resizes (“Resize
Live”, the
egui-pop-section-resizestring), with its increment and decrement actions; the one above a folded band takes the focus, and the lines under folded bands carry the same name. Its value is the height of that section’s body, between its least and how far the stack lets it grow. sections::laid_out(ctx, name)gives each section as drawn on the last pass: key, title, count, open, height, whether that height is set by hand, band and body rectangles, how far its body is scrolled, when windowed the rows drawn, the empty room under it (the last section’s) and how a drag under way resizes it (PushorPull). The debug bridge’sstatecollector lists it ascore.sections.laid, each section’s height, whether it is set by hand, its window and its drag (dragged,pulled) in its summary, and the empty room at its end.- A title that drags stays a button named as it was. The pull’s keys are not announced on it; the arrows on a boundary do the same as a pull with them.
- The gallery’s
sectionspage has its tests and snapshots: a stack sized by the list, one already pushed, a panel too short, a stack of a long windowed section over aviews::List, and a stack with both options on, which the playground turns off.
Survey: adopt, wrap or own
Checked 2026-10-27, on egui 0.36 and crates.io.
| Candidate | What it has | Why not |
|---|---|---|
egui’s CollapsingHeader, CollapsingState | Fold with an animation, the open state remembered per header, a custom header (show_header) | A body’s height is its content’s: nothing divides a panel between sections, nothing resizes them, and each header keeps its own record where the stack needs fold and shares in one |
egui_extras::StripBuilder | Fixed, relative and remainder sizes in a row or a column | No fold and no drag |
egui::Resize | One box resized from a corner | Not a stack |
egui_tiles 0.18 | Linear containers with resizable shares, tabs, drag and drop | Its own tree and tab bars. A folded section is not a tile state, and the bands would still be drawn by hand |
egui_dock 0.21 | Tabs and splits | No folding headers. It is a workbench, as egui-pop already uses it, not a panel’s content |
egui_animation | A collapse animation | Animation only |
Styled kits (functora-egui, egui-elegance, egui_sauge and the like) | Accordions or collapsibles in their own style | Their own theme systems, not the kit; no resizable stack found |
Verdict: own. No crate stacks folding sections with resizable
boundaries, and the band must be drawn by the kit like every other
part. The widget is small, built on egui’s ScrollArea and
interaction, with egui’s persisted memory for the layout.
Since 2026-11-04: owned in egui_stack, wrapped here (ADR 0022): the plain-egui core moved to egui_stack, which egui-pop already depends on for its docks, behind a painter, labels and configuration; the kit, the strings and the gestures stay egui-pop’s.
Overlays, placement, layers and header bands
The contract of the family “Overlays, placement and layers”
(ADR 0027): what floats above the
interface, where it goes, in which order, and the handle a movable
surface is dragged by. Four modules of egui-pop-core:
| Module | What it does |
|---|---|
egui_pop_core::overlay | The overlay stack: modals, popovers and menus, their dismissal, the focus they give back |
egui_pop_core::placement | Pure geometry: a floating element next to its anchor, inside bounds |
egui_pop_core::layers | Layer ranks: a fixed order between kinds of foreground layers (ADR 0026) |
egui_pop_core::band | A header band: the handle of a movable dialog or palette |
Owns: the overlay stack and its rules, the placement of a floating element next to its anchor, the ranks between kinds of foreground layers, the header bands of movable surfaces.
Refuses: a z-index beyond the ranks; system windows drawn as overlays (a separate window is an application window, ADR 0025).
The overlay stack
OverlayStack is the model, pure and tested by its invariants;
egui_pop_core::overlay::show is the egui side. An overlay is declared
by an OverlaySpec (an id, a label, a Kind: Modal, Popover or
Menu) and shown while a bool says it is open:
use egui_pop_core::overlay::{self, Anchor, Kind, OverlaySpec};
use egui_pop_core::placement::Side;
fn ui(ui: &mut egui::Ui, open: &mut bool) {
let button = ui.button("Options");
if button.clicked() {
*open = true;
}
let spec = OverlaySpec::new("options", "Options", Kind::Popover);
let anchor = Anchor { rect: button.rect, side: Side::Bottom };
overlay::show(ui.ctx(), &spec, open, Some(anchor), |ui| {
ui.checkbox(&mut true, "Snap to grid");
});
}
The rules (each one a test of OverlayStack):
- Escape dismisses the top overlay only, if it allows it
(
OverlaySpec::keep_on_escaperefuses). - A gesture takes Escape before any host. With the focus plugin
installed (an
Appinstalls it), Escape pressed during a drag (a slider’s, a knob’s, a scrub, a viewport’s) is the drag’s alone: egui aborts the drag, the plugin takes the press out of the pass’s input, and no host around it (a dialog, the Settings window, a popover, a host’s own Escape) sees it. The widget puts its value back, reading the press throughegui_pop_core::focus::escape_cancelledoregui_pop_core::focus::cancel_pressed(not from the keys), and a value store gesture opened byegui_pop_core::binding::editis rolled back. The next Escape reaches the host. A host closed while a gesture is still open (its Close button, a command) does not leave it open: a bound widget not drawn in a pass with its gesture open has the gesture cancelled and its drag stopped. The whole order is inegui_pop_core::focus(“Escape, in order”). - A click outside dismisses the dismissable overlays above the one clicked, or all of them, and stops at a modal: nothing below a modal gets the click. A press on the overlay’s anchor, or on an egui popup opened from inside it (a combo box’s list, a context menu), is inside.
- Closing an overlay closes every overlay opened above it; each
Closedsays why (Reason::Escape,Outside,Closed,Parent). - The focus goes back to the widget focused when the overlay opened, once that widget can hold it again, unless something else took the focus meanwhile.
- Keys held when a modal comes up (the Enter that opened it) are not read by it, nor by what is behind it when it closes.
- Tab cycles inside a popover on top of the stack; a menu’s keys are
its own; an overlay its owner draws itself (
egui_pop_core::overlay::hold, a flyout) lets the focus leave. - Each window has its own stack; a modal open in one window blocks
the others of its group (
egui_pop_core::overlay::block_window), andegui_pop_core::overlay::modal_opensays whether one is open. - Resizable modals (
OverlaySpec::resizable) are dragged by their edges and a corner grip, which is also a keyboard splitter named “Resize”.
Reads for tests and agents: egui_pop_core::overlay::stack, rects,
recently_closed, modal_size.
Placement
egui_pop_core::placement::place puts an element of a given size next
to an anchor, inside bounds: on the preferred Side if it fits, else
flipped, else on the side with more room; then shifted along the side to
stay inside, and shrunk only when larger than the bounds. Placed says
where it went and whether it flipped. It is pure geometry, tested by
properties; every popover, menu and tooltip uses it.
use egui::{Rect, pos2, vec2};
use egui_pop_core::placement::{Placement, Side, place};
let bounds = Rect::from_min_size(pos2(0.0, 0.0), vec2(400.0, 300.0));
let anchor = Rect::from_min_size(pos2(20.0, 270.0), vec2(80.0, 24.0));
let p = place(&Placement::new(anchor, vec2(160.0, 120.0), bounds).side(Side::Bottom));
assert!(p.flipped && bounds.contains_rect(p.rect));
Layer ranks
egui has no z-index: in one Order, the layer clicked last is on top.
Ranks fix the order between kinds of layers, bottom to top: the docked
panels; Rank::Over (zones lying over their neighbour, flyouts);
Rank::Overlay (egui-pop’s and the application’s overlays: cards,
popovers, toasts); every foreground layer nobody ranked (menus, combo
lists, dialogs); tooltips. Inside a rank, the last clicked is on top.
An application overlay calls egui_pop_core::layers::area where it
would show an egui::Area; a layer drawn otherwise calls
egui_pop_core::layers::rank each pass it is shown. The application
installs the ranks (egui_pop_core::layers::install); a context without
them draws as plain egui does.
use egui_pop_core::layers::{self, Rank};
fn card(ctx: &egui::Context) {
layers::area(
ctx,
egui::Area::new(egui::Id::new("my_app.card")).anchor(egui::Align2::LEFT_BOTTOM, [8.0, -8.0]),
Rank::Overlay,
|ui| ui.label("Did you know?"),
);
}
Header bands
egui_pop_core::band::begin lays out the band’s row (a title, its
buttons) over a drag area registered first, so the buttons stay
clickable; egui_pop_core::band::paint has the kit’s header-band
paint it across the frame’s width, hover under the pointer, active
while dragged. The Band says what the pointer did (dragging,
delta, double_clicked, hovered); moving the surface is the
owner’s. The band is not focusable: a surface moves by keyboard through
a command of its own (dialogs.move, Alt+F7, for dialogs).
States and failure
- An overlay closed by a rule (Escape, a click outside, a parent
closing) sets the caller’s
boolto false;recently_closedkeeps why. - A focus target gone when the overlay closes takes nothing (no panic, the focus stays where it is).
placenever returns a rectangle outside the bounds; an element larger than the bounds is shrunk to them.- A layer opened from something above its rank (a hover card from a
dialog,
egui_pop_core::layers::rank_from) is left unranked, so it stays above its opener instead of sinking under it.
Accessibility
A modal’s first focus is inside it and the focus returns on close; a
resizable modal’s grip is a named splitter with its size as value; band
buttons (egui_pop_core::band::button) carry the name they are given.
Popovers keep Tab inside; Escape always has a way out unless the spec
says keep_on_escape.
Tier
From API stability: overlays are Stable (“the theme …, focus scopes and the focus chain, the key dispatcher, overlays”); placement and header bands are Supported (“Placement of a floating element next to its anchor … the geometry every popover, menu and tooltip uses since 0.1”; “Header bands … their behaviour is kept, their drawing follows the kit”); layer ranks are Experimental (“the order between kinds of foreground layers may still gain ranks”).
Tests
- The stack’s invariants, placement properties, keys held and focus
return:
crates/egui-pop-core/tests/core.rsand the module’s unit tests; focus coming back across scales:crates/egui-pop-test/tests/focus_place.rs. - Overlays per window and blocking:
crates/egui-pop-api/tests/it/windows.rs,window_scope.rs,app_windows.rs; flyouts held by their owner:flyouts.rs. - Ranks:
crates/egui-pop-core/tests/layers.rs(the order between ranks and the unranked layers whatever was raised last, a rank kept one pass, sublayers of a base noted at its rank,rank_from, a layer outside the foreground left alone);crates/egui-pop-api/tests/it/layer_ranks.rs(an application area and an overlay stay above a panel lying over, a popup opened from it too). - Bands: through the movable dialogs in
crates/egui-pop-api/tests/it/dialogs.rs; the band has no test of its own yet.
Dialogs and the settings window
The contract of the family “Standard windows and dialogs” (ADR 0027): the standard modal dialogs, the settings form and window, and the pages plugins add to it. About has its own page (About the application).
| Module | What it does |
|---|---|
egui_pop_api::dialogs | DialogsPlugin: confirm, form, choose, info and custom dialogs, queued, one shown at a time per window |
egui_pop_api::settings | The settings form: every declared setting by section, applied live, each with its reset |
egui_pop_api::settings_window | SettingsPlugin: the settings window (search, tree, form), the shortcuts editor, the gestures and the Fonts page |
egui_pop_api::settings_pages | Custom pages a plugin draws in the settings window, mounted through the mount contract (ADR 0013) |
Both plugins are in DefaultPlugins.
Owns: the dialogs’ rules (what the primary button says, Enter and Escape, the queue, the backdrop, moving), the settings window generated from declared settings, custom settings pages and their resets.
Refuses: wizards spanning several applications; a form builder for arbitrary data (that is admin forms).
Dialogs
A dialog is data, queued on the DIALOGS service; accepting runs its
command through the host with its arguments, the form’s values and the
choice merged in.
use egui_pop_api::dialogs::{self, Choose, Confirm, DialogSpec};
use egui_pop_api::App;
use egui_pop_model::ids::CommandId;
let app = App::builder()
.plugin(dialogs::DialogsPlugin)
.build(&egui::Context::default())
.unwrap();
let d = app.handle().service(&dialogs::DIALOGS).unwrap();
d.open(
Confirm::new("Delete 3 images?", "Delete 3 images", CommandId::from_static("doc.delete"))
.detail("They go to the trash.")
.danger(),
);
d.open(DialogSpec::new(Choose::new("Export as", &["JPEG", "PNG"], CommandId::from_static("doc.export"))).movable(true));
assert_eq!(d.len(), 2);
- Kinds (
Dialog):Confirm(a question before an action),Form(fields typed by value descriptors; a path field has Browse; aDescriptor::noteis a read-only line, what the command will also do, with no value answered),Choose(options under a filter field, each answering a value of its own),Info(a notice, orInfo::errorwith its details shown),Custom(a body of the application’s,Dialogs::open_custom). - Rules: the primary button says what it does (“Delete 3 images”,
never “OK”); a dangerous one is styled so and the focus starts on
Cancel; Enter accepts (except a danger), Escape cancels; a click on the
backdrop never closes. A notice and a confirmation have Copy (title,
text and
Details, for a bug report). - Presentation (
DialogSpec):closable(a ✕ that is Escape),movable(a header band,dialogs.movewith Alt+F7 for the keyboard),backdrop(Backdrop::DimorClear, modal either way),remember_position. The settingsdialogs.closableanddialogs.movableapply them to every dialog. - Withdrawn:
Dialogs::cancel(id, origin)cancels a dialog by the idopenreturned, shown or waiting, on the next frame and through the answer step, when its question no longer stands (it expired);falsewhen it was no longer open. - Windows (ADR 0025): each application window has its own queue and a dialog blocks its own window group only; a dialog whose window closes is cancelled with it.
- Owners (ADR 0028): a dialog belongs to the plugin of its command,
and a custom one also to the plugin that opened it. When that plugin
is disconnected the dialog is cancelled at once, whatever the hooks:
dialog.cancelledfromegui_popwith areason(“its pluginxis disconnected”) and an info line; the next queued dialog shows. It does not come back when the plugin reconnects. - Custom bodies are hosts of the mount contract: drawn every frame
in a
dialogfocus scope and a fault boundary; keys the body claims go to it first (when it claims Enter, Ctrl+Enter accepts); its values (CustomPass::value) join the command’s arguments. - Steps (ADR 0011):
dialog.show(a veto cancels),dialog.answer(a veto keeps it open with the reason, a redirect changes the answer),dialog.move. The journal saysdialog.answered, thendialog.chosenordialog.cancelled, anddialog.moved. - Agents: the
dialogscollector shows the dialog and answers it as its caller (Answer::Accept,Choose,Value,Cancel); an answer that would run a command not offered to agents is refused to anyone but the user (dialog.answer.refused), and the dialog stays open.
The settings window
Ctrl+, (app.settings) opens the Settings app when the application
has it (DefaultPlugins do), else the settings window; the window
itself opens from the Settings app’s General › Advanced page
(app.settings.window). It has a search field over a tree of sections,
the form (egui_pop_api::settings::form), the shortcuts editor (keys
captured by pressing them, conflicts said, each change reset on its
own), the pointer gestures and the Fonts page. Its writes go to the
store’s SETTINGS history: while the focus is in the window, Ctrl+Z
undoes the settings’ changes.
A plugin adds a page with Ctx::settings_page:
use egui_pop_api::settings_pages::SettingsPage;
use egui_pop_api::{Ctx, Plugin, PluginError};
use egui_pop_model::ids::PluginId;
struct Compute;
impl Plugin for Compute {
fn id(&self) -> PluginId {
PluginId::from_static("compute")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.settings_page(
SettingsPage::new("compute.devices", "Compute").keywords(&["GPU", "threads"]).order(10),
|ui, _app| {
ui.label("The devices found, and which one runs what.");
},
);
Ok(())
}
}
A page has a place in the tree (under, order), keywords for the
search, and the settings it edits (settings): those leave the
generated sections and its reset takes them back as one undo step, with
reset_with for what is not a setting. Agents open a page with
app.settings.page ({"page": "<id>"}) and read the pages in the
settings_window collector.
States and failure
- A dialog vetoed by
dialog.showis cancelled before it shows; one whose answer is vetoed stays open with the reason. Dialogs::open_customrefuses a spec that is not aCustom; a custom page or body whose component needs what the host does not offer is refused at mount (ADR 0003): reported, nothing added.- A body or page that panics shows a fault card in its place; the dialog keeps Cancel and Escape.
- A body is drawn only while its page is shown; the settings window moves by commands, applied before the next frame.
Accessibility
Every dialog is modal with its first focus inside and the focus given back on close (overlays); every editor of the settings form is labelled by its setting’s label; the ✕ is named “Close”; a movable dialog moves by keys. Labels, sections and choices are in the interface’s language.
Tier
From API stability: dialogs and the settings window are Supported (“The components: the command palette, dialogs, toasts, the settings window and shortcuts editor, … Their behaviour and commands are kept; their drawing follows the theme and may be refined”). Custom settings pages follow the settings window.
Tests
crates/egui-pop-api/tests/it/: dialogs.rs (kinds, rules, queue,
windows, moving), custom_dialog.rs (custom bodies, claimed keys),
dialog_copy.rs (Copy and details), settings_window.rs,
settings_pages.rs, and the settings’ history in history.rs and
undo.rs; dialogs opened by other families in about.rs,
clipboard.rs, files.rs, toasts.rs.
F6 regions
Part of the family “Focus and keyboard” (ADR 0027): F6 moves the keyboard between the parts of a window (an area, a palette, the status bar), as in most desktop applications, without changing any Tab order.
| Item | What it does |
|---|---|
egui_pop_core::focus::region | Draws a part of the window as a region: a focus scope with a rank |
egui_pop_core::focus::prefer | Names the widget a region lands on when nothing was focused there before |
egui_pop_core::regions::next | Says where F6 (or Shift+F6, back) goes: a Hop |
Owns: the order of the regions, where a hop lands, what blocks it.
Refuses: binding the key (whoever binds F6 moves the focus; the
application binds the commands workbench.next_region and
workbench.previous_region); Tab order inside a region (that is
egui_pop_core::tab, see Inputs, field states and Tab order).
The API
use egui_pop_core::{focus, regions};
fn window(ui: &mut egui::Ui) {
focus::region(ui, &focus::Region::new("list", 0), |ui| {
let _ = ui.button("Row");
});
focus::region(ui, &focus::Region::new("status", 1), |ui| {
let _ = ui.button("Item");
});
if ui.input(|i| i.key_pressed(egui::Key::F6))
&& let Some(regions::Hop { target: Some(id), .. }) = regions::next(ui.ctx(), false)
{
ui.memory_mut(|m| m.request_focus(id));
}
}
An application gets this without code: the workbench draws its areas, palettes and status bar as regions and binds F6 and Shift+F6.
The rules
- The order is the regions’ ranks, and it wraps. From nothing it starts at the first (the last going back); after Escape or a press, nothing holds the focus but the focus chain still says where the user is, so it goes on from that region.
- Where it lands: the widget focused there last, if it can still
take the focus; else the one the region names with
focus::prefer; else the first focusable widget of a scope inside the region, the content before what stands around it (a dock’s tabs, a palette’s band); else nowhere, for a region made withRegion::holding, whose content then holds the focus itself (a canvas); else any focusable widget of the region in view. A region with nothing to land on is passed over. - Panel Tab scopes inside a region take that region’s turn, each a stop of the round; F6 goes on out of them.
- Nothing moves behind a modal, overlay or scope:
nextanswersNone. - A focused widget taking every key (a terminal) gets F6 before any binding does.
- Each window has its own regions, as it has its own focus.
States and failure
next reads the last pass’s widget rectangles (egui lists no focusable
widgets, but records each widget’s sense in drawing order), so it can
answer before anything is drawn in this pass. With no region, or none
with anything to land on, it answers None and the focus stays.
Accessibility
F6 is the keyboard’s way between the window’s parts; a region is a focus scope, so screen readers follow the focus as usual. Every region must have something to land on or say it holds the focus, else it is unreachable by F6 (the keyboard walk test catches it in the gallery).
Tier
Supported, decided in API stability on 2026-11-15: F6 regions shipped in 0.8, 0.9 and 0.11; their rules are kept, the commands that bind them follow the workbench’s tier (experimental).
Tests
crates/egui-pop-api/tests/it/frame.rsandzen.rs(F6 through the frame and in zen mode),crates/egui-pop-test/tests/scale.rs(at several scales).crates/egui-pop-gallery/tests/it/keyboard_walk.rsandgallery.rs(every page reachable by keys).
Accessibility
The contract of the family “Accessibility” (ADR 0027), and the rule every other family follows (CREDO.md, point 7): every interactive widget has a name and a role that assistive technologies read, through egui’s AccessKit tree.
| Module | What it does |
|---|---|
egui_pop_core::a11y | Names and roles for custom widgets; the announcer (AccessKit live regions) |
egui_pop_test (the checks) | “Every interactive node has a name”, the accessibility tree as text |
Owns: the names of egui-pop’s custom widgets, the announcer, the checks that keep both true.
Refuses: a screen reader of its own; platform bridges (AccessKit is the bridge, through eframe and winit).
Names for custom widgets
A widget drawn from ui.allocate_response has no role or name for
AccessKit. egui_pop_core::a11y::name gives it both:
use egui::accesskit::Role;
use egui_pop_core::a11y;
fn swatch(ui: &mut egui::Ui) -> egui::Response {
let response = ui.allocate_response(egui::vec2(16.0, 16.0), egui::Sense::click());
a11y::name(&response, Role::Button, "Red label");
response
}
egui-pop’s own widgets name themselves: a compact cell by its name, a late value by its value’s name with its state as value, a thumbnail by its label, a slider by its label with its value, a modal’s grip as a splitter. A widget whose label is an icon takes the name its caller gives (a band button, a toolbar command by its command’s label).
The announcer
What changes without the focus moving (a toast, a status line, a file
picker’s count) is said through egui_pop_core::a11y::announce, polite
(read when the reader is idle) or assertive (at once):
use egui_pop_core::a11y::{self, Politeness};
let ctx = egui::Context::default();
a11y::announce(&ctx, "Saved", Politeness::Polite);
assert_eq!(a11y::announcements(&ctx)[0].text, "Saved");
egui_pop_core::a11y::live_regions draws the two live regions (one
polite, one assertive) holding the latest message of each, invisible;
the application’s shell draws them each pass, so a plugin only
announces.
The last KEPT (32) announcements are kept for tests and agents
(announcements).
States and failure
- A region holds the latest message of its politeness: the same text announced twice in a row leaves the region unchanged, so a reader may say it once.
- Without the application (a plain egui program),
announcestill queues; nothing is read until something drawslive_regions. - Busy states are said with AccessKit’s
busyflag: a skeleton (egui_pop_core::placeholder::Skeleton), a late value while its work runs, a command-bound control waiting for the host.
Checks
The test kit fails a test when an interactive node has no name
(egui_pop_test::assert_all_named, unnamed_interactive) and prints
the tree for a review (egui_pop_test::a11y_tree). A keyboard walk over
the gallery (crates/egui-pop-gallery/tests/it/keyboard_walk.rs) reaches
every page by keys alone.
A pass with a real screen reader (Orca on Linux) is not run yet; it is planned.
The focus ring
A focus ring shows only when the keyboard is in use, by the web’s
:focus-visible rule. Each window keeps one flag, with the focus plugin
(egui_pop_core::focus::install):
- on after a navigation key: Tab and Shift+Tab, the arrows, Home, End, Page Up, Page Down, even when the focus stays where it is (an arrow moving a grid’s cursor), and when the focus moves without the pointer (F6, a command’s shortcut, a screen reader);
- off at any press of the pointer.
Every ring egui-pop draws follows it: the plugin’s ring, and the focus look
of its widgets (the kit’s focus state through State::from_response),
lists, tables, trees, the thumbnail grid, the file browser, the workbench’s
tabs, bars and docked parts, the graph, the viewport and its tools. Text
inputs (fields, the editor, the terminal) show their focus however it came,
as the web’s do. A widget of your own asks focus::shows_ring(&response)
before drawing its ring, and calls focus::own_ring whenever it has the
focus. Only the ring’s visibility changes: where the keyboard goes, and the
focus AccessKit reports, stay the same. Without the plugin, the flag is
always on.
Tier
From API stability: Supported (“Accessibility
helpers (egui_pop_core::a11y): names for custom widgets and the
announcer”); the test kit’s checks are Supported with the test kit.
Tests
- The announcer and live regions:
crates/egui-pop-core/tests/core.rs. - Names across components:
crates/egui-pop-views/tests/views.rs,crates/egui-pop-api/tests/it/files.rs,status_items.rs,zen.rs; focus rings at several scales:crates/egui-pop-test/tests/focus_ring.rs; the gallery’s pages:crates/egui-pop-gallery/tests/it/inspect.rs,keyboard_walk.rs.
Containment: fault boundaries and the paint guard
The contract of the family “Containment” (ADR 0027): a part of the window that fails stays in its own rectangle, says so, and leaves the rest of the window working; a window never stays empty without a word. It applies ADR 0003 (no silent no-op) to drawing.
| Module | What it does |
|---|---|
egui_pop_core::fault | Fault boundaries: a panic while drawing a region becomes an error card in that region |
egui_pop_api::paint_guard | The main window’s paint guard: a focus screen without its page, a window that painted nothing |
Owns: the boundaries around panels, blocks, stories, custom dialog bodies and settings pages; the main window’s paint guard.
Refuses: recovering the application’s state after a panic (its kernel’s job); crash reporting (the platform services’ logs and crash reports, Logs and crash reports).
Fault boundaries
egui_pop_core::fault::boundary draws a closure inside a boundary. A
panic in it is caught (catch_unwind), logged on the egui_pop target,
and kept: the region shows an error card (the kit’s fault-card) with
the boundary’s name, the panic’s message and a Retry button, until the
user retries. The boundary returns None while the card is shown.
use egui_pop_core::fault;
fn inspector(ui: &mut egui::Ui) {
let drawn = fault::boundary(ui, "inspector", "Inspector", |ui| {
ui.label("Drawn by code that might panic");
});
if drawn.is_none() {
// The error card is shown in place of the inspector.
}
}
egui_pop_core::fault::boundary_reporting hands the caught Fault (its
name and message) to a
callback, once per failure: the application uses it to log the panel’s id and owner and to
publish panel.fault on the journal. egui_pop_core::fault::faults
lists the faults shown, for the debug bridge.
The application draws inside a boundary: every declared panel, every
block of a zone, every gallery story, a custom dialog’s body and a
custom settings page. Code drawn outside these (an application’s own
egui::Area, a wrap around the shell) is not contained unless it
calls boundary itself.
The paint guard
At the end of each pass of the main window, the application checks two holes:
- A focus screen without its page. A wizard run as a focus screen
hides the shell under its page. When the wizard is stored but no page
of it was drawn in the pass, the shell is drawn again from the next
pass on, a warning is logged once, and
window.focus_holeis published.AppHandle::focus_screen_holereads it. - A window that painted nothing. When the window added nothing but
backgrounds and lines (no text, no image, no overlay held) for longer
than a delay (
egui_pop_api::paint_guard::DEFAULT_DELAY, two seconds), an error says once what holds the screen (the place stack, the Settings app and its wizard, the overlays, the layout’s areas),window.painted_nothingis published, and a fallback page offers to reset the arrangement and go back to the first place. The page leaves as soon as the window paints again.AppHandle::empty_windowreads it,AppHandle::screen_stategives what the log says.
AppHandle::set_empty_window_delay changes the delay, or turns the
second watch off with None (an application that paints a blank canvas
on purpose).
use std::time::Duration;
use egui_pop_api::AppHandle;
fn setup(app: &AppHandle) {
app.set_empty_window_delay(Some(Duration::from_secs(5)));
}
The cost is a counter and a scan of the pass’s shapes that stops at the first text or image.
ADR 0029 makes the guard’s findings
events of the window lifecycle (window.painted, window.invariant)
read from one window registry, instead of watches of its own.
Failure behaviour
- Where panics abort (
panic = "abort", WebAssembly without unwinding) nothing is caught: the boundary changes nothing there. - A boundary never retries by itself: Retry forgets the fault and draws the closure again; a new panic shows a new card and is reported again.
- The paint guard says each hole once per occurrence (log, journal event), not each pass.
Accessibility
The error card is text (title, sentence, message) and a named Retry button, reachable by Tab. The fallback page is an ordinary page with named buttons.
Tier
From API stability: fault boundaries are Supported
(“a panel that panics is replaced by its fallback, the rest of the
window goes on”); the paint guard is Experimental (“The main
window’s paint guard (egui_pop_api::paint_guard): new, not yet
released”).
Tests
- Boundaries:
crates/egui-pop-core/tests/core.rs; a panel that panics is contained, named and logged:crates/egui-pop-api/tests/it/paint_guard.rs(a_panel_that_panics_is_contained_and_named); mounted components in boundaries:crates/egui-pop-gallery/tests/it/mounts.rs. - The paint guard:
crates/egui-pop-api/tests/it/paint_guard.rs(a focus screen with and without its page, a window that paints nothing, with and without decorations, the watch turned off).
Jobs and progress
egui-pop never runs an application’s background work. The host (ADR
0010) runs it and publishes job events on egui-pop’s pop.job.event
point, each typed by a JobEventKind; egui-pop folds
them into a model, draws them, and sends the user’s requests back to the
host as commands. The design notes and the survey behind this page are
in Advanced widgets, section 3.
The jobs model
egui_pop::model::jobs::Jobs (no egui) folds the events into jobs;
JobsPlugin (opt-in, egui_pop::api::jobs) keeps it behind the JOBS
service, as a listener on the bus
(ADR 0029): the bus delivers each job
event once, in journal order, to the listeners of pop.job.event
(each pass, and before a wait or a plugin’s disconnection reads the
jobs: AppHandle::deliver_events), and pop.jobs.model is one of them.
Nothing polls: without new events, nothing is read.
The host publishes with a JobPublisher (Send + Sync, any thread):
the application hands one to its host (Host::set_job_publisher), and
AppHandle::job_publisher or AppHandle::publish_job give the same.
Each event is recorded in the journal under its kind’s label (the
table’s names, job.started…) for the journal’s readers, but the model
follows the point only: a journal entry merely named job.started is
not a job event, so a host never has to carry egui-pop’s names.
Asking about a job is a request on the bus: pop.job.cancel, pop.job.pause,
pop.job.resume, pop.job.retry (AppHandle::request_job with a
bus::JobAsk, or jobs::ask). Their listeners run in the call, in
their declared order: pop.jobs.model marks the job as waiting for the
answer, then pop.jobs.host runs its command for the host (or the
application’s runner); the answer is the host’s events. With no jobs
plugin, nobody listens and the request is refused (job.refused). The
order is printed by AppHandle::bus_order_of(&bus::JOB_POINTS) and kept
as a reviewed file (crates/egui-pop-api/tests/bus/jobs-points.txt).
| Kind (journal label) | Data |
|---|---|
job.started | id, title, kind, badge ({icon, tone, tip}: a registry symbol before the title, its tip its tooltip and accessible name), parent, weight, total (none: indeterminate), steps ([{id, title, weight}]), cancellable (true), pausable (false), retryable (true), owner (the plugin it runs for), command (the command that started it) |
job.progress | id, done, total, failed, skipped, item, item_progress (0 to 1), phase, step, step_done, step_total, estimate (the host’s own fraction), badge (null takes it away) |
job.item_failed | id, item, error (the job goes on) |
job.paused, job.resumed | id |
job.cancelling | id, reason (why, when it was not the user) |
job.failed | id, error |
job.finished | id, actions ([{title, command, args}]: “Show in folder”) |
job.cancelled | id, reason (why, when it was not the user) |
job.orphaned | id, plugin, reason (from egui_pop, not the host: the job’s plugin is disconnected and the job goes on) |
job.adopted | plugin, jobs (from egui_pop: the plugin is back, these jobs are no longer orphaned) |
job.log | id, text (lines of the job’s log) |
A job.started for a job already known starts it again (a retry): its
progress is reset, its log kept, its finished children forgotten.
Every job carries an estimated overall percentage (Job::fraction,
0 to 1, Job::percent), or none while it cannot estimate:
- a job with sub-steps rolls them up, each weighted by its estimate: its
declared
steps(a render: decode 1, process 3, write 1) and its child jobs (parent, each with itsweight). Finished parts count whole, the current one by its own progress, the others nothing; a batch with atotalcounts its children not started yet; - otherwise
doneoftotal, the current item’s progress included; - otherwise the host’s
estimate; - otherwise the job is indeterminate until it can estimate, and once determinate it never goes back (a growing total moves the bar back instead);
- the application refines it with a hook on the
jobs.estimatestep (ADR 0011).
Time left (Job::eta) follows the rate of that fraction (a moving
average over the times events arrived), never before 3 seconds, never
while paused. “Now” comes from the plugin’s clock: the motion clock by
default (below), a ManualClock of the test’s own if it wants
(JobsPlugin::clock).
use egui_pop::api::App;
use egui_pop::api::bus::JobEventKind;
use egui_pop::api::jobs::{JOBS, JobsPlugin};
use serde_json::json;
let mut app = App::builder()
.plugin(JobsPlugin::default())
.build(&egui_pop::egui::Context::default())
.unwrap();
let h = app.handle().clone();
// What a host publishes, from its own job facts.
h.publish_job("host", JobEventKind::Started, json!({
"id": "render", "title": "Render",
"steps": [
{ "id": "decode", "weight": 1 },
{ "id": "process", "weight": 3 },
{ "id": "write", "weight": 1 },
],
}));
h.publish_job("host", JobEventKind::Progress, json!({
"id": "render", "step": "process", "step_done": 1, "step_total": 2,
}));
app.logic(&egui_pop::egui::Context::default());
let render = h.service(&JOBS).unwrap().job("render").unwrap();
// Decode done (1), half of process (1.5), of 5.
assert_eq!(render.percent(), Some(50.0));
Cancel, pause, resume, retry
They are commands the host runs, each with { "id" }: job.cancel,
job.pause, job.resume, job.retry. JobsPlugin declares them for
the host (Ctx::declare), or runs them in-process with a runner the
application gives (JobsPlugin::run_locally). jobs::ask(app, id, request) runs one as the user and marks the job: it shows “cancelling”
from the moment it was asked until the host publishes job.cancelled;
a refused command leaves the reason in Job::request_error. The model
follows the commands’ command.dispatched and command.failed events,
so a request from an agent or a script shows the same way.
A job’s owner, and what happens when it goes
A job belongs to a plugin when its job.started names it: owner (the
plugin’s id) or command (a command the plugin declared, the one that
started the job). A job naming neither belongs to the plugin that
published it, when the events’ source is a plugin’s id; a host’s job
naming no one has no owner. Job::owner and Job::command keep them.
When the plugin is disconnected
(ADR 0028), each of
its jobs still going on gets one of two ends, both on the bus: the
plugin’s disconnection is a request (pop.plugin.disconnect) asked before
plugin.disconnected is said, and its listener
pop.jobs.cancel-on-disconnect asks them (Jobs::left_by decides, the
model follows the events as for any other):
- a job naming it that is
cancellableis cancelled by the host: the framework runsjob.cancelwith{ "id", "reason" }(sourcescript:egui_pop,reason“its pluginxis disconnected”). The job shows “cancelling” until the host publishesjob.cancelled, and keeps the reason (Job::reason); a host that refuses leavesJob::request_erroras for any request; - any other (not cancellable, or published by the plugin itself, which
will never end it) is kept and marked orphaned:
job.orphanedwith thepluginand thereason,Job::orphaned. The jobs centre says “running, its plugin x is off” and offers Dismiss on it though it goes on (Jobs::dismissaccepts an orphaned job). The mark goes when the job ends or starts again, or when the plugin reconnects (job.adopted, said bypop.jobs.adopt-on-connect, a listener ofpop.plugin.connect). An orphaned job is not waited on: nothing owns it and it may never end, soJobs::idle(and the application’ssettled) leave it out, andJobs::orphanslists it apart. Thejobscollector saysorphaned(a count) besideidle, andbridge.waitanswers it too: an agent sees the job without waiting on it. With only orphaned jobs going on, the status bar’s ring stays still (a spinning ring asks for a repaint each pass, so the application would never settle).
A child job follows its parent. plugin.disconnected counts both ends
(jobs_cancelled, jobs_orphaned), and each is an info line in the
log. Without the jobs plugin nothing is done: nothing follows jobs.
The jobs.estimate step
| Step | Arguments | Result |
|---|---|---|
jobs.estimate | id, title, kind, fraction (the model’s own, null while it cannot), done, total, steps, step, elapsed | { "fraction": 0 to 1 }, or the model’s own (or null) to leave it to the model |
It runs only when a plugin hooks it, once per pass for each active job that moved, so a job’s progress does not double the journal.
use egui_pop::prelude::*;
use egui_pop::api::jobs::STEP_ESTIMATE;
struct ScanEstimate;
impl Plugin for ScanEstimate {
fn id(&self) -> PluginId {
PluginId::from_static("scan_estimate")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
// A scan cannot count what is left; a library holds about 500
// folders.
ctx.replace(STEP_ESTIMATE, |_, args| {
if args["kind"] != "scan" || !args["fraction"].is_null() {
return Ok(serde_json::json!({ "fraction": args["fraction"] }));
}
let done = args["done"].as_f64().unwrap_or(0.0);
Ok(serde_json::json!({ "fraction": (done / 500.0).min(0.95) }))
});
Ok(())
}
}
let _ = ScanEstimate;
Agents and tests
The debug bridge’s jobs collector shows every job (state, fraction,
counts, time left, the end of its log), idle, what an agent waits
for (no owned job going on), and orphaned, the jobs going on that a
disconnected plugin left, which it does not wait for; its actions cancel, pause, resume, retry, dismiss and
clear do what the buttons do, for the user (devtools). They write, so
the bridge’s agent is refused them: it runs the job.cancel,
job.pause, job.resume and job.retry commands instead
(Agents).
egui_pop_test::jobs::FakeHost is a host whose jobs a test scripts,
event by event, without threads; it answers the job commands now, later
(until release) or never (Answer::Refuse):
let host = FakeHost::new();
host.answer(Answer::Later);
let mut app = App::builder().host(host.clone()).plugin(JobsPlugin::default())
.build(&ctx).unwrap();
host.job("export").start("Export", Some(4)).item(1, "a.raw").fail("disk full");
The motion clock
Spinners, travelling bars, shimmer and the busy delay read the motion
clock (egui_pop::core::motion), not the input’s time directly:
motion::now(ctx): the interface’s time, or a clock the application or a test gives (set_clock,freeze). A given clock moves only when told: a test freezes motion, steps it, and gets the same frames on every run. The jobs model reads the same clock, so a job’s start and a busy indicator’s delay agree;motion::phase(ctx, period, still): where a looping animation is (0 to 1);stillunder reduced motion (motion.durationis 0), so animated widgets give still frames;motion::animate(ctx): asks for the next frame of an animation on screen, never at once (a headless harness settles), four a second while the window is not focused, never under reduced motion or a given clock;motion::Busy: the delayed busy indicator. Nothing shows beforemotion.spinner.delay(300 ms): most work ends sooner, and a flash of spinner reads as a glitch. Once shown it staysmotion.spinner.min(500 ms), so it does not flash off. The delay counts from when the work started (a job’s or a command’s start), not from when the widget was first drawn, so a panel opened midway shows the right state at once; the frame where the indicator appears is asked for, no timer thread runs.
| Token | Default | What |
|---|---|---|
motion.spinner.delay | 300 ms | work shorter than this shows no busy indicator |
motion.spinner.min | 500 ms | a busy indicator, once shown, stays this long |
motion.spinner.turn | 900 ms | one turn of a spinner |
motion.progress.travel | 1500 ms | an indeterminate bar’s segment crossing its track |
motion.skeleton.shimmer | 1600 ms | a skeleton’s shimmer crossing it |
use egui_pop::core::motion::{self, Busy};
let ctx = egui_pop::egui::Context::default();
// In a test: motion stands still until told.
let clock = motion::freeze(&ctx, 0.0);
let busy = Busy::new(egui_pop::egui::Id::new("export"), 0.0);
clock.set(0.2);
assert!(!busy.visible(&ctx, true));
clock.set(0.4);
assert!(busy.visible(&ctx, true));
Progress widgets
egui_pop::core::progress draws progress from a fraction; the jobs
centre and the status bar feed them a job’s estimate. They are drawn by
the kit (kit.md): progress-bar and progress-line (the
tracks), progress-fill (fills and sections, by tone),
progress-caption, meter and meter-tick, progress-ring and
spinner (colours only), on the motion clock. The former progress.*
tokens are no longer read (see the changelog’s migration table).
| Widget | What |
|---|---|
ProgressBar | determinate (new(Some(f)), counts(done, total)) or indeterminate (new(None): a segment travelling along the track; a still striped track under reduced motion); tones (Tone::Accent while running, Info, Success, Warning, Danger, Muted when paused); stacked sections after the fill (failed, skipped); line() for the thin line; caption(true) draws the name and the value text above it |
Ring | a small circle: an arc from the top, or a turning arc when indeterminate |
Meter | a value against thresholds (disk space, memory), its tone the highest threshold reached; AccessKit role Meter. As a value bar in a slot: size(vec2) fills it, vertical() fills it from the bottom (a level meter, vertical for assistive technologies too) |
Spinner | a turning arc with a label; delayed(id, since, busy) shows it only after motion.spinner.delay and keeps it motion.spinner.min, its space kept while hidden |
Each is an AccessKit ProgressIndicator with its name (label); a
determinate one has a numeric value and its range (0 to the total with
counts, otherwise 0 to 100) and a value text (“340 of 1,204”, or the
text given); an indeterminate one has no value. Colour is never the
only signal: the state is in the name or the text.
use egui_pop::core::progress::{ProgressBar, Spinner, Tone};
fn ui(ui: &mut egui_pop::egui::Ui, started: f64, loading: bool) {
ui.add(
ProgressBar::counts(340, 1204)
.label("Importing photos")
.section(61.0 / 1204.0, Tone::Danger, "failed")
.text("340 of 1,204, 61 failed")
.caption(true),
);
ui.add(
Spinner::new()
.label("Loading thumbnails")
.delayed(egui_pop::egui::Id::new("thumbnails"), started, loading),
);
}
Busy controls and the status bar
A command the host answers later (Reply::Later) shows as running
until its result arrives (AppHandle::running, and
AppHandle::running_since, by the motion clock). Controls bound to it
show it:
egui_pop::api::busy::CommandButton: a button running a command, greyed while it waits; aftermotion.spinner.delaya spinner takes its icon’s place for at leastmotion.spinner.min. Its width and its name stay, AccessKit’sbusyflag is set, and a failed run says why on hover;- menu items bound to the command do the same;
- a status bar indicator (
strips::IndicatorState::busy, the time the work started) shows a delayed spinner before its text; JobsPluginadds the status bar’s jobs item: a ring with the jobs’ overall estimate (turning while one cannot estimate), “Jobs: 3 (42%)”, and “Failed: 1”; nothing while there is nothing to say.
use egui_pop::api::AppHandle;
use egui_pop::api::busy::CommandButton;
use egui_pop::core::icon::Icon;
use egui_pop::model::ids::CommandId;
fn toolbar(ui: &mut egui_pop::egui::Ui, app: &AppHandle) {
ui.add(CommandButton::new(app, CommandId::from_static("doc.export")).icon(Icon::Save));
}
The jobs centre
egui_pop::api::jobs_centre draws every job the host runs, the same
list in two places: the Jobs panel (declared by JobsPlugin,
closed until asked for; without_panel() leaves it out) and a
popover from the status bar’s jobs item.
- Each job: a chevron, its title and state, a bar of its estimated overall percentage (failed and skipped items stacked after the fill), the percentage, “n of m”, the current step and item, the time left, the reason it failed or why the host refused a request, its failed items (folded), and buttons asking the host: Pause, Resume, Cancel, Retry; Dismiss forgets a finished one, its actions (“Show”) run their commands. A batch’s children fold under it. Finished jobs go to the history, cleared by hand (“Clear finished”).
- The chevron opens the job’s log console, collapsed by default and
remembered per job (
JobsService::expanded), so the panel, the popover and a toast agree. The console streams the job’sjob.loglines. - Buttons are named with their job for assistive technologies (“Cancel: Export 12 images”); the chevron says what it does (“Show the log of Export 12 images”).
- A toast can carry a job (
Toast::info("Exporting").job(id)): its bar, Cancel while it runs, its first action once it ended. It stays while the job goes on; closing it does not cancel the job.
Where the console comes from (layering). The jobs centre is part of
the application API (L3), which sits below egui-pop-editors (L4,
ADR 0001), so it cannot use the editors’ Terminal. It draws plain
lines (ANSI escapes dropped) by itself, and looks for a JOB_LOG_VIEW
service first: egui_pop::editors::JobConsolesPlugin provides one, a
Terminal over a Console source per job, fed the job’s new lines as
they come (colours, scrollback, selection, copy; with TerminalPlugin,
agents read it as the terminal job:<id>). The facade offers it with
its editors feature; an application without the editors keeps the
plain console.
use egui_pop::prelude::*;
use egui_pop::api::jobs::JobsPlugin;
use egui_pop::editors::{JobConsolesPlugin, TerminalPlugin};
let app = App::builder()
.plugin(JobsPlugin::default())
.plugin(TerminalPlugin)
.plugin(JobConsolesPlugin)
.build(&egui_pop::egui::Context::default())
.unwrap();
let _ = app;
An application’s rows: row sources
Not all background work is a host job: an application may wait on
promises, keep links to other machines, or watch conditions. Instead of
a list of its own, it declares a row source, and the jobs centre
shows its rows beside the jobs (egui_pop::model::job_rows). The
source is on the bus, so nothing else needs to know it:
pop.jobs.rows(JobRowsSet, aJobRowsAsk) declares a source, or replaces its rows: its id, its title (the filter’s label), its owner, and every row it has now.pop.jobs.source.drop(JobSourceDrop) takes it away. Both may be asked from any thread on the bus the application holds (app.bus().alter::<JobRowsSet>(…)), or withAppHandle::request_job_rowsandrequest_job_source_drop.JobsPlugin’s listener (pop.jobs.sources) keeps them (JobsService::sources).- A plugin disconnected takes the sources it owns with it
(
job_sources_droppedinplugin.disconnected’s counts). - Each row (
JobRow): an id, a title, a state (queued,running,waiting,done,failed), its progress when it knows it (0 to 1: a bar), a detail line (also its tooltip), a registry symbol (JobBadge, its tip its accessible name), a group, and actions (RowAction:cancel,retryoropen, each a command run with its arguments; its label the kind’s unless it gives atitle). - The list shows each source’s rows under its title, ungrouped rows first, then each group under its name. The source decides when a row goes: the jobs centre keeps no history of them.
- Once a source is declared, a filter bar shows: a toggle per source
(egui-pop’s own jobs first,
OWN_SOURCE) and the states shown (all, active, done, failed);JobsService::filterandset_filterread and set it. Without a source, the list is as before, unfiltered. - Accessibility: each source’s rows are a list named by its title, each row a list item named “title, state” (“Sync with the NAS, waiting”), each action a button named with its row (“Retry: Sync with the NAS”); the filter bar is a toolbar (“Filter the jobs”), its source toggles check boxes (“Show Network”), its states radio buttons (“Show: Failed”).
use egui_pop::prelude::*;
use egui_pop::api::bus::JobRowsAsk;
use egui_pop::api::jobs::{JOBS, JobsPlugin};
use egui_pop::model::job_rows::{JobRow, RowAction, RowActionKind, RowState};
use serde_json::json;
let app = App::builder()
.plugin(JobsPlugin::default())
.build(&egui_pop::egui::Context::default())
.unwrap();
let h = app.handle();
h.request_job_rows(JobRowsAsk::new(
"nodes",
"Network",
"my_app",
vec![
JobRow::new("nas", "Sync with the NAS", RowState::Waiting)
.detail("The NAS is asleep")
.group("Machines")
.action(RowAction::new(RowActionKind::Retry, "nodes.wake").args(json!({ "node": "nas" }))),
],
));
assert_eq!(h.service(&JOBS).unwrap().sources()[0].rows.len(), 1);
The gallery’s Jobs page adds a demo source (“Add a row source”).
Skeletons and empty states
egui_pop::core::placeholder:
Skeletonstands in for content that fills progressively, in its layout:Skeleton::text(lines)for a paragraph,Skeleton::rows(n)for list rows (a block and two lines each). Shapes inskeleton.fill, a shimmer crossing them inskeleton.shimmereverymotion.skeleton.shimmer; no shimmer under reduced motion nor under a given motion clock, so tests get still frames. Its region carries AccessKit’sbusyflag and a name (“Loading the metadata”, “Loading” by default). Not for thumbnails: show what is known instead (an embedded preview, an average colour, as the thumbnail grid does).EmptyStatesays why a place is empty and what to do: an icon, a title, a sentence, an action (showreturns whether it was clicked; the application runs its command),danger()when something went wrong.
use egui_pop::core::icon::Icon;
use egui_pop::core::placeholder::{EmptyState, Skeleton};
fn queue(ui: &mut egui_pop::egui::Ui, rows: Option<&[String]>) -> bool {
match rows {
None => {
ui.add(Skeleton::rows(4).label("Loading the queue"));
false
}
Some([]) => EmptyState::new(Icon::Folder, "The queue is empty")
.text("Export images to fill it.")
.action("Export")
.show(ui),
Some(rows) => {
for r in rows {
ui.label(r);
}
false
}
}
}
Tests: crates/egui-pop-core/tests/placeholder.rs (a skeleton busy and
named, its height per line or row, a width kept, still under a given
clock; an empty state’s title, sentence and action, an unknown icon
drawn as the placeholder and reported).
Gaps
- A job with no event for a long time is not shown as “not responding” yet (the host would declare its timeout).
- Queued jobs (a position in a queue, reordering) are not modelled.
Translations
egui-pop-i18n translates an egui-pop application with
Fluent: catalogues per locale, a fallback
chain ending in English, a language setting, numbers, dates and plurals
written for the locale, and tools that find the keys the code uses. It
is a plugin built on egui-pop’s public API; the facade re-exports it as
egui_pop::i18n with the i18n feature:
egui-pop = { version = "0.3", features = ["i18n"] }
The plugin
I18nPlugin loads egui-pop’s own catalogues (English and French: menus,
the palette, the settings window, dialogs, the shortcuts editor, the
workbench, devtools, the platform services), the application’s, and
optionally a directory read at start-up whose messages replace the
built-in ones, so translators try their work without rebuilding:
use egui_pop::egui;
use egui_pop::i18n::{Catalogue, I18nPlugin, args, plugin, t};
use egui_pop::prelude::*;
static CATALOGUES: &[Catalogue] = &[
// Usually `include_str!("../locales/fr/app.ftl")`.
Catalogue::new("en", "app.ftl", "greeting = Hello, { $name }!\n"),
Catalogue::new("fr", "app.ftl", "greeting = Bonjour, { $name } !\n"),
];
let ctx = egui::Context::default();
let mut app = App::builder()
.plugins(DefaultPlugins)
.plugin(
I18nPlugin::new()
.catalogues(CATALOGUES)
.dir("locales-override")
.env("MYAPP_LANG"),
)
.build(&ctx)
.unwrap();
plugin::set_language(app.handle(), "fr").unwrap();
let mut shown = String::new();
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| {
app.show(ui);
shown = t(ui.ctx(), "greeting", &args![name = "Ada"]);
});
out.textures_delta.clear();
assert_eq!(shown, "Bonjour, Ada !");
// egui-pop's own strings follow.
assert_eq!(
egui_pop::core::strings::tr(&ctx, &egui_pop::core::strings::RETRY),
"Réessayer"
);
Catalogues are Fluent files, one directory per locale
(locales/<locale>/*.ftl). A build script can list a directory and
generate the Catalogue array with include_str!; a handful of files
are as easily listed by hand.
Looking text up
t(ctx, "key", &args![…]): the text in the context’s language;text(ctx, "key", "English", &args![…])gives the English to show when no catalogue has the key.tr!("key", name = value): the same from anywhere, through the catalogues last installed (the connected plugin’s).I18n::t,I18n::text: on the catalogues themselves (I18nPlugin::i18n()gives them), in tests or worker threads.
A key is a Fluent message id, optionally with an attribute
(command-app-quit.title). A lookup tries the locale, its parents
(fr-CA, then fr, then a regional catalogue of the same language),
then English. A key missing everywhere shows the English written in the
code, else the key itself.
egui-pop’s interface asks egui_pop::core::strings, which the plugin
answers. What plugins declare is translated where it is drawn, through
keys derived from stable ids, never from English, so rewording English
keeps every translation:
| What | Key |
|---|---|
| a command’s title, description | command-<id>.title, .description |
| a command’s category | category-<english> |
| a panel’s title | panel-<id>.title |
| a submenu’s label | menu-<id>.label |
| a setting’s label, description | setting-<id>.label, .description |
| one value of a choice setting | setting-<id>-choice-<value> |
| a plugin’s title (a settings section) | plugin-<id>.title |
| a clipboard type’s title (“a colour”) | clip-<format>.title |
Every character of an id other than an ASCII letter, a digit or -
becomes - (app.quit gives command-app-quit.title).
A command’s title may say { $application }, in its English and in its
translations: it is filled with the application’s name
(AppBuilder::name), so “About { $application }” reads “About Helios”
and its translation “À propos de { $application }” reads “À propos de
Helios”. The extractor (declarations) keeps it a placeable in the
English catalogue (extract::plain_with); every other brace of a title
stays text.
The commands every panel gets (<panel>.focus, <panel>.toggle) read
texts shared by all panels, with a { $panel } placeholder filled with
the panel’s translated title: egui-pop-panel-focus-title,
egui-pop-panel-focus-description, egui-pop-panel-toggle-title,
egui-pop-panel-toggle-description, in egui-pop’s own catalogue. An
application translates its panels’ titles and nothing more; a
translation under the command’s own key (command-<id>.title) still
wins. The extractor leaves those commands’ texts out.
An application’s catalogue may define a key egui-pop’s own catalogue
already has (a better word for egui-pop-cancel in its domain): its
text overrides egui-pop’s, I18n::overridden lists it and the plugin
publishes an i18n.overridden warning on the journal. A key defined
twice by the application itself is still refused. egui-pop’s catalogues
are base catalogues (Catalogue::as_base).
A plugin shipping its own catalogue adds it with I18n::add_owned:
every message must carry the plugin’s id (acme-…, command-acme-…),
so it cannot rewrite another’s text.
Without the application
An application that does not use App builds an I18n and installs it
in its egui context with install(&ctx, &i18n): t(ctx, ..),
text(ctx, ..) and of(ctx) read it, tr! reads it as the global
catalogues, and egui-pop’s own text is translated through a Provider
installed as the context’s strings provider. The plugin installs its
catalogues the same way when it connects.
use egui_pop::egui;
use egui_pop::i18n::{I18n, args, install, t, tr};
let i18n = I18n::with_egui_pop("fr");
i18n.add("fr", "hello = Bonjour, { $name } !\n").unwrap();
let ctx = egui::Context::default();
install(&ctx, &i18n);
assert_eq!(t(&ctx, "hello", &args![name = "Ada"]), "Bonjour, Ada !");
assert_eq!(tr!("hello", name = "Ada"), "Bonjour, Ada !");
The I18n is shared: i18n.set_locale("en") or a catalogue added later
shows at the next lookup, without installing again. The global tr!
reads is the process’s: the last install wins. What the plugin adds on
top (the language setting, locale.changed, the i18n.resolve step,
the debug collector) is left to the application.
Numbers, dates and plurals
Plurals select on the locale’s rules; numbers are written with its
separators; DATETIME writes dates:
use egui_pop::i18n::{I18n, args};
let i18n = I18n::new("fr");
i18n.add("fr", "
photos = { $count ->
[one] { $count } photo
*[other] { $count } photos
}
size = { NUMBER($mib, maximumFractionDigits: 1) } Mio
saved = Enregistré le { DATETIME($when, dateStyle: \"long\") }
").unwrap();
assert_eq!(i18n.t("photos", &args![count = 1]), "1 photo");
assert_eq!(i18n.t("photos", &args![count = 2400]), "2\u{202f}400 photos");
assert_eq!(i18n.t("size", &args![mib = 12.345]), "12,3 Mio");
assert_eq!(i18n.t("saved", &args![when = "2026-10-12"]), "Enregistré le 12 octobre 2026");
egui-pop’s own strings (egui_pop_core::strings) take typed arguments.
tr_args places text as it is, even text that looks like a number: a
folder named “2026” stays “2026”, not “2,026”. A count or a size goes
through tr_with as an Arg::Num, built with into(), so it is
written with the locale’s separators:
use egui_pop::core::strings::{self, StrKey};
use egui_pop::egui;
const OPENED: StrKey = StrKey::new("opened", "{ $folder }: { $count } entries");
let ctx = egui::Context::default();
let text = strings::tr_with(&ctx, &OPENED, &[("folder", "2026".into()), ("count", 3.into())]);
assert_eq!(text, "2026: 3 entries");
egui_pop::i18n::format does the same from Rust (number, date,
time, and quantity, a number and its unit with the locale’s space
between them: a narrow no-break space in French, a plain space in
English; sliders use it through egui_pop_core::strings::quantity). Month and weekday names are known for English and French;
other languages get numeric dates.
The language setting and its signal
The plugin declares appearance.language in the host’s store, like
every setting: system (an environment variable named with
I18nPlugin::env, then the system’s language), or a locale with a
catalogue, each shown by its own name. Changing it switches the locale;
the plugin publishes locale.changed ({ "from", "to", "setting" }) on
the host’s journal and the next frame is drawn in the new language.
The i18n.resolve step
Lookups are a step (ADR 0011): a plugin
may observe them, redirect them (another key or locale) or replace them.
Without hooks, lookups do not run the step; with one, each distinct
lookup runs it once ({ "key", "locale", "args" }, its result the text
or null), at the next frame, and its answer is kept until the locale
or the catalogues change. ShowKeys replaces every lookup by its key,
to see which key a piece of text comes from; it is connected while the
developer.show_keys setting is on:
use egui_pop::egui;
use egui_pop::i18n::{I18nPlugin, ShowKeys};
use egui_pop::model::commands::Origin;
use egui_pop::model::values::{Change, Set, Value};
use egui_pop::prelude::*;
let ctx = egui::Context::default();
let mut app = App::builder()
.plugin(I18nPlugin::new())
.plugin(ShowKeys)
.build(&ctx)
.unwrap();
egui_pop::core::lock(&app.handle().store())
.set(Set::new(
"settings/developer.show_keys",
Change::To(Value::Bool(true)),
Origin::User,
))
.unwrap();
let mut shown = String::new();
for _ in 0..4 {
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| {
app.show(ui);
shown = egui_pop::core::strings::tr(ui.ctx(), &egui_pop::core::strings::RETRY);
});
out.textures_delta.clear();
}
assert_eq!(shown, "egui-pop-retry");
Debugging
The i18n collector of the debug bridge (shown in devtools’
collectors tab) gives the locale, its chain, the locales and, per
locale, the keys looked up that its language lacks; set_locale and
clear_missing act on them, for the user (devtools): they write, so
the bridge’s agent is refused them (Agents). The pseudo-locale x-pseudo shows English
accented and lengthened, to spot text that is not translated and
layouts too tight for longer languages.
Tools: extracting and checking keys
egui_pop::i18n::extract finds the keys an application uses:
scan_tree(src, Pattern::DEFAULTS)reads Rust sources for literal keys (tr!("key"),t(ctx, "key", …),text(ctx, "key", "English", …),StrKey::new("key", "English"),lookup(ctx, "key", "English")); an application adds its own patterns (Message::new, key first, English second).scan_dirgives only the keys;declarations(app, &[])lists what a built application declares, under the derived keys.
How a call is matched: by its callee’s path, however long it is and
however it is laid out. A pattern Message::new takes
Message::new(…), app_core::Message::new(…),
crate::strings::Message::new(…) and ::app_core::Message::new(…),
with the path, the arguments or both split across lines and comments
in between; t takes egui_pop_i18n::t(…). A method (x.t(…)) or a
definition (fn t(…)) is not a call. The key must be a string literal
and a Fluent key; a call whose key is not is skipped. A constructor,
a pattern whose callee ends in ::new (StrKey::new, Message::new),
declares a message, so a constructor call the scanner cannot read is
reported rather than skipped silently: its key is not a string literal
(Message::new(id, …)), not a Fluent key, or its English is not a
string literal (concat!(…), a constant; the key is then kept without
English). Each such call is in Scan::unread, with its file and line
(src/ui.rs:12: `app::Message::new(…)` not read: the key is not a string literal), and logged as a warning. The catalogue check,
out_of_date(path, current, fresh, &scan.unread), gives None when
the catalogue on disk is what the code gives now, else a failure
message that lists those calls, the usual cause of a key missing.
messages merges them; english writes the English catalogue (sorted,
deterministic), update merges them into an existing one (keeping the
English written there for keys the code gives none, reporting keys
added, changed and unused), and report gives, per locale, the keys
missing and unused. egui_pop::i18n::check checks a catalogue directory
for faults (a file that does not parse, a key defined twice, no
English), coverage, and keys whose English changed since they were
translated (an english.hashes sidecar per locale, written by stamp).
An application wires them into its own tasks (cargo xtask i18n extract, for instance):
use egui_pop::i18n::extract::{self, English, Found, Messages};
let found = extract::scan_source(
r#"ui.label(tr!("app-welcome")); let k = StrKey::new("app-save", "Save");"#,
"src/main.rs",
extract::Pattern::DEFAULTS,
);
let messages: Messages = extract::messages(&found).unwrap();
assert_eq!(messages["app-save"], English::Pattern("Save".into()));
let updated = extract::update("app-welcome = Welcome!\n", &messages, "", false);
assert_eq!(updated.added, ["app-save"]);
assert!(updated.source.contains("app-welcome = Welcome!"));
// An application's constructor, under any path; a call it cannot read
// is listed by the catalogue check.
let patterns = [extract::Pattern { callee: "Message::new", key: 0, english: Some(1) }];
let scan = extract::scan(
"const A: Message = app_core::Message::new(\n \"app-ready\",\n \"Ready\",\n);\n\
let b = app_core::Message::new(id, \"Busy\");",
"src/status.rs",
&patterns,
);
assert_eq!(scan.found[0].key, "app-ready");
assert_eq!(scan.unread[0].origin, "src/status.rs:5");
let failure = extract::out_of_date("en/app.ftl", "", "app-ready = Ready\n", &scan.unread);
assert!(failure.unwrap().contains("src/status.rs:5"));
let _: Vec<Found> = found;
A single instance and deep links
An application that should run once per user (a photo library, a
player, a chat) makes a second launch hand its arguments to the running
one, which comes to the front and opens what it was given: files,
myapp:// links. egui-pop-platform does it with a local socket named
after the application; the facade re-exports it as
egui_pop::platform with the platform feature (or
platform-instance alone):
egui-pop = { version = "0.3", features = ["platform-instance"] }
At the top of main
instance::single runs before any window. The first launch listens and
gets Single::First; a later one connects, hands over its arguments,
its working directory and its activation token, gets Single::Handed
and exits:
use egui_pop::platform::instance::{self, InstancePlugin, Single};
use egui_pop::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let first = match instance::single("org.example.Viewer")? {
Single::Handed => return Ok(()),
Single::First(first) => first,
};
App::builder()
.plugins(DefaultPlugins)
.plugin(
InstancePlugin::new(first)
.scheme("viewer")
.links(CommandId::from_static("viewer.open_link")),
)
.run_native("Viewer", Default::default())?;
Ok(())
}
The socket is an abstract Unix socket on Linux (a connection from
another user is refused), a file in $XDG_RUNTIME_DIR/app/<id> inside a
Flatpak sandbox (the directory the application’s sandboxes share, since
each may have a network namespace of its own), a named pipe on Windows,
and a socket in /tmp on the other Unix systems; its name holds the
application’s id and the user’s name. Nothing else is written.
Without the application
instance::single does not need App. An application without it takes
the later launches itself from the Launches of Single::First
(Instance::launches): Launches::set_waker with its egui context, so
a launch handed over repaints the window, and Launches::take in each
frame, which drains the launches handed over since the last call:
use egui_pop::egui;
use egui_pop::platform::instance::{Instance, Launch};
let first = Instance::detached(Launch::default()); // `Single::First(first)`
let launches = first.launches();
let ctx = egui::Context::default();
launches.set_waker(Some(ctx.clone()));
launches.deliver(Launch { args: vec!["photo.jpg".into()], ..Launch::default() });
// Each frame:
for launch in launches.take() {
egui_pop::platform::window::raise(&ctx);
assert_eq!(launch.args, ["photo.jpg"]); // open what it names
}
Links in the application’s scheme are in Launch::links(&["viewer".into()]);
what to do with them, and who asked (a link from a launch is not the
user’s gesture, below), is the application’s call.
The steps
| Step | Arguments | Default |
|---|---|---|
instance.second_launch | args, cwd, links (the arguments in one of the plugin’s schemes) | the main window comes to the front, then each link runs deeplink.open |
deeplink.open | url, origin | the plugin’s links command runs with { "url" }, for origin; without one the step fails and says so |
A click on a link in one of the plugin’s schemes inside the
application (the links service) opens it in-process, with
no round trip through the system: the plugin adds its schemes to the
links policy at start, and its hidden command deeplink.open (url)
runs the same step.
deeplink.open also runs at start for the links the first launch was
given (viewer://album/3 on its command line). A plugin vetoes
instance.second_launch to stay in the background, replaces it to open
the files a launch names, or follows deeplink.open to log links:
use egui_pop::egui;
use egui_pop::platform::instance::{
Instance, InstancePlugin, LAUNCHES, Launch, STEP_SECOND_LAUNCH,
};
use egui_pop::prelude::*;
struct Viewer;
impl Plugin for Viewer {
fn id(&self) -> PluginId {
PluginId::from_static("viewer")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.command(
CommandSpec::new(CommandId::from_static("viewer.open_link"), "Open a link", "Viewer"),
|call| Ok(call.args["url"].clone()),
)?;
// Files named by a second launch open here; links still go to
// `deeplink.open`.
ctx.after(STEP_SECOND_LAUNCH, |app, args, _| {
for file in args["args"].as_array().into_iter().flatten() {
app.publish("viewer", None, "viewer.file", file.clone());
}
});
Ok(())
}
}
let ctx = egui::Context::default();
let mut app = App::builder()
.plugin(Viewer)
.plugin(
InstancePlugin::new(Instance::detached(Launch::default()))
.scheme("viewer")
.links(CommandId::from_static("viewer.open_link")),
)
.build(&ctx)
.unwrap();
// A launch handed over in-process, as the socket would.
app.handle().service(&LAUNCHES).unwrap().deliver(Launch {
args: vec!["viewer://album/3".into()],
..Launch::default()
});
app.logic(&ctx);
app.logic(&ctx);
let ran: Vec<_> = app.handle().history().into_iter().map(|r| r.id.to_string()).collect();
assert_eq!(ran, ["viewer.open_link"]);
Instance::detached is an instance listening to nothing, for tests and
for applications that are single some other way; Launches::deliver
hands a launch over in-process.
Who opens a link
A link that comes with a launch is not the user’s gesture: any program
of the user’s can start the application with one (a web page in a
browser, a script, another application), and a later launch reaches the
running one through the single-instance socket. So the links command
runs for Origin::Remote("deeplink") (instance::deeplink_origin,
remote:deeplink on the journal and in the step’s origin), not for
the user:
- the handler sees it in
Call::origin; - the commands it starts with
AppHandle::runrun for it too, and it may not run one as the user (command.refusedon the journal); - the values it writes are written as
remote:deeplink, held to their declared writers.
A handler that changes or deletes anything on a link asks the user
first, in a dialog: the user’s answer runs its command as the user. A
link of the application’s own scheme clicked inside the application
(the deeplink.open command, run by the links service) runs for the
click’s origin, the user’s.
Platforms
| Single instance | Coming to the front | |
|---|---|---|
| Linux, X11 | yes | yes |
| Linux, Wayland | yes | the window asks for attention: the compositor gives the focus only with an activation token, which egui does not pass on to the window |
| Windows | yes (named pipe) | yes, within the focus-stealing rules of Windows (the taskbar button flashes otherwise) |
| macOS | yes | yes; macOS itself usually keeps a bundle single and sends links as Apple events, which winit does not hand to egui yet: links reach a bundled application only on its command line |
| Web | no (each tab is its own) | no |
Registering the viewer: scheme with the system (a desktop file’s
MimeType=x-scheme-handler/viewer, a registry key, the bundle’s
CFBundleURLTypes) is the package’s part: see
Packaging.
Notifications
egui-pop-platform’s notifications show on the desktop (the XDG
notification server on Linux and BSD, the notification centre on macOS,
toasts on Windows, all through notify-rust) with actions that run
commands, and fall back to egui-pop’s in-app toasts where the desktop
shows none. The facade re-exports them with the platform feature (or
platform-notify alone):
egui-pop = { version = "0.3", features = ["platform-notify"] }
Showing one
A Notification has a title, a body, a level, actions (an id, a label,
a command and its arguments) and a command for a click on its body.
notify::show shows one from the interface thread; Notifier::post
(the NOTIFIER service) queues one from any thread, shown at the next
pass:
use egui_pop::egui;
use egui_pop::platform::notify::{self, Level, Notification, NotifyPlugin, Simulated, NOTIFIER};
use egui_pop::prelude::*;
let ctx = egui::Context::default();
// `NotifyPlugin::new("Viewer")` shows them on the desktop; the
// simulated desktop records them instead.
let desktop = Simulated::default();
let mut app = App::builder()
.plugins(DefaultPlugins)
.plugin(NotifyPlugin::new("Viewer").backend(desktop.clone()))
.build(&ctx)
.unwrap();
let export = Notification::new("Export done", "3 images in Pictures")
.level(Level::Success)
.action("show", "Show", CommandId::from_static("files.reveal"), serde_json::json!({ "path": "Pictures" }))
.on_click(CommandId::from_static("export.open"), serde_json::Value::Null);
let out = notify::show(app.handle(), export);
assert_eq!(out.result().unwrap().as_ref().unwrap()["via"], "desktop");
// From a worker thread:
let notifier = app.handle().service(&NOTIFIER).unwrap();
let n = (*notifier).clone();
std::thread::spawn(move || n.post(Notification::new("Import done", "120 images")))
.join()
.unwrap();
app.logic(&ctx);
assert_eq!(notifier.history().len(), 2);
Where it shows
The notifications.desktop setting decides: always (the default) on
the desktop, unfocused on the desktop only while the window does not
have the focus, never in the window. A notification goes to a toast
when the setting says so, when the desktop has no notification server,
or when showing it failed; a failure arrives later (desktop
notifications are shown from a thread of their own, since the D-Bus
call can block) and publishes notify.failed with the error. A toast
carries the notification’s first action.
Toasts
The in-app toasts are the ToastsPlugin’s (in DefaultPlugins;
egui_pop::api::toasts): a level, a text, one action, a close button,
and a job’s progress when given one. Information and success go after
4 s, warnings after 8 s, errors stay until closed; a thin bar in the
level’s colour empties as the time runs. The pointer over a toast stops
its time (and its bar); it goes on from where it stopped once the
pointer leaves. An action whose command went with its plugin is greyed,
its tooltip saying which plugin is disconnected (ADR 0028); it is alive
again when the plugin reconnects.
They show in the corner the appearance.toast_corner setting chooses,
under Appearance: top-left, top-center, top-right, bottom-left,
bottom-center or bottom-right (the default). An application gives
its own default with AppBuilder::toast_corner:
use egui_pop::api::toasts::Corner;
use egui_pop::prelude::*;
let app = App::builder()
.plugins(DefaultPlugins)
.toast_corner(Corner::TopRight)
.build(&egui_pop::egui::Context::default())
.unwrap();
assert_eq!(egui_pop::api::toasts::corner(app.handle()), Corner::TopRight);
The newest is always the nearest to the edge: at the bottom under a
bottom corner, on top under a top one. A toast slides in from its
corner’s side and out again when it goes, in motion.toast.slide
(200 ms) with a cubic ease-out; in the middle of an edge it comes from
the edge and fades. Under reduced motion it appears and goes at once,
and its bar steps once a second.
Toasts cast the shadow of what lies over the interface: toast.shadow-*,
aliases of shadow.popup.*, as menus and popovers have it.
Their state is data: Toasts::shown (each with its phase, appear,
idle, its time left as the bar shows it, and whether the pointer
held it), Toasts::leaving (gone, still sliding out: painted only,
with nothing to press and nothing for a screen reader) and
Toasts::history, all in the debug bridge’s toasts collector. Their
time runs on the motion clock (core::motion), so a test freezes it
and steps it.
The slide with its appear, idle and disappear states, the time-left bar
that stops under the pointer, the corner as a choice, the newest nearest
the edge and the shadow are ideas taken from
egui-notify (MIT; see
NOTICE).
The steps
| Step | Arguments | Default |
|---|---|---|
notify.show | the notification’s fields and id | to the desktop or a toast, as above; the result is { "id", "via" } and, for a toast, reason |
notify.action | id, action (an action’s id, default for a click on the body), command, args | the command runs through the host; default also brings the window to the front |
A toast’s button and a desktop button both go through notify.action
(the toast runs the hidden notify.act command). A plugin vetoes
notify.show for a do-not-disturb mode, replaces it to send
notifications elsewhere, and follows notify.action to count what users
pick:
use egui_pop::egui;
use egui_pop::platform::notify::{self, Notification, NotifyPlugin, Simulated, STEP_SHOW};
use egui_pop::prelude::*;
struct DoNotDisturb;
impl Plugin for DoNotDisturb {
fn id(&self) -> PluginId {
PluginId::from_static("dnd")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.before(STEP_SHOW, |_, args| {
if args["level"] == "error" { Before::Go } else { Before::Veto("busy".into()) }
});
Ok(())
}
}
let app = App::builder()
.plugins(DefaultPlugins)
.plugin(NotifyPlugin::new("Viewer").backend(Simulated::default()))
.plugin(DoNotDisturb)
.build(&egui::Context::default())
.unwrap();
let out = notify::show(app.handle(), Notification::new("Synced", ""));
assert_eq!(out.vetoed(), Some("busy"));
Platforms
| Shows | Actions | Click on the body | |
|---|---|---|---|
| Linux, BSD | through the XDG notification server (GNOME Shell, KDE Plasma, dunst, mako…) | yes, when the server offers actions | yes |
| Windows | as Windows toasts | yes (buttons) | not reported by notify-rust: nothing runs |
| macOS | through the notification centre | the first action, as the notification’s button | yes |
| Web | no: toasts | in the toast | no |
| No server (a bare X session, a container) | toasts | the first, in the toast | no |
Gaps: a toast shows one action (the first). Each desktop notification
waiting for an answer holds a thread until it is closed. Inside a
Flatpak sandbox the notification server is reached through
--talk-name=org.freedesktop.Notifications (the portal’s notification
interface is not used yet).
The desktop knows the application by its id, given with
NotifyPlugin::new("Viewer").backend(Desktop::new("Viewer").app_id("org.example.Viewer")):
its desktop file’s name on Linux (the desktop-entry hint, so the
server shows its icon and its settings apply), its AppUserModelID on
Windows (without one, notifications show as PowerShell’s), its bundle
identifier on macOS. See Packaging.
The tray icon
egui-pop-platform’s tray puts an icon in the panel, the notification
area or the menu bar, with a menu that is an ordinary egui-pop menu:
plugins fill it as they fill any other, its items take their titles,
keys, ticks and greying from the commands, and a pick runs the command
through the host. The facade re-exports it with the platform feature
(or platform-tray alone):
egui-pop = { version = "0.3", features = ["platform-tray"] }
It wraps tray-icon: the StatusNotifierItem protocol over D-Bus on Linux and BSD (through ksni, with no GTK), the notification area on Windows, the menu bar on macOS.
A declared menu
The menu is MENU_TRAY (app.tray). A command placed in it, a
submenu, a list filled when it opens: all as in the window’s menus. The
plugin keeps the system’s menu current at each pass, so a checked
clause ticks the item as the context changes:
use egui_pop::egui;
use egui_pop::platform::tray::{Entry, MENU_TRAY, Simulated, TrayPlugin, Icon, STEP_ACTIVATE};
use egui_pop::prelude::*;
const PAUSE: CommandId = CommandId::from_static("player.pause");
struct Player;
impl Plugin for Player {
fn id(&self) -> PluginId {
PluginId::from_static("player")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.command(
CommandSpec::new(PAUSE, "Pause", "Player")
.checked("playerPaused")
.menu(MENU_TRAY, "1_play", 0),
|call| {
let paused = call.app.context().get("playerPaused") == "true";
call.app.set_context("playerPaused", if paused { "false" } else { "true" });
Ok(serde_json::Value::Null)
},
)?;
// A left click toggles instead of bringing the window up.
ctx.replace(STEP_ACTIVATE, |app, _| {
app.run(PAUSE, serde_json::Value::Null);
Ok(serde_json::json!({ "toggled": true }))
});
Ok(())
}
}
// `TrayPlugin::new("Player")` shows the system's icon; the simulated
// tray records what it would show.
let tray = Simulated::default();
let ctx = egui::Context::default();
let mut app = App::builder()
.plugin(Player)
.plugin(
TrayPlugin::new("Player")
.app_id("org.example.Player")
.tooltip("Player: idle")
.icon(Icon::disc(32, [0xe6, 0x61, 0x00]))
.backend(tray.clone()),
)
.build(&ctx)
.unwrap();
app.logic(&ctx);
assert!(matches!(&tray.menu()[0], Entry::Item { checked: Some(false), .. }));
tray.click("left");
app.logic(&ctx);
app.logic(&ctx);
assert!(matches!(&tray.menu()[0], Entry::Item { checked: Some(true), .. }));
The step
| Step | Arguments | Default |
|---|---|---|
tray.activate | button: left, middle, double | the main window comes to the front (shown, restored, focused) |
The right button opens the menu on every platform. A pick from the menu is a command run, in the host’s journal like any other.
Hiding to the tray
eframe keeps running the application’s logic while the window is
hidden, when something asks for a repaint: the tray’s thread does on
each click, and the plugin takes it at the next pass (On::Pass). An
application that hides instead of closing vetoes frame.close (or
handles eframe’s close request) and sends
ViewportCommand::Visible(false); the default tray.activate shows
the window again.
Platforms
| Icon | Menu | Clicks | |
|---|---|---|---|
| KDE Plasma, Xfce, Cinnamon, LXQt, sway’s bars | yes (StatusNotifierItem) | yes | left, middle |
| GNOME | only with the AppIndicator extension (installed by default on Ubuntu and Fedora’s workstation, not on vanilla GNOME) | yes | left, middle |
| Windows | yes | yes | left, middle, double |
| macOS | yes, in the menu bar | yes | left, middle |
| Web | no |
Where no tray host runs, the icon has nowhere to go and nothing says so
(the protocol has no answer for it); the TRAY service reports what
the backend could start. The icon is RGBA pixels (Icon); a themed icon
name is not used. Inside a Flatpak sandbox the plugin goes without a
well-known D-Bus name, as the StatusNotifierItem hosts accept; see
Packaging.
Global shortcuts
A global shortcut runs its command while the application is not
focused: play or pause from any window, a quick capture, a push-to-talk.
In egui-pop it is an ordinary key binding in the system scope: it is
declared with its command, listed and rebound in the shortcuts editor,
saved in keymap files, and inside the window it fires as a global
binding does. egui-pop-platform registers these bindings with the
desktop; the facade re-exports it with the platform feature (or
platform-keys alone):
egui-pop = { version = "0.3", features = ["platform-keys"] }
Declaring one
use egui_pop::egui;
use egui_pop::api::system_keys::{KeyStatus, SYSTEM_KEYS};
use egui_pop::model::keymap::BindOptions;
use egui_pop::platform::keys::{Simulated, SystemKeysPlugin, STEP_PRESSED};
use egui_pop::prelude::*;
const TOGGLE: CommandId = CommandId::from_static("player.toggle");
struct Player;
impl Plugin for Player {
fn id(&self) -> PluginId {
PluginId::from_static("player")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.command(
CommandSpec::new(TOGGLE, "Play or pause", "Player")
.key_with("Ctrl+Alt+P", BindOptions::system()),
|_| Ok(serde_json::Value::Null),
)?;
// Count the presses that come from outside the window.
ctx.after(STEP_PRESSED, |app, args, _| {
app.publish("player", None, "player.global_key", args.clone());
});
Ok(())
}
}
// `SystemKeysPlugin::new("org.example.Player")` registers them with the
// desktop; the simulated desktop records them.
let desktop = Simulated::default();
let ctx = egui::Context::default();
let mut app = App::builder()
.plugins(DefaultPlugins)
.plugin(Player)
.plugin(SystemKeysPlugin::new("org.example.Player").backend(desktop.clone()))
.build(&ctx)
.unwrap();
app.logic(&ctx);
let keys = app.handle().service(&SYSTEM_KEYS).unwrap();
assert_eq!(keys.status("Ctrl+Alt+P"), Some(KeyStatus::Registered));
// The user picks other keys in the shortcuts editor: they stay global.
app.handle().rebind(TOGGLE, Some("Ctrl+Alt+F9".into()));
app.logic(&ctx);
app.logic(&ctx);
assert_eq!(desktop.registered()[0].keys, "Ctrl+Alt+F9");
desktop.press("Ctrl+Alt+F9");
app.logic(&ctx);
assert_eq!(app.handle().history()[0].id, TOGGLE);
In a keymap file the scope is written "scope": "system".
What the shortcuts editor says
The plugin provides the SYSTEM_KEYS service
(egui_pop::api::system_keys): whether the desktop takes global
shortcuts at all, and each binding’s state. The shortcuts editor shows
it next to the command:
- Ctrl+Alt+P also works outside the window: registered;
- Ctrl+Alt+P outside the window: waiting for the desktop: asked, the desktop has not answered (a portal asking the user);
- Ctrl+Alt+P does not work outside the window: taken by another
application (or the desktop’s reason, or a global shortcut is a
single chord for
Ctrl+K Ctrl+P); - Ctrl+Alt+P works only in the window: (reason): the desktop takes no global shortcuts (a Wayland compositor without the portal, the web);
- … no plugin registers global shortcuts: the application did not add the plugin.
Nothing fails silently: a binding that cannot work outside the window says so where the user changes it.
The step
| Step | Arguments | Default |
|---|---|---|
keys.system | command, keys, backend | the command runs through the host |
Platforms
| Through | Notes | |
|---|---|---|
| Windows | global-hotkey (RegisterHotKey) | keys another application holds are refused, and said so |
| macOS | global-hotkey (Carbon hot keys) | Ctrl in egui-pop’s keys is Command; no accessibility permission is needed |
| Linux and BSD, X11 | global-hotkey (an X grab on the root window) | checked end to end under Xvfb with XTest; refused keys are said so |
| Linux, Wayland | the XDG GlobalShortcuts portal | GNOME 48 and later, KDE Plasma 5.27 and later; the desktop asks the user to accept the shortcuts and may let them choose other keys; outside a sandbox the portal needs the application’s desktop file, <app id>.desktop, installed, else it refuses (“an app id is required”) and the editor says so |
| Wayland without the portal (sway, older GNOME) | nothing | the editor says the shortcuts work only in the window |
| Web | nothing | as above |
On Wayland the backend is the portal even when XWayland runs: an X grab
there only sees keys going to X11 windows. detect picks the backend
for the session; HotKeys, Portal and Simulated can be given to
SystemKeysPlugin::backend directly. See
Packaging for the desktop file.
Logs and crash reports
egui-pop-platform writes the application’s logs to a file in the
platform’s log directory, rotated by size, at a level the user sets.
The facade re-exports it with the platform feature (or
platform-logs alone):
egui-pop = { version = "0.3", features = ["platform-logs"] }
Logs
LogsPlugin installs a logger for the log facade, which egui-pop and
most crates log through. Each line goes to <log dir>/<name>.log and
to a tail kept in memory; when the file passes its size (5 MiB by
default) it becomes <name>.1.log, the older ones shift and the oldest
beyond those kept (3) goes.
| The log directory | |
|---|---|
| Linux and BSD | $XDG_STATE_HOME/<app>/logs (~/.local/state/<app>/logs) |
| macOS | ~/Library/Logs/<app> |
| Windows | %LOCALAPPDATA%\<app>\logs |
The plugin declares the developer.log_level setting (error, warn,
info, debug, trace; info by default), the logs.reveal command
(opens the folder) and the logs debug collector (the file, the level,
the tail):
use egui_pop::egui;
use egui_pop::platform::logs::{Level, Logs, LogsPlugin, LOGS};
use egui_pop::prelude::*;
let dir = std::env::temp_dir().join(format!("viewer-logs-{}", std::process::id()));
let ctx = egui::Context::default();
let app = App::builder()
.plugins(DefaultPlugins)
// `LogsPlugin::new("org.example.Viewer")` uses the platform's
// directory; here, a temporary one, smaller files, two kept.
.plugin(LogsPlugin::new("org.example.Viewer").logs(Logs::new(&dir, "viewer").max_size(1 << 20).keep(2)))
.build(&ctx)
.unwrap();
let logs = app.handle().service(&LOGS).unwrap();
// What `log::warn!(target: "viewer", ...)` writes, from any thread:
logs.write(Level::Warn, "viewer", "the cache is nearly full");
assert!(logs.tail().last().unwrap().ends_with("WARN viewer: the cache is nearly full"));
logs.flush();
assert!(std::fs::read_to_string(dir.join("viewer.log")).unwrap().contains("nearly full"));
std::fs::remove_dir_all(&dir).unwrap();
An application that installed another logger first (env_logger,
tracing’s) gets a warning in the tail, and feeds the lines it wants in
the file with Logs::write(level, target, message). No step runs per
line: lines are written from whatever thread logs them.
A view showing log lines colours their levels with the theme’s
palette.log.{trace, debug, info, warn, error, critical} tokens
(Tokens::of(ctx).palette.log, Tokens).
Crash reports
CrashPlugin marks the session as running in the crash directory
(<state dir>/crashes) and installs a panic hook, chained to the one
before it. A panic writes the session’s report: the application’s name
and version, the OS and its release, the thread, the message and where,
a backtrace, the last log lines and the tail of the host’s journal. A
clean exit (the app.exit step) takes the marker and the session’s
panics away, so a panic a fault boundary caught makes no report.
On the next start, a marker left by a session that is gone means it
did not end cleanly: its panics, or, without one, a report saying it
ended without closing (killed, out of memory, a crash in native code)
with the last lines of its log file, become a report, offered by the
crash.report step. Nothing is sent anywhere: the default writes
the report and shows a toast that stays, with a button opening the file.
| Step | Arguments | Default |
|---|---|---|
crash.report | path, report | the report (with what a before-hook added under report.extra) is written, then offered in a toast with Show the report (crash.reveal) |
An application adds its own data with a before-hook, and sends the report itself, after asking the user, with an after-hook:
use egui_pop::egui;
use egui_pop::platform::crash::{self, CrashPlugin, Report, CRASHES, STEP_REPORT};
use egui_pop::prelude::*;
struct Reporter;
impl Plugin for Reporter {
fn id(&self) -> PluginId {
PluginId::from_static("reporter")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.before(STEP_REPORT, |_, args| {
let mut args = args.clone();
args["report"]["extra"] = serde_json::json!({ "catalog": "photos.db" });
Before::Redirect(args)
});
ctx.after(STEP_REPORT, |app, args, _| {
// Ask the user, then send `args["report"]` to the
// application's own service.
app.publish("reporter", None, "reporter.offered", args["path"].clone());
});
Ok(())
}
}
let dir = std::env::temp_dir().join(format!("viewer-crashes-{}", std::process::id()));
// What a session that panicked leaves behind.
crash::simulate(&dir, 4_100_000, &Report::panic("Viewer", "1.0.0", "index out of bounds")).unwrap();
let ctx = egui::Context::default();
let mut app = App::builder()
.plugins(DefaultPlugins)
.plugin(Reporter)
// `CrashPlugin::new("org.example.Viewer", env!("CARGO_PKG_VERSION"))`
// uses the platform's directory and installs the hook.
.plugin(CrashPlugin::new("Viewer", "1.0.0").dir(&dir).hook(false))
.build(&ctx)
.unwrap();
app.logic(&ctx);
let crashes = app.handle().service(&CRASHES).unwrap();
let report = crashes.read(&crashes.reports()[0]).unwrap();
assert_eq!(report.extra["catalog"], "photos.db");
assert_eq!(report.summary(), "index out of bounds at src/main.rs:1:1");
std::fs::remove_dir_all(&dir).unwrap();
The reports stay in the crash directory until dismissed
(crash.dismiss, Crashes::dismiss). The hook never blocks: if the
session’s state is held at the moment of the panic, the panic is not
written.
Platforms
| Logs | Crash reports | |
|---|---|---|
| Linux and BSD | yes | yes; a session is known gone when its process is |
| Windows, macOS | yes | yes; a session left behind is taken as gone (two instances at once should use the single instance) |
| Web | no file system: the tail only | no |
A panic with panic = "abort" still runs the hook, so the report is
written; a crash in native code (a segmentation fault in a driver)
leaves only the marker: the next start reports a session that ended
without closing, with its last log lines.
The focus mode
egui-pop follows the window manager’s focus mode: where the keyboard
goes when the pointer moves. In click mode it goes where the user
clicks; in hover mode the surface under the pointer gets the keys
(see egui_pop::core::focus_mode). The appearance.focus setting
(system, click, hover) lets the user decide; system asks the
desktop.
By default run_native asks the desktop once, at start, through a
helper program (gsettings, kreadconfig6). On Windows it reads
nothing and takes click: a helper (reg) would flash a console window
at every start, and egui-pop-core has no registry access. With
egui-pop-platform (feature platform, or platform-focus alone) the
same answers are read in the process, and followed while the
application runs:
egui-pop = { version = "0.3", features = ["platform-focus"] }
use egui_pop::platform::focus::{self, FocusModePlugin};
use egui_pop::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
App::builder()
.plugins(DefaultPlugins)
// Read in-process now: `run_native` starts no helper.
.system_focus(focus::read())
// Read again, from a thread, each time the window gets the focus
// back: a change in the desktop's settings applies at once.
.plugin(FocusModePlugin::new())
.run_native("Viewer", Default::default())?;
Ok(())
}
What each desktop says
| Read from | Hover when | |
|---|---|---|
| GNOME, and desktops using its settings (Budgie, Pantheon…) | the XDG Settings portal: org.gnome.desktop.wm.preferences, focus-mode | sloppy or mouse |
| KDE Plasma | kwinrc ($XDG_CONFIG_HOME), group Windows, FocusPolicy, read as a file: the portal does not carry KWin’s settings | FocusFollowsMouse, FocusUnderMouse, FocusStrictlyUnderMouse |
| Windows | HKCU\Control Panel\Desktop\UserPreferencesMask, its active window tracking bit: what SystemParametersInfo(SPI_GETACTIVEWINDOWTRACKING) reports, read through the registry API (egui-pop has no unsafe code, so not through SystemParametersInfo itself) | the bit is set (“Activate a window by hovering over it with the mouse”) |
| macOS | nothing: its window manager has no focus following the pointer | never |
| Other Linux desktops (sway, Hyprland, Xfce…), the web | nothing read | never |
EGUI_POP_FOCUS_MODE (click or hover) stands in for the desktop,
for tests and for desktops egui-pop does not read. The portal is asked
with a two-second timeout, so a session without one starts as fast.
The plugin reads again when the window gets the focus back rather than
listening to each desktop’s change signal: a user changes the focus mode
in the desktop’s settings, then comes back to the application, which
reads it then. FocusModePlugin::fixed answers a given mode instead,
for tests and pictures.
Where an application writes
The folders an application writes to, read from the environment as each
platform names them. Two modules, in two families
(ADR 0027): the configuration folder
is part of “Foundations” (AppBuilder::persist_in_config saves there),
the state, logs, crash reports and caches part of “Platform services”.
| Module | What it gives |
|---|---|
egui_pop_api::dirs | config_dir: where settings, the layout and the window’s place are kept |
egui_pop_platform::dirs | state_dir, log_dir, crash_dir, cache_dir, temp_dir, pid, reveal; re-exports config_dir |
| Configuration | State | Logs | |
|---|---|---|---|
| Linux and BSD | $XDG_CONFIG_HOME/<app> (~/.config/<app>) | $XDG_STATE_HOME/<app> (~/.local/state/<app>) | <state>/logs |
| macOS | ~/Library/Application Support/<app> | ~/Library/Application Support/<app> | ~/Library/Logs/<app> |
| Windows | %APPDATA%\<app> | %LOCALAPPDATA%\<app> | <state>\logs |
Crash reports go to <state>/crashes; compiled files (a theme’s cache)
to the platform’s cache directory. Inside a Flatpak sandbox the XDG_*
variables point into the application’s own directory, so the same code
finds the sandbox’s place.
Owns: the names of these places per platform.
Refuses: creating or cleaning them (the writer creates what it
writes); data folders the user chooses (the application asks with
choosing files); a general directories crate (dirs and
directories were surveyed: three variables, and neither has a state
folder on macOS and Windows).
The API
let config = egui_pop_api::dirs::config_dir("demo");
let logs = egui_pop_platform::dirs::log_dir("demo");
let _ = (config, logs);
// The same, from an environment of the caller's (tests, a sandbox):
let dir = egui_pop_platform::dirs::state_dir_with("demo", |name| match name {
"XDG_STATE_HOME" => Some("/state".into()),
_ => None,
});
if cfg!(all(unix, not(target_os = "macos"))) {
assert_eq!(dir, Some("/state/demo".into()));
}
egui_pop_platform::dirs::reveal opens a file or folder with what the
system opens it with (the log folder from a crash dialog).
Failure behaviour
Each function answers None when the environment names no home (no
HOME, no APPDATA); a relative value of a variable is ignored, as the
XDG specification says. The caller then keeps the data in memory or
uses temp_dir, the last resort. On the web there is no file system:
the functions answer None, pid is 0 and reveal refuses. reveal
returns the opener’s error as text; it does not wait for the opener.
Accessibility
None: no UI.
Tier
From API stability: egui_pop_api::dirs is
Supported (decided 2026-11-15: the places users’ settings live are
kept; moving them would need a migration of where they are read).
egui_pop_platform::dirs follows the platform services:
Experimental (“their backends, services … may move while the first
applications ship them”).
Tests
Unit tests in crates/egui-pop-api/src/dirs.rs; doc tests of both
modules; crates/egui-pop-platform/tests/dirs.rs (the state directory
per platform from the environment given, a relative place skipped, the
logs, crash reports and cache under their places, the temporary
directory and the process id). reveal starts the system’s opener and
is not run in tests.
Tips
A tip of the day and contextual hints, registered by plugins,
translated, dismissed for good and remembered in the settings. The
gallery’s tips page shows them.
Registering tips
use egui_pop::api::tips::{TIPS, TIPS_PLUGIN, Tip, TipsPlugin};
use egui_pop::api::{App, Ctx, Plugin, PluginError};
use egui_pop::model::ids::PluginId;
struct Photos;
impl Plugin for Photos {
fn id(&self) -> PluginId {
PluginId::from_static("photos")
}
fn requires(&self) -> Vec<PluginId> {
vec![TIPS_PLUGIN]
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
let tips = ctx.app().service(&TIPS).expect("required");
tips.add(Tip::new("photos.rate", "Rate quickly", "Press 1 to 5 to rate the selected photos."));
tips.add(Tip::new("photos.export-here", "Export from here", "Exports with the last settings.").contextual());
Ok(())
}
}
let app = App::builder()
.plugin(TipsPlugin)
.plugin(Photos)
.build(&egui_pop::egui::Context::default())
.unwrap();
assert_eq!(app.handle().service(&TIPS).unwrap().all().len(), 2);
Add TipsPlugin to the application. A tip has an id, an English title
and text; a contextual tip is shown only where the application asks for
it, never as the tip of the day.
Tips in files
A tip is also a file, tips/<id>.md: one idea per file, shipped by a
plugin beside its code, with no code of its own.
---
command: photos.rate
surface: focusedPanel == 'photos.grid'
target: photos.rating
---
# Rate quickly
Press {key} to rate the selected photos, **0** to clear the rating.
| Header | What | Default |
|---|---|---|
id | The tip’s id, prefixed by its plugin’s | The file’s name |
surface | A when clause: where the tip makes sense | Anywhere |
command | The command the tip teaches | None |
target | The name of what the tip is about | None |
contextual | true: shown only where the application asks | false |
The header is optional; the text starts with a # Title heading. It
keeps paragraphs (a blank line between them), **bold** and
`code`. {key} is the key bound to the tip’s command in the
keymap in force, and {key:<command>} another command’s: a key the
user rebound shows rebound. A command without a key shows its title in
bold.
Tips::add_files(origin, files) registers files built into the binary
(include_str!), Tips::add_dir(origin, dir) a folder’s; both return
the files that could not be read (the line and what is wrong), and
register the others. origin is the plugin’s id, which groups its
tips. The gallery’s own tips are in crates/egui-pop-gallery/tips.
Showing them
tips::tip_of_the_day(ui, app): a card with the tip in turn among those not dismissed, “Previous tip”, “Next tip”, where it is in the turn, “Don’t show again” and “Close” (for this session). It returns whether it drew a card.tips::hint(ui, app, "photos.export-here"): the tip as a card where it is called, beside what it is about, with “Got it”.
The card is a note for screen readers; its buttons are named (“Got it:
do not show <title> again”).
Shown by themselves
Tips::set_auto(true) lets tips come by themselves, as a card that
never takes the focus and is never modal: once five seconds after the
start, then the first time a tip’s surface holds (a panel focused, a
mode entered). Off by default: an application turns it on. The rules
choose the tip:
- not contextual, not dismissed (“Got it” is final), its plugin’s tips not turned off;
- its command never used: a person who ran it knows it (the commands a
person runs, from the keyboard, a menu or the palette, are recorded
in
tips.used; an agent’s or a script’s are not); - its surface holds;
- not shown in the last day (
tips.seen); - among the rest, the one shown longest ago, never shown first, then the first registered.
Tips::pick applies them in a context, Tips::refusal says why a tip
would not be chosen, and tips::pick::Rules is the same without an
application.
The card says “Did you know?”, with “Got it” (never again), “Next tip”
(the next the rules choose), “No more tips” (the tips.show setting)
and a close button, “Not now”, which Escape is too: the tip may come
back another day.
Pointing at what it is about
A tip with a target names what it is about, and the element names
itself where it is drawn:
tips::mark(ui.button("Import"), "photos.import");
// or, for any rectangle: tips::target(ui.ctx(), "photos.rating", rect);
The card goes beside the target, after it when there is room, else on
another side (placement), a gap away, never over it, and a halo
surrounds the target. A tip whose target is not drawn shows in the
bottom corner at the start (toasts keep the end). Both come from the
theme:
| Token | What | Without it |
|---|---|---|
tip-card.halo-color | The halo around a target | status.info, the card’s icon’s |
tip-card.width | The card’s width | A toast’s width |
The browser
“Tips…” in the Help menu (tips.browse, which needs the dialogs
plugin) lists every tip by the plugin that declared it, under the
plugin’s title: each with its text as shown, whether it was dismissed
or its command used, and a “Show” button. Each plugin’s group has its
own switch, “Show these tips”: off, that plugin’s tips are never shown
(tips.off), the others still are. tips::browser(ui, app) draws the
same list anywhere, and tips.origin (origin, on) turns a plugin’s
tips on or off for agents.
The lint
tips::lint::problems(app, targets) checks every tip registered
against the application: its command and those its {key:<command>}
name are declared, a {key} has a command, its surface parses, its
target is named (in targets, or drawn so far), its id starts with
its origin. In a test, after drawing the screens the tips point at:
egui_pop_test::assert_tips_clean(&app, &["photos.stars"]);
A renamed command or target then fails the test instead of leaving a dead tip behind. The gallery’s tips pass it.
Commands
| Command | What |
|---|---|
tips.show | Shows the tip the rules choose here (tip: that one) |
tips.next | The next tip, in place of the one shown |
tips.gotIt | Dismisses the tip shown for good |
tips.notNow | Closes the card (Escape) |
tips.off | No more tips |
tips.current | For agents: the tip shown, its card’s and its target’s rectangles |
tips.browse | “Tips…”: the browser |
tips.origin | Turns a plugin’s tips on or off (origin, on) |
tips.reset | Shows every tip again |
tips.list, tips.dismiss | For agents: every tip, and dismissing one |
tipShown is set while a card is shown, for when clauses; the
journal says tip.shown.
Remembered in the settings
| Setting | What |
|---|---|
tips.show | Show tips at all (on by default) |
tips.dismissed | The ids of the tips not to show again, separated by commas |
tips.seen | When each tip was shown last, id@seconds |
tips.used | The commands a person used, separated by commas |
tips.off | The plugins whose tips are off, separated by commas |
Dismissing a tip writes tips.dismissed without an undo step, through
the tips.dismiss step (tip, cause: user or agent; a veto keeps
it showing). The settings are saved with the others, so a tip dismissed
stays dismissed in the next run. tips.reset (“Show every tip again”)
empties the list and tips.seen, so a tip shown today may come again
at once; tips.used stays, since what a person knows does not change
(the browser still shows those tips). For agents, tips.list and tips.dismiss (tip).
Translated
A tip’s title and text are looked up under keys derived from its id,
tip-<id>.title and tip-<id>.text (the id’s dots become dashes), in
the application’s catalogues; the English given is the fallback. A
file’s tip is translated the same way. In a catalogue, {key} is
written { $key } and {key:<command>} is { $key-<command> } (the
command’s dots become dashes), Fluent’s own placeholders. The
gallery’s own tips are translated in crates/egui-pop-gallery/locales:
tip-gallery-next-page =
.text = { $key } et { $key-gallery-page-previous } passent à la page suivante et à la précédente.
.title = Parcourir les pages
The card’s own text (“Tip of the day”, “Next tip”, “Got it”…) is in egui-pop’s catalogues.
Survey (2026-10-13)
egui’s tooltips (on_hover_text) stay what they are, help on hover. No
crate was found offering a tip of the day, onboarding hints or tours
for egui with dismissal kept in settings and translations: owned.
Not done yet: translated tips as files of their own
(i18n/<lang>/tips/<id>.md); a tip is translated in the catalogues.
About the application
Help > About application: a dialog with the application’s name, icon,
version, one-line description, licences, authors and links, and a
“Copy version info” button for bug reports. The gallery’s about page
shows it, and its Help menu has it.
Turning it on
use egui_pop::api::about::{ABOUT, AboutPlugin, AppInfo};
use egui_pop::api::App;
let info = AppInfo::new("Darkroom", env!("CARGO_PKG_VERSION"))
.description("A photo editor.")
.licence("GPL-3.0-or-later")
.author("The Darkroom contributors")
.repository("https://example.org/darkroom")
.website("https://example.org")
.docs("https://example.org/darkroom/docs")
.issues("https://example.org/darkroom/issues");
let app = App::builder()
.name("Darkroom")
.plugin(AboutPlugin::new(info))
.build(&egui_pop::egui::Context::default())
.unwrap();
assert_eq!(app.handle().service(&ABOUT).unwrap().info().name, "Darkroom");
AboutPlugin is opt-in. The host fills an AppInfo: the name (empty:
the application’s, AppBuilder::name), the version (typically
env!("CARGO_PKG_VERSION")), a one-line description, licences (SPDX
expressions), authors, and the links it has: the repository, a website,
the docs, where to report issues. A link not given is not shown.
AppInfo::icon(|ui, side| …)draws the application’s icon at the top of the dialog, in a square of the side given.AppInfo::renderer("wgpu: Vulkan, llvmpipe")says what draws the interface, for the version info; the host knows it once the window is up, and may set it later through the service:app.service(&ABOUT).unwrap().update(|i| i.renderer = Some(…)).
Links open with egui’s Context::open_url: a new tab on the web, the
system’s browser on the desktop.
Commands
| Command | What |
|---|---|
about | Help > About application (the title says { $application }, filled with the name) |
about.read | For agents, kept out of the palette: everything as JSON (name, version, description, licences, authors, links, egui-pop’s and egui’s versions, the platform, the renderer, version_info) |
help.report | Help > Report a problem, the palette, the inspect dialog’s Report… button and the About dialog’s link: a prefilled new issue in the browser. Declared only when AppInfo::issues is set |
help.suggest | Help > Suggest an idea, the palette: a new issue for an idea in the browser, with the page shown. Declared only when AppInfo::issues is set |
about::open(app) opens the dialog from code; about::show(ui, app, copied) draws its body anywhere (the gallery’s page does).
The version info
“Copy version info” copies plain text, the same as
AppInfo::version_info():
Darkroom 1.2.0
egui-pop 0.2.0
egui 0.37
Platform: linux x86_64
Renderer: wgpu: Vulkan, llvmpipe
With the clipboard plugin connected, it goes through the
clipboard.copy step from the about.version endpoint (hooks see it,
sanitisers run, a refusal shows in a toast); without it, straight to the
system clipboard.
Reporting a problem
AppInfo::issues(url) says where issues go (the issue list,
https://github.com/owner/repo/issues) and turns help.report on;
AppInfo::issue_form("bug.yml") names the repository’s issue form.
AboutPlugin::page(|app| …) says which page or view is shown, when the
application can:
use egui_pop::api::about::{AboutPlugin, AppInfo, CMD_REPORT};
use egui_pop::api::App;
let info = AppInfo::new("Darkroom", "1.2.0")
.issues("https://github.com/example/darkroom/issues")
.issue_form("bug.yml");
let app = App::builder()
.plugin(AboutPlugin::new(info).page(|_app| Some("Develop".into())))
.build(&egui_pop::egui::Context::default())
.unwrap();
assert!(app.handle().command(&CMD_REPORT).is_some());
Without an issues URL the command is not declared at all: a library cannot know where an application’s bugs belong, and a menu entry, a palette entry or an agent’s command leading nowhere is noise. The About dialog’s “Report a problem” link runs the same command, so there is one way to report.
The command opens <issues>/new through the links service (a new tab on
the web, the system’s browser on the desktop; egui’s open_url without
the links plugin), prefilled with GitHub’s query parameters:
title:Problem in <page>, orProblem in <application>;- with an issue form,
template=bug.ymland one parameter per field, named by itsid:version(the version info without its platform line),platform,page,pick(the last inspect pick’s text, when there is one); the reporter’s own fields (what happened, expected, steps) stay empty; - without a form, the same in
body, a Markdown section each.
On the web the platform names the browser and its system, read from the
user agent (web (wasm32), Firefox 132 on Linux). Every value is
percent-encoded and the URL stays under 8000 bytes (report::URL_LIMIT;
GitHub refuses a little over 8 KB): the pick is cut first, then the page,
each ending (trimmed). about::report_url(app) gives the URL without
opening it. egui-pop’s own form is
.github/ISSUE_TEMPLATE/bug.yml;
an application copies it, or keeps its field ids.
An idea is not a problem: Help > Suggest an idea (help.suggest) sits
beside Report a problem, so that the reporter chooses before the form
opens. It opens <issues>/new titled Idea for <page> (or <application>)
with the page alone (no version info, platform or pick), in the idea form
named by AboutPlugin::idea_form("feature.yml") (its page field), or in
the body without one. about::idea_url(app) gives the URL. egui-pop’s form
is .github/ISSUE_TEMPLATE/feature.yml.
Translated
The dialog’s text is in egui-pop’s catalogues (egui-pop-about-*); the
command’s title, command-about.title, says { $application }
(À propos de { $application }), so one translation serves every
application. What the host gives (the description, the authors) is
shown as given.
Survey (2026-10-28)
egui has no About dialog, and no crate was found offering one for egui with translations, agents’ access and a copy for bug reports: owned.
Not done yet: credits for third-party licences; a screenshot and a panic’s text in the report.
Debugging
Every registry describes itself to the debug bridge: collectors for
commands, key resolution traces, focus, overlays, zones, plugins, steps,
the workbench, the store (each path’s owner, writers and last writer,
and the writes refused to a scope that is not a writer), the journal,
diagnostics and the mount
contract (mounts: every component and host declared, what is mounted
where, where_can and check, see hosts.md), the fonts
(fonts: faces, fallback chains, sizes, and check for the chars a
family misses, see fonts.md), the settings window
(settings_window: open or not, the page shown, the search, the tree and
the custom pages), the pointer (pointer: the profile in force, the
hint, and the widgets that claim the secondary button, see
pointer-gestures.md), each with a JSON snapshot and
actions flagged mutates and agent; every call returns a feedback
block. A person reads it in the gallery, an agent or a test reads the
same data as JSON. The bridge’s calls are the agent’s: it may call the
actions that only read and commands.run, while those that write are
the user’s (debug_call_as with Origin::User, as devtools does); every
call goes through the debug.call step a plugin may veto (see
Agents).
use egui_pop::egui;
use egui_pop::prelude::*;
let ctx = egui::Context::default();
let mut app = App::builder().plugins(DefaultPlugins).build(&ctx).unwrap();
let snapshot = app.handle().debug_snapshot();
assert!(snapshot["commands"]["commands"].is_array());
let feedback = app.debug_call("commands", "run", &serde_json::json!({ "id": "app.palette" }));
assert!(feedback.ok && feedback.mutates);
The gallery’s Debug page shows them, with the last key resolutions:
Run headless, the gallery prints the same snapshot on stdout before it
quits (--dump-debug, see tools/wbox). What cannot
apply (a hook on a step nobody declares, two plugins replacing the same
step) is reported as a diagnostic, never a silent no-op
(ADR 0003).
State in egui’s memory
egui-pop keeps its per-context state (tokens, fonts, the frame’s
layout, focus, overlays, a slider’s drag) in egui’s temporary memory,
through typed slots (egui_pop::core::state::Slot). Every slot written
is listed by the state collector: its name, type, whether it holds one
value per context or one per instance (a widget, a window), how many
entries it holds now and a one-line summary of the first ones. A count
of instance entries that keeps growing while the interface does not is
a leak; the slot action lists every entry of one slot.
use egui_pop::core::debug::DebugBridge;
use egui_pop::core::state::Slot;
use egui_pop::egui;
// A component's own state, declared once.
const OPEN: Slot<bool> = Slot::new("my_plugin.open");
let ctx = egui::Context::default();
OPEN.keyed("first").set(&ctx, true);
let bridge = DebugBridge::with_core_collectors();
let state = bridge.snapshot_of(&ctx, "state").unwrap();
let open = state["slots"]
.as_array()
.unwrap()
.iter()
.find(|s| s["name"] == "my_plugin.open")
.unwrap();
assert_eq!((open["scope"].as_str(), open["entries"].as_u64()), (Some("instance"), Some(1)));
egui locks its context while its memory is read or written: a slot
takes the lock itself, so build keys (ctx.viewport_id(), a widget’s
id) and read other state before calling it. Only update’s closure
runs under the lock, and it must not touch the context; a slot touched
there panics with both names instead of deadlocking.
Devtools
The same collectors inside the application: DevtoolsPlugin (opt-in)
adds a bottom panel, opened with Shift+F12 once the developer.devtools
setting is on (off by default, so end users never meet it;
DevtoolsPlugin::on_by_default(true) turns it on in an application
shown to developers, as the gallery does). Its tabs
show the last key resolutions with each binding’s verdict, the journal,
the steps with their hooks and last runs, the focus chain, overlays and
context keys, each window’s scale (the screen collector), and every
collector as JSON with its actions. An action run from the panel goes
through the devtools.call step, which a plugin may veto (an action too
dangerous to offer in the panel), then, as the user’s call, through the
bridge’s debug.call step, whose veto (a kiosk build) covers the panel
and agents alike.
use egui_pop::api::devtools::{DevtoolsPlugin, PANEL_DEVTOOLS};
use egui_pop::egui;
use egui_pop::prelude::*;
let app = App::builder()
.plugins(DefaultPlugins)
.plugin(DevtoolsPlugin::default())
.build(&egui::Context::default())
.unwrap();
// Closed until asked for, and only once the setting allows it.
assert!(!app.handle().panel_visible(&PANEL_DEVTOOLS));
assert!(app.handle().debug_snapshot()["screen"]["windows"].is_array());
Inspecting an element
When something on screen misbehaves, say exactly which element it is:
devtools.inspect (Ctrl+Shift+F12; View > Inspect an
element, the palette, the picker button at the end of the menu bar, or
the button at the start of the devtools panel) enters the inspect mode
once the developer.devtools setting is on. The menu bar’s button
shows only then; its tooltip gives the command’s key as the keymap
binds it, and it stays pressed while the mode is on (the inspecting
context key). While it is on:
- the pointer is a crosshair over the window (not over the inspect dialog), the widget under it outlined, with a small label (its role, name and size), and a hint sits at the top of the window;
- a click picks it and does not reach it (nothing is pressed);
- Tab, Shift+Tab and the arrows move between the interactive widgets instead, Enter picks the one outlined;
- Escape, Ctrl+Shift+F12 again, or the menu bar’s button pressed again, leaves (that button is not picked);
- it works in every window, a detached panel’s included.
A pick opens a dialog with what egui and egui-pop know: the element’s
role, accessible name, value and description, the nearest named element
around it, its egui id, its rectangle, window and egui layer; the zone
and block or the panel drawing it and the plugin owning them; the
theme, its kit and density, and the kit part that painted its box with
the state it was in (fill, border, radius, text colours); whether it is
focused and enabled; and what the application adds
(DevtoolsPlugin::describe; the gallery adds its page and story).
Copy puts it on the clipboard as a readable text block, one
Name: value line each, with its JSON form
(application/x-egui-pop.inspect+json), through the clipboard’s
clipboard.copy step; Report…, when the application says where
issues go (help.report, see About),
opens a new issue prefilled with the pick, the version info, the
platform and the page; Pick another goes back to the mode. The last
pick is also the inspect collector’s snapshot (json and text).
use egui_pop::api::devtools::{DevtoolsPlugin, inspect};
use egui_pop::egui;
use egui_pop::prelude::*;
let app = App::builder()
.plugins(DefaultPlugins)
.plugin(DevtoolsPlugin::default().describe(|_app, pick| {
vec![("Document".into(), format!("picked by {}", pick.how))]
}))
.build(&egui::Context::default())
.unwrap();
// Off with the setting.
assert!(inspect::start(app.handle()).is_err());
assert!(app.handle().debug_snapshot()["inspect"]["last"].is_null());
How an element is found, and the limits:
- The hit test reads the widget rectangles of the pass just drawn
(egui’s
ViewportState::this_pass.widgets, public in egui 0.36): the top-most layer holding a rectangle under the point, then the smallest rectangle, the one drawn last on a tie. Tooltips are passed over. Every eguiUiregisters a rectangle, so a custom-painted element with no rectangle of its own (a cell painted by its row, a mark on a canvas) is named by its nearest container: the dialog says(container), and Within gives the nearest named element. - Names and roles come from the AccessKit tree of the same pass, switched on while the mode is (and off again after, unless a screen reader had it on). A widget that names itself nowhere shows its id, its rectangle and what it senses.
- Zones, blocks and panels are recorded around each block and panel drawn, only while the mode is on.
- The kit part is known for parts painted through a kit
component’s handler (
Component::paint,Component::show). egui’s own widgets drawn with a kit’s scoped visuals show none. - The keys: not F12 nor Ctrl+Shift+C, the browsers’ own: a web build never sees them, the browser opens its developer tools or its element picker first. Nor Ctrl+Shift+I, J, K, E, M, Z (Firefox’s and Chrome’s tools; Cmd+Option on a Mac), Shift+F5, F7, F9 (Firefox), Shift+F5, F6, F10 and Ctrl+F4, F5, F6 (Chrome), or Ctrl+Alt+a letter (AltGr types a character with it on many Windows layouts). Shift+F12 and Ctrl+Shift+F12 are taken by none of Firefox, Chrome and Safari, on Linux, Windows and macOS (on a Mac laptop, with Fn).
- Ctrl+Shift+C, rebound: egui-winit turns it into a copy event and swallows the key. While the devtools setting is on and the mode is bound to it, egui-pop gives that event back as the key, so the binding works; a focused terminal then loses Ctrl+Shift+C as its copy.
How other toolkits do it
| Tool | Entered | Shows | Left |
|---|---|---|---|
| Browser devtools’ element picker (Firefox) | Ctrl+Shift+C (Cmd+Shift+C on macOS) or the picker button | while hovering, the element’s box (content, padding, margin) and a tooltip: tag, classes, size, colours, accessible name and role; a click selects it in the Elements panel | after a pick, Escape, or the chord again |
| GTK Inspector | Ctrl+Shift+I or Ctrl+Shift+D once enabled (GTK_DEBUG=interactive), then its picker button | the object tree, properties, CSS nodes and style classes, size and allocation, accessibility | after a pick |
| GammaRay (Qt) | injected into the process; Ctrl+Shift+click on a widget in the application | the object tree, properties, geometry, a layout overlay, signals and slots | the next click is the application’s |
| Flutter’s widget inspector | the Select widget mode toggle in DevTools | the widget tree, the widget’s properties, its render object and the layout explorer; a tap selects | the toggle |
egui’s debug_on_hover | a style flag (debug builds) | the hovered widget’s and its Ui’s rectangles and layout; show_interactive_widgets outlines every interactive rectangle | the flag |
What egui-pop takes: the browsers’ chord, outline and label, the mode
ending with the pick or Escape, and keyboard picking (Tab and Enter);
a dialog instead of a side panel, so that one pick is one copyable
report. Adopt, wrap or own: nothing to adopt (no crate picks
elements in egui, and debug_on_hover shows layout, not who drew
what, in debug builds only); egui’s widget rectangles and AccessKit
tree are wrapped as they are; the mode, its dialog and what egui-pop
adds (zones, blocks, panels, plugins, the kit) are its own, in
egui_pop::core::inspect and egui_pop::api::devtools::inspect.
Agents and the debug bridge
A command “yields its agent surface” (CREDO): unless it says otherwise, every command an application declares can be run by an agent through the debug bridge, with the arguments its spec describes, and the run is marked as the agent’s. This page says what that bridge is, how an agent reaches it, what it can and cannot do, and what is not protected today.
In short: the bridge is a Rust API inside the application’s process.
egui-pop opens no socket and no port for it unless the application turns
on the opt-in agent socket (egui-pop-agent). An
agent is code that holds the App (a test, a harness, a transport such
as the agent socket); it discovers the collectors and commands as JSON, runs the
commands offered to agents, reads every collector’s state, and calls
the collector actions offered to agents. What keeps an action away from
it is the command’s or the collector action’s agent flag, the
command’s when clause, step hooks (debug.call for every collector
action) and the host; the known gaps list what nothing
checks.
What an agent connects to
In the process, or over the agent socket. The bridge
(egui_pop::core::debug::DebugBridge) is a list of collectors held by
each App. By default nothing listens for it: no TCP port, no socket,
no pipe. An application that wants agents outside its process adds the
opt-in crate egui-pop-agent, which serves the calls below as JSON-RPC
over a private local socket (The agent socket); never
TCP. In the process, it is reached by Rust calls:
| Call | What it does |
|---|---|
AppHandle::debug_describe() | every collector: name, description, actions (each with mutates, agent, an example of its arguments, and its JSON Schemas when given) |
AppHandle::debug_capabilities() | every collector action and command as one list, protocol 1 (bridge.describe, Capabilities) |
AppHandle::debug_snapshot() | every collector’s snapshot, by name, as one JSON object |
AppHandle::debug_call(collector, action, args) | calls an action as the agent (debug-bridge); always returns a Feedback; commands.run is queued for the next frame |
App::debug_call(collector, action, args) | the same, but commands.run runs at once and its result is in the feedback |
AppHandle::debug_call_as(collector, action, args, origin), App::debug_call_as | the same for another caller: the user’s calls (the devtools panel, a debug page) pass Origin::User |
AppHandle::debug_log() | the last 64 feedback blocks, refusals included |
Always there, on, read-only or off. Every App builds its bridge
with the core collectors and registers its own and its plugins’ when it
is built, in release builds as in debug builds. What it lets anyone but
the user do is the application’s choice, AppBuilder::debug_bridge:
| Mode | Agents (any origin but the user) |
|---|---|
BridgeMode::On (default) | every action and command offered to them |
BridgeMode::ReadOnly | only calls that change nothing: actions with mutates: false, and commands.run of a command declared read_only |
BridgeMode::Off | nothing: every call is refused (“the debug bridge is off”) |
The user’s calls (the devtools panel, debug_call_as with
Origin::User) are never refused by the mode. Refusals go on the
journal (debug.call.refused).
Devtools is a view, not a gate. DevtoolsPlugin (opt-in) shows the
same collectors in a panel, opened with Shift+F12 once the
developer.devtools setting is on (off by default). The setting gates
the panel only; the bridge answers Rust calls whatever its value. The
panel is the user’s: an action run from it goes through the
devtools.call step, then, as the user, through the debug.call step
every collector action goes through; a plugin may veto either, and a
veto of debug.call covers the panel and agents alike. See
Debugging.
Reaching it from another process takes a transport that turns
requests into debug_calls on the UI thread. egui-pop’s is the opt-in
agent socket (egui-pop-agent): the bridge as
JSON-RPC over a private local socket, held by the bridge’s mode, each
agent’s grants and the input lock, with an MCP server on top
(egui-pop-agent-mcp), its ui method for the accessibility tree
and input, and inspect, egui’s inspection protocol (screenshots,
drags) without its TCP port, which the MCP server’s widget_* tools
(Rerun’s egui_inspection_tools) drive for testing by pointer and
pixels. An application may write its own transport (stdin, another
protocol) over the same calls. The other ways out of the process are
not the bridge:
- the gallery’s
--dump-debugprints the bridge’s snapshot as one JSON line on stdout when it quits by--quit-after(read only, the gallery only; see tools/wbox); - tools/wbox drives a real gallery window in a nested, headless compositor: screenshots, clicks and keys, as a person would;
- the gallery’s opt-in
inspectionfeature serves egui’segui_inspectionprotocol on loopback, without authentication, for Rerun’segui-mcp: the accessibility tree, clicks and keys by role or label, screenshots and a wait, as a person would, not the bridge (Driving the gallery with egui-mcp). Development builds only: the endpoint is an unauthenticated TCP port on loopback. It bypasses egui-pop’s bridge mode, the agent socket’s grants and its input lock: an agent behind it acts as the user, and can click a destructive call’s confirmation or a pairing dialog itself. It is for development builds only, never for an application you ship. - the single-instance plugin of
egui-pop-platform(instance.md) listens on a local socket for later launches of the same application; what they hand over (arguments, working directory, links) reaches theinstance.second_launchanddeeplink.opensteps, not the bridge.
What it can do
Discover
debug_describe() lists the collectors. One entry, as the gallery
answers it:
{
"name": "store",
"description": "The value store: every path, its value, its owner, who may write it and who changed it.",
"actions": [
{ "name": "get", "description": "Reads a value with its descriptor.", "mutates": false, "agent": true, "args": { "path": "settings/x" } },
{ "name": "set", "description": "Writes a value (`path`, `value`) as its caller: the user through the framework, anyone else as itself, held to the value's writers (`Origin::writer`); for the user only unless offered (agents run the `value.set` command).", "mutates": true, "agent": false, "args": { "path": "settings/x", "value": 1 } },
{ "name": "undo", "description": "Undoes the last change of values as its caller, refused when it may not write one of them; for the user only unless offered (agents run the `value.undo` command).", "mutates": true, "agent": false, "args": null }
]
}
The commands collector’s snapshot lists every command with what an
agent needs to run it: id, title, category, description, when
(where it applies), keys, agent (offered to agents or not), args
(its arguments: a JSON Schema, enforced, or a free description such as
an example, null when it takes none), running, owner and its icons; beside
them, the context (the context keys in force) and history (the last
runs). In the gallery:
{
"id": "about.read",
"title": "Read about the application",
"category": "Help",
"description": "The application's name, version, description, licences, authors and links, egui-pop's and egui's versions, the platform, the renderer and the version info as text.",
"when": "",
"keys": [],
"agent": true,
"args": null,
"running": false,
"owner": "egui_pop.about",
"icon": null,
"icon_on": null,
"icon_set_by": null,
"unknown_icons": []
}
Run a command
commands.run takes { "id", "args" }. The bridge checks that the
command exists and is offered to agents, then runs it with
Origin::Agent("debug-bridge"). A collector action acts as its caller:
called by the user (the devtools panel, debug_call_as with
Origin::User), commands.run runs the command as the user, a command
kept from agents included. The reply is a Feedback, the same
shape for every call, success or not:
| Field | Meaning |
|---|---|
ok | the call succeeded |
collector, action | what was called |
mutates | the call is one that changes the application (whether or not it did): the action’s flag, and for commands.run the command’s (false for a command declared read_only) |
message | what happened, in a sentence |
data | the result, null on failure |
Through App::debug_call, about.read in the gallery answers:
{
"ok": true,
"collector": "commands",
"action": "run",
"mutates": false,
"message": "`about.read` ran; the application may have changed",
"data": {
"authors": ["The egui-pop contributors"],
"description": "egui-pop's components in every variant, state, theme and density.",
"egui": "0.37",
"egui_pop": "0.2.0",
"licences": ["MIT OR Apache-2.0"],
"links": {
"docs": "https://quazardous.github.io/egui-pop/docs/",
"issues": "https://github.com/quazardous/egui-pop/issues",
"repository": "https://github.com/quazardous/egui-pop",
"website": "https://quazardous.github.io/egui-pop/"
},
"name": "egui-pop gallery",
"platform": "linux x86_64",
"renderer": null,
"version": "0.2.0 (59ba7f9f)",
"version_info": "egui-pop gallery 0.2.0 (59ba7f9f)\negui-pop 0.2.0\negui 0.37\nPlatform: linux x86_64\n"
}
}
Through AppHandle::debug_call the run is only queued:
{ "ok": true, "collector": "commands", "action": "run", "mutates": false, "message": "`commands.run` done; nothing changed", "data": { "queued": true } }
A command whose host answers later (Reply::Later) gives
"data": { "pending": true } and the message “<id> is running; its
result goes to the journal”.
Read state and results
- Every collector’s snapshot: focus and the focus chain, overlays, fields (each input’s label, kind and state), indicators, the announcements made to screen readers, the theme, the store (every path, value, owner, writers, last writer), the context stack, dialogs, file choices, jobs, the workbench, the windows’ scale, and those of the plugins connected (about 50 in the gallery).
- The value store also as commands:
value.list,value.get,value.set,value.reset,value.undo,value.redo. - The journal:
journal.sincewith{ "seq": n }returns the events aftern. Each run of a command leaves acommand.dispatchedevent and acommand.done(orcommand.failed) event whosecauseis the dispatch:
[
{ "seq": 1, "source": "agent:debug-bridge", "cause": null, "name": "command.dispatched", "data": { "command": "about.read", "args": null } },
{ "seq": 2, "source": "agent:debug-bridge", "cause": 1, "name": "command.done", "data": { "command": "about.read", "result": { "name": "egui-pop gallery" } } }
]
(The second event’s result is cut here; it is the whole answer shown
above.)
A plugin’s disconnection is a plugin.disconnected event, and a run of
a command whose plugin went is a command.refused event saying so
(Plugins).
Act through collector actions
Besides commands.run, collectors offer actions of their own. Each
says whether agents may call it (agent): by default those that only
read, and none that writes. In the gallery, agents may call
commands.run (the command’s own agent flag is checked) and the
read-only actions: state.slot, fonts.check, icons.search,
journal.since, store.get, mounts.where_can, mounts.check,
frame.hit and the gallery’s gallery.viewport.wait_idle. The actions
that write are the user’s (the devtools panel, a debug page):
screen.set_interface_zoom, focus.clear, overlays.close_top,
announcements.announce, plugins.set_enabled, store.set,
store.undo, i18n.set_locale, i18n.clear_missing,
contexts.request, contexts.hold, contexts.release,
dialogs.answer, files.answer, the jobs actions (cancel, pause,
resume, retry, dismiss, clear), toasts.dismiss,
viewport.set_view and the gallery’s gallery.tree.hold_loads. Most have a command an agent runs instead
(value.set, value.undo, job.cancel, context.hold…).
An agent’s call to an action not offered to it is refused before anything runs, in the bridge’s log and on the journal:
{ "ok": false, "collector": "store", "action": "set", "mutates": true, "message": "`store.set` refused: it is not offered to agents; only the user may call it", "data": null }
{ "seq": 7, "source": "agent:debug-bridge", "cause": null, "name": "debug.call.refused", "data": { "collector": "store", "action": "set", "args": { "path": "settings/x", "value": 1 }, "reason": "it is not offered to agents; only the user may call it" } }
Every other call, the user’s included, runs through the debug.call
step ({ "collector", "action", "args", "origin" }), whose
before-hooks may veto it (“journal.since vetoed by kiosk: …”,
debug.call.vetoed on the journal). A call that writes is published as
debug.call; one that only reads (a read-only command’s
commands.run included) is published and traced only when vetoed or
failed, so polling fills neither the journal nor the steps’ traces. A
refused commands.run (a command not offered to agents, or unknown) is
on the journal once, as a failed debug.call with the reason.
An application may offer a writing action to agents it trusts with it
(a test harness, its own automation): AppBuilder::offer_to_agents
("dialogs.answer"); a name that matches no action is reported
(agent-offer-unknown). A collector declares its own with
FnCollector::agent.
Wait
bridge.wait checks a condition: a journal event after since
({ "event": "command.done", "cause": 42 }), the application settled
({ "settled": true }: no command queued or running, every job idle,
no repaint asked for), or the first of several ({ "any": [..] }). It
answers { "met", "by", "event", "last" }; last is the next check’s
since. In-process the call answers at once, it never blocks the UI
thread: whoever waits checks again after each frame. A transport holds
the call until it is met or its deadline_ms passes.
In Rust, AppHandle::wait_met(&WaitFor, since) is the same check
(egui_pop::api::wait), and a test steps frames until it holds with
egui_pop_test::wait::wait_until(&mut harness, &until, since, Deadline::default()), or settle (Testing). The
steps collector still gives the last runs of each step, and an
application may add its own waits (the gallery’s
gallery.viewport.wait_idle).
Capabilities
bridge.describe (AppHandle::debug_capabilities()) lists everything
an agent may name as one list, under protocol: 1: every collector
action (kind: "action", name as collector.action) and every
command (kind: "command", run through commands.run), each with
description, mutates, agent, destructive (the user confirms an
agent’s call; an action’s without arguments), private (a command’s
result is private data an agent may be refused), args (a JSON Schema
when the author gives one, else null), example (example arguments), result (a JSON
Schema of the result, or null) and call (how to call it). A
collector gives its schemas with FnCollector::schema and
FnCollector::result_schema; a command whose args is a JSON Schema
(CommandSpec::schema) is listed with it, and its runs are checked
against it. The protocol number changes only when a field changes
meaning: a client calls only names the list gives, so adding
capabilities breaks none.
Screenshots and the accessibility tree
Not through the bridge’s calls. Out of the process, the agent socket’s
ui method reads the accessibility tree and acts on it, and its
inspect method takes screenshots and sends any egui event, under the
bridge’s mode, the ui grant and the input lock
(The agent socket). Over MCP, the widget_* tools
(widget_screenshot, widget_click, widget_drag, widget_type_text,
widget_press_key, widget_scroll, widget_batch, widget_wait_for,
widget_resize, widget_tree) are Rerun’s egui_inspection_tools
served over inspect, under the same mode, grants and lock: for testing
by pointer and pixels, not the way an agent acts on the application
(its commands are). In tests, egui_kittest renders
frames and egui_pop_test::a11y_tree prints the accessibility tree
(Testing); for a real window, wbox takes screenshots, and
the gallery built with --features inspection gives both to egui-mcp
(inspection.md), in development builds only (it opens
an unauthenticated port that bypasses the grants). The bridge gives the
same information as data: the fields, focus, indicators and
announcements collectors.
Watched. kittest_inspector (Rerun), a GUI to step a kittest test
frame by frame: watched; revisit when egui_kittest ships an inspector.
An example, end to end
An application with two commands, one kept off the agent surface. The
agent discovers the bridge, lists the commands offered to it, runs one,
reads its result and the journal, and is refused the other. This block
is compiled and run with the guides (cargo test -p consumer-smoke --doc).
use egui_pop::egui;
use egui_pop::prelude::*;
use serde_json::{Value as Json, json};
struct Notes;
impl Plugin for Notes {
fn id(&self) -> PluginId {
PluginId::from_static("notes")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.command(
CommandSpec::new(CommandId::from_static("notes.count"), "Count notes", "Notes")
.description("How many notes a folder holds (`folder`).")
.args(json!({ "folder": "inbox" })),
|call| Ok(json!({ "folder": call.args["folder"], "count": 3 })),
)?;
// Never run by an agent.
ctx.command(
CommandSpec::new(CommandId::from_static("notes.purge"), "Purge notes", "Notes")
.no_agent(),
|_| Ok(Json::Null),
)?;
Ok(())
}
}
let ctx = egui::Context::default();
let mut app = App::builder()
.plugins(DefaultPlugins)
.plugin(Notes)
.build(&ctx)
.unwrap();
// 1. Discover the collectors and their actions.
let described = app.handle().debug_describe();
let commands = described
.as_array()
.unwrap()
.iter()
.find(|c| c["name"] == "commands")
.unwrap();
assert_eq!(commands["actions"][0]["name"], "run");
assert_eq!(commands["actions"][0]["mutates"], true);
// 2. The commands offered to agents, with their arguments.
let snapshot = app.handle().debug_snapshot();
let offered: Vec<&Json> = snapshot["commands"]["commands"]
.as_array()
.unwrap()
.iter()
.filter(|c| c["agent"] == true)
.collect();
let count = offered.iter().find(|c| c["id"] == "notes.count").unwrap();
assert_eq!(count["args"], json!({ "folder": "inbox" }));
assert!(!offered.iter().any(|c| c["id"] == "notes.purge"));
// 3. Run one: `App::debug_call` runs it now and returns its result.
let before = app.handle().last_event();
let f = app.debug_call(
"commands",
"run",
&json!({ "id": "notes.count", "args": { "folder": "inbox" } }),
);
assert!(f.ok, "{}", f.message);
assert_eq!(f.data, json!({ "folder": "inbox", "count": 3 }));
// 4. The journal says the agent did it.
let events = app.debug_call("journal", "since", &json!({ "seq": before }));
let done = events
.data
.as_array()
.unwrap()
.iter()
.find(|e| e["name"] == "command.done")
.unwrap();
assert_eq!(done["source"], "agent:debug-bridge");
assert_eq!(done["data"]["result"]["count"], 3);
// 5. The command kept off the surface is refused, and says why.
let f = app.debug_call("commands", "run", &json!({ "id": "notes.purge" }));
assert!(!f.ok);
assert_eq!(
f.message,
"`commands.run` failed: `notes.purge` is not offered to agents"
);
The JSON replies shown on this page were captured from the gallery
itself, headless: a test built it with Gallery::new on a plain
egui::Context (no window, no GPU), ran one frame of App::logic, and
printed debug_describe, the commands snapshot and the feedback of
commands.run (about.read, app.quit), journal.since, store.get
and store.set.
What it cannot do, and the trust model
The bridge has one caller identity: every command it runs is
Origin::Agent("debug-bridge"), and the journal’s source is
agent:debug-bridge. What is checked:
- Collector actions’
agentflag. An action that writes is the user’s unless it says otherwise (onlycommands.rundoes) or the application offers it (AppBuilder::offer_to_agents): the agent’s call is refused and journaled (debug.call.refused). Every call that goes on, the agent’s and the user’s, runs through thedebug.callstep a plugin may veto (a kiosk build). - Typing into a terminal.
terminal.sendwrites to a terminal’s program, in a pseudo-terminal shell (theeditors-ptyfeature, as in the gallery) any command the user could run: it is not offered to agents. An application whose agent should type offers it (AppBuilder::offer_command_to_agents(CMD_SEND), see Editors), and the input still goes throughterminal.inputwith the agent’s origin, where a hook can narrow or veto it. - The
agentflag.commands.runrefuses a command declared withCommandSpec::no_agent()(and an unknown one) with “<id>is not offered to agents”. In egui-pop and the gallery: quitting, the window’s close, minimise, maximise and menu, opening devtools,deeplink.open,links.confirmed(the confirmed link), the pointer gestures,viewer.load_images, and a few gallery commands. 31 of the gallery’s 259 commands are not offered. - Where a command applies. A command whose
whenclause does not hold in the current context is refused (“does not apply here”), for an agent as for a key. - Destructive commands. A command declared
CommandSpec::destructive()(it deletes files, empties a trash, drops unsaved work), or an action its collector says is destructive (Collector::destructive), waits for the user’s confirmation when an agent calls it through the agent socket: a dialog names the agent, the command and its arguments, and a decline or a deadline refuses it (command.refused,by: "pop.agent.confirm") and cancels the dialog. While it is open, agents’uiactions are refused, so an agent cannot click its own confirmation. The user’s own runs are never asked (The agent socket). - Argument schemas. A command whose
argsis a JSON Schema (CommandSpec::schema) is held to it: a run whose arguments do not match is refused before its handler, whoever asks it, the user included (command.refused,by: "pop.command.args", the reason naming where and why:/factor: expected a number, got a string). A destructive command’s run refused so is never asked about. A command whose arguments are only described (an example, a text) checks nothing (The agent socket). - Grants per agent. Over the agent socket, each agent is held to a
grant the application sets (commands, read-only, values,
uiactions; presets read-only, editor, full): a client that does not sayhelloreads only unless the application allows unpaired writes, and thepop.agent.grantslistener refuses onpop.command.runwhat a grant does not allow (command.refused,by: "pop.agent.grants"), before the application’s own listeners (The agent socket). - Private data. A command declared
CommandSpec::private()(places, people, absolute file paths) is refused to an agent whose grant withholds private data; a read only partly private leaves those fields out whengrants::reads_private(app, origin)isfalse. Every preset reads it until the user turns it off on the Agents page. An application with its own switch lifts it for every agent through a host hook,AgentGrantsExt::agent_private_allowed, read at each request (The agent socket). - The user’s say. Settings › Developer › Agents lists the paired agents (connected now, last seen), sets each one’s access and the defaults to a preset, and private data shown or withheld, live, and revokes a pairing: its token stops pairing and its connections close. Agents cannot change any of it (The Agents page).
- Links. A link an agent asks to open (
links.open,files.reveal,viewer.open_outside) is always confirmed by the user, and the links plugin vetoes any answer to that confirmation but the user’s: an agent may cancel it, not accept it (Links). - The clipboard. An agent copies and pastes in its own slot
(
agent:debug-bridge): it neither reads nor overwrites what the user copied unless the owner allows it (The clipboard). - The chain of commands. A command’s handler runs for its origin
(
Call::origin,AppHandle::acting_origin), and the commands it starts withAppHandle::runrun for the same origin: an agent’s command starts the agent’s commands. While a command runs for anyone but the user, its handler may not run another as the user (AppHandle::run_aswithOrigin::Useris refused,command.refusedon the journal); one running for an agent may only name an agent. To act for the user, the handler asks the user: a dialog whose answer, the user’s, runs its command as the user.App::runandAppHandle::run_asrefuse a command not offered to agents to an agent origin, wherever it comes from (command.refused). - Deep links. A link that comes with a launch, the first one’s or a
later one’s through the single-instance socket, runs the
application’s links command as
Origin::Remote("deeplink")(instance::deeplink_origin), not as the user: any program of the user’s may launch the application with a link. The handler sees it, what it starts inherits it, it may not claim the user, and its writes are held to the values’ writers. A handler that changes anything on a link asks the user first (Instance). - Dialogs and file choices.
dialogs.answerandfiles.answeranswer as their caller. Accepting a dialog runs its command with the caller’s origin, and an answer that would run a command not offered to agents is refused to anyone but the user, even when the application offersdialogs.answer(dialog.answer.refusedon the journal); an agent may still cancel it. A file choice carries its origin to its consumer (files::chosen_origin). - The value store. An agent writes as itself
(
agent:debug-bridge,Origin::writer), throughvalue.set,value.reset,value.undo,value.redoand, when offered,store.setandstore.undo: a value’s declared writers (ADR 0016) apply, so it is refused a setting only its owner writes (settings/developer.devtools) and the undo of a change to one. To let it write a value, name it among the value’s writers (Descriptor::writers). The user writes through the framework, as the settings form does. A write is also refused when the value is held by someone else’s gesture, changed sinceif_seq, or invalid for its type; past the soft range only withforce. - Steps. Every step’s before-hooks see its arguments and may veto
it; steps that carry an
origin(dialog.answer,terminal.inputamong them) let a hook refuse agents only. - The host. Every command goes through the host’s dispatch with its
origin (
Dispatch::origin), those that run in the interface too (Dispatch::deferred): a host may refuse agents there, in one place. An agent’s undo, redo, jump, restore or out-of-order undo, throughedit.undoorhistory.*, is held to the values’ writers as a write is, all or nothing.
Keeping an action off the agent surface
- Declare the command with
.no_agent(); it stays in menus, keys and the palette. - A dialog whose command is declared
.no_agent()is accepted by the user only, even when the application offersdialogs.answerto agents. When a dialog confirms an action whose command agents may run otherwise, veto thedialog.answerstep unless itsoriginisuser, as the links plugin does. - To refuse a collector action to everyone, the user’s devtools panel
included, veto the
debug.callstep for it. - When a step does the work, veto it from a before-hook for agents (the origin is in the arguments when the step carries it).
- In the host’s
dispatch, refuseOrigin::Agentfor the commands it should never run for one. Every command goes through it, undo and redo,history.*, the context stack’s and the clipboard’s commands included: their handler calls the host itself, so it runs once the dispatch has approved it (Dispatch::deferred; the dispatch’srun_localanswersnullat once). A host refuses one by answering an error without callingrun_local.
use egui_pop::api::dialogs::STEP_ANSWER;
use egui_pop::api::host::{Dispatch, Host, Journal, LocalHost, Reply, Waker};
use egui_pop::egui;
use egui_pop::prelude::*;
use serde_json::{Value as Json, json};
/// The default host, refusing agents the `notes.` commands.
struct Guarded(LocalHost);
impl Host for Guarded {
fn dispatch(&mut self, d: &Dispatch<'_>) -> Reply {
if matches!(d.origin, Origin::Agent(_)) && d.command.as_str().starts_with("notes.") {
return Reply::Done(Err(format!("`{}` is not for agents", d.command)));
}
self.0.dispatch(d)
}
fn journal(&self) -> Option<&Journal> {
self.0.journal()
}
fn journal_mut(&mut self) -> Option<&mut Journal> {
self.0.journal_mut()
}
fn store(&self) -> SharedStore {
self.0.store()
}
fn set_waker(&mut self, waker: Waker) {
self.0.set_waker(waker);
}
fn layout_document(&self) -> Option<String> {
self.0.layout_document()
}
}
struct Notes;
impl Plugin for Notes {
fn id(&self) -> PluginId {
PluginId::from_static("notes")
}
fn connect(&mut self, ctx: &mut Ctx<'_>) -> Result<(), PluginError> {
ctx.command(
CommandSpec::new(CommandId::from_static("notes.count"), "Count notes", "Notes"),
|_| Ok(json!(3)),
)?;
// Only the user accepts a dialog; an agent may still cancel one.
ctx.before(STEP_ANSWER, |_, args| {
let cancel = args["answer"]["answer"] == "cancel";
if !cancel && args["origin"] != "user" {
Before::Veto("only the user answers dialogs".into())
} else {
Before::Go
}
});
Ok(())
}
}
let mut app = App::builder()
.host(Guarded(LocalHost::new(SharedStore::default())))
.plugins(DefaultPlugins)
.plugin(Notes)
.build(&egui::Context::default())
.unwrap();
let count = CommandId::from_static("notes.count");
let f = app.debug_call("commands", "run", &json!({ "id": "notes.count" }));
assert!(!f.ok);
assert!(f.message.contains("is not for agents"), "{}", f.message);
// The user still runs it.
assert_eq!(app.run(&count, Json::Null, Origin::User).now(), Some(Ok(json!(3))));
Known gaps
What is not protected today. None of these is fixed by documenting it.
- No authentication beyond the socket’s owner. Every call through
the bridge in the process is
debug-bridge; through the agent socket,agent-socketuntil the client sayshello, its paired id after, and a pairing token attributes, it does not isolate. The socket is a Unix socket of mode 0600 in a directory only the user may write to (a named pipe on Windows, with the system’s default access), so any process of the same user that reaches it is an agent, with what the bridge’s mode allows (read-only unless the application offers more). - Code in the process is the user if it says so. The bridge’s mode
holds anyone but the user; code in the process (a plugin included)
that calls
debug_call_aswithOrigin::Useris not held. Turning the bridge off keeps out agents, not in-process code. - An offered
files.answeranswers a choice with any paths. The origin goes with the choice (files::chosen_originon its result,originin thefile.chosenstep,byin thefilescollector’s last choices), but nothing refuses it: a consumer that acts only on a person’s choice checks it, or a hook onfile.chosenvetoes it. - Origin is a label, not a credential. Code in the process names
any
Originoutside a command’s handler: a plugin’s own code, a step’s hook or a timer may still run a command as the user. Only the chain from a command running for someone else is held (above). The origin is not carried into work a handler leaves for later (a thread, a host’sReply::Laterthat starts other commands): code there names the origin itself, withAppHandle::run_as. - A new command is offered by default. Every command an application
or a plugin declares is offered to agents until it says
.no_agent(): one that reaches the system must say so itself. - What is not a command does not reach the host’s dispatch.
Collector actions (
store.set,contexts.hold… thedebug.callstep covers them), code calling a step orAppHandle::undodirectly (the step’s hooks cover it), and a text field’s own undo inside egui are not dispatched. - Snapshots are not redacted. Every value in the store, the file
choices and their folders, the terminal steps with their arguments
(
terminal_io), the journal’s arguments and results are readable through the bridge. - A command’s read-only flag is its author’s word.
commands.runreportsmutatesfrom the command’sread_onlyflag, and a read-only bridge runs only those; a command that says it only reads and writes all the same is not caught. - No rate limit, and no blocking wait in-process.
bridge.waitanswers at once; holding a call until it is met is the transport’s (oregui_pop_test::wait’s, stepping frames). Nothing limits how often an agent calls: a transport that exposes the bridge limits the rate itself.
The agent socket
egui-pop-agent serves the debug bridge out of the
process, so an agent (a script, an MCP client, a test runner) can drive
a running application: list its capabilities, read its state, call its
actions and commands, and wait for what they cause. It is the local
socket transport of the agent control design.
Turning it on
Nothing listens unless the application asks for it:
use egui_pop_agent::{AgentSocket, AgentSocketExt as _};
let builder = App::builder()
.app_id("org.example.App")
// Always, at the default place:
// .agent_socket(AgentSocket::new())
// Or only when the user asks: EGUI_POP_AGENT_SOCKET=1 (the default
// place) or EGUI_POP_AGENT_SOCKET=/path/to/app.sock.
.agent_socket_from_env();
From a setting
An application that lets its users turn the socket on from its settings
window uses agent_socket_from_env_or_setting():
let builder = App::builder()
.app_id("org.example.App")
.agent_socket_from_env_or_setting();
It declares the developer.agentSocket setting (Developer section, off
by default; “Lets local programs drive this app (read-only unless the
app allows more)”). The socket follows it live: it starts, at the
default place, when the setting turns on, and stops, its file removed,
when it turns off; a client still connected then has its requests
refused (-32001, “the agent socket is off”). EGUI_POP_AGENT_SOCKET
still turns it on (at its path, when it gives one) whatever the setting
says. agent_socket_on_setting(AgentSocket::at(path)) follows the
setting at another place. The bridge is made read-only at build when the
application chose no mode, the setting on or off.
- Where. By default
egui-pop-agent-<app id>.sockin$XDG_RUNTIME_DIR($TMPDIRon macOS); on Windows the named pipe\\.\pipe\egui-pop-agent-<app id>. The path is logged once, at start (egui_pop_agenttarget). - Private or not at all. The socket’s directory must not be writable by group or others, and the socket is made mode 0600; when either fails, or another instance answers on the path, the socket is not started and the reason is logged (the application still starts). A socket file left by an instance that is gone is replaced.
- The user’s own processes only. On Linux and macOS, a client whose
process runs as another user (the socket’s peer credentials:
SO_PEERCRED,getpeereid) is answered-32001and closed before any request; on a platform without peer credentials, every client is. On Windows, the pipe’s access list (SDDLD:P(A;;GA;;;OW)(A;;GA;;;SY)) lets in only its owner, the user the application runs as, and the system; remote clients are rejected, and the first instance is created withFILE_FLAG_FIRST_PIPE_INSTANCE, so a pipe another process made first under the name is never served. A client that does not sayhellois the agentOrigin::Agent("agent-socket"). - Limits. At most 8 clients at once (
MAX_CONNECTIONS): one more is answered-32004and closed. A request line longer than 1 MiB (MAX_REQUEST_BYTES) is answered-32004and its connection closed. A connection serves one request at a time, so at most 8 waits are held at once, each 120 s at most. - Read-only by default. When the application chose no bridge mode,
turning the socket on makes the bridge
ReadOnly: snapshots, actions that do not mutate and read-only commands. An application that offers more says so withAppBuilder::debug_bridge(BridgeMode::On), before or after; the mode applies to every agent, not only the socket’s. - Unpaired clients read only. Whatever the mode, a client that does
not say
hellois held to the read-only grant (Grants); a paired agent to the editor grant unless the application says otherwise.
The protocol
JSON-RPC 2.0, one request per line and one response per line (UTF-8
JSON, \n-terminated). A request without id is a notification: run,
not answered. A connection’s calls are made as
Origin::Agent("agent-socket"), or, once it said hello, as its paired
agent, Origin::Agent("<id>"); either way the bridge’s mode, the
agent flags, the debug.call step and the journal apply as to any
agent.
| Method | Params | Result |
|---|---|---|
hello | { "name", "token"?, "deadline_ms"? } | { "agent", "name", "origin", "paired": true, "token"? }: see Identity |
describe | none | bridge.describe: { "protocol": 1, "capabilities": [..] } (Capabilities) |
snapshot | { "collector"? } | every collector’s snapshot by name, or one collector’s |
call | { "collector", "action", "args"?, "deadline_ms"? } | the bridge’s feedback block: { "ok", "collector", "action", "mutates", "message", "data" }, a refusal included (ok: false); a destructive call is held until the user confirms it, see Destructive calls |
wait | bridge.wait’s arguments (event and cause, settled: true, or any; since) and deadline_ms (5 s by default, 120 s at most) | { "met", "by", "event", "last" }; met: false at the deadline |
ui | { "action": "tree", "label"?, "role"?, "window"? } | { "count", "nodes" }: the accessibility tree’s nodes (id, parent, role, label, value, rect in points, disabled), every one or those matching |
ui | { "action": "click" | "hover" | "secondary_click" | "type" | "scroll", "label"?, "role"?, "nth"?, "text"?, "up"?, "window"? } | { "node" }, once the input went in |
ui | { "action": "key", "key": "Ctrl+K", "window"? } | { "key" } |
inspect | { "request" }: an egui_inspection request ("GetTree", { "GetScreenshot": { "pixels_per_point": 1.0 } }, { "ApplyEvents": { "events": [..] } }, { "Resize": { "width", "height" } }, { "Settle": { "max_steps" } }, "GetInfo") | { "response" }: its response, see Inspect |
The interface. ui reads the AccessKit tree of the frame just
drawn (AccessKit is turned on at the first ui request) and acts on it
as a person does: a node is found by its label (exactly; a text
label’s text) and its role (Button, TextInput, Window, any
case), and an action needs exactly one, or nth picks one of several
in reading order (top to bottom, then left to right, from 0). click hovers the node’s
centre, presses and releases, a frame each; hover moves the pointer
over its centre and leaves it there, so egui shows its tooltip after its
delay (read the tree for it); secondary_click is a click with the
secondary (right) button, which opens a context menu; type clicks it, then
types text; scroll turns the wheel over it, down unless up; key
presses and releases a key with its modifiers (Ctrl, Shift, Alt,
Cmd). The events go into egui’s raw input through an egui plugin
(input_hook), so they work the same in a kittest harness, headless in
a nested compositor and in a window on a desktop. tree needs the
bridge on or read-only; the actions change the application, so they
need it on, and are refused when it is read-only. A node not found, or
found twice, is error -32003, with the reason.
window names the application window ui reads and acts in (its id,
main for the main window; ADR 0025):
an OS window of its own has its own tree and its own input. Without
it, the main window, with what egui embeds in it. Where egui embeds the
application windows in the main one (the web, a kittest harness), a
window is its embedded Window node (found by its title) and what is
in it, and main is the main window without them. In a window of its
own, the root node (a Window node egui leaves unnamed) takes the
window’s title, so an application window’s tree has a Window node
named by its title either way. A window that is
not open is error -32602, naming the open ones. An action that closes
its window (Escape, a close button) is answered once the window is
gone, with "window_closed": true; the events left for it are dropped,
and the application keeps running.
Inspect: egui’s inspection protocol
inspect carries egui’s own inspection protocol,
egui_inspection (by Lucas
Meurer and Emil Ernerfeldt, emilk/egui),
to an InspectionPlugin in the application’s process, the plugin
eframe’s inspection feature serves on TCP (inspection.md).
Here no port is opened: the request travels on the socket, the plugin
serves it through InspectionPlugin::submit, and the reply comes back
as { "response" }. Tunnelling it, rather than opening the plugin’s
port, is the idea of Rerun’s egui_mcp and egui_inspection_tools (the
same authors, rerun-io/egui_crates),
whose Transport takes one request and gives one response.
It gives what ui does not: the full AccessKit tree
({ "Tree": { "step", "pixels_per_point", "accesskit" } }), a
screenshot of the main window ({ "Screenshot": { "size": [w, h], "png_base64" } }, taken even while the window is hidden), any egui
event (a drag, a scroll by a delta, a click at a position, a click
count), a resize, and a wait until the frame settles ({ "Settled": { "settled", "steps" } }). Events and a resize are answered "Done" once
a frame processed them. Requests and responses are the protocol’s types
in serde’s JSON form; in Rust, egui_pop_agent::inspect::request_to_json
and response_from_json convert them. The protocol follows egui’s
version: a client built on another egui may not read its tree.
It is held more tightly than ui, since a screenshot or the tree shows
whatever the window shows and its events act anywhere:
- the bridge on: read-only and off refuse every request, the tree
included (
uitreestill reads under read-only); - the agent’s grant allows
uiand private data (Grant::ui,Grant::private), else-32001anddebug.call.refused(collectorinspect, the request’s name as the action,by: "pop.agent.grants"); - the input lock: while the user answers an agent’s request, every
inspectrequest is refused (below), checked again just before it is handed to egui.
It reads and acts on the main window. For the application’s other
windows, use ui with window.
commands.run through call is queued for the next frame, as
AppHandle::debug_call does: its result comes on the journal. Wait for
it with wait { "event": "command.done", "since": <last> }, last from
an earlier wait.
Errors: -32700 (not JSON), -32600 (not a request), -32601 (no such
method), -32602 (bad params), -32001 (the bridge refused describe,
snapshot or wait, data being the feedback block when there is
one; or the user declined a pairing or a destructive call, or a token
is unknown), -32002 (the application did not answer: it ran no frame,
or it closed; or the user did not answer a pairing or a destructive
call in time), -32003 (ui found no
node, or more than one, to act on), -32004 (a transport limit: too
many clients, a request too long; the connection closes).
$ printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"wait","params":{"settled":true}}' \
| socat - UNIX-CONNECT:$XDG_RUNTIME_DIR/egui-pop-agent-org.example.App.sock
{"id":1,"jsonrpc":"2.0","result":{"by":"settled","event":null,"last":42,"met":true}}
When the bridge is Off, hello, describe, snapshot, wait and
every call are refused: nothing but the user reads or drives it.
Identity: hello and pairing
An agent names itself once per connection, with hello; from then on
the connection’s calls run as Origin::Agent("<id>"), so the journal,
the histories and the bridge’s log tell agents apart. A connection that
never says hello keeps working as before, as
Origin::Agent("agent-socket"), with the same rights.
- The first time,
hello { "name": "Claude Code" }asks the user: a confirmation dialog, “Pair the agent “Claude Code”?”, says which id it would act as. The request is held until the user answers, as awaitis (deadline_ms, 120 s by default and at most). Accepted, the answer carries the agent’sid(claude-code: the name in lower case,[a-z0-9._-], 32 characters at most, a number added when the id is taken or reserved:agent-socket,anonymous,user,debug-bridge) and itstoken, given this once. Declined, it is error-32001; unanswered at the deadline,-32002, and the dialog is cancelled (an answer given late pairs nothing). - The next times,
hello { "name": "Claude Code", "token": "egp_…" }is paired at once; an unknown token is error-32001, and the agent asks again without one. - Only the user pairs. The dialog’s answer runs the command
pop.agent.confirm(egui_pop_agent::CMD_CONFIRM), hidden and kept from agents; an agent’s accept throughdialogs.answeris vetoed, its cancel goes through. - Kept. The pairings are written to
agent-pairings.jsonin the application’s persistence directory (AppBuilder::persist), with each token’s SHA-256, never the token; without a directory they last as long as the application runs.egui_pop_agent::pairings(app)lists them. - One
helloper connection: a second one is error-32602. - The journal says
agent.paired(agent,name),agent.declined(name,reason),agent.connected(ahellothat paired the connection) andagent.disconnected(a paired connection closed), from the agent’s origin (agent:<id>;userfor a decline).
A token says which agent calls; it does not isolate agents from one
another: every process of the user may read what another one keeps.
What each agent may do is its grant,
within the bridge’s mode and the agent flags.
$ printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"hello","params":{"name":"my script"}}' \
| socat - UNIX-CONNECT:$XDG_RUNTIME_DIR/egui-pop-agent-org.example.App.sock
{"id":1,"jsonrpc":"2.0","result":{"agent":"my-script","name":"my script","origin":"agent:my-script","paired":true,"token":"egp_…"}}
Paired in advance: scenario runners
A scenario runner cannot answer a dialog, and nobody sits at the
screen to approve it. The application pairs it in advance instead: it
issues a token at start, the runner says hello with it, and only that
connection gets the grant meant for runs; every unpaired client keeps
its own (read-only by default).
use egui_pop_agent::{Grant, PreIssue, PreIssueExt as _};
let mut builder = App::builder()
.debug_bridge(BridgeMode::On)
.agent_socket(AgentSocket::new());
// EGUI_POP_AGENT_TOKEN: a token the launcher gives both sides;
// EGUI_POP_AGENT_TOKEN_FILE: a file the application writes a new one to.
if let Some(p) = PreIssue::from_env("scenario") {
builder = builder.pre_issued_pairing(p.grant(Grant::full()));
}
- The token.
PreIssue::token(id, token)takes one the launcher made (at least 32 characters;EGUI_POP_AGENT_TOKENthroughPreIssue::from_env).PreIssue::file(id, path)makes a new random one and writes it topath, mode 0600, replacing a file there without following a link (EGUI_POP_AGENT_TOKEN_FILE); put it in a directory only the user may write to, such as the runtime directory. Without a builder:pairing::pre_issue(app, id, token, grant)andpairing::pre_issue_file(app, id, path, grant). - The pairing is
idexactly ([a-z0-9._-], 32 characters at most, not a reserved id nor a saved pairing’s), lasts as long as the application runs, and is never saved;Pairing::pre_issuedsays so, and the Agents page lists it, where the user may revoke it. Issuing the same id again replaces its token. - The grant.
PreIssue::grantis that agent’s; without it, the grants’ own for the id (AgentGrants::agent), or their paired default. AnAgentGrants::agentgrant for the id wins over it. - The runner.
egui_pop_test::scenario::live::LiveRunner::token(ortoken_file, which waits for the file as long as the runner tries to connect, ortoken_from_env) sayshellowith the token on each connection, asegui-pop-scenario; theegui-pop-scenariocommand line takes--tokenor--token-file, else reads the two variables. An unknown token fails the run atconnect. Without a token the runner says nohelloand is an unpaired client.
Destructive calls: the user confirms
A call that destroys or discards what cannot easily be had back waits
for the user: commands.run of a command declared
CommandSpec::destructive(), or an action its collector says is
(Collector::destructive(action, args); FnCollector::destructive,
FnCollector::destructive_when). describe says it (destructive on
each capability; for an action, without arguments).
By its arguments. A command that destroys only with some arguments says which, and only those calls are asked about; the others run at once:
CommandSpec::new(EXPORT, "Export", "Library")
// Only an export that overwrites existing files asks the user.
.destructive_if("clash", json!("overwrite"))
destructive_if(arg, value) matches when the argument arg (a
top-level name, or a JSON Pointer such as /options/clash) equals
value; several rules, any one matching. CommandSpec::is_destructive(args)
answers for a call. describe lists the rules as destructive_if
([{ "arg", "equals" }], beside destructive: false), and the MCP tool
keeps destructiveHint, its description naming the rules.
CommandSpec::destructive() still makes every call destructive.
- Held. The agent’s
callopens a confirmation dialog, in the danger style: “Let “claude-code” run “files.trash”?”, with the call’s arguments (the command’s own forcommands.run, cut at 240 characters). The request is held until the user answers, ashellois:deadline_ms, 60 s by default (CONFIRM_DEADLINE), 120 s at most (MAX_CONFIRM_DEADLINE). - Accepted, the call runs as the agent asked it, with the agent’s
origin (the journal’s
command.donesaysagent:<id>, notuser), and answers as anycall. - Declined (Cancel, or the dialog closed), it is error
-32001; unanswered at the deadline,-32002. Either way the journal sayscommand.refused(command,origin,reason,by: "pop.agent.confirm") forcommands.run,debug.call.refused(with the sameby) for another action, from the agent’s origin. - Only the user answers. The dialog’s answer runs
pop.agent.confirm(CMD_CONFIRM, the pairing’s), kept from agents; an agent’s accept throughdialogs.answeris vetoed, its cancel goes through. - Never asked: the user’s own calls and runs, a call that is not
destructive, and a call the bridge refuses anyway (its mode, the
agentflags): that one is refused at once, as before. - Expired. Unanswered at its deadline (or when the socket stops),
the call is refused and its dialog cancelled; an answer given late
(
pop.agent.confirmrun after it) finds nothing waiting and runs nothing.
Input locked while the user answers
While a confirmation is open, a destructive call’s or a pairing
request’s, agents do not act on the interface: a ui action (click,
type, keys, scroll, hover) is error -32001, “input is locked while the
user answers an agent’s request”, and the journal says
debug.call.refused (collector: "ui", the action, by: "pop.agent.confirm") from the agent’s origin. Otherwise an agent
allowed to act through ui could click the confirmation’s button,
which answers as the user. Every inspect request is refused the same
way (collector: "inspect"), a screenshot included. Reading the tree
(ui tree) still works,
and the user’s own mouse and keyboard are not touched. An action
already on its way when the dialog opens is refused before its events
go in. Once the dialog is answered or cancelled, agents act again.
$ printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"call","params":{"collector":"commands","action":"run","args":{"id":"files.trash","args":{"path":"a.jpg"}},"deadline_ms":30000}}' \
| socat - UNIX-CONNECT:$XDG_RUNTIME_DIR/egui-pop-agent-org.example.App.sock
{"error":{"code":-32001,"message":"the user declined `files.trash`: it is destructive and needs the user's confirmation"},"id":1,"jsonrpc":"2.0"}
Grants: what each agent may do
The application says what each of the socket’s agents may do, with an
egui_pop_agent::Grant per agent:
| Field | Says |
|---|---|
commands | the commands it may run: *, a prefix (files.*) or an id |
read_only | only read-only commands and calls that change nothing |
values | the value paths value.set and value.reset may write: *, a prefix (settings/*) or a path |
ui | ui may act for it (click, type, keys, scroll); reading the tree is always allowed. inspect needs it, and private too |
private | it reads private data: places (GPS), people (faces, names), absolute file paths (Private data) |
Three presets: Grant::read_only() (every command that reads, nothing
written), Grant::editor() (every command offered to agents, no value
written directly, no ui action) and Grant::full() (everything the
bridge’s mode allows), each reading private data. .commands([..]),
.values([..]), .ui(..) and .private(..) narrow or widen one.
use egui_pop_agent::{AgentGrants, AgentGrantsExt as _, Grant};
let app = App::builder()
.debug_bridge(BridgeMode::On)
.agent_socket_from_env_or_setting()
.agent_grants(
AgentGrants::new()
// A paired agent without a grant of its own (editor by default).
.paired(Grant::editor().commands(["library.*", "about.read"]))
// The paired agent `claude-code`.
.agent("claude-code", Grant::full().ui(false)),
);
- Who gets which. A client that said no
hello(Origin::Agent("agent-socket")) getsAgentGrants::unpaired, read-only by default; a paired agent its own grant, orAgentGrants::paired, the editor by default. Other origins (the user, an in-process caller, a script) are not the socket’s: grants say nothing about them. - Within the mode. The bridge’s mode stays the ceiling: under
ReadOnlyno grant writes, and destructive calls are still confirmed by the user (Destructive calls). - Enforced fail-closed, twice. The socket checks each
calland eachuiaction first, so the agent is answered-32001at once, before anything runs or is asked (a call the bridge refuses anyway, its mode or anagentflag, is answered by the bridge as before). And a listener namedpop.agent.grants(egui_pop_agent::GRANTS) onpop.command.runrefuses any run its grant does not allow, whatever path it took. It has prioritygrants::PRIORITY(10 000): it runs before the application’s own listeners (helios.policy, for one), which see only what the grants let through; one that must run first saysListenOpts::new().before(GRANTS). - On the journal, a refusal is
command.refused(a command) ordebug.call.refused(another action,uiactions as collectorui), withby: "pop.agent.grants"and the reason, from the agent’s origin. - Changed live with
egui_pop_agent::grants::set_grants(app, ..);grants::grants(app)reads them,grants::grant_of(app, origin)the one an origin is held to.
Private data
An agent may read everything the application offers it, private data included, unless the user or the application withholds it:
-
A private read.
CommandSpec::private()says a command’s result is private data (where the photos were taken, who is in them, absolute file paths). An agent whose grant hasprivate: falseis refused it, in the same two places as any grant refusal (-32001“the agent does not read private data”,command.refusedwithby: "pop.agent.grants").describelistsprivate: true, and the MCP tool’s description says it. -
A read that is only partly private (a photo list with places among other fields) does not refuse the whole list: its handler asks
egui_pop_agent::grants::reads_private(app, origin)and leaves the private fields out when it isfalse. It istruefor every origin that is not one of the socket’s agents, the user’s included. -
What others ran stays private too. The user may run a private command, or a granted agent: its arguments, result and error reach the journal (
command.dispatched,command.done,command.failed, each marked"private": truein its data), thecommandscollector’s runhistory(marked"private": true), and, when it ran through the bridge (commands.run), the call’s owndebug.callstep: its events (debug.call,debug.call.vetoed,debug.call.refused, marked"private": truein their data) and its trace in thestepscollector (marked"private": true). A step asked with"private": truein its arguments (egui_pop_api::steps::PRIVATE) is marked so whatever it is. The socket redacts them at read time, per reader: an agent whose grant withholds private data reads"<private>"in their place in everysnapshot,callandwaitanswer (egui_pop_agent::grants::redacted_for, which callsegui_pop_api::host::redact_private); an agent shown private data reads them whole, soegui-pop-agent-mcpstill reads a queued private command’s result back from itscommand.done. In process, the application reads its journal andAppHandle::historywhole. The journal is not redacted when written: a host that writes it elsewhere (a trace log, a report) redacts the events marked private itself. -
On by default. Every preset reads private data;
Grant::read_only().private(false)withholds it, and the Agents page has a switch for it per agent and for the defaults. -
Only commands are judged: a collector action has no private flag, so an application keeps private data out of what its collectors offer agents, or offers it through a private command.
-
The host’s switch. An application with its own setting for private data (agents may read it without a grant, say) hands it over with a hook: while it answers
true, every agent is treated as if its grant hadprivate(no private command refused,inspectnot refused for it, nothing redacted). It is asked at each request, so turning the setting on or off applies at once; the grants are left as they are, and without a hook nothing changes.use egui_pop_agent::AgentGrantsExt as _; let app = App::builder() .agent_private_allowed(|app| app.value::<bool>("settings/agents/private").unwrap_or(false));Later, or from a plugin:
grants::set_private_allowed(app, |app| ..),grants::clear_private_allowed(app);grants::private_allowed(app)reads its answer.
The escape hatch. Before grants, an unpaired client wrote whatever
the mode allowed. A scenario runner is
paired in advance instead. A
client that cannot say hello (the MCP binary, a script) and must
write, for a run on a throwaway profile, needs the application to say
so:
App::builder()
.debug_bridge(BridgeMode::On)
.agent_socket(AgentSocket::new())
.agent_grants(AgentGrants::new().allow_unpaired_writes());
allow_unpaired_writes gives unpaired clients Grant::full(), today’s
behaviour. Put it behind the same switch that turns the bridge On.
The Agents page: the user’s view and say
The socket’s plugin declares a page in the Settings app, Developer ›
Agents (developer/agents), as a manifest of the admin forms
framework (design/admin-forms.md), not as
widgets of its own:
- Paired agents, a table: name, id, paired since, last seen (UTC),
connected now (and how many connections), the access and what it means
in words. Read from
pop.agent.list(read-only), again after everyagent.*event. - Access, a row field: one of the presets (read only, editor, full),
applied at once through
grants::set_grants(pop.agent.grantwith{ "agent", "preset" }). A grant the application set that is none of the presets shows as “Set by the app” and stays until the user picks a preset. - Private data, a switch beside it: on, the agent reads places,
people and file paths; off, they are withheld
(Private data).
pop.agent.grantwith{ "agent", "private": false }; a preset chosen later keeps the switch, and the switch alone does not make the preset “Set by the app”. - Defaults: the same choices for clients that are not paired and for
paired agents without an access of their own (
pop.agent.grantwith{ "default": "unpaired" | "paired", "preset" }). - Revoke, a row action asking first: the pairing’s stored token hash
is removed (its token no longer pairs), its own grant dropped, its open
connections closed, and the journal says
agent.revoked(agent,name,closed) fromuser. In code:egui_pop_agent::revoke(app, id). On Windows a revoked connection closes at its next request.
pop.agent.grant and pop.agent.revoke are the user’s only: kept from
agents (no_agent), and their handlers refuse any origin but the
user’s. egui_pop_agent::pairing::connected(app, id) says how many
connections an agent has open; Pairing::last_seen when it last asked
something, kept with the pairing when its connection closes.
The page’s texts are translated through Admin::texts: a component
registers its StrKeys, and a declared text equal to a key’s English
shows in the interface’s language.
Argument schemas
A command declares its arguments’ JSON Schema with
CommandSpec::schema (the same as CommandSpec::args given a schema):
CommandSpec::new(ZOOM, "Zoom", "View").schema(json!({
"type": "object",
"required": ["factor"],
"additionalProperties": false,
"properties": { "factor": { "type": "number", "minimum": 0.1, "maximum": 8 } }
}))
- Enforced before the handler, for every origin. A run whose
arguments do not match is refused before
pop.command.runis asked and before the handler runs, and the journal sayscommand.refusedwithby: "pop.command.args"and the reason, which says where and why (refused by `pop.command.args`: its arguments do not match its schema: /factor: expected a number, got a string). Over the socket,commands.runanswers the refusal at once (ok: false) rather than queueing a run bound to fail; a destructive command’s run refused so is never asked about.AppHandle::command_args_refusalasks before a run. - Why every origin, not only agents. The schema is the handler’s contract, not a trust rule: a handler may rely on it whoever asks. The user’s runs carry arguments the application wrote (a key, a menu entry, a palette prompt), so a mismatch there is a bug in the application, better refused visibly than met by a handler that assumed the shape. One rule is also simpler to state and to test.
- Additive. A command whose
argsis a free description (an example, a text) ornullchecks nothing, as before. Only an object of schema keywords naming atype(orproperties, a combinator,$schema) is taken as a schema (egui_pop_core::debug::is_schema).nullarguments are checked as{}against an object’s schema, so a required property refuses a run with none. - The subset checked (
egui_pop_core::schema::check, egui-pop’s own, no dependency):type(a name or a list;integera number without a fraction),enum,const,properties,required,additionalProperties(falseor a schema),items,minItems,maxItems,minimum,maximum,exclusiveMinimum,exclusiveMaximum,minLength,maxLength,allOf,anyOf,oneOf,not. Other keywords (pattern,format,$ref…) are read as notes and not checked. - Published.
describelists the schema as the command’sargs, and MCP gives it as the tool’sinputSchema.
MCP
With the mcp feature, the crate serves the socket as an MCP server
(on rmcp): the binary
egui-pop-agent-mcp <socket> speaks MCP over stdio and the socket’s
JSON-RPC to the application.
$ cargo install --path crates/egui-pop-agent --features mcp
$ claude mcp add my-app -- egui-pop-agent-mcp $XDG_RUNTIME_DIR/egui-pop-agent-org.example.App.sock
- Tools from
describe.tools/listasks the application’sdescribeeach time, so a capability added since is a tool with no code. Each capability offered to agents becomes a tool: its name sanitised for MCP (about.readbecomesabout_read;[A-Za-z0-9_-], 64 characters at most, a number added on a clash), its description, its input schema (the args’ JSON Schema; without one, an object schema made from the example; a schema that is not an object’s is taken asargs), its output schema when it declares a result schema of an object,readOnlyHintfrommutates, anddestructiveHint: truefor a destructive one (its description says the user confirms each run; an undeclared command keeps MCP’s default). - Calls. An action’s tool is the socket’s
call: itsdatais the result (structured when there is an output schema), a refusal an error result (isError: true) the model reads. A command’s tool runs it withcommands.run, then waits for itscommand.done(orcommand.failed) on the journal, 10 s at most, and answers the command’s result. - Built-ins.
snapshot(collector, optional),wait(the socket’swait, its params and its answer as structured content) andui(the socket’sui: the tree, click, type, key, scroll).bridge.wait, which does not block, is not offered as a tool. - Widget tools.
widget_tree,widget_get_widget,widget_screenshot,widget_wait_for,widget_click,widget_hover,widget_scroll,widget_drag,widget_type_text,widget_press_key,widget_resizeandwidget_batchdrive the main window by pointer and pixels: they read the AccessKit tree, find a widget by id, role or text, and send real input, take a screenshot (an image item, PNG), wait until widgets show or frames pass, and run several of these in one call (widget_batch, whose steps take either name,widget_clickorclick). They are Rerun’s agent tools,egui_inspection_tools(by Lucas Meurer and Emil Ernerfeldt, MIT OR Apache-2.0), served overinspectthrough its one-methodTransport, so each request is held likeinspect: the bridge on, the agent’suiand private grants, and the input lock (refused while the user answers a confirmation or a pairing, a batch’s steps included). Their annotations follow the tool:readOnlyHintfor the tree, a screenshot and a wait,destructiveHintfor a click, a drag, typed text and a key. They are for testing by pointer and pixels; an agent acts on the application through its commands. Until Rerun publishes the crate, egui-pop depends on its temporary, unchanged forkegui-pop-inspection-tools(#660). - Off. When
describeis refused (the bridge is off) or the application does not answer,tools/listofferssnapshot,wait,uiand the widget tools, which are refused too.
In Rust, egui_pop_agent::mcp::McpBridge implements rmcp’s
ServerHandler over a Backend (SocketClient for a socket),
mcp::tools makes the tools from a describe reply, and
mcp::widget_tools lists the widget tools.
Threading
The socket’s threads never touch the application. A request goes to the
UI thread through a channel that the application drains at each pass of
its logic (Lifecycle::Pass); the reply comes back on a one-shot
channel. The socket’s thread asks for a repaint when a request arrives,
so a window that is idle answers at once.
A wait is held by the transport, never by the UI thread: it is checked
when it arrives, then again at each pass, until it holds or its deadline
passes; meanwhile a repaint is asked for every 10 ms. The repaints the
transport asks for are delayed ones, so they never count as the
application’s own (settled stays reachable).
Known gaps
- No recording of a session as a scenario yet.
- No wait for a widget to appear on the socket.
waitwaits on the journal or for the frame to settle; a client pollsuitree(orinspectGetTree) for a widget. Over MCP,widget_wait_fordoes the polling. - The widget tools see the main window only, as
inspectdoes;ui(withwindow) reaches the others. - Windows is compile-checked only.
- Access set on the Agents page lasts the session. The user’s
presets apply live but are not kept; at the next start the
application’s grants hold again. Only presets are offered, not
patterns. The MCP binary does not say
helloyet, so it reads only unless the application allows unpaired writes. - Private data is judged per command. A collector action has no private flag (Private data).
- Collector actions’ schemas are not enforced. Only commands’
are: an action’s
FnCollector::schemais listed and given to MCP, not checked. - In-process calls are not asked. Calls made in the application’s
own process (
AppHandle::debug_call) are not confirmed: only the socket’s are.
Driving the gallery with egui-mcp
The gallery has an opt-in Cargo feature, inspection, that turns on
eframe’s inspection feature. With it, and with the EGUI_INSPECTION
environment variable set, the gallery listens for the
egui_inspection protocol,
and Rerun’s egui-mcp server
connects to it. An agent behind egui-mcp reads the gallery’s
accessibility tree, clicks and types by role or label, takes
screenshots and waits for a widget to appear, in a live window.
This is a tool for working on egui-pop, not a part of it: no published
crate turns the feature on, and an application that wants it turns on
eframe’s inspection itself.
What it opens, and the risk
Development builds only. The endpoint is an unauthenticated TCP port on loopback. It bypasses egui-pop’s bridge mode, the agent socket’s grants and its input lock: an agent behind it acts as the user, and can click a destructive call’s confirmation or a pairing dialog itself. It is for development builds only, never for an application you ship. To let an agent read and drive the interface of a shipped application, use the agent socket: its
uimethod, orinspect, which carries this same protocol to the same plugin with no port, held by the mode, the grants and the input lock.
- Off unless asked twice. The feature is off by default, so no
build has it unless it says
--features inspection, release builds included. A build with it opens nothing untilEGUI_INSPECTIONis set (1ortrue:127.0.0.1:5719; ahost:port: that address; unset, empty,0orfalse: nothing). - No authentication. Whoever reaches the port drives the gallery and reads its screen: on loopback, any process of any user on the machine. Never bind it to another address than loopback on a machine you share; for a remote session, keep loopback and tunnel it (SSH). The gallery says so on stderr when it starts.
- Native only. On the web the feature compiles and opens nothing.
- One port.
127.0.0.1:5719is fixed: two galleries started withEGUI_INSPECTION=1collide, the second one logs that it cannot bind. Give each its own address (EGUI_INSPECTION=127.0.0.1:5720).
Run the gallery with it
cargo gallery --features inspection
cargo gallery (the xtask) passes the feature on and, when the
environment does not set EGUI_INSPECTION, sets it to 1 for the
gallery, so the endpoint is on 127.0.0.1:5719. It prints a line saying
so. Set the variable yourself for another address:
EGUI_INSPECTION=127.0.0.1:5720 cargo gallery --features inspection
# or without the xtask
EGUI_INSPECTION=1 cargo run -p egui-pop-gallery --features inspection
The gallery then prints:
inspection: the egui_inspection endpoint listens on 127.0.0.1:5719, without authentication: ...
From automation, run the gallery headless, never on a desktop session:
in wbox’s nested compositor (tools/wbox), with
EGUI_INSPECTION in the environment of the command it starts. The tree,
clicks and keys work while the window is hidden; a screenshot needs a
rendered frame, which a headless compositor gives.
Install and start egui-mcp
egui-mcp is an MCP server on stdio (MIT OR Apache-2.0):
cargo install egui_mcp --locked # the `egui-mcp` binary, 0.3 at the time of writing
Register it with the agent, for example Claude Code:
claude mcp add egui egui-mcp
or in an .mcp.json:
{ "mcpServers": { "egui": { "command": "egui-mcp" } } }
The agent then calls attach (default 127.0.0.1:5719, or
{"port": 5720}), and the other tools work on the gallery:
| Tool | What it does |
|---|---|
attach, disconnect, status | connect to the endpoint (retrying for a while), leave, say what is connected |
widget_tree, get_widget | the accessibility tree, filtered by role, label_contains, value_contains, content_contains; one widget in full |
click, hover, drag, scroll | at a widget found by id, role or text, or at a position in points |
type_text, press_key | text into the focused widget (or one found first), a key with modifiers |
wait_for | until widgets matching a query are there, or a number of frames ran |
screenshot, resize | a PNG of the window, its size in points |
batch | several of the above in one call |
An example session
The tool calls an agent makes, with what the gallery answered (trimmed);
the gallery started with cargo gallery --features inspection.
attach {}
{"attached":{"label":"egui-pop gallery","protocol_version":1,"transport":"127.0.0.1:5719"},"ok":true}
widget_tree {"role": "Button", "limit": 40}
{"nodes":[{"id":"e6b2a9759ad95ec2","label":"File","role":"Button"},
{"id":"41914c2377eb539e","label":"Edit","role":"Button"},
{"id":"c1a99ae429a37eda","label":"View","role":"Button"},
{"id":"52e44f5028f53c93","label":"Help","role":"Button"}, ...]}
click {"label_contains": "Help"}
{"button":"primary","clicked_id":"52e44f5028f53c93","count":1,"ok":true,"pos":[135.0,14.0]}
wait_for {"role": "Button", "label_contains": "Report a problem", "timeout_secs": 5}
{"matched":[{"id":"edf89024e9b57bbf","label":"Report a problem","role":"Button"}],"ok":true}
screenshot {}
{"height":692,"width":1100} and the PNG: the Help menu, open
click {"role": "Button", "label_contains": "About egui-pop gallery"}
{"clicked_id":"e5325c61cbb50a26","ok":true,"pos":[214.8,217.0]}
wait_for {"role": "Button", "label_contains": "Copy version info", "timeout_secs": 5}
{"matched":[{"label":"Copy version info","role":"Button", ...}],"ok":true,"steps_waited":6}
screenshot {}
the About dialog over the overview page
click {"label_contains": "Close"}
click {"role": "Button", "label_contains": "Report a problem"} is the
same call, but
that entry opens a new issue in the system’s browser rather than a
dialog in the gallery: from an agent’s session it opens a browser on
whatever desktop the session reaches. Help > About is the dialog to
practise on.
A widget is found by its accessible name, so a click by label works
for every widget the test kit already requires to have a name
(Testing). Several matches are an error that lists them:
a dialog’s title is a Label and a text run with the same text as the
menu entry that opened it, and the About dialog has its own “Report a
problem” link. Add a role, or pass an id from widget_tree.
How it relates to the debug bridge
Two ways in, for different things:
egui_inspection / egui-mcp | egui-pop’s debug bridge | |
|---|---|---|
| Reaches | egui: the AccessKit tree, raw input events, the framebuffer | the App: collectors, commands, steps, the journal (Agents) |
| Acts as | a person at the keyboard and mouse | the agent (debug-bridge origin, or its paired id), held by agent flags, when clauses and hooks |
| From another process | yes, TCP on loopback, unauthenticated | yes, through the opt-in agent socket: a private local socket, the bridge’s mode, each agent’s grants |
| The interface (tree, input) | yes, as the user: the mode, the grants and the input lock do not apply | the agent socket’s ui method, under the mode, the ui grant and the input lock |
| Wait | wait_for on the tree or frames | the agent socket’s wait (a journal event, settled), or polling in the process (journal.since) |
| Screenshots | yes | the agent socket’s inspect, this protocol without the port |
| Built in | the gallery with --features inspection only; development builds only | every App; the socket where the application turns it on |
egui_inspection cannot carry the bridge’s calls: its protocol has a
fixed set of requests (the tree, input events, a screenshot, a resize,
a wait), no extension point, and egui-pop adds none. A command reached
through egui-mcp is reached the way a person reaches it, through its
menu, its button or its shortcut; it runs as the user, and the bridge’s
agent flags and its mode do not apply. To run a command as an agent,
read a collector or call a collector action, use the bridge
(Agents); devtools shows the same collectors in the window
(Debugging), and through egui-mcp an agent can open
that panel and read it like any other widget.
Tests
crates/egui-pop-gallery/tests/it/inspection.rs attaches the plugin eframe
attaches to a headless gallery (kittest, no window), serves it on a free
loopback port and asks for the info and the tree over TCP: the gallery
must answer with its Help menu in the tree. CI also builds and lints
the gallery with --features inspection.
Extensions
An extension is a crate that adds to egui-pop through its public API: a plugin registering commands, panels, settings, steps and stories, and usually a component drawn from tokens. This page lists the known ones, says how to get listed and what a listed extension must hold to.
To write one, start from the extension template (a plugin, a component with its tokens and strings in English and French, a gallery story, a step, an agent command, headless tests):
cargo generate --git https://github.com/quazardous/egui-pop templates/extension
How egui-pop treats extensions across versions (what counts as a breaking change for them, deprecation windows) is in GOVERNANCE.md.
Tiers
- Official: in this repository, released with egui-pop, gated by
its CI on every commit. Optional crates behind a feature of the
egui-popfacade are official extensions. - Community: in their authors’ repositories, listed here after the checks below. Their authors release them; egui-pop does not build them.
- Featured: community extensions shown first and named in the release notes. Promotion is asked for in a pull request moving the entry, once the extension has followed two egui-pop minors (two egui bumps) within a month of each release, has users other than its author, and passes the checks. An extension left behind by a minor for more than three months goes back to community; one left behind by two minors is moved to the unmaintained list, and back when it catches up.
- An official extension may move out of the repository (to its own, as a community one) or a featured one into it, by a decision recorded as an ADR.
Entry format
One entry per extension, under its tier, in this shape:
### tally
- **Crate**: [`egui-pop-extension-template`](../templates/extension)
- **Adds**: a counter component, the `tally.change` step, `tally.set` for agents
- **egui-pop**: 0.1 (egui 0.36)
- **Licence**: MIT
- **Maintainer**: the egui-pop maintainers
- Crate: its name on crates.io, linked to its page or repository.
- Adds: one line: the components, plugins, steps and commands it brings.
- egui-pop: the egui-pop minors it builds against, with the egui minor each one uses (one egui-pop minor per egui minor).
- Licence: its SPDX expression.
- Maintainer: a person or group, with a way to reach them (the repository’s issues are enough).
Entries are sorted by name within a tier.
Getting listed
Open a pull request adding the entry under Community, with a link to
a release on crates.io. A maintainer runs the checks below and merges,
or says what is missing. The crate should also carry the egui-pop
keyword on crates.io, so a search finds it.
An entry is updated by a pull request too: a new egui-pop minor supported, a new maintainer. An author may ask for their entry to be removed at any time.
Checks an entry must pass
- Licence: an OSI-approved licence that lets applications combine it with egui-pop (MIT). Permissive licences (MIT, Apache-2.0, BSD, Zlib) fit everywhere; a copyleft one (GPL, LGPL, MPL) is accepted and said in the entry, since it binds the applications using it. Its dependencies’ licences say the same.
- Builds against the stated versions:
cargo testpasses against each egui-pop minor in the entry, with the egui of that minor and no second copy of egui in its dependency tree (cargo tree -d -i eguiis empty). - Plugin rules: its ids start with its plugin’s id; it registers
through
Ctxonly, so disconnecting its plugin leaves nothing behind (ADR 0004); nothing fails silently (ADR 0003); what changes state runs as a step (ADR 0011); its commands are declared once, with their arguments described when agents may run them. - Token contract: colours, sizes and durations come from tokens,
never literals; its component tokens are read by path with a system
token as fallback (
tally.background, elsesurface.raised) and named by role (Design tokens); text over its backgrounds keeps 4.5:1 (7:1 in the high-contrast themes) and a control’s boundary 3:1 in every built-in theme, which a test of its own checks. - Accessibility: every interactive widget has a role, a name and a
value, reachable with the keyboard; its tests find widgets by role and
label and run
egui_pop_test::assert_all_named. - Strings: every text shown has a key and an English fallback; its
catalogues carry its plugin’s id (
I18n::add_ownedrefuses others).
The template passes all of them; an extension that keeps its tests’ shape passes most of them by construction.
Official
i18n
- Crate:
egui-pop-i18n(featurei18n) - Adds: Fluent catalogues, the language setting, locale formatting, the
i18n.resolvestep, the key extractor and checks - egui-pop: 0.1 (egui 0.36)
- Licence: MIT
- Maintainer: the egui-pop maintainers
imaging
- Crate:
egui-pop-imaging(featureimaging) - Adds: the image tools’ steps (
histogram.drag,curve.change,wheel.change,zoom.change,cursor.resolve,graph.*) and the node graph editor in an application - egui-pop: 0.1 (egui 0.36)
- Licence: MIT
- Maintainer: the egui-pop maintainers
platform
- Crate:
egui-pop-platform(featuresplatform-*) - Adds: a single instance and deep links, notifications, a tray icon, global shortcuts, logs and crash reports, the focus mode, each an opt-in plugin
- egui-pop: 0.1 (egui 0.36)
- Licence: MIT
- Maintainer: the egui-pop maintainers
tally (the template)
- Crate:
egui-pop-extension-template(not published: copy it, orcargo generate) - Adds: a counter component with its tokens and strings, a gallery story, the
tally.changestep,tally.incrementandtally.setfor agents - egui-pop: 0.1 (egui 0.36), and every commit of
main - Licence: MIT
- Maintainer: the egui-pop maintainers
views and editors
- Crate:
egui-pop-views(featureviews),egui-pop-editors(featureeditors) - Adds: a live tree, lists and tables, the photo library’s widgets; text and code editors and a terminal; every moment a step, agent commands
- egui-pop: 0.1 (egui 0.36)
- Licence: MIT
- Maintainer: the egui-pop maintainers
viewport
- Crate:
egui-pop-viewport(featureviewport) - Adds: the image viewport (tiles from the application’s source, wide gamut and HDR), thumbnails, the histogram, curves, colour wheels, the zoom control and navigator, the node graph editor
- egui-pop: 0.1 (egui 0.36)
- Licence: MIT
- Maintainer: the egui-pop maintainers
Featured
None yet.
Community
None yet: be the first, with a pull request.
Unmaintained
None.
Built with egui-pop
Applications, for reference and ideas; a pull request adds one (name, link, licence, one line on what it shows of egui-pop).
- Helios (GPL-3.0): a client/server image processing framework whose first application is photo editing. The flagship: an editor over a kernel of its own, which egui-pop’s host contract, image tools, workbench and library widgets are shaped for.
UI index: what to use for a need
Before drawing anything with egui’s own widgets, look here: each row maps a need to the egui-pop call that answers it, themed by the kit, named for screen readers and agents. A need missing here is a gap to fill in egui-pop, not a reason to hand-draw it.
ui.* methods come from the UiPop trait, in egui_pop::prelude.
To add an entry, give the item a doc line
/// Need (group): a search field., the group one of: text, layout, action, input, state, status, icon, help, dialog, data, image.
Text and titles
| Need | Use | What it is |
|---|---|---|
| a heading over a group of fields | ui.section_title(..)egui_pop::core::ui::UiPop::section_title | A section’s title (text-role.section). |
| a label in a named text role (title, section, body, muted, meta) | ui.text_role(..)egui_pop::core::ui::UiPop::text_role | A label in a text role (role_text). |
| a section title | ui.section_title(..)egui_pop::core::ui::UiPop::section_title | A section’s title (text-role.section). |
| greyed or weak text | ui.muted(..)egui_pop::core::ui::UiPop::muted | Secondary text: a hint, a description (text-role.muted). |
| monospace text, a log or console line, a path or code | ui.code_text(..)egui_pop::core::ui::UiPop::code_text | Monospace text: a log’s or a console’s line, a path, a piece of code. |
| secondary text, a hint or a description | ui.muted(..)egui_pop::core::ui::UiPop::muted | Secondary text: a hint, a description (text-role.muted). |
| small print about an item, a date or a size | ui.meta(..)egui_pop::core::ui::UiPop::meta | Small print about an item: a date, a size (text-role.meta). |
| strong or bold text inline, a word that must stand out | ui.strong_text(..)egui_pop::core::ui::UiPop::strong_text | Inline emphasis: a word or a value that must stand out in running text, at the body’s size in a heavier weight (text-role.strong, strong_text). |
| text in a tone, a failed state or an error in the danger colour | ui.text_tone(..)egui_pop::core::ui::UiPop::text_tone | Text in a tone: a failed state, an error, a warning, a success. |
Spacing, cards and scrolling
| Need | Use | What it is |
|---|---|---|
| a card, a framed group | ui.card(..)egui_pop::core::ui::UiPop::card | add inside the kit’s card in a tone (Tone::Neutral for the plain card). |
| a divider, a rule between two sections (separator) | ui.divider(..)egui_pop::core::ui::UiPop::divider | A divider: a rule across the layout between two sections, in border.default, one point wide on whole physical pixels, centred in a space of Space::Group. |
| a group that folds and opens inside a panel (a disclosure, a collapsing header) | Foldegui_pop::core::fold::Fold | A group inside a panel whose header row folds and opens its body: a section band (disclosure mark, title, count) with optional actions at its right end, its body indented below it when open. |
| a panel opened several times at once, each instance with its own state | PanelSpecegui_pop::model::panels::PanelSpec | A panel as declared: its id, title, areas, sizes, and whether it opens once or as many times as asked (PanelSpec::instances). |
| a scrolling region | ui.scroll_area(..)egui_pop::core::ui::UiPop::scroll_area | Shows egui’s scroll area with its bars drawn from the kit’s scroll-bar (Stock::ScrollBar: the thumb’s fills and corners, the track), add its content, drawn in this Ui’s own style. |
| a tab bar button that moves a whole tab group into a window of its own | DockControlsegui_pop::api::workbench::DockControls | The controls the workbench’s docks show beyond the tabs, as the application sets them (AppBuilder::dock_controls). |
| a widget of a fixed size, filling its box (add_sized) | ui.sized(..)egui_pop::core::ui::UiPop::sized | widget in a box of size at the layout’s cursor, filling it (centred and justified along the layout’s direction): a row the width of its room, a field of a set width. |
| collapsible sections in a panel | Sectionsegui_pop::core::sections::Sections | A stack of collapsible sections filling the room it is given (a panel’s height), named for its memory and for agents. |
| content in a box of a fixed size (allocate_ui_with_layout) | ui.sized_ui(..)egui_pop::core::ui::UiPop::sized_ui | add in a box of exactly size at the layout’s cursor, laid out by layout (Layout::centered_and_justified to fill it): a cell of a set width in a row. |
| content placed in a given rectangle, clipped to it (put) | ui.rect_ui(..)egui_pop::core::ui::UiPop::rect_ui | add in rect, laid out by layout and clipped to it, for what places its parts by rectangles (a card laid out by a layout engine, a slot): nothing it draws goes past rect. |
| one of egui’s own widgets, styled by the kit | ui.scoped(..)egui_pop::core::ui::UiPop::scoped | add in a scope where egui’s own widgets of a Stock kind (buttons, combo boxes, text fields, buttons shown on or off) are drawn from the kit’s component, in a tone: its states become egui’s widget visuals, so egui keeps drawing the widget (Kit::scope). |
| open a closed panel again where it was, or in a given tab group | PanelOpenAskegui_pop::api::bus::PanelOpenAsk | A panel asked open: which panel, where, and who asks. |
| space between blocks, by intent (never a number of points) | ui.space_role(..)egui_pop::core::ui::UiPop::space_role | Space by intent along the layout’s direction (Space); egui’s own add_space takes points. |
Buttons and actions
| Need | Use | What it is |
|---|---|---|
| a button by tone (primary, danger, quiet) | ui.button_tone(..)egui_pop::core::ui::UiPop::button_tone | egui’s button in a tone of the kit’s button (button.tone.*): a Stock::Button scope (UiPop::scoped), so the button keeps its layout, icon and shortcut text. |
| a button with a menu of alternatives (split button) | input::split_button(..)egui_pop::core::input::split_button | A split button on its own: an action (text) and a chevron opening a menu of items. |
| a small (compact) button in a dense list row | RowButtonegui_pop::core::compact::RowButton | A button small enough for a list’s row (see the module). |
| a small frameless text button in a bar (a breadcrumb, a name in a title bar) | widgets::bar_text_button(..)egui_pop::core::widgets::bar_text_button | A frameless text button sized for a bar: small text, no box, as wide as its text, egui’s hover look (its text brightens under the pointer) and the focus ring when it has the keyboard. |
| an icon button | IconWidgetegui_pop::core::icon::IconWidget | An icon as a widget. |
| keys that work in every instance of a panel | CONTEXT_FOCUSED_PANEL_KINDegui_pop::api::app::CONTEXT_FOCUSED_PANEL_KIND | The context key holding the kind of the focused panel (PanelId::kind): the panel’s own id, or app.gallery while its instance app.gallery#2 has the focus, so one clause reaches every instance: when: "focusedPanelKind == 'app.gallery'". |
Fields and choices
| Need | Use | What it is |
|---|---|---|
| a checkbox | widgets::checkbox(..)egui_pop::core::widgets::checkbox | A checkbox (Checkbox): ui.checkbox, drawn through the kit. |
| a colour picked on a wheel | ColorWheelegui_pop::viewport::wheel::ColorWheel | A colour wheel, with its luminance slider. |
| a drop-down choice (combo box) | ui.combo_box(..)egui_pop::core::ui::UiPop::combo_box | Shows egui’s combo box (widgets::combo_box, for the kit’s arrow) with its box drawn from the kit’s combo-box (Stock::ComboBox), add its list’s content: ComboBox::show_ui in a scope. |
| a file or folder path field | Input::path(..)egui_pop::core::input::Input::path | A path field. |
| a filter box | Input::search(..)egui_pop::core::input::Input::search | A search field: a magnifier before the query, clearable. |
| a masked field for a secret (token, API key) | Input::masked(..)egui_pop::core::input::Input::masked | A masked text field (a password, a token, a key): every character a bullet, nothing to copy, and its value never given to assistive technologies or agents, only its name. |
| a multi-line text field (a description, notes) | Input::multiline(..)egui_pop::core::input::Input::multiline | A multi-line text field: rows lines tall, growing with its text up to max_rows, then scrolling; Enter starts a new line, Ctrl+Enter submits (see submit_on_enter). |
| a number field with a unit | Input::number(..)egui_pop::core::input::Input::number | A number field: a number or an expression (x * 2, 1,5), committed when it loses the focus. |
| a number field with steps and limits | NumberInputegui_pop::core::number::NumberInput | A number input; see the module. |
| a password field | Input::masked(..)egui_pop::core::input::Input::masked | A masked text field (a password, a token, a key): every character a bullet, nothing to copy, and its value never given to assistive technologies or agents, only its name. |
| a rotary knob | Knobegui_pop::core::knob::Knob | A rotary knob over an f64. |
| a search field | Input::search(..)egui_pop::core::input::Input::search | A search field: a magnifier before the query, clearable. |
| a single-line text field | Input::text(..)egui_pop::core::input::Input::text | A text field named label (for assistive technologies and agents; the label itself is drawn by the form around it). |
| a slider over a number | Slideregui_pop::core::slider::Slider | A slider over an f64. |
| a star rating | RatingStarsegui_pop::core::rating::RatingStars | Five stars (see the module). |
| a text area that grows with its text | Input::multiline(..)egui_pop::core::input::Input::multiline | A multi-line text field: rows lines tall, growing with its text up to max_rows, then scrolling; Enter starts a new line, Ctrl+Enter submits (see submit_on_enter). |
| a text field with a placeholder | Input::text(..)egui_pop::core::input::Input::text | A text field named label (for assistive technologies and agents; the label itself is drawn by the form around it). |
| a toggle chip, a filter turned on or off | ToggleChipegui_pop::core::widgets::ToggleChip | A small toggle showing a short text or a glyph, on while selected: its box is the kit’s toggle-chip component (based on selectable-row), its text or glyph in the state’s text. |
| an on/off switch (a toggle with a track and a thumb) | Switchegui_pop::core::widgets::Switch | An on/off switch: a track (the kit’s switch component, selected while on) and a round thumb, at the track’s start while off and at its end while on, in the state’s text; its label after it, in the text of the same state off. |
| one choice among a few (radio buttons) | widgets::radio_value(..)egui_pop::core::widgets::radio_value | A radio button setting current to alternative when clicked: ui.radio_value, drawn through the kit. |
| one mode among a few, as a segmented control or a tab strip | Segmentedegui_pop::core::segmented::Segmented | A segmented control: a row of exclusive options, one selected (a view’s modes, a panel’s tabs), as Mantine’s SegmentedControl, Ant’s Segmented or libadwaita’s AdwToggleGroup have it. |
Loading, empty and progress
| Need | Use | What it is |
|---|---|---|
| a busy spinner | Spinneregui_pop::core::progress::Spinner | A spinner, with a label after it; Spinner::delayed shows it only after motion.spinner.delay, and keeps it motion.spinner.min. |
| a place shown by its kind with its state on it (a node glyph with an offline mark) | .badge_icon(..)egui_pop::api::files::places::PlaceItem::badge_icon | A state badge on the corner of the kind icon: an icon of the icon registry (phosphor:cloud-slash) and its tooltip (Offline), the tooltip shown when the pointer is on the badge and said in the item’s description. |
| a place shown out of reach but still choosable (a folder of an offline volume) | .dimmed(..)egui_pop::api::files::places::PlaceItem::dimmed | Drawn muted and said to be unavailable (see PlaceItem::dimmed): an offline volume’s folders, still choosable. |
| a progress bar | ProgressBaregui_pop::core::progress::ProgressBar | A progress bar. |
| a small circular progress | Ringegui_pop::core::progress::Ring | A small circular progress: determinate (an arc from the top) or indeterminate (a turning arc). |
| a value or a list still loading | Skeletonegui_pop::core::placeholder::Skeleton | Grey shapes standing in for content. |
| a value still loading | Spinneregui_pop::core::progress::Spinner | A spinner, with a label after it; Spinner::delayed shows it only after motion.spinner.delay, and keeps it motion.spinner.min. |
| an empty state, nothing here yet | EmptyStateegui_pop::core::placeholder::EmptyState | An empty place: an icon, a title, a sentence, an action. |
| no results for a search or a filter | EmptyStateegui_pop::core::placeholder::EmptyState | An empty place: an icon, a title, a sentence, an action. |
| placeholder shapes while content loads | Skeletonegui_pop::core::placeholder::Skeleton | Grey shapes standing in for content. |
Status marks and badges
| Need | Use | What it is |
|---|---|---|
| a colour swatch | Indicatoregui_pop::core::indicator::Indicator | A micro-indicator, built then added inline (ui.add) or painted on a widget (Indicator::on, Indicator::paint_at). |
| a level against thresholds (disk space, memory) | Meteregui_pop::core::progress::Meter | A value against thresholds (disk space, memory), not progress: a bar whose tone follows the highest threshold reached. |
| a status dot, a LED, a count badge or a flag | Indicatoregui_pop::core::indicator::Indicator | A micro-indicator, built then added inline (ui.add) or painted on a widget (Indicator::on, Indicator::paint_at). |
| an inline error, warning or success message | ui.text_tone(..)egui_pop::core::ui::UiPop::text_tone | Text in a tone: a failed state, an error, a warning, a success. |
Icons and glyphs
| Need | Use | What it is |
|---|---|---|
| a small mark by meaning (disclosure, sort, check, close) | Glyphegui_pop::core::kit::Glyph | What a small mark means. |
| an icon as a widget (sized, toned, clickable) | IconWidgetegui_pop::core::icon::IconWidget | An icon as a widget. |
| an icon by name | Iconegui_pop::core::icon::Icon | What an icon means. |
Tooltips, hover cards and notices
| Need | Use | What it is |
|---|---|---|
| a hover card, a rich tooltip with rows and links | HoverCardegui_pop::core::hover_card::HoverCard | A hover card next to a widget. |
| a toast, a short notice that fades | Toastsegui_pop::api::toasts::Toasts | The queue of toasts. |
| a tooltip | .tip(..)egui_pop::core::tooltip::TooltipExt::tip | Shows text in the kit’s tooltip while the widget is hovered and enabled, as Response::on_hover_text does with egui’s. |
| an inline message (an error, a warning, a success) in sentences, selectable and copyable | Noteegui_pop::core::note::Note | An inline message in sentences: see the module. |
| why a control is disabled | .disabled_tip(..)egui_pop::core::tooltip::TooltipExt::disabled_tip | Shows text in the kit’s tooltip while the widget is hovered and disabled (the reason it is), as Response::on_disabled_hover_text. |
Dialogs, menus and pages
| Need | Use | What it is |
|---|---|---|
| a command palette | Paletteegui_pop::api::palette::Palette | The palettes’ state, one per window group (AppHandle::window_group): open or not, the query. |
| a command row with its shortcut in a menu drawn by hand | menus::command_row(..)egui_pop::api::menus::command_row | A command row in a menu drawn by hand (a popup or context menu built in a closure), drawn as the declared menus’ command rows: the kit’s menu-item, its label at the start, shortcut (the keys’ text, such as Ctrl+C) muted at the end in the menu’s key font. |
| a confirmation dialog | Confirmegui_pop::api::dialogs::Confirm | A question before an action: a primary button and Cancel, or, with a Secondary, the classic three buttons (“Save”, “Don’t save”, “Cancel”) in the platform’s order (ButtonOrder). |
| a file or folder picker | FileBrowseregui_pop::api::files::browser::FileBrowser | The file browser: entries from a FileSource, shown by a ViewMode chosen in its toolbar (or with Ctrl+1 to Ctrl+9), kept per dialog in the host’s store when drawn with FileBrowser::show_in. |
| a popover’s surface in an area the application places itself | ui.popover(..)egui_pop::core::ui::UiPop::popover | add on the kit’s popover surface (its popover component, with egui’s popup shadow): the look of egui-pop’s own popovers, for an area the application places itself (a first-run notice, a hint by a control), outside the overlay stack. |
| a quick pick, a filtered list of choices in the palette | QuickPickegui_pop::api::palette::QuickPick | A list of choices the palette offers in place of the commands (Palette::pick_in): typed text filters them by a fuzzy match of their labels, Enter runs the selected one’s command, Escape closes. |
| a settings or admin page declared as a manifest | Adminegui_pop::api::admin::Admin | The administration app’s state, manifests, hooks, widget kinds and value layers. |
| a side panel of places whose rows are drop targets or drag sources | .on_row(..)egui_pop::api::files::places::PlacesPanel::on_row | A hook called with each item’s row and its response, after the panel’s own handling: the application attaches what the panel knows nothing of (a drop target or a drag source through the drag session, bus::drag; its own context menu; a tip). |
| a side panel of places, with sections of an application’s | PlacesPanelegui_pop::api::files::places::PlacesPanel | A side panel of places: sections, each a heading over its items, as the in-app picker lists them (an import window’s sources column). |
| a submenu in a context menu drawn by hand | menus::submenu(..)egui_pop::api::menus::submenu | A submenu item in a menu drawn by hand (a context menu built in a closure, egui_pop_core::pointer::claim::context_menu), drawn as the declared menus’ submenu items: the kit’s menu-item with the submenu arrow, selected while its submenu is open. |
| a three-button question (Save, Don’t save, Cancel) | Confirmegui_pop::api::dialogs::Confirm | A question before an action: a primary button and Cancel, or, with a Secondary, the classic three buttons (“Save”, “Don’t save”, “Cancel”) in the platform’s order (ButtonOrder). |
| ask before a destructive action | Confirmegui_pop::api::dialogs::Confirm | A question before an action: a primary button and Cancel, or, with a Secondary, the classic three buttons (“Save”, “Don’t save”, “Cancel”) in the platform’s order (ButtonOrder). |
Lists, trees and tables
| Need | Use | What it is |
|---|---|---|
| a list of places without a heading | PlaceSection::untitled(..)egui_pop::api::files::places::PlaceSection::untitled | A section without a heading: no title drawn and no fold arrow, its rows shown directly (a library’s top rows, “All photos”, above the titled sections). |
| a long list, virtualised | ListViewegui_pop::views::list::ListView | The list widget. |
| a narrow column of states headed by an icon | .header_icon(..)egui_pop::views::table::DataTable::header_icon | Shows column column’s header as an icon of the icon registry (phosphor:cloud-check) with a tooltip (Backed up), for a narrow column of states. |
| a narrow column’s header shown as an icon | .show_icon(..)egui_pop::core::widgets::SortHeader::show_icon | Draws it over rect with icon in its title’s place (a narrow column’s header): the title is no longer shown but stays its name for assistive technology, and the sort glyph follows the icon. |
| a row of a hand-built tree with its disclosure toggle (a folder tree in a side panel) | TreeRowegui_pop::core::fold::TreeRow | A row of a hand-built tree: a branch’s toggle, or a leaf’s room for one, then the row the caller draws; TreeRowResponse::body shows the rows below a branch, indented, when it is open. |
| a row picked from a short list | SelectableRowegui_pop::core::widgets::SelectableRow | A row picked from a short list: its box is the kit’s selectable-row component, selected for the chosen one (never hover then, so the choice stays visible under the pointer), its label in the state’s text. |
| a side panel of places with one selection in each section (scopes chosen together) | .selected_set(..)egui_pop::api::files::places::PlacesPanel::selected_set | The items shown selected, by id, beside PlacesPanel::selected: one in each section where the application’s scopes add up (a folder, an album and a keyword chosen together). |
| a sortable column header | SortHeaderegui_pop::core::widgets::SortHeader | A column’s header: its box is the kit’s table-header-cell component, selected while the rows are sorted by it, the direction the kit’s sort-ascending or sort-descending glyph after the title. |
| a table with sortable, resizable columns | DataTableegui_pop::views::table::DataTable | The data table widget. |
| a tree of places in a side panel (folders and their subfolders, nested keywords) | .children(..)egui_pop::api::files::places::PlaceItem::children | Items nested under it, after those it has: a branch of a tree (volume, folder, subfolders; Animals, Dog). |
| a tree of places whose levels are easy to follow (folders nested deep) | .indent_guides(..)egui_pop::api::files::places::PlacesPanel::indent_guides | When a tree section (PlaceItem::children) draws its indent guides, a thin line down each nesting level in the kit’s list-guide (list-guide.rest.border-color, border-width): never (the default), while the pointer is over the panel, or always, as VS Code’s renderIndentGuides. |
IndentGuidesegui_pop::core::fold::IndentGuides | When a hand-built tree draws its indent guides: a thin line down each nesting level, as VS Code’s explorer does (renderIndentGuides). | |
a tree row of compacted folders (a / b / c) whose each folder is clickable | .segments(..)egui_pop::api::files::places::PlaceItem::segments | Its name drawn as a compacted chain, a / b / c (egui-pop draws the separator, SEGMENT_SEPARATOR): each segment underlined under the pointer, its own click target and its own node for assistive technology, named by the chain up to it (a / b) or its PlaceSegment::name. |
| a tree, lazy and keyboard-driven | TreeViewegui_pop::views::tree::TreeView | The tree widget. |
| many rows of equal height, only the visible ones drawn | ui.scroll_area_rows(..)egui_pop::core::ui::UiPop::scroll_area_rows | UiPop::scroll_area for rows rows row_height high, the Ui’s item spacing apart: egui’s ScrollArea::show_rows, add given the rows in view. |
Images and imaging
| Need | Use | What it is |
|---|---|---|
| a colour wheel | ColorWheelegui_pop::viewport::wheel::ColorWheel | A colour wheel, with its luminance slider. |
| a curve editor | CurveEditoregui_pop::viewport::curve::CurveEditor | The curve editor. |
| a grid of thumbnails | ThumbnailGridegui_pop::core::thumbnail::ThumbnailGrid | thumbnail_grid with its options: where it keeps its scrolling, how high it gets, and a cell to bring into view, drawn or not. |
| a histogram | Histogramegui_pop::viewport::histogram::Histogram | The histogram widget. |
| a place shown by its picture (a camera’s photo) in a places list | .image(..)egui_pop::api::files::places::PlaceItem::image | An image in the icon’s place: a texture the application loaded (egui::load::SizedTexture), or a URI egui’s image loaders read (file://, bytes://, https://). |
| a zoom control | ZoomControlegui_pop::viewport::navigator::ZoomControl | The zoom control: zoom out, the zoom, zoom in, fit, 100 %. |
| an application’s logo in its own title bar, beside its name | .logo(..)egui_pop::api::frame::FramePlugin::logo | The application’s logo, drawn after the system menu button and before its name, a toolbar icon’s size (size.icon.toolbar), so the application keeps the frame’s menu block instead of replacing it. |
| an image navigator (overview with the visible area) | Navigatoregui_pop::viewport::navigator::Navigator | The navigator: the whole image and the part in view. |
| an image viewport (pan, zoom, tiles) | Viewportegui_pop::viewport::widget::Viewport | The viewport widget, built per frame. |
The gallery
The gallery (crates/egui-pop-gallery, not published) is the catalogue
of egui-pop, itself a plugin application: each page is a story a plugin
registers.
cargo run -p egui-pop-gallery -- --theme pop-light --page zones
cargo run -p egui-pop-gallery -- --help
The media pages. The viewer’s MP4 page (feature video, GStreamer) and
YouTube page (feature webview, WebKitGTK, Linux only) need the system’s
libraries to build, so they are off by default. cargo gallery (short for
cargo xtask gallery) asks pkg-config for them, turns on each feature it can
build, prints a line per feature, off with the packages to install, then runs
the gallery:
cargo gallery # what the system allows
cargo gallery --check # only print the decision
cargo gallery --release -- --page viewer
cargo gallery --no-detect --features video # only what is asked
video needs gstreamer-1.0, gstreamer-base-1.0, gstreamer-app-1.0 and
gstreamer-video-1.0 (Fedora: gstreamer1-devel gstreamer1-plugins-base-devel;
Debian/Ubuntu: libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev); its demo
clip is written with the AVI muxer of the good plugins (gstreamer1-plugins-good,
gstreamer1.0-plugins-good). webview needs webkit2gtk-4.1 and gtk+-3.0
(Fedora: webkit2gtk4.1-devel; Debian/Ubuntu: libwebkit2gtk-4.1-dev). Off
Linux, webview stays off and video is probed the same way, through the
pkg-config files of GStreamer’s installers.
Driven by an agent. cargo gallery --features inspection opens the
egui_inspection endpoint Rerun’s egui-mcp attaches to, on loopback and
without authentication: the accessibility tree, clicks by label,
screenshots and waits (Driving the gallery with egui-mcp).
It bypasses the bridge’s mode, the agent socket’s grants and its input
lock, so an agent behind it acts as the user and can click a
confirmation or a pairing dialog: development builds only, never an
application you ship.
Options: --theme, --density (comfortable or compact),
--accent, --reduced-motion, --page (the page shown first),
--lang (the language setting’s default: en, fr or system),
--quit-after <frames>, --dump-debug, --no-persistence and
--detach <panel> (a panel opened in a window of its own at start) for
scripted runs, and
--platform (the desktop’s own platform services: a single instance
answering gallery://page/<name> links, notifications, a tray icon, the
global shortcut Ctrl+Alt+G, logs and crash reports in the user’s state
directory; without it they are simulated and nothing reaches the
desktop).
The side bar lists the pages in egui-pop’s own tree view (the tree), one scroll for all, their groups as folders. A click or Enter opens a page; the arrows walk the list, Left and Right fold and open a group, letters find a row. The folds are kept with the window’s layout, and the group of the page shown opens by itself.
A field above the list filters it (the tree’s filter): a page
shows when every word typed is in its title, its description or its group,
ignoring case and accents, its group opened for it; the words found are
underlined in the titles, and “3 of 63” beside the field says how many rows
match. Ctrl+F or / in the list goes to the field, Down goes back to the list
on the first match, Escape clears the field and then leaves it. The folds kept
are left as they were.
A page scrolls, each keeping its place, as its playground does: a shell panel
gives no scroll area of its own (bare panels). Those
that stay inside the zone by themselves are marked (shell::FILLS_THE_ZONE): the
pages with a scroll area of their own around nearly all of them (overview,
tokens, builtins, icons, grading, inputs, platform, sliders), and
graph-file, a canvas and the file beside it sized to what is left. A canvas in
a scrolling page keeps the wheel over itself. A test walks every page in a short
window.
What survives a restart (eframe’s persistence): the folds of the page list,
the stacked sections, the panels’ sizes and how far pages are scrolled (egui’s
memory), the workbench’s layout, and on the desktop the window’s size and place.
They are in a file in the application’s data directory, or in the browser’s local
storage for this origin on the web, where egui’s memory is under its shared key
egui_memory_ron and they are written when the page loses the focus and
every 30 seconds. The page, the theme and the settings start over. --size wins
over the size kept. --no-persistence or --quit-after run the gallery with
nothing read and nothing kept, as tools/wbox/app.sh does.
Pages: overview (the theme overview), tokens, builtins (egui’s
built-ins, and egui-pop’s kit-drawn checkbox, radio, rows and chips), roles (layout by role: text roles, spacing by intent, cards and buttons by tone, rows and grids on one baseline), regions (slot regions: cards around and over an image, folding by priority), scoped (egui’s own buttons, toggles, combo box and text fields restyled by the kit in a scope), theme-editor (the theme editor), fonts (candidate font pairs side by side), icons, indicators (dots, badges, pips, flags, swatches), notes (inline messages in every severity: wrapped, selectable, copyable, with folded details), sections (collapsible sections stacked in a panel), folds (groups folding inside a panel, a hand-built tree’s rows with their toggles), motion (the motion clock), values, history (the application’s history: its panel’s list, a click jumping to a step), sliders, faders (vertical sliders as a strip of faders, knobs in their three layouts, sliders in narrow slots, a standalone section band), compact (controls for a slot of a given size: scrub fields, compact cells, a value’s marks, value bars, menu rows), ramps (sliders and knobs drawn in a colour ramp from their minimum’s colour to their maximum’s: the colour at the value, or the whole ramp on the track), inputs (decorated inputs, field states and Tab order),
menus, toolbars (toolbars of commands, More tools, a tool palette), dialogs, files (the file chooser), toasts, tips (tips of the day and
hints), about (Help > About: what the gallery says about itself, its
version info to copy), progress,
placeholders (skeletons and empty states), viewport (the image
viewport), viewport-labels (labels over a bright and a dark image), navigator (the zoom control and the navigator), images,
grading (curves and colour wheels), cursors (tool cursors, brush
outlines and the loupe), node-graph (the node graph editor), graph-file (the node graph editor over a YAML file), display (wide gamut and HDR surfaces),
preview (a custom dialog previewing an export in a viewport), tree
(the live tree), list-items (dense rows on their own and in a tree,
property rows in a selection panel), table (lists and tables), plot (charts: a time
series with a time cursor, a scatter and bars), plot-time (a plot over a
timeline’s time), text-log (a text log on the data table: level chips, a
filter, the tail followed, the rows at the playhead), library (the photo
library), timeline (timelines over seconds, a timecode and bars and beats), tracks (tracks of clips), dj (two DJ decks: hot cues, loops, sync, the waveform dragged under a fixed playhead), editor (a video editor: split, ripple delete, in and out marks, a transport row), text-editor,
code-editor, terminal, zones (zones and blocks), workbench,
palettes, arrangements, contexts (the context stack: places and modes, and the status bar that follows them), clipboard (typed items copied between palettes, paste special’s previews), links (one policy for every link: declared links, links that ask first, local files, an agent’s request), viewer (help pages, markdown, a safe subset of HTML and images in a panel), strips (the activity bar, and status items: live states, a popover, hover cards), jobs (a pretend host’s
background jobs), frame, scale, pointer (pointer gesture profiles),
platform (the platform services),
settings, i18n (translations), debug (the debug
bridge), linked-panels (a list driving a slow preview in another
panel, closed, moved or detached) and selection (a tree, a list and a
canvas sharing one selection and one hovered item). Alt+Down and Alt+Up go to the next and previous page,
Ctrl+Shift+T to the next theme.
It also builds for the web (wasm32-unknown-unknown, with Trunk from
crates/egui-pop-gallery), and runs offscreen in a nested compositor
for scripted runs and screenshots (tools/wbox). Its
pages are also the snapshot tests (see Testing).
Examples. The crate also holds whole applications built on egui-pop:
threading (frame times under load, Threading) and
rerun_like, a viewer with the Rerun viewer’s look and layout
(cargo run -p egui-pop-gallery --example rerun_like,
A Rerun-like viewer).
Screenshots
Every snapshot the gallery’s tests keep, by kind, four to a row. They are regenerated with the tests (see Testing), so they show the current state. Click one for its full size.
A picture is cut to what it tests: a page’s shows the page and its playground, without the gallery’s bars; one that drives the side bar, the bottom area or the status bar shows everything under the top bar; what floats over the window (a dialog, a menu, a toast) is shown whole. The bars have their own pictures.
Look and feel
Themes, design tokens, the theme editor, icons and scaling.
The overview in the other built-in themes
Widgets
Egui’s built-ins in egui-pop’s style, and restyled by a kit in a scope, values, the history (its list, an agent’s step, one undone), sliders, faders and knobs, compact controls (scrub fields, cells, value marks and bars, menu rows), colour ramps (a white balance, a saturation, an exposure and a clipping warning, in the colour at the value or on the whole track; the theme’s own fill in high contrast), inputs keeping to a narrow panel (a slider’s value, a number’s field), inputs (decorators, field states, Tab order), menus, toolbars (icons, titles, More tools, a tool palette), dialogs (movable ones, a clear backdrop), file choosing (and an image’s preview), toasts, micro-indicators (still under reduced motion), notes (every severity with long text), collapsible sections (folded, resized, a windowed one scrolled to its end, pulled with empty room under the last), folds inside a panel and a hand-built tree’s rows, and progress (bars, rings, meters, spinners; still under reduced motion).
The places panel, as an import window’s sources column (and a focused, chosen item, its fill under the focus outline; a place showing a camera’s photo in its icon’s place; a Library’s tree with its indent guides under the pointer, and a compacted chain of folders underlining the one under the pointer):
![]() places-pop-dark |
![]() places-pop-high-contrast |
![]() places-pop-light |
![]() places-focused-chosen-pop-dark |
![]() places-focused-chosen-pop-light |
![]() places-camera-photo |
![]() places-tree-guides |
![]() places-tree-segment-hover |
Data views
The live tree, list items and property rows, lists and tables, charts (and a plot over a timeline’s time: its cursor the playhead, a stepped line, an error band, the range shaded, the values at the pointer, two million samples decimated per pixel column), a text log (after Rerun’s: level chips and a text filter, the rows at the playhead highlighted, a click moving the playhead, a multi-line body unfolded), and the photo library (a thumbnail grid and filmstrip, marks, filter chips, a comparison of one to many images, a loupe and surveys of two, four and six; a cell’s stars previewing a lower rating over the current one, Rating stars).
Timeline
A timeline per time scale (seconds, a timecode at 25 fps, bars and beats at 128 BPM) with markers, cue points and a looping range; then keys on the track: Up to the Drop, I, two bars, O, and L twice (the speed beside the playhead). See Timeline.
![]() timeline-pop-dark |
![]() timeline-pop-light |
![]() timeline-keys-pop-dark |
Tracks and clips
A 40-second edit at 25 fps: a titles track, two video tracks and two audio tracks, their clips drawn by the page’s painter (pretend thumbnails and a waveform); then keys on a clip. See Timeline.
![]() tracks-pop-dark |
![]() tracks-pop-light |
![]() tracks-keys-pop-dark |
DJ decks
Two decks on bars and beats, at 128 and 124 BPM: a pretend waveform
under a beat grid drawn by the page’s clip painter, coloured hot cues,
a loop, the pitch fader and Sync; then keys on deck B: S, 3, a bar on,
3, [ twice, Shift+4 and L; then deck B’s waveform dragged (the
playhead fixed in the middle, the song moving under it), the wheel
stepping by beats, Play and a nudge. See Timeline.
![]() dj-pop-dark |
![]() dj-pop-light |
![]() dj-keys-pop-dark |
![]() dj-drag-pop-dark |
Video editor
A minute at 25 fps: a pretend program monitor showing the frame under the playhead, a titles track, two video tracks and two audio tracks; then Ctrl+K at the playhead (every clip there split), Shift+Delete on a half (its gap closed), Ctrl+Z and Ctrl+Y, an agent’s split, O and L twice; then the transport row under the monitor (go to end, step back, go to start, step forward, play backward, stop, play, pause, loop), its tooltip naming the key. See Timeline.
![]() editor-pop-dark |
![]() editor-pop-light |
![]() editor-keys-pop-dark |
![]() editor-transport-pop-dark |
Editors
The text editor, the code editor and the terminal.
![]() text-editor-pop-dark |
![]() code-editor-pop-dark |
![]() terminal-pop-dark |
Images
The tiled image viewport, its zoom control and navigator, images, curves and colour wheels, cursors and the loupe, the node graph editor, the display, a preview dialog (a custom dialog holding a viewport), and labels over a bright and a dark image.
Layout
Zones and blocks, the workbench, the layout controls, slot regions, palettes, arrangements, the context stack, the clipboard, links, the viewer, strips and the window frame.
The page list
The gallery’s side bar: every page in the light and the dark theme, in a short window, with a group folded, and filtered. Every other shot veils the list, so a page added to the gallery changes only these.
![]() pages-pop-dark |
![]() pages-pop-light |
![]() pages-short-pop-dark |
![]() pages-folded-pop-dark |
![]() pages-filtered-pop-dark |
The bars
The gallery’s own bars around a page: the top bar, the side bar (its list veiled) and the status bar, per theme and in the compact density, and one picture of the whole window. Every other shot is cut to what it tests (a page’s to the page and its playground), so a change to a bar changes only these.
Application services
Settings, the Settings app (generated pages, a manifest’s section, value scopes, the search), shortcuts, pointer gesture profiles, tips, About (the page and its dialog), platform services, translations, the developer tools (with the inspect mode’s dialog), and the jobs centre (drawn narrow as a side navigator; a job’s log console open, in the page and in the status bar’s popover; the application’s row sources, filtered by source and state).
Drops on a detached window
A tab dragged over a detached panel’s window: its drop frame where the window sees the pointer, and the outline every window that may take the tab gets where the system hides window positions (Wayland).
![]() window-drop-frame-pop-dark |
![]() window-drop-outline-pop-dark |
Drag ghosts
The ghost a drag carries under the pointer, from the kit: a photo’s thumbnail alone, a stack of several with their count, objects by their icon and name, each with the verdict of the target it would hover (add, move, copy, tag, link, or refused).
![]() drag-ghosts-pop-dark |
A panel’s state
A panel whose content is not current (pop.panel.state, the workbench): updating, dimmed with the busy mark on its corner and its tab once the delay passed; failed, with the failed mark.
![]() panel-state-updating-pop-dark |
![]() panel-state-failed-pop-dark |
A panel’s kind
A panel that edits (PanelKind::Control or Mixed, the workbench): the edits mark on its tab (Properties), and after its floating palette’s title (the toolbox); a view panel carries none.
![]() panel-kind-tab-pop-dark |
![]() panel-kind-palette-pop-dark |
Examples
The rerun_like example, a whole application (A Rerun-like viewer), in its two kits.
![]() rerun-like-dark |
![]() rerun-like-light |
No snapshot yet: platform, i18n.
A Rerun-like viewer
A stress test of egui-pop’s application model: the
Rerun viewer’s look and layout, rebuilt from
egui-pop’s workbench, kit and components over generated data. It is
not pixel-perfect and holds no Rerun code: the look is a kit made from
the token values of Rerun’s re_ui crate (MIT OR Apache-2.0, see
NOTICE). What it could not do with egui-pop alone is
listed, ranked, in the gaps.
cargo run -p egui-pop-gallery --example rerun_like
| Rerun-like Dark | Rerun-like Light |
|---|---|
The code is the gallery crate’s rerun_like module
(crates/egui-pop-gallery/src/rerun_like/), started by
examples/rerun_like.rs; its tests are tests/it/rerun_like.rs.
What it shows
- The top bar: the menus (View holds the playback commands) and, at
the bar’s end, the recording’s name, play and pause and the time
readout (a block of the
TOP_BAR_ENDzone), then the panel toggles (the workbench’s area toggles, as commands ofMENU_BAR_END). - The Blueprint, on the left: the views and their entities in a tree with its filter field; an eye on a hovered row hides the entity from the views.
- The viewport, in the centre: four views, each a panel, as
egui_stack splits two by two: a time series (three scalars on
egui-pop’s plot, its time cursor dragged, their values at the pointer
in a tooltip), a camera image with moving detection boxes, a dataframe (the
views crate’s
DataTable, a row per frame) and a text log (the views crate’s text log view: time, entity, level and body, level chips and a filter, the lines at the time cursor highlighted, a multi-line critical line that unfolds). - The Selection, on the right: the selected entity (its path, archetype, latest values at the time cursor, visualizer) or view (its class and entities), in collapsible sections of property rows.
- The time panel, at the bottom: play, step, loop, the timeline’s name and the time, a ruler with a cursor to drag, and a row per entity with a tick where it has data.
Selecting an entity anywhere (the tree, a line or a legend entry of the plot, a box or the image, a log line, a row of the time panel) selects it everywhere: the tree follows, the views outline it, the dataframe tints its column, the log and the time panel tint its rows, and the Selection panel shows it. Hovering an entity highlights it in every view and in the tree. A click on a view’s background selects the view. A row of the dataframe moves the time cursor to its frame, and so does a line of the log, which also selects its entity; the log’s lines at the time cursor are selected, and come into view as the cursor moves.
Keys and commands
| Key | Command | Rerun’s |
|---|---|---|
| Space | Toggle play/pause (rerun.playback.toggle) | Space |
| Left, Right | Step back, forward one frame (the time panel focused) | Left, Right |
| Home | Restart (the time panel focused) | |
| Ctrl+P | The command palette (app.palette; Ctrl+Shift+P and F1 stay) | Cmd/Ctrl+P |
| Ctrl+Shift+B, Ctrl+Shift+S, Ctrl+Shift+T | Toggle the blueprint, the selection, the time panel (the workbench’s area toggles; Ctrl+B, Ctrl+Alt+B and Ctrl+J stay) | the same |
| Ctrl+Shift+R | Reset viewer: the layout, the selection, the time | the same |
| Ctrl+, | Settings (light, dark or the system’s) | the same |
Every command is in the palette: the five playback commands, Clear selection, Reset viewer, and the panels’ own focus and toggle commands.
The theme: Rerun-like Dark and Light
One kit, examples/kits/rerun-like, holding both variants: its
kit.yaml is Rerun-like Dark and carries Rerun-like Light as its
counterpart (the manifest’s counterpart), and shared.tokens.yaml
holds what the two share (sizes, radii, type, the tab bar, the section
bands, the plot’s and the table header’s shapes, the time cursor). The
viewer starts with ThemeSpec::new("rerun-like-dark"), and
the View menu’s light and dark toggle (and the settings’ light, dark or
system choice) switches between the variants. The settings have no
theme picker: another theme is picked in code (ThemeService::kits
lists the kits, a variant each, for an application’s own picker). Data
only; each variant records its source (repository, files, commit,
licence) in org.egui-pop.source.
What was taken from re_ui (dark_theme.ron, light_theme.ron,
color_table.ron, design_tokens.rs), token values only:
| egui-pop token | Dark | Light | From |
|---|---|---|---|
gray.0 to gray.12 | Rerun’s Gray.0, 50, 100, 150, 200, 250, the divider, 350, 400, 500, 600, 725, 1000 | the same scale the other way | color_table.ron, the aliases below |
surface.panel, surface.canvas | Gray.100 #0d0d0d | Gray.1000 #ffffff | panel_bg_color, viewport_background |
surface.raised, list rows under the pointer | Gray.150 #171717 | Gray.950 #f5f5f5 | card_fill, list_item_hovered_bg |
surface.hover | Gray.250 #272626 | Gray.850 #e6e6e5 | widget_hovered_color |
border.default | #353434 | Gray.800 #e0dfdf | divider_stroke (light: Gray.700 at half a point; a full point of it would not set the accent apart on a slider’s track) |
text.default, text.strong | Gray.725 #cccccc, Gray.1000 | Gray.250 #272626, Gray.0 | text_default, text_strong |
text.muted | Gray.600 #9f9f9f | Gray.375 #555555 | the tab’s text (dark: Rerun’s text_subdued, Gray.375, fails egui-pop’s contrast checks there) |
accent.* | Blue.550 #5a81ff, hover Blue.575, pressed Blue.525, dark text on it | Blue.500 #186add, hover Blue.475, pressed Blue.450, white text | button_blue; Rerun’s Blue.500 cannot both read as text on its near-black panel and carry white text, as egui-pop’s contrast checks ask, so the dark kit’s accent is a step lighter |
selected rows (list-row.selected) | Blue.500 #186add, white text | the same | selection_bg_fill |
a table’s selected rows (table-row.selected): a quiet fill, the strong text, a 2-point marker on the left in the accent | Blue.750 at a tenth | Gray.900 #eeeeed | table_interaction_row_selection_fill |
a table’s row under the pointer (table-row.hover): no fill, a 1-point outline | border.default | the same | table_interaction_hovered_bg_stroke, approximated by the divider |
selection (text selected, the palette’s row) | Blue.350 | Blue.800 | ordinary text must read on it |
focus.ring | the accent | Blue.500 | focus_outline_stroke (Blue.400 is too dark on the dark panel) |
success, info, warning, danger | Green.700, Blue.700, #ff7a0c, Red.600 | Green.300, Blue.300, #b35000, Red.400 | success_text_color, info_text_color, warn_fg_color; the reds lifted from error_fg_color for contrast |
radius.widget, radius.window | 4, 10 | 4, 10 | small_corner_radius, window_corner_radius |
size.control.height (and so the rows) | 22 | 22 | large_button_size (Rerun’s list items are 20 or 24) |
size.icon.inline, size.title-bar.height | 14, 24 | 14, 24 | small_icon_size, title_bar_height |
font.size.xs to xl | 10.5, 11, 12.5, 13, 16 | the same | Typography Small, Eyebrow, Body, Heading 4, Heading 3 |
space.* | 2, 4, 8, 12, 16: egui-pop’s own, already Rerun’s 4-point grid | view_padding 12, item_spacing 8 | |
palette.log.trace, .debug, .info | Gray.700, Blue.700, Green.700 | Gray.300, Blue.500, Green.475 | trace_log_text_color, debug_log_text_color, info_log_text_color (light: Green.500 reads at 4.48:1 on white, a step darker at 4.5:1) |
palette.log.warn, .error | warning, danger | warning, #ab0116 | warn_fg_color, error_fg_color (lifted or darkened where they fail the contrast checks, as warning and danger are) |
palette.log.critical | Red.900 | Red.200 | strong_fg_color on error_fg_color: a level’s token is a text colour, so the kit takes the red nearest the strong text |
palette.axis.x, .y, .z | Red.600, Green.600, Blue.600 | Red.550, Green.550, Blue.550 | axis_color_x, axis_color_y, axis_color_z |
viewport-label: shape box, padding-x 6, padding-y 4, font-size Body, rest.radius 4, rest.text text.strong | rest.fill Gray.250 at 0.65 | rest.fill Gray.850 at 0.55 | create_labels: widgets.inactive.bg_fill at spatial_label_bg_opacity (0.5), raised until the text reads at 4.5:1 over black and over white (0.5 gives 3.1:1 in dark, 4.43:1 in light) |
plot: shape plain, no border, no radius, rest.fill | Gray.100 | Gray.1000 | no frame around a time series; viewport_background, PlotBackground’s default colour |
plot: grid-color, grid-fade | Gray.200, 0.3 | Gray.850, 0.3 | plot_grid_color, plot_grid_fade |
plot-cursor: width, rest.fill, hover.fill | 1.5, text.default, text.strong | the same | paint_time_cursor: 1.5 times the widgets’ stroke, in their foreground colour, strong under the pointer |
plot-cursor: head, head-size | triangle, 10 | the same | paint_time_cursor’s triangle at the top |
table-header-cell: shape plain, a line under it (indicator-side bottom), rest.fill, rest.border-color | Gray.150, Gray.300 | Gray.850, Gray.700 | table_header_bg_fill, table_header_stroke_color |
viewport.background (a 2D view) | Gray.100 | Gray.1000 | viewport_background |
dock-body: rest.border-width | 0 | 0 | no outline around a view or a panel: they are told apart by their fill |
dock-separator: rest.fill | transparent | transparent | views meet without a line at rest; the separator shows in the default kit’s colours under the pointer and while dragged |
scroll-bar: visibility | hover | hover | egui’s floating scroll bars, shown while the pointer is over their area: no line at rest |
The kit’s components: buttons without an outline (button_secondary),
tabs and the tab bar on the panel’s colour with the tab’s three text
greys and no border, rows selected in the solid accent with the
accent’s text, section bands 24 high on the panel’s colour, panel
bodies without an outline, separators and scroll bars that show only
under the pointer, so at rest at most one line (a side area’s) parts
two panels. For the
views: plots without a frame on the view’s background, in Rerun’s grid
colour, with a thin time cursor in the text’s colour under a triangle, table headers filled with a line under
them, table rows selected quietly with a marker on the left and
outlined under the pointer, the log levels in Rerun’s colours and the
2D view’s background.
Inter and JetBrains Mono, Rerun’s fonts, are egui-pop’s bundled ones
already.
The gaps
Ranked by how much each stands in the way of an application like Rerun’s viewer: first what had to be built by hand, then what was worked around, then the small things.
- No timeline. The time panel is all hand-painted: the ruler, the cursor and its drag, the rows of data ticks, play, step and loop. There is no time model either (a cursor, a range, a speed, a loop, a choice of timelines), no zoom or pan of the ruler, and no transport icons (play, pause, step) in the icon set; the video widget’s play button is private to it. A timeline component is planned.
- No application-wide selection. The tree, the four views, the
time panel and the selection panel share an
Rc<RefCell<Model>>and each copies the selection in or out by hand (the tree’s selection is compared each pass to notice a change; the views set it back withTreeState::set_selection). Hover across views needs a two-pass trick (what was hovered in the last pass is drawn in this one). There is no selection history (Rerun’s back and forward), no selection in the debug bridge or the undo history, and no way for a view to say what it shows as selected. A selection service is planned. - Binary splits only. The workbench’s layout (
layout::Node) is tabs or a split in two, so the viewport’s two by two grid is three nested splits, and Rerun’s containers (a grid of n views, a row or column of n) cannot be said: a third view in a column moves the others’ shares. Panels are declared when a plugin connects, so a view cannot be added while the application runs, as Rerun adds views to its blueprint. N-ary containers and a grid are planned. - Rows tied to controls. The tree’s and the list’s rows are as
high as
size.control.height(egui’s interact size), so the rows cannot be denser than the buttons; there is no property row (a name and a value, Rerun’slist_itemproperty content): the selection panel uses egui’sGrid. The tree does not say which row is under the pointer, and cannot be asked to highlight a row from outside: both are done fromTreeView::row_widgets, whose childUispans the row (the eye shows only on a hovered row the same way). Dense list items and property rows are planned. - No starting layout in the builder (solved). The shell’s three
zone panels (side bar, main, inspector) are always declared, and the
example hid them through a whole layout put in after
build(App::handle().set_layout, fromrun_native_with), withCtx::arrangementnaming the same layout so that resetting went back to it.AppBuilder::layoutsays it once now: the layout to start with (the shell’s panels among its closed ones), and the one theDefaultarrangement resets to. - No plot. The time series is painted by hand (axes, grid, lines,
the nearest line under the pointer, a value tag); egui-pop had no
chart component and no categorical data palette among its tokens:
the entities’ colours are the example’s own. Both exist now
(Charts, the categorical palette),
and the kit’s two variants give their own hues (
chart.*, fitted to Rerun’s surfaces). The example’s time series is aPlotnow (its time cursor dragged, the values at the pointer in a tooltip, the entity hovered or selected elsewhere drawn thicker); it keeps the entities’ own colours, which its other views share. Its time panel is still painted by hand (gap 1). Rerun draws series of millions of points, reading the time range in view and aggregating per pixel column; the plot does the same now (decimation). - A kit is one variant (solved). A kit package held one theme: the
light and dark pair was two kit folders naming each other. A kit’s
manifest may carry its other variant now (
counterpart), switched by the light, dark or system setting: the example’s two folders are one kit. - The top bar’s zone is after the menus only (solved). Its blocks
keep the width they took, after the menus; content at the bar’s end
went through
MENU_BAR_END, as commands only, where Rerun has its recording and its toggles. TheTOP_BAR_ENDzone takes any widget at the bar’s end now, before those commands: the example’s recording, playback and time are there. - The data table’s cells paint their own highlight. A column cannot be highlighted as a whole, and a header neither selects nor reports the pointer: the selected entity’s column is tinted cell by cell.
- Side areas are framed (solved).
AppBuilder::main_edge_to_edgedrew the centre’s panels without a margin; the side and bottom areas kept theirs and a rounded frame, where Rerun’s panels run to the window’s edges and its views are separated by a line only.AppBuilder::framelesstakes an area’s margin and its panels’ frames away; the example makes every area frameless, and its side and bottom panels give themselves a small margin. - Contrast. Rerun’s subdued text (
#555555on#0d0d0d), its error red (#ab0116), its focus outline and its accent under white text fail egui-pop’s AA contrast checks (contrast::check, which the example’s test runs on both variants); the kit lifts them, so the dark kit’s muted text and accent are lighter than Rerun’s. - View tokens the kit cannot give. Rerun’s time series, text log
and 2D view use design tokens with no egui-pop counterpart, so the
kits leave them out:
- The plot’s grid (solved). The
plotcomponent drew its grid in itstextcolour; it has agrid-colorand agrid-fadenow, and the kit gives Rerun’s (plot_grid_color: Gray.200 in dark, Gray.850 in light;plot_grid_fade, 0.3). - The time cursor’s head (solved).
plot-cursorwas a line alone and was not dragged in the plot. It has ahead(noneortriangle,head-sizewide) and ahoverstate now, and the plot drags it (Plot::drag_cursor,Plot::timeline): the kit draws Rerun’s triangle, 10 points wide, turning to the strong text under the pointer. - Table rows (solved). The data table’s rows were
list-rowboxes, the same as lists’: a selected row was the solid accent. They are atable-rownow, based onlist-row: the kit gives Rerun’s quiet selection (table_interaction_row_selection_fill: Gray.900 in light, Blue.750 at a tenth in dark) with a marker on the left, and outlines the hovered row (table_interaction_hovered_bg_stroke). Rerun also outlines a pressed row (..._active_bg_stroke); a table row has no pressed state. - The 2D view’s labels and axes. The viewport has a background,
a frame and a guide colour. Rerun’s labels sit on the background at
half opacity (
spatial_label_bg_opacity), and its axes take Red, Green and Blue 550 in light, 600 in dark (axis_color_x,_y,_z): no viewport token for either.
- The plot’s grid (solved). The
Packaging
An egui-pop application is one executable, but the desktop knows it by
more than that: a name and an icon in menus, an id its notifications,
shortcuts and links are tied to, a manifest on Windows, a bundle on
macOS. This page says what each platform expects, and what each platform
service of egui-pop-platform needs from the package. The examples use
an application whose id is org.example.Viewer, whose executable is
viewer and whose links are viewer://....
Give the same id everywhere: to eframe (ViewportBuilder::with_app_id,
the Wayland app id and the X11 class), to the application
(AppBuilder::app_id, which run_native takes from eframe’s when not
given; the viewer’s YouTube player names the application with it), to the plugins
(SystemKeysPlugin::new, TrayPlugin::app_id, Desktop::app_id,
instance::single), and to the package’s files below.
use egui_pop::platform::notify::{Desktop, NotifyPlugin};
use egui_pop::platform::tray::TrayPlugin;
use egui_pop::platform::keys::SystemKeysPlugin;
const APP_ID: &str = "org.example.Viewer";
let notifications = NotifyPlugin::new("Viewer").backend(Desktop::new("Viewer").app_id(APP_ID));
let tray = TrayPlugin::new("Viewer").app_id(APP_ID);
let keys = SystemKeysPlugin::new(APP_ID);
let _ = (notifications, tray, keys);
What each service needs
| Service | Linux | Windows | macOS |
|---|---|---|---|
| Single instance and deep links | the desktop file’s Exec=viewer %U and MimeType=x-scheme-handler/viewer | a viewer URL protocol in the registry | CFBundleURLTypes in Info.plist (links arrive as Apple events, which winit does not hand to egui yet: a gap) |
| Notifications | the desktop file named after the id (the desktop-entry hint) | an AppUserModelID on the Start menu shortcut | the bundle identifier |
| Tray | nothing (a StatusNotifierItem host on the desktop; on GNOME the AppIndicator extension) | nothing | nothing; LSUIElement for an application living in the menu bar only |
| Global shortcuts | on Wayland, the desktop file named after the id: the portal refuses an application it cannot find | nothing | nothing |
| Logs and crash reports | nothing ($XDG_STATE_HOME) | nothing (%LOCALAPPDATA%) | nothing (~/Library/Logs, ~/Library/Application Support) |
| Focus mode | nothing (the Settings portal; kwinrc on KDE) | nothing | nothing |
Single instance and deep links
The single instance needs nothing installed: its socket is made at run
time. Deep links need the system to know the scheme: the desktop file’s
MimeType=x-scheme-handler/viewer and Exec=viewer %U on Linux, a URL
protocol in the registry on Windows, CFBundleURLTypes on macOS (see
each platform below). A link opened while the application runs starts a
second launch, which hands it over (instance.second_launch, then
deeplink.open).
Notifications
The desktop ties notifications to the application’s id: the desktop
file’s name on Linux, the AppUserModelID of the Start menu shortcut on
Windows, the bundle identifier on macOS. Give it with
Desktop::app_id. Inside Flatpak, allow the notification server’s bus
name.
Tray
Nothing to install. The desktop must run a StatusNotifierItem host on
Linux (KDE, Xfce, Cinnamon, LXQt, the bars of tiling compositors; on
GNOME the AppIndicator extension); inside Flatpak, allow the watcher’s
bus name. On macOS, LSUIElement hides the Dock icon of an application
that lives in the menu bar.
Global shortcuts
On Wayland the GlobalShortcuts portal must find the application: a
sandboxed one by its Flatpak id, another by its desktop file, named
after the id given to SystemKeysPlugin::new and installed where the
desktop looks (/usr/share/applications,
~/.local/share/applications). Without it the portal refuses (“an app
id is required”) and the shortcuts editor says so. Elsewhere nothing is
needed.
Logs and crash reports
Nothing to install: the files go to the user’s state directory. A
package may point its bug report instructions at the logs.reveal
command.
Focus mode
Nothing to install; inside Flatpak on KDE, allow reading kwinrc.
Linux
The desktop file
org.example.Viewer.desktop, installed in
/usr/share/applications (or ~/.local/share/applications for one
user). Its name is the application’s id: the global shortcuts portal
looks the application up by it, notification servers find its icon and
settings through it, and the compositor matches the window’s app id to
it.
[Desktop Entry]
Type=Application
Name=Viewer
Comment=Look at photos
Exec=viewer %U
Icon=org.example.Viewer
Terminal=false
Categories=Graphics;Viewer;
MimeType=x-scheme-handler/viewer;image/jpeg;image/png;
StartupNotify=true
StartupWMClass=org.example.Viewer
SingleMainWindow=true
X-GNOME-UsesNotifications=true
%Upasses files and links, so a link opened from a browser startsviewer viewer://album/3, whichinstance::singlehands to the running instance.MimeType=x-scheme-handler/viewermakes it the handler ofviewer://onceupdate-desktop-databaseran (a package’s scripts do);xdg-mime default org.example.Viewer.desktop x-scheme-handler/viewermakes it the default for one user.StartupNotify=truemakes the launcher pass an activation token (XDG_ACTIVATION_TOKEN), which a second launch hands over.X-GNOME-UsesNotifications=truelists it in GNOME’s notification settings.
AppStream
Software centres read /usr/share/metainfo/org.example.Viewer.metainfo.xml:
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>org.example.Viewer</id>
<name>Viewer</name>
<summary>Look at photos</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>MIT</project_license>
<launchable type="desktop-id">org.example.Viewer.desktop</launchable>
<provides>
<binary>viewer</binary>
</provides>
<description>
<p>A photo viewer built with egui-pop.</p>
</description>
<releases>
<release version="1.0.0" date="2026-10-12"/>
</releases>
<content_rating type="oars-1.1"/>
</component>
Check it with appstreamcli validate.
Icons
Install the icon in the hicolor theme under the id’s name:
/usr/share/icons/hicolor/scalable/apps/org.example.Viewer.svg, or PNGs
at 16x16, 32x32, 48x48, 64x64, 128x128, 256x256 and
512x512 in hicolor/<size>/apps/. The window’s own icon comes from
eframe (ViewportBuilder::with_icon); the tray’s from its RGBA pixels
(tray::Icon), not from the theme.
Flatpak
The sandbox changes a few things:
finish-args:
- --socket=wayland
- --socket=fallback-x11
- --share=ipc
- --device=dri
# Notifications (notify-rust talks to the notification server).
- --talk-name=org.freedesktop.Notifications
# The tray (a StatusNotifierItem without a well-known name).
- --talk-name=org.kde.StatusNotifierWatcher
# The focus mode on KDE: kwinrc, read only.
- --filesystem=xdg-config/kwinrc:ro
- The single instance’s socket is a file in
$XDG_RUNTIME_DIR/app/<id>, which every sandbox of the application shares. - Global shortcuts and the GNOME focus mode go through portals, which know a sandboxed application by its Flatpak id: no permission needed.
- Logs and crash reports land in
~/.var/app/<id>/.local/state. - X11 global shortcuts work only on an X11 session
(
--socket=x11); on Wayland the portal is used.
Windows
The manifest and the icon
Embed an application manifest and an icon with a build script, with winresource or embed-resource. The manifest declares the DPI awareness egui expects (per monitor, version 2), the common controls version 6 (the tray’s menus use them) and the supported systems:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" name="org.example.Viewer" version="1.0.0.0"/>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls"
version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</assembly>
The icon is an .ico holding 16, 24, 32, 48 and 256 pixel images.
#![windows_subsystem = "windows"] in main.rs keeps a console from
opening.
Installer options
- MSIX: the modern package; it gives the application an identity
(notifications work without a shortcut) and declares the URL protocol
in its manifest (
windows.protocol). - MSI through WiX (cargo-wix), Inno Setup or NSIS: classic installers; they create the Start menu shortcut and the registry keys below.
- cargo-packager makes NSIS and WiX installers, macOS bundles and Linux packages from one configuration.
What the installer sets for the platform services:
-
The Start menu shortcut carries the AppUserModelID (
System.AppUserModel.ID=org.example.Viewer): Windows ties toasts to it. Without it, notify-rust shows them as PowerShell’s. -
The URL protocol, per user or per machine:
HKCU\Software\Classes\viewer (Default) = "URL:Viewer" HKCU\Software\Classes\viewer URL Protocol = "" HKCU\Software\Classes\viewer\DefaultIcon (Default) = "C:\...\viewer.exe,0" HKCU\Software\Classes\viewer\shell\open\command (Default) = "C:\...\viewer.exe" "%1"
Code signing
Unsigned executables meet SmartScreen warnings. Sign the executable and
the installer with signtool and a code signing certificate, or with
Azure Trusted Signing; see Microsoft’s documentation on code signing for
Windows applications.
macOS
The bundle
An application is a bundle, Viewer.app/Contents/ with MacOS/viewer,
Resources/Viewer.icns and Info.plist (cargo-packager or
cargo-bundle make it):
<key>CFBundleIdentifier</key> <string>org.example.Viewer</string>
<key>CFBundleName</key> <string>Viewer</string>
<key>CFBundleExecutable</key> <string>viewer</string>
<key>CFBundleIconFile</key> <string>Viewer</string>
<key>CFBundleShortVersionString</key> <string>1.0.0</string>
<key>NSHighResolutionCapable</key> <true/>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key> <string>org.example.Viewer</string>
<key>CFBundleURLSchemes</key> <array><string>viewer</string></array>
</dict>
</array>
<!-- An application living in the menu bar only, without a Dock icon: -->
<!-- <key>LSUIElement</key> <true/> -->
- Notifications are tied to the bundle identifier
(
Desktop::app_id); outside a bundle they show as another application’s. - macOS keeps a bundle single by itself, and delivers links and files opened later as Apple events; winit does not hand those to egui yet, so a link reaches a running bundle only when it starts it. A gap.
- Global shortcuts (Carbon hot keys) need no accessibility permission.
Signing and notarisation
Gatekeeper refuses unsigned downloads. Sign the bundle with a Developer
ID certificate and the hardened runtime (codesign --options runtime),
send it to Apple’s notary service (xcrun notarytool submit --wait),
and staple the ticket (xcrun stapler staple Viewer.app); see Apple’s
documentation on notarizing macOS software before distribution.
Testing
How egui-pop is tested, and what to know when a test misbehaves.
Goal: time that does not grow with the tests
The suite’s wall time must not grow linearly with the number of tests. Two levers:
- Parallel runs: every test binary runs side by side, every test in a process of its own (cargo-nextest, below);
- Selective runs: a change runs the tests it can affect, not the
whole suite (Selection);
mainalways runs everything.
The integration tests are split into small binaries
(crates/*/tests/*.rs, one per feature) where a binary links little: a
binary is a unit of selection, and editing one test file relinks one
small binary. Where every binary links the whole application stack, the
links cost more than the selection saves: those crates have one test
executable, it, and each former binary is a module of it.
One test executable: the gallery and the application layer
egui-pop-gallery’s and egui-pop-api’s integration tests are each one
executable, it (crates/<crate>/tests/it/main.rs, one module per
feature: gallery, keyboard_walk, mounts… in the gallery,
windows, dialogs, files… in egui-pop-api). Each former binary
linked egui, eframe and the whole application layer: fifteen copies of
the stack for the gallery, 115 for egui-pop-api (135 MB each, 15 GB in
all), and as many links per build. A module is still a unit of selection
(Selection names it it::mounts and runs it alone by a
test name filter); editing one relinks the one executable. Helpers
shared by several modules live in tests/it/support/, a module of the
executable declared in its main.rs.
cargo nextest run -p egui-pop-gallery --test it -E 'test(/^mounts::/)' # one module
cargo test -p egui-pop-gallery --test it keyboard_walk:: -- --ignored # the same, cargo test
cargo test -p egui-pop-api --test it windows:: # one module of egui-pop-api
The test names carry their module (gallery::snapshots_per_theme).
Under nextest every test still has a process of its own. Under plain
cargo test, every module’s tests now share one process, where before
each former binary had its own: a test leaning on process-wide state
(an environment variable, a global installed once) may meet one from
another module. A global installed once goes in tests/it/support/ and
is shared (the log capture of egui-pop-api’s removal and
window_invariants: log::set_logger succeeds once per process).
Every gallery module passed in one cargo test process when the change
was made (the egui-pop-test-1p box job, test=it).
The runner: cargo-nextest
CI runs the tests with cargo-nextest, configured in
.config/nextest.toml. Plain cargo test --workspace still works and
remains the reference: every commit passes it.
cargo install cargo-nextest --locked # once
cargo nextest run --workspace # every test, binaries side by side
cargo test --workspace --doc # doctests (nextest does not run them)
cargo nextest run -p egui-pop-viewport # one crate
What the configuration sets:
- Retries for tests that may render. A crash of the Vulkan loader
(below) kills the process of one test instead of a whole binary, and
that test is tried again twice before it counts as a failure; nextest
lists it as flaky. The crates whose tests never render
(
egui-pop-tokens,egui-pop-model, the platform layers,xtask) get no retry. A flaky test in the report is still a bug to look at. - Slow tests are reported after 60 seconds (10 for critical tests).
The
ciprofile stops a test after 4 minutes and writes a JUnit report (target/nextest/ci/junit.xml, renamedjunit-<n>.xmlafter each run bycargo xtask affected --run), which CI keeps: the slowest tests are visible there, andcargo xtask shards refreshreads them to split the shards (Shards by duration). - The
criticalprofile runs the critical tests alone (below).
One process per test means one wgpu device per test on lavapipe. The
GitHub runner has four cores, as many as nextest runs tests at once; no
test group caps the rendering tests yet. If a machine with many cores
runs out of memory, cap them with --test-threads, or add a test group
to the configuration.
The next branch
Pull requests target next, a buffer branch between them and main:
- a contributor’s pull request into
next(from a fork) runs the quick checks only (format, clippy, the guides’ documentation, licences, changesets and title), in minutes; it merges as soon as they pass; - the maintainers’ own pull requests (branches of this repository) are
tested on the bench box, and on GitHub run one check,
pr-lint(.github/workflows/pr-lint.yml), on every push, in a few minutes and without building a test: the title,cargo fmt --check, the changeset check,cargo xtask ui-index --check,cargo deny checkandcargo doc --workspace --no-deps --lockedwithout a warning. Such a pull request merges when its box jobs are green and itspr-lintcheck is green (since 2026-11-15). Look at the check once, when the box jobs are done:gh pr checks <n> --watch --fail-fast(it returns when the checks end), or a singlegh pr checks <n>; nothing else of CI is watched. The box jobs of a branch are narrow: theegui-pop-testruns of the crates and test targets the change touches, plusegui-pop-snapshotswhen something visible or listed changes (a page drawn differently, a page or a story added, a snapshot’s subject moved);next’s CI runs the rest. The box’segui-pop-gatejob (fmt, clippy, every test, the doctests and the documentation build) is for releases or a by-hand check, not for each branch; it runs every test and every step even after a failure, so one run shows all that fails; - every push to
nextruns everything; a run is never cancelled: a newer push waits behind the running one (GitHub keeps only the newest waiting), so a batch of merges is checked once andmainis promoted even while merges keep coming; - once that run passes,
mainfast-forwards to the commit it checked (.github/workflows/promote.yml), and the site is deployed frommain.mainonly ever holds commits that passed everything; - when
nextfails, the merge that broke it is fixed onnextor reverted (its pull request reopened);mainwaits untilnextis green.
Releases, publishing and tags happen from main. A release pull request
goes through next like any other.
When Ubuntu’s archive is down
GitHub’s Ubuntu runners install packages from Ubuntu’s archive
(archive.ubuntu.com, its Azure mirror, security.ubuntu.com). When
Canonical has an outage, every apt-get step fails (“Temporary failure
resolving”, “Unable to fetch some archives”) through no fault of the
code, next stays red and main is not promoted. One repository
variable, UBUNTU_ARCHIVE_DOWN, tells the workflows:
gh variable set UBUNTU_ARCHIVE_DOWN --body true -R quazardous/egui-pop # on
gh variable delete UBUNTU_ARCHIVE_DOWN -R quazardous/egui-pop # off
While it is true, what can only work with the archive is skipped, not
failed, what has a fallback without it takes the fallback, and every run
says so: a warning and a line in the summary, from the job “Ubuntu’s
archive down” and from the steps that changed.
| Workflow | Job or step | With the switch on |
|---|---|---|
| CI | Tests (lavapipe 1/3 to 3/3) | lavapipe from a pinned Mesa build of gfx-rs/ci-build (checked by SHA-256, .github/actions/software-vulkan), on ubuntu-26.04, whose LLVM it links; a cache of its own |
| CI | Viewer’s video (GStreamer) | skipped |
| CI | Viewer’s web view (WebKitGTK) | skipped |
| CI | Semver checks | no GStreamer or WebKitGTK packages: every crate as usual but egui-pop and egui-pop-views, checked with all their features but the video and webview ones |
| Gallery and docs on the web | Build the API documentation | every feature but the video and webview ones |
Unset or false, the workflows behave as they always did. A skipped job
counts as passed, for the CI job and for the run’s result, so a green
run on next still promotes main. The Platforms workflow (Windows,
macOS) uses no apt and is not affected.
The Linux tests still run on GitHub (lavapipe from the fallback Mesa);
no full gate is run on the bench box in their place. The video and
webview builds wait until the switch is off, or run where GStreamer’s
and WebKitGTK’s development
packages are installed. Delete the variable once apt-get update works
on the runners again.
Selection
cargo xtask affected reads the files a change touches (against the
merge base with origin/main, the working tree and untracked files
included) and the workspace’s dependency graph (cargo metadata --no-deps, nothing is built), and says which tests and which CI jobs
the change needs, and why.
cargo xtask affected # the report: jobs, crates, skipped crates
cargo xtask affected --plan # the cargo commands it would run
cargo xtask affected --run # run them (what CI's test job runs)
cargo xtask affected --base upstream/main # another base
cargo xtask affected --files docs/kit.md # a change given by hand
cargo xtask affected --full --run # everything, as on main
The rules, per changed file:
| Changed | Tests that run |
|---|---|
a crate’s sources, manifest, build script, data (crates/<crate>/...) | every test of the crate, and of every workspace crate depending on it (dev-dependencies included), doctests too |
a test binary’s file (crates/<crate>/tests/<binary>.rs) | that binary alone, unless another test file includes it as a module |
a module beside a binary’s main.rs (crates/egui-pop-gallery/tests/it/mounts.rs, crates/egui-pop-api/tests/it/windows.rs) | that module alone (it::mounts, a test name filter on the binary it) |
a snapshot (crates/<crate>/tests/snapshots/...) | the crate’s tests, not its dependents |
a crate’s README.md | as its sources, and egui-pop::readme_links |
documentation (docs/**, *.md at the root) | the guides’ doctests (consumer-smoke), egui-pop::readme_links, egui-pop-gallery::it::gallery_doc and it::hosts_doc |
the docs site (book.toml, tools/book/**) | none (the book job checks it) |
examples/** (example kits) | egui-pop-tokens::kits, egui-pop-gallery::it::gallery |
the workspace (Cargo.toml, Cargo.lock, rust-toolchain*, any root file but Markdown and book.toml), .github/, .config/, .cargo/, xtask/, the test kit (egui-pop-test, egui-pop-test-macros), the token files (crates/egui-pop-tokens/themes/) | everything |
| any path no rule names | everything |
When in doubt, run. A missing rule costs time, never safety. Every
selection adds the critical tests it does not already
hold (a docs-only change: those that need no GPU). Selection can still
miss a dependency (a file read at run time from another crate’s folder),
so main runs everything, and a pull request labelled ci:full too.
What the selection runs, with --run: one cargo nextest run over the
whole crates (-p each, so only their tests are built), cargo test --doc for their doctests, and one cargo nextest run per crate with
single binaries or critical tests (--test each, filtered with -E).
Arguments after -- go to every nextest run (-- --profile ci).
CI jobs
The jobs of .github/workflows/ci.yml are selected the same way. A
first job, changes, runs cargo xtask affected --github: it writes
which jobs the change needs as outputs, and the report (why, the crates
selected and skipped, the critical tests added) in the run’s summary.
| Job | Runs when |
|---|---|
fmt | a .rs file changed |
clippy (and cargo doc) | a crate’s file changed, other than a snapshot |
alone (tools/check-alone.sh: every published crate’s cargo check -p, with and without its default features, outside the workspace’s feature unification) | as clippy |
doc (the guides’ cargo doc) | documentation changed and clippy does not run |
book (the docs site: mdbook build, tools/book/summary.py, tools/book/links.py) | a file under docs/, book.toml or tools/book/ changed |
test | always: the selection above, critical tests at least, in three shards (by duration) |
deny | a Cargo.toml, Cargo.lock or deny.toml changed |
wasm | a crate the gallery builds from changed (its tests and examples aside) |
package | a manifest changed, or a file was added to or removed from a crate |
semver | a crate egui-pop builds from changed (its tests and examples aside), or a changeset |
A change under .github/, .config/, .cargo/, xtask/, to the
workspace files, the test kit or the token files, or to any path no rule
names runs every job. So do every push to main and a pull request
labelled ci:full.
A push to next runs every job too, but semver: it runs when what
changed since main (the last commit that passed every job) selects it
by the rule above. Comparing with main rather than with the previous
push keeps the commits of a run that never finished (a newer push
waiting replaces an older one). The job is its own workflow,
.github/workflows/semver.yml, that ci.yml calls; it also runs every
night on next (03:17 UTC) when next moved since the last nightly
run, and by hand (workflow_dispatch). A failed nightly run is red on
the Actions page, like CI. The nightly run starts with a gate job that
takes seconds (no checkout, no toolchain): it reads next’s head and
looks for the cache entry semver-tested-<sha>, which a nightly run
saves once it has checked that commit, pass or fail. Found, the checks
are skipped, the run stays green and its summary says skipped: next unchanged since <sha>. A cache entry records which next was checked
(a scheduled run’s own head is main’s). Any API or cache error, or an
evicted entry, runs the checks (the gate fails open). A run from
ci.yml or by hand always checks. cargo xtask publish runs the checks again before uploading
anything (Changesets and releases).
A skipped job reports nothing, and a required check that never reports
blocks a pull request: the last job, CI, needs every other one and
fails when one of them failed. It is the only check to require.
Shards by duration
The test job runs in three shards side by side (Tests (lavapipe 1/3 to
3/3)), split by each test’s measured time rather than by count or name,
so the slowest shard stays close to the average:
ci/test-durations.jsonholds every test’s time on CI, per nextest binary id, taken from thejunit-*artifacts of full runs onnext.cargo xtask shardscomputes the split from that file alone, so the three jobs compute the same one: the tests are grouped into units (a whole binary; a heavy binary cut into its modules, and a heavy module into its tests, until a unit weighs less than a twelfth of a shard), and the units go, longest first, to the lightest shard. Shard 1 starts withfirst_shard_secondsof its own (the doctests, the icon set’s SVG tests and the shard check, which run there alone), counted overthreads(the runner’s four cores).- The lightest shard at the end runs every test the two others do not
(
not (...)): a test the file does not know yet runs there, and no test can be dropped. On a full run, shard 1 checks it anyway:cargo xtask shards checklists each shard’s tests with nextest and fails unless every test of the workspace is in exactly one shard. cargo xtask affected --run --shard I/Nruns shard I: each nextest run is narrowed by the shard’s filter (joined with its own-E), the doctests run on shard 1 only.
cargo xtask shards # the split: each shard's expected time and filter
cargo xtask shards --filter 2 # shard 2's nextest filter alone
cargo xtask shards refresh --run RUN_ID # rewrite the durations from a CI run's JUnit reports
cargo xtask shards refresh DIR... # or from reports on disk (target/nextest/ci/)
Refresh the file by hand when a shard drifts from the others (each run’s
summary shows the shards’ times), from one or more green full runs of
next (gh run list --branch next --workflow ci.yml): a test in several
runs gets its mean time. Nothing refreshes it on a schedule yet. A test
added since only lands on the rest shard, so the split degrades slowly,
never by losing a test. Three shards, because each one pays about seven
minutes before its first test (the runner’s setup and the build), against
about five of tests: a fourth shard would save about a minute of wall time
for seven more runner minutes.
Measured on 2026-11-19 (two full runs of next): with nextest’s hash
partition the shards’ test steps took 4 min 10 s to 6 min (plus the
doctests on every shard, 40 s each); the durations split expects about
5 min 10 s for each, the doctests and the check counted on shard 1.
To run locally what the test job runs on a pull request:
git fetch origin
cargo xtask affected --run # the selection against origin/main
cargo xtask affected --full --run # what main runs
Other platforms
.github/workflows/platforms.yml runs the workspace on Windows and macOS,
on every push to next and by hand (workflow_dispatch). A run is never
cancelled: a newer push waits for the running one. It is a workflow of its
own, so main’s promotion, which waits on CI, does not wait on it; but its
jobs are blocking: a failed one turns the run red, a broken next to fix
first, as CI’s (zero warnings and green tests on every platform).
Windows (windows-latest) | macOS (macos-latest, Apple silicon) | |
|---|---|---|
Build (cargo build --workspace --all-targets) | yes | yes |
Tests (cargo nextest run --workspace) | yes, rendering on WARP (DirectX 12 in software, WGPU_BACKEND=dx12) | yes, rendering on Metal (the virtual machine’s paravirtualised GPU, WGPU_BACKEND=metal) |
| Snapshots | compared with the thresholds of kittest.toml’s [windows] | compared with [mac] |
| Real window | tools/window-smoke.py | tools/window-smoke.py |
The window’s smoke run starts the debug gallery with a scripted run:
--quit-after 360 --detach gallery.notes --page workbench --focus-detached --type "smoke 42" --resize-to 800x600. The gallery
opens its window and detaches the notes panel into a second one. A
quarter of the way through it asks the system to focus that window and
gives the window’s field the keys (the field shows only in this run),
then types the text into that window’s input once the window says it
has the focus; it asks for a new size halfway and closes by itself.
The script checks its JSON lines (the first line of each counts) and
prints one line per check:
| Check | What it proves |
|---|---|
| detach | ready says the panel is in its own window |
| focus | the detached window got the system’s focus (focus) |
| keys | the text typed into that window reached its field (windows, field): egui-pop’s per-window key routing (upstream.md, the focus plugin’s workaround) |
| scale | each window has its own pixels per point, the system’s times the zoom; --scale main=1.5 checks a factor |
| resize | the new size was asked (resize) |
| quit | quit after every frame, exit code 0, within five minutes |
The size the window had when it closed is printed, not checked: a
window manager may refuse it. On GitHub’s runners nothing outside the
gallery can type, so the gallery types into its own window’s input; on
Linux the bench box’s egui-pop-window-smoke job runs the same checks
in a headless labwc (tools/wbox/window_smoke.py), as a Wayland client
and as an X11 one through Xwayland, with the keys typed by the
compositor and a scale set by the system (the output’s scale 2 changed
while the gallery runs on Wayland, WINIT_X11_SCALE_FACTOR=1.5 on
X11). That job is a pre-release check, run by hand, not on CI
(releasing).
Each job’s summary says whether the tests and the smoke run passed, and names the failed tests; a failed job also leaves an error annotation on the run’s page. The JUnit report and any snapshot differences are kept as artifacts.
The pictures are the same on every platform: the gallery’s test
harnesses pin the dialogs’ button order (ButtonOrder::pin, Windows and
KDE put the primary button first), and a shot showing a whole path reads
the demo folder from memory, at /demo (demo_memory_folder_at), which
the picker writes with / everywhere. A test on Windows or macOS opens
its wgpu device on all the system’s backends at once (DirectX 12’s WARP,
Metal); only Linux tries Vulkan alone first (lavapipe).
Known failures and differences (2026-12-01): none fail. What is left out, by platform:
- Windows and macOS: the gallery’s
files-breadcrumbs-pop-darkandfiles-replace-pop-darksnapshots are compared on Linux only. They show the demo folder’s path, in the temporary folder:/tmpwhere the pictures are made,C:\Users\…\Tempon Windows,/var/folders/…on macOS. The tests’ other checks run everywhere. - Windows: the viewer test of an image address no parser can join
(
//[bad…) checks a drive’s path written as is instead://[badbefore a drive makes no path at all, and the image fails unread. - Windows: paths built by the file picker carry
\, the tests’ paths/; the tests compare paths, not text (assert_pathinegui-pop-api’stests/it/files.rs). The root of/top, a path without a drive, is named/.
Screen readers
The test kit checks that every interactive node has a name
(egui_pop_test::assert_all_named) and dumps the AccessKit tree; neither
says what a screen reader announces. Two passes do, before a release
(releasing).
Orca on Linux, on the bench box. The egui-pop-screen-reader job
(Helios’s tools/bench/Benchfile) runs tools/wbox/screen_reader.py
after a release build of the gallery. Each walk gets its own D-Bus session
and accessibility bus (at-spi2, switched on as a desktop does for a screen
reader), the gallery as a Wayland client in a headless labwc, Orca with
its debug log (each SPEECH OUTPUT line is what it would say; speech goes
to speech-dispatcher’s dummy module), and tools/wbox/atspi_focus.py,
which notes the node that takes the focus (role, name, states, value) as
the accessibility bus reports it. The compositor types real keys and each
step waits for Orca’s line:
| Walk | Page | Keys |
|---|---|---|
palette | overview | Ctrl+Shift+P, Down, Down, Up, Escape |
settings | settings | Tab ×4, Shift+Tab, F6, Tab |
tree | tree | Tab to the tree, Down, Down, Right, Left, Up, Shift+Tab |
table | table | Tab to the table, Down, Down, Up, Tab |
dialog | dialogs | Tab to “Confirm an export”, Enter, Tab, Shift+Tab, Escape |
Each step prints one line (tree.3 Down: PASS: ...). A step fails when
the focused node has no name or Orca says “unlabelled” (fix the widget in
egui-pop, never the expectations), or when the node or Orca’s line differs
from tools/wbox/screen_reader.json: both are printed as a diff. A step
marked silent in the walk may say nothing: opening and closing a folder,
which AccessKit’s AT-SPI adapter does not report (upstream,
“AccessKit: no expanded state on Linux”). After a
reviewed change, record=yes writes what the run heard to
out/screen_reader.json, to copy over the checked-in file; walk=<name>
runs one walk. Orca’s log, the focus lines and a screenshot of each walk
are in the job’s out/. When Orca cannot start, the run says so and
compares the nodes alone (orca=no forces that): what Orca would read,
without its words.
NVDA on Windows, by hand. Before a release, on a Windows machine with NVDA (its default settings, speech viewer on: NVDA menu, Tools, Speech viewer), start a release build of the gallery and walk the same five places with the keys of the table above. At each step:
- NVDA says a name for what has the focus, never “unlabelled” or a bare role (“button”, “check box” alone);
- the role is the right one (a check box is a check box, a slider a slider) and states are spoken: checked, expanded or collapsed, selected, a slider’s value;
- the palette: its field is announced with its name, and the selected entry follows the arrows;
- the tree: each row’s name and whether it is expanded; Right opens a folder, Left closes it;
- the table: the cell’s text and its column’s header;
- the dialog: its title and text when it opens, its buttons on Tab, and Escape gives the focus back to “Confirm an export”;
- F6 moves to the next region and NVDA names where the focus lands.
Note in the release’s pull request where NVDA’s words differ from Orca’s
in tools/wbox/screen_reader.json. VoiceOver is not covered: there is no
macOS box.
Time budget
The budget (decided 2026-10-20): a pull request’s CI under 10 minutes on GitHub’s standard runner (four cores), a docs-only one under 5. Measured on 2026-10-20, wall time of the whole workflow, with a warm cache:
| Change | Before (every job, cargo test) | After (selection, nextest) |
|---|---|---|
everything (main, ci:full, CI files) | about 6 min (tests 5 min 45 s) | about 7 min 20 s (tests 6 min 40 s) |
| documentation only | about 6 min | about 4 min (tests 3 min 30 s; fmt, clippy, deny, wasm, package and semver skipped) |
one crate’s source (egui-pop-views) | about 6 min | about 6 min (6 crates of 20 tested, deny and package skipped) |
A full run was not faster: one test, rendering every gallery page under
every theme and density, ran for nearly 4 minutes on lavapipe and set the
pace (and reached the CI timeout as pages were added). Every test that
walks the gallery’s pages is now a test per page (since 2026-11-18): in
egui-pop-gallery‘s it, gallery::every_page_renders::<page> (every
theme and density), gallery::every_interactive_node_has_a_name::<page>,
gallery::every_input_brick_has_a_name::<page>,
gallery::every_page_ends_in_a_short_window::<page>,
gallery::every_playground_ends_in_a_short_window::<page> and
default_fonts::every_page_draws_with_eguis_own_fonts::<page>. They run
side by side, none grows with the gallery, and a slow page shows by name.
The gallery’s build script writes the page list as a macro
(for_each_page!, from PAGES in src/lib.rs) and the tests’ per_page!
makes a module of tests from it: a page added to PAGES gets its tests,
and gallery::every_page_has_its_generated_tests fails if the list read
differs from PAGES. The JUnit reports of each run (the junit
artifact) list every test’s time.
Layers
- Model (
egui-pop-model): plain unit tests, no egui, milliseconds. - Widgets and applications: egui_kittest harnesses, finding widgets
by role and label (never by position), including the keyboard. The
test kit (
egui-pop-test) has harnesses for a whole application (app,harness_for), at a given scale (app_at,SCALES,at_scales,set_native_scale), and checks (assert_all_named,assert_keymap_clean,assert_writes_declared,a11y_tree). - Keyboard walks (below): real key presses, and what holds the focus after each.
- Snapshots (
crates/egui-pop-gallery/tests/snapshots): the gallery’s pages rendered with wgpu, per theme; thresholds per operating system inkittest.toml. Regenerate withUPDATE_SNAPSHOTS=1 cargo test -p egui-pop-galleryand look at the images in the diff. Each is cut to what it tests (below).
Snapshots cut to what they test
A picture of the whole gallery window holds the top bar, the side bar
and the status bar around the page. Compared whole, every picture
changes when a bar does: a label added to the top bar would rewrite
every page’s snapshot, and the diff would hide what the change did to
the pages. So no test of a page calls kittest’s snapshot; the gallery’s
tests cut the picture (crates/egui-pop-gallery/tests/it/shot.rs):
| Call | What the picture holds | For |
|---|---|---|
h.page_shot(name), h.try_page_shot(name) | the page’s region: the main zone’s block, heading included, and the playground beside it (Nav::region, recorded by the gallery’s shell as it draws) | a page’s own content: nearly every snapshot |
h.body_shot(name), h.try_body_shot(name) | everything under the top bar | a page that drives the side bar, the bottom area or the status bar (workbench-*, arrangements-*, strips-*, contexts-*, jobs-*) |
h.window_shot(name), h.try_window_shot(name) | the whole window | what fills the window or draws its frame (admin-*, frame-own-*, frame-full-screen-*), and chrome-window-* |
h.try_shot_of(name, rect) | a rectangle the test names | the bars (chrome-*), the side bar with its list (pages-*) |
What floats over the window (a dialog, a file chooser, a menu, a tip, a toast, a palette) widens a page’s or a body’s cut when it reaches out of it, so the picture holds all of it; a sheet over the whole window (a modal’s dimming) does not. The cut is rounded to whole pixels and depends on the layout alone, so a picture has the same size on every run.
The bars have a suite of their own, gallery::the_bars_have_their_own_snapshots:
chrome-top-bar-*, chrome-side-bar-* and chrome-status-bar-* per
theme and in the compact density, and chrome-window-pop-dark, the one
picture of a whole window. So:
- a change to the top bar changes the
chrome-top-bar-*pictures andchrome-window-pop-dark, plus the few whole-window pictures above and any whose floating part reaches over the bar; - a change to the side bar or the status bar changes its
chrome-*pictures, the body shots, and the pictures a dialog widens over it; - a change to a page changes that page’s pictures only.
A shot that reaches over the side bar still veils the page list
(Nav::veil_list): the list is laid out and answers as usual, but it is
drawn over with the side bar’s fill, so a page added to the gallery
changes only the list’s own shots (pages-*, which lift the veil).
The Rerun-like example (rerun-like-*) is an application of its own,
without the gallery’s bars: its pictures show its whole window.
Keyboard walks
Putting the focus on a widget through AccessKit (.focus()) shows what
the widget does once focused, not that the keyboard gets there. A walk
(egui_pop_test::walk) only presses keys, through the harness, and looks
at egui’s focus after each:
use egui_pop_test::walk::{self, End, ESCAPE, SHIFT_TAB, TAB};
let walked = walk::walk(&mut h, TAB, 200); // until it loops or is lost
assert_eq!(walked.end, End::Looped { at: 0 });
assert!(walked.stops.iter().all(|s| s.visible), "{walked}");
let stop = walk::reach(&mut h, SHIFT_TAB, "Save", 40).expect("the keyboard gets there");
assert_eq!(walk::press(&mut h, ESCAPE), None); // nothing holds the focus
presspresses one key (TAB,SHIFT_TAB,F6,SHIFT_F6,ESCAPE, or anyPress), runs until the application settles and returns theStopholding the focus, if any;focusedonly looks.Stopsays what holds it:role,name,rect,visible(any of it on screen, not scrolled or clipped away; a layer drawn over it does not count) and egui’sid. A stop with no role and no name is a focusable widget that declares nothing.walkpresses one key until the focus comes back to a stop seen, or nothing holds it, or a limit:End::Looped { at },End::Lost,End::Limit. A window has no outside: egui wraps Tab, so a walk ends looped unless a key drops the focus.atbeing the last stop means the key does not move it (a terminal keeps Tab).holdputs a key down and leaves it there, each further call being a repeat, andreleaselets go: what a held key does, wherepressgoes down and up in one frame.reachpresses a key until a stop of that name holds the focus: the way to a widget in a test about the keyboard.
crates/egui-pop-gallery/tests/it/keyboard_walk.rs walks the gallery for the
keyboard survey: what holds is pinned, and a gap is an
ignored test asserting what the survey asks, its reason naming the survey’s
item, so that
cargo test -p egui-pop-gallery --test it keyboard_walk:: -- --ignored
lists what is still open, each failing. The change closing an item removes
its ignore. A page’s stops come last in the window’s order, so these tests
get there with Shift+Tab: each press is a few passes of the whole gallery.
Waiting on the application
A test that starts something asynchronous (a command whose host answers
later, a job) waits with egui_pop_test::wait::wait_until: it steps the
harness’s frames until a journal event matches or the application
settles, the conditions of the bridge’s bridge.wait
(Agents), and fails past a deadline (120 frames or 10
seconds by default) with the condition and the journal’s last events.
use egui_pop::api::wait::WaitFor;
use egui_pop_test::wait::{Deadline, settle, wait_until};
let since = h.state().handle().last_event();
// ... start something ...
wait_until(&mut h, &WaitFor::event("command.done"), since, Deadline::default())?;
settle(&mut h, Deadline::default())?;
One GPU device per test process
Rendering tests run on a software Vulkan driver (lavapipe) in CI and
locally when it is installed. Creating or enumerating wgpu instances and
devices on parallel test threads crashes the Khronos Vulkan loader
1.4.341 (a use-after-free while debug labels are set; Fedora ships it):
the test binary dies with SIGSEGV, on any test, at random. It is fixed
upstream in loader 1.4.350 (Vulkan-Loader pull request 1866).
So a test process opens one wgpu device and every rendering harness shares it:
use egui_pop_test::SharedGpu as _;
let h = egui_kittest::Harness::builder()
.shared_wgpu() // instead of .wgpu()
.build_ui(|ui| { ui.label("hi"); });
The shared instance asks for Vulkan alone when a Vulkan adapter exists
(lavapipe): an instance that also enumerates OpenGL makes an EGL context
current on whichever test thread asks, and a shared device would then
be used from another thread. Without Vulkan it falls back to wgpu’s
default backends. egui_pop_test::app_wgpu uses the shared device. A test that must open a device of its
own holds egui_pop_test::gpu_lock() while it does. A harness built
without a renderer opens a device of its own the first time it renders
(kittest’s lazy renderer): give it .shared_wgpu() when it renders.
Until the loader is updated everywhere, a crashing GPU test binary is
rerun with --test-threads=1 before concluding anything. Under nextest
every test is a process of its own, so the parallel threads that trigger
the crash are rarer, and a test that crashes anyway is retried.
Performance
The gallery’s perf example measures its heavy pages headless:
node-graph, viewport, file-browser, table, text-log and
sections. Each page runs on a fresh context for 60 frames of warm-up and
300 measured frames, with a fixed clock (1/60 s a frame) and fixed input:
the pointer sweeps the window on a set path and the wheel scrolls down
then up every four seconds. Per page, one JSON line:
build_p50_ms,build_p95_ms,build_max_ms: the frame’s build (run_ui, egui-pop’s logic and drawing);tessellate_p50_ms,tessellate_p95_ms: its tessellation;shapes,vertices: what the last frame draws;rss_start_mb,rss_peak_mb,rss_end_mb,rss_growth_mb: the process’s resident memory after the warm-up, its peak while the page runs, after the last frame, and what the measured frames added (Linux,/proc/self/status; none elsewhere).
The counts (shapes, vertices) are the same on every run; the times and, less so, the memory vary with the machine and its load. Rendering is not measured: there is no GPU, only what the interface thread does before egui-wgpu.
cargo run --release -p egui-pop-gallery --example perf
cargo run --release -p egui-pop-gallery --example perf -- node-graph table
cargo run --release -p egui-pop-gallery --example perf -- --baseline last.jsonl
With --baseline (the JSON lines of an earlier run), a figure that grew
beyond its threshold is reported as a warning: line; the exit code stays
0. The thresholds, in percent: build p50 25, build p95 40, tessellation
p50 25, vertices 10, resident peak 15, resident growth 50 (a figure under
a tenth of a millisecond or a megabyte is noise, and is not compared).
The gate runs on the maintainers’ bench box, the machine alone (a timing
job, egui-pop-perf): every full run is kept per branch, and compared
with the last run of next, which is the baseline. It is run on next
after merges that may move the figures, and on a branch before merging
one that may. It warns; it never blocks a merge.
Critical tests
Selective runs (below) skip what a change cannot affect. Some tests guard rules that any change can break, so they run on every change, whatever the selection says. They carry a mark from the test kit:
#[egui_pop_test::critical]
#[test]
fn every_interactive_node_has_a_name() { /* ... */ }
The mark changes nothing in how the test runs: it renames the function
with the prefix critical_ (critical_gpu_ with #[critical(gpu)],
for a test that renders), and the runners select by name. Crates whose
tests do not use the test kit (egui-pop-tokens, egui-pop-model,
egui-pop-core, egui-pop-i18n) use #[egui_pop_test_macros::critical],
the same attribute, through a path-only dev-dependency.
cargo nextest run --workspace --profile critical # every critical test
cargo test --workspace -- critical_ # the same, plain cargo
Rules for the mark:
- Critical tests stay fast. They run on every pull request; one that becomes slow loses its mark or is split (nextest reports it as slow after 10 seconds).
- The list is short and written down here, each test with the rule it guards. A mark is a decision: added or removed in a commit that says why.
- A docs-only change runs the critical tests that need no GPU. The
ones marked
gpuwait for a code change, or formain.
| Test | Rule it guards |
|---|---|
egui-pop::layering critical_dependencies_point_down_the_layers | crate layers, ADR 0001 |
egui-pop-tokens::themes critical_built_in_themes_answer_the_whole_contract_cleanly | every theme gives every required token |
egui-pop-tokens::themes critical_system_and_component_tokens_are_aliases_of_the_tier_below | component tokens alias the tier below |
egui-pop-tokens::contrast critical_every_built_in_theme_and_density_passes_its_contrast_pairs | contrast of every built-in theme and density |
egui-pop-tokens::kits critical_the_default_kit_is_a_kit_folder | the default kit is a clean kit folder |
egui-pop-i18n::catalogues critical_the_english_catalogue_is_generated_from_the_code | no text missing from the English catalogue |
egui-pop-i18n::catalogues critical_every_locale_translates_everything_and_nothing_else | no missing key, no unstamped translation |
egui-pop-core::core critical_documents_are_written_atomically_with_a_backup_and_migrated_on_load | an old saved document still loads |
egui-pop-model::shell critical_a_version_1_layout_is_migrated_to_start_and_end_areas | an old layout still loads |
Scenarios
A scenario is a test written as data: a RON file of steps that call the application’s capabilities, act on its interface, wait and check. The test kit replays it headless, in an egui_kittest harness, and checks a set of invariants after every step, so a scenario catches more than it asserts. Agents write scenarios from what they did in a running application; from then on they are regression tests. Discovery and waiting come from the bridge (Agents).
Running them
// tests/scenarios.rs
#[test]
fn scenarios() {
egui_pop_test::scenario::run_dir(|| my_app::builder(), "tests/scenarios");
}
run_dir builds a fresh application for each *.ron file of the folder
(not its subfolders), runs it, and panics with every failure’s report.
For more, egui_pop_test::scenario::Runner:
| Call | What it does |
|---|---|
Runner::new(build) | a runner building each scenario’s application with build |
.size(v), .frame_budget(d), .deadline(d) | the window (1100 × 720), the longest frame (2 s), how long a Wait waits (120 frames or 10 s) |
.invariant(name, check) | an application’s own invariant, a predicate on the harness, the step and its journal events |
.snapshots(true) | renders with wgpu (feature wgpu): a Shot is a snapshot image |
.run(&scenario), .run_file(path) | one scenario: Ok(Passed) or Err(Failure) |
.run_dir(dir), .assert_dir(dir) | a folder, its results, or a panic on any failure |
Runner::load(path), scenario::parse(text) | reads a scenario |
The format
Scenario(
name: "toasts",
description: "A person asks for toasts.",
fixtures: [Fixture("test.library", { "photos": 3 })],
allow: ["NoErrorToast"],
steps: [
Call("gallery.page", { "page": "toasts" }),
Wait(Event("command.done")),
Ui(Click(role: "Button", label: "Information")),
Expect(Value("toasts.shown.0.level", "info")),
Wait(Settled),
Shot("after"),
],
)
Arguments are JSON values written in RON: { "key": value } maps,
lists, strings, numbers, true, false, and () for none. Fields
that may be left out are written bare (label: "Save", not
Some("Save")).
fixtures are test.* capabilities called before the steps, to set
up the world without Rust code (a library, a folder of photos, a fake
card). An application registers them as collector actions or commands
in its test builds, under a feature of its own.
allow lifts invariants by name, for a scenario that expects what
they forbid.
Steps
| Step | What it does |
|---|---|
Call(name, args) | calls a capability that bridge.describe lists, as the agent: a collector action (journal.since) or a command (about.read, run at once) |
Wait(Settled) | steps frames until no command is queued or running, every job is idle and no repaint is asked for; then checks StableWindows |
Wait(Event(name)) | steps frames until a journal event of that name follows the last Call or Ui step |
Wait(Any([..])) | the first of several |
Ui(Click(label: .., role: ..)) | clicks a node of the accessibility tree, by label, role (Button, Window, CheckBox…, any case) or both; it must be the only one, unless nth: 0 picks one of several in reading order (top to bottom, then left to right) |
Ui(Type(label: .., role: .., text: "..")) | focuses a node and types into it |
Ui(Key("Ctrl+K")) | presses a key, with Ctrl, Shift, Alt, Cmd |
Ui(Scroll(label: .., role: .., up: true)) | scrolls a node, down unless up |
Expect(NoError) | no error toast and no failed command since the start, whatever allow lifts |
Expect(Tree(has: (..), lacks: (..))) | the tree has, or lacks, a node |
Expect(Value("collector.key.0", v)) | a collector’s snapshot value (AppHandle::debug_snapshot); the collector’s name may hold dots |
Expect(Journal(has: "name", data: {..})) | an event since the start, its data holding the keys given |
Shot(name) | a snapshot image <scenario>-<name> when the runner renders, else the accessibility tree, kept in Passed::trees |
Window("import") | the Ui steps and Expect(Tree) that follow read and act in that application window (its id; main for the main window); see below |
Windows
An application with several windows (AppHandle::open_window,
ADR 0025) names the one its steps
look at with Window, which holds until the next Window:
Ui(Click(role: "Button", label: "Import photos…")),
Wait(Settled),
Window("import"),
Expect(Tree(has: (role: "Window", label: "Import photos"))),
Ui(Click(role: "Button", label: "Import")),
Window("main"),
Expect(Tree(lacks: (label: "Import photos"))),
Before the first Window, the steps read the main window with what is
embedded in it, as they always did. Live, a window of its own has its
own tree and input. In-process, kittest embeds every window in the main
one as an egui window titled as it: a window is that embedded window and
what is in it, and main the rest. Either way an application window’s
tree has a Window node named by its title (Expect(Tree(has: (role: "Window", label: "Import photos")))): the embedded window’s, or, in a
window of its own, the root node, whose title is otherwise only the
system’s title bar. A window that is not open breaks the step
that reads it, naming the open ones. Call, Wait and Expect(Value)
are not affected: a call goes where the agent’s calls go without a
window (the active one).
Invariants
Checked after every step, in this order, unless allow lifts them:
| Invariant | Breaks when |
|---|---|
NoErrorToast | an error toast shows |
NoFailedCommand | command.failed is on the journal during the step |
WindowInvariants | window.invariant is on the journal during the step: the window registry disagrees with what is on screen (ADR 0029) |
NoUnknownCommand | a Call names a capability, or commands.run a command, that is not registered |
NoPanic | the step panics |
StableWindows | an area (window, popup, modal) moves or resizes in the frames after a Wait(Settled) |
FrameBudget | a frame takes longer than the budget (generous: a guard against loops) |
NoMissingText | the i18n collector reports a key shown untranslated during the step in a language other than English (a key without an English entry shows its English text; keys already untranslated before the first step are left out) |
An application adds its own with Runner::invariant.
A failure
A failure names the scenario, the step as written, what broke (an invariant, an expectation, a call refused, a wait past its deadline…), why, the journal’s last events and the accessibility tree:
scenario `unknown-page` failed
step 2: Call("gallery.page", {"page":"no-such-page"})
broken: invariant NoFailedCommand
why: command.failed: [...]
journal (last 12):
#41 command.dispatched [agent:debug-bridge] {...}
#42 command.failed [...] {...}
tree:
Window "egui-pop gallery"
...
The gallery’s scenarios are in crates/egui-pop-gallery/tests/scenarios;
the broken ones, under broken/, fail on purpose and
tests/it/scenarios.rs checks their reports.
Live runs
The same files run against a running application over its agent
socket, as an agent drives it, with
egui_pop_test::scenario::live::LiveRunner (Unix) or its command line:
$ egui-pop-scenario --socket "$XDG_RUNTIME_DIR/egui-pop-agent-my-app.sock" \
--var folder=/tmp/photos --out /tmp/out \
--shot my.screenshot '{"path": "$path"}' tests/scenarios
- Steps. Every step works as in-process.
UiandExpect(Tree)go through the socket’suimethod: the accessibility tree of the frame just drawn, and input queued into egui’s next frames (a click is a hover, a press and a release), in the window the lastWindowstep named; aUistep ends once its input went in, so follow it with aWait.$namevariables fill labels and typed text too. - Pairing. Without a token the runner is an unpaired client,
read-only by default. With the token the application issued in
advance (
--token,--token-file, elseEGUI_POP_AGENT_TOKENorEGUI_POP_AGENT_TOKEN_FILE;LiveRunner::token,token_file,token_from_env), it sayshellowith it and runs as that agent, held to its grant (Paired in advance). - Variables.
--var name=value(LiveRunner::var) replaces$namein every string argument of the steps and fixtures: a folder the run made, a file. - Invariants.
NoErrorToast,NoFailedCommand,NoUnknownCommandandNoMissingTextas in-process;NoPanicbreaks when the application is gone (it crashed or exited).StableWindowsandFrameBudgetneed the frames, andWindowInvariantsis not checked live yet: in-process only. - Shots. A shot keeps every collector’s snapshot as
<scenario>-<name>.jsonin--out. With--shot CAPABILITY ARGS(LiveRunner::shot), it also calls the application’s own screenshot capability,$pathin its arguments replaced by<scenario>-<name>.png, and waits for the file. - Output. One JSON line per scenario on stdout; with
--out, each passed scenario’s journal as<scenario>-journal.jsonand a failure’s report as<scenario>-failure.txt. The exit status is 1 when one fails.
The application must let the agent write (BridgeMode::On): a socket
turned on without a mode is read-only, and a scenario that changes
anything, a Ui action included, is refused.
Not yet
- The recording of an agent’s session as a scenario, and a frame-time
collector so
FrameBudgetholds live too.
Threading
What runs on which thread in an egui-pop application, what egui allows, what egui-pop could move off the interface thread, and at what cost. It began as an analysis that changed no behaviour; the decisions it asks for are listed at the end, and the one taken since (the viewport’s tile intake) is recorded in section 5.3.
In short.
- egui builds each frame on one thread: the thread running the window’s event loop, which is the process’s main thread (on macOS it must be; on Linux and Windows it may be another one, opted into). That thread builds the frame, tessellates it and renders it with wgpu, in that order, every frame. No egui API builds parts of one frame on several threads.
- egui’s
Contextitself isSend + Sync: any thread may ask for a repaint, upload or replace a texture, or read the context. So work can run anywhere; only drawing it into the frame happens on the interface thread. - The application’s kernel can already live on another thread: the
host contract (ADR 0010) was made for it (results later, from any
thread; a journal; a waker). What cannot move is egui-pop’s own
interface state (commands, keymap, steps and hooks, zones, the
workbench): it is built with
RcandRefCelland is used while the frame is drawn. Moving it would cost a frame of latency on every interaction and make hooks asynchronous; it is not recommended. - Technical displays can be delegated: a worker renders into a texture (on the CPU, or on the GPU with its own wgpu work on the shared device), the interface thread only draws the texture. egui-pop could offer this as a component (“a delegated surface”).
- The measurements below show where the interface thread actually loses time under background load today, and the fixes are cheap: budgets on what a frame takes in, coalesced wakeups, and no parsing under a lock the frame needs.
1. egui’s constraints
All references are to the crates.io sources of egui, eframe, egui-wgpu, epaint and egui-winit 0.36.2, winit 0.30.13 and wgpu 30.0.1 (the version egui-wgpu 0.36.2 depends on).
1.1 Which thread builds the frame
eframe 0.36’s App has logic(&mut self, ctx, frame) (a default body)
and ui(&mut self, ui, frame) (eframe/src/epi.rs). eframe calls both
from winit’s RedrawRequested handler: run_ui_and_paint
(eframe/src/native/run.rs) calls integration.update
(native/wgpu_integration.rs, with the comment “make sure we hold no
locks here!”), which runs egui_ctx.run_ui(raw_input, |ui| { app.logic(..); app.ui(ui, ..) }) (native/epi_integration.rs). The glow backend
does the same. All of it runs inside event_loop.run_app: on the
thread that created the winit event loop. eframe’s own state there is
Rc<RefCell<..>>: single-threaded by design.
Which thread may create the event loop is winit’s rule
(winit/src/event_loop.rs): “the EventLoop must be created on the
main thread, and only once per application”. On Linux and Windows,
creating it elsewhere panics unless with_any_thread(true) is set
(platform/x11.rs, platform/wayland.rs, platform/windows.rs); on
macOS there is no way around it (platform_impl/macos/event_loop.rs:
“on macOS, EventLoop must be created on the main thread!”).
eframe has no option for it, but NativeOptions::event_loop_builder
(a hook given the EventLoopBuilder) lets an application call
with_any_thread(true): the interface then runs on a thread of the
application’s choosing on X11, Wayland and Windows. That moves the
interface thread; it does not give the interface two threads.
In plain words: one thread draws the window, and on a Mac it is always the process’s first thread. “The interface thread” below is that thread.
1.2 Is Context shareable, and what locks it takes
pub struct Context(Arc<RwLock<ContextImpl>>) (egui/src/context.rs),
a parking_lot lock behind epaint’s wrapper; a test asserts
Context: Send + Sync. The lock is not held for the whole frame:
run_ui takes it briefly to begin the pass, runs the application’s
code unlocked, and takes it again to end the pass. Every widget call
takes it for a moment. Another thread can therefore use the context
while a frame is being built, between those moments.
What a worker may do with a cloned Context:
request_repaint()/request_repaint_after(d): documented for this: “If called from outside the UI thread, the UI thread will wake up and run” (eframe installs the callback). It targets the viewport on top of the context’s viewport stack; a worker should preferrequest_repaint_of(ViewportId::ROOT)when several windows exist;load_texture,TextureHandle::set,tex_manager(): the texture manager has its own lock (Arc<RwLock<TextureManager>>); the change is picked up at the next end of pass (take_delta). It does not wake the interface: callrequest_repainttoo;- read input or memory: possible, but it reads whatever state the
frame in progress left, and
input()andmemory_mut()take the write lock.
What a worker must not do: call the context from inside a closure
given to the context (ctx.input(|i| ctx.request_repaint())): the
lock is not reentrant (“you may NOT recursively lock the same Context,
as that can lead to a deadlock”). Note also that tessellate holds the
write lock for the whole tessellation, so a worker calling the context
then waits that long.
1.3 Viewports (several windows)
- Immediate viewports (
show_viewport_immediate): the callback is called at once, “This may only be called on the main thread”; the renderer for them is a thread-local eframe installs. - Deferred viewports (
show_viewport_deferred): the callback must beFn(&mut Ui, ViewportClass) + Send + Sync + 'staticand is “called by the integration at a later time, perhaps multiple times”. In eframe it is called on the same event-loop thread, when that window needs a repaint.Send + Syncis required of the callback’s type; no other thread runs it.
Neither kind draws in parallel. A second window costs the interface thread its own frame build, tessellation and render.
1.4 Textures from other threads
eframe gathers the frame’s TexturesDelta and hands it to egui-wgpu’s
Painter::paint_and_update_textures, which takes
renderer.write() and calls Renderer::update_texture for each
change (egui-wgpu/src/winit.rs): the GPU upload happens on the
interface thread, during the render, for every texture a worker set.
To avoid that copy, a texture can be made outside egui:
RenderState { device, queue, renderer: Arc<RwLock<Renderer>>, .. } is
Clone, reachable from CreationContext::wgpu_render_state or
Frame::wgpu_render_state(). wgpu’s Device and Queue are
Send + Sync on native (asserted in wgpu/src/api/device.rs and
queue.rs), so a worker can create textures, write them and submit
its own command buffers. To show one in egui, register its view once
with Renderer::register_native_texture (an Rgba8Unorm view) or swap
it with update_egui_texture_from_wgpu_texture; both need
renderer.write(), the lock the render holds, so a worker does it
rarely (registering a few textures once and then writing into them is
the pattern).
1.5 Drawing off the interface thread
- Paint callbacks (
egui_wgpu::CallbackTrait: Send + Sync):prepareandfinish_preparerun insideRenderer::update_buffersunderrenderer.write(), andpaintinsideRenderer::renderunderrenderer.read(), both on the interface thread during the render; their command buffers go in egui’s submit. A callback is GPU work recorded on the interface thread, not work done elsewhere. Shared resources live incallback_resources, a concurrent type map. - Rendering to a texture on a worker is allowed: a worker with the
shared
DeviceandQueuerecords and submits its own passes into a texture it owns (two textures, or a ring, so the one being shown is never the one being written), then tells the interface which one is ready; the interface draws it as an image or samples it in a paint callback. wgpu orders submissions on one queue, so the texture is complete when the interface’s frame samples it, if the worker submitted before the frame’s submit. This is how a technical viewport can be “delegated”. - On the CPU, a worker fills pixels and calls
TextureHandle::set; the upload still happens on the interface thread at the next render (1.4).
1.6 Where egui-wgpu renders
Synchronously, on the interface thread, after the frame is built:
run_ui_and_paint builds the frame, then tessellates it
(Context::tessellate), then calls paint_and_update_textures, which
uploads textures, prepares callbacks and buffers, renders, submits and
presents. With the default surface configuration (AutoVsync, at most
one frame in flight) the thread can block on the display in
get_current_texture and present (egui-wgpu times them as “vsync”).
Tessellation runs in parallel only with epaint’s rayon feature (off
in egui’s and eframe’s defaults) and only splits large shapes.
1.7 Repaint plumbing
eframe sets set_request_repaint_callback to send a RequestRepaint
user event through winit’s EventLoopProxy (behind a Mutex); the
loop drops requests made obsolete by a frame that already ran, and
throttles invisible windows to 100 ms. A zero-delay request asks for
two passes. The callback is called while the context’s write lock
is held. Context::repaint_causes() says why the last pass asked for
another (“helpful in debugging why egui is constantly repainting”);
each request_repaint records its caller’s file and line.
egui_kittest runs run_ui on the test’s own thread, with no event
loop: everything egui-pop tests headless runs on one thread.
1.8 What this means
| Wish | With egui |
|---|---|
| Build the frame on two threads | No. One thread builds, tessellates and renders. |
| Move the interface off the main thread | Linux and Windows only (event_loop_builder + with_any_thread); never on macOS. |
| Compute anything on a worker | Yes: the context and wgpu’s device and queue are shareable. |
| Upload pixels from a worker | Set on a worker, copied to the GPU on the interface thread; or written by the worker into its own wgpu texture, no copy on the interface thread. |
| Render a technical view on a worker | Yes, into a texture (CPU or wgpu), presented by the interface thread. |
| A second window drawn in parallel | No: deferred viewports run on the same thread. |
2. egui-pop’s threads today
2.1 On the interface thread
Each frame, in this order:
App::logic: attach the context, install the theme if asked, settle (poll every command result in flight), feed the strips’ indicators from the journal, the pass lifecycle, process the requests (commands queued by blocks and handlers, enabling plugins, rebinding keys, workbench changes). eframe calls it througheframe::App::logic, thenApp::showcalls it again, for hosts without that hook; a second call in the same pass does nothing, so it runs once per pass. Calls between passes (eframe’s ticks of a hidden window) always run.App::show: key dispatch (commands run synchronously through the host), the shell (title, menu bar, status bar, the workbench and its panels), auxiliary windows, overlays, popups, live regions, the requests again.- Inside the panels, the components: the viewport takes in the tiles that arrived, already converted by the source’s workers (the default since section 5.3), and hands them to egui within an upload budget; the terminal locks its model and paints the grid; the editor locks its model, highlights up to 500 lines a pass and lays out the visible lines; code assist calls the provider; the tree applies the edits its source sent; the platform plugins drain their queues.
- eframe tessellates and renders (1.6). On the GPU path, the
viewport’s paint callback creates a texture for each new tile and
copies its half-float texels into it, in
prepare, on this thread (section 5.2 measures it).
Steps and hooks (ADR 0011), command handlers of LocalHost, store
listeners and writes, persistence of documents, and the default code
assist provider (WordCompletion, which scans up to 5,000 lines around
the cursor) all run here, synchronously.
2.2 Threads egui-pop starts
| Thread | Crate | Lives | Returns results through |
|---|---|---|---|
egui-pop-file-chooser | api | one per system file dialog | an Arc<Mutex<Option<Answer>>> polled each frame, then a repaint |
egui-pop terminal input | editors (pty) | a PTY session | an unbounded channel from the interface |
egui-pop terminal output | editors (pty) | a PTY session | feeds the emulator itself, under the terminal’s model lock, then a repaint per read (16 KiB at most) |
egui-pop terminal wait | editors (pty) | until the child exits | the model (pending_exit) |
egui-pop-viewport-demo-N | viewport (demo source) | the source | the tile sink (a channel), a repaint per tile |
egui-pop instance | platform | the process | an Arc<Mutex> inbox, a repaint per launch |
egui-pop global shortcuts | platform (portal) | the plugin | a channel, a repaint per press |
egui-pop notifications | platform | the plugin | a channel, a repaint per event |
egui-pop notification | platform | one per shown actionable notification (no limit) | the same channel |
egui-pop focus mode | platform | one read at a time | an Arc<Mutex>, a repaint |
Libraries add their own (global-hotkey’s handler thread, ksni’s D-Bus, rfd’s portal). Applications add theirs behind the traits below: a tile source’s workers, a tree source’s loader, a terminal source, an assist provider’s thread, the host’s kernel.
All of them post the same way: a queue (a channel or a vector behind a
mutex) and request_repaint(). The interface drains the queue at its
next pass. None is drained with a budget, except the editor’s
highlighting (500 lines a pass).
A component its host stops drawing (a tab behind another, a palette hidden or rolled up) keeps receiving. Each of egui-pop’s keeps bounded memory meanwhile, by draining off-draw or by a cap whose drops are counted where agents see them:
| Queue | While not drawn |
|---|---|
Terminal output (a PTY, a Console) | Off-draw: the delivering thread feeds the emulator, whose scrollback is bounded. |
A Console no terminal started yet | Capped: the latest CONSOLE_PENDING bytes (1 MiB) from a line’s start; Console::dropped, and dropped in the start’s result. |
Jobs (job.* events) | Off-draw: folded at each pass from the bounded journal; each job’s log keeps its last lines. |
Image viewport (TileSink) | Tiles and failures answer requests, made only when drawn. Changes and readouts are capped at source::NOTICES (256): a change past it becomes one change of the whole image, a readout is dropped; coalesced in the viewport’s stats. |
Tree (TreeHandle, a source’s answers) | Capped at tree::EDITS_WAITING (4096): past it, the edits waiting are dropped and every branch loads again at the next pass; TreeState::dropped, and a tree.overflowed event. |
| Library commands | Capped at library::plugin::INBOX (64), the oldest dropped; dropped in the libraries collector. |
| Code assist | One answer waiting per kind; a new request cancels the old. |
| Platform plugins (notifications, shortcuts, tray, instance, focus mode) | Off-draw: drained at each pass. |
Thumbnails and the library’s images are the application’s: egui-pop
keeps no queue of them. A component an application declares with
workers drained when drawn (Mountable::workers) gets condition c11
in docs/hosts.md; Mountable::bounded_workers says it keeps bounded
memory hidden.
2.3 What is shared
- The value store,
SharedStore = Arc<Mutex<Store>>: bound widgets lock it every frame to read, each change locks it again; listeners run while it is locked, on whatever thread wrote. - Command results:
Pending/Resolver, anArc<Mutex<Option<..>>>slot, polled bysettle; theWaker(Arc<dyn Fn() + Send + Sync>) callsrequest_repaint. - Services (
Arc<dyn Any + Send + Sync>) and the plugins’ states (toasts, dialogs, files, devtools:Arc<Mutex<State>>). - The terminal’s model (
Arc<Mutex<Model>>): the source’s thread parses into it, the interface paints from it. - The editor’s model (
Arc<Mutex<Model>>): the interface highlights and paints under it; an assist provider’s thread reading the text throughRequest::statelocks it too. - The viewport’s tile channel, its GPU upload queue (
Arc<Mutex>), its cancel tokens (atomics).
Everything else of the application layer is not shareable:
AppHandle is Rc<Shared> with about thirty RefCell fields;
command handlers, step hooks, list providers and reducers are Rc<dyn Fn>; blocks are Box<dyn FnMut> without Send; the Host trait has
no Send bound and lives in a RefCell.
2.4 The Send and Sync contract
| What the application implements | Bound | Called on |
|---|---|---|
Host | none | the interface thread (dispatch must return at once) |
command handler (Ctx::command) | none (Rc) | the interface thread |
step hooks (before, replace, after) | none (Rc) | the interface thread |
| store listener | FnMut + Send | the writer’s thread, store locked |
TileSource | none | the interface thread (request must return at once) |
DisplayTransform | Send + Sync | the interface thread (CPU path) |
TreeSource | none | the interface thread (load must return at once) |
TerminalSource | Send | the interface thread (start, write); output from any thread |
AssistProvider | Send | the interface thread (every request must return at once) |
Highlighter | Send | the interface thread, editor locked |
notification Backend | Send + Sync | its own thread (may block) |
shortcuts and tray Backend | none | the interface thread |
What the application gets to answer from any thread: Resolver,
Waker, TileSink, the tree’s Sink, the terminal’s Sink and
Console, the assist Reply, Notifier, Launches.
The rule the traits follow today, “the interface asks, never waits; the
answer comes from anywhere”, is the right one. It is written in each
trait’s documentation, not checked: a source that computes inside
request, or a provider that answers inside complete, stalls the
frame (measured below).
3. The kernel on another thread
3.1 What it would mean
“The kernel” here is two different things:
- The application’s kernel: its documents, engine, commands,
undo history, its bus. ADR 0010 already puts it behind
Host. - egui-pop’s interface kernel: the registries (commands, keymap,
menus, panels, zones), the
whencontext, steps and hooks, the workbench, the requests queue, the journal fallback, the value store.
(1) can run on its own thread today. dispatch returns
Reply::Later(pending) and the kernel resolves it from its thread;
the kernel publishes on its own bus and egui-pop reads it through
since; the kernel wakes the interface with the Waker. What is
missing is convenience, not possibility: Journal is not thread-safe
(a kernel keeps it behind its own lock, as the threading example’s
LockedHost does), and Host::store() hands out an
Arc<Mutex<Store>> the interface locks every frame, so a kernel
writing the store from its thread contends with the frame (briefly).
(2) cannot move as it is, and should not.
3.2 What assumes the same thread
RcandRefCelleverywhere inegui-pop-api:AppHandle, every handler and hook type, every block. Making themSendmeansArc<Mutex>for each andSendbounds on every closure an application writes, a breaking change to the whole API.- Synchronous steps feeding the frame:
AppHandle::stepreturns anOutcomethe caller uses at once (the workbench applies a dock change, the palette drag reads the result in the same frame, the file chooser resolves). A hook may veto or redirect, and the drawing code acts on that in the same frame. &mutduring the frame: the keymap is borrowed mutably inside the rebind step’s default; the workbench is borrowed mutably while areas are drawn (changes made while drawing are deferred, which already shows how much the frame depends on owning it).- Commands from keys run in the frame that saw the key, and their
whencontext is computed from the focus of that frame. - The host is taken out of its cell while it dispatches; reads made
meanwhile (
can_undo,events_since) return defaults.
3.3 What a split would cost
- Latency. Input is read by the interface thread. If the kernel that decides what a key does runs elsewhere, the key’s effect appears one frame later at best (the kernel answers before the next frame), two in practice (intent sent during frame N, applied by the kernel, snapshot visible at frame N+1 or N+2). At 60 Hz that is 17 to 33 ms added to every interaction: noticeable on drags and typing, where egui’s immediate mode is otherwise zero-latency.
- Consistency. The frame draws a snapshot; the user acts on what
was drawn. Two intents built from the same stale snapshot can
conflict (two drags, a menu item greyed by a
whenthat was true a frame ago). Every intent needs a version or a precondition, and a refusal path. - Hooks become asynchronous. A before-hook that vetoes
frame.closemust answer before the window decides to close; with the kernel elsewhere the close waits a round trip, or the veto arrives after the fact. ADR 0011’s promise (“observe, veto, replace, extend at the moment it happens”) would weaken to “at the next frame”. - Undo. Undo is already the host’s (
Host::history): it moves with the application’s kernel without change. The store’s undo groups gestures by drag start and end on the interface thread; across threads a gesture’s begin and end must travel with their writes, in order. - Gain. The interface kernel’s own work per frame is small (see
the measurements:
pop.app.logicandpop.app.requests); the heavy work is in components and in the application’s kernel, which can already move.
3.4 Two designs
A. Message-passing kernel. The interface thread keeps egui and a view model; the kernel thread owns the state. The interface sends intents (a command and its arguments, a gesture’s begin, changes and end, a key that resolved to a command) over a channel; the kernel applies them in order, publishes events, and posts a new view model (or diffs) back, then wakes the interface.
interface thread kernel thread
---------------- -------------
input -> keymap -> intent --chan--> apply, validate, journal
draw(view model vN) <--chan-- view model vN+1 (or diffs)
settle: take latest vN+1 <--wake--
- Pros: the kernel never waits on the frame, the frame never waits on the kernel; the journal is the log of intents and results; testable without egui; matches a kernel in another process.
- Cons: one to two frames of latency per interaction; every piece of interface state the kernel decides must be in the view model; steps and hooks either stay on the interface thread (then they are not the kernel’s) or become asynchronous.
B. Double-buffered state. The kernel writes into a back buffer;
at the start of each frame the interface swaps (or the kernel
publishes an Arc of an immutable snapshot, swapped atomically, as
arc-swap does). The interface reads the front snapshot without locks
and writes nothing to it; its changes go back as intents, as in A.
- Pros: reads in the frame are lock-free and consistent (one version
per frame); cheap when the state is a persistent structure (clone an
Arcper frame). - Cons: same latency as A for writes; a big state must be persistent (structural sharing) or the copy dominates; the interface sees a snapshot up to a frame old.
Both are a kernel pattern for the application, and egui-pop’s part
is small: a thread-safe journal, a Host adapter over a channel, and
a snapshot service the blocks read. Neither requires moving egui-pop’s
interface kernel.
3.5 Assessment
- The application’s kernel on its own thread: yes, today, through
HostwithReply::Later, its own journal behind a lock, and the waker. Cost: commands it runs complete a frame later (they already show as running), and its state is read through snapshots or the store. egui-pop can make this the paved road (follow-ups 5 and 6). - egui-pop’s interface kernel on its own thread: possible only by
rewriting
egui-pop-apiaroundSendtypes and asynchronous steps, for a gain the measurements do not show: the interface kernel’s own per-frame work is a small part of a frame. Not recommended; the owner decides.
4. Delegated display
A technical view (the image viewport, a node graph, histograms, waveforms, scopes) is drawn by a worker into a texture and only shown by the interface thread. With egui and wgpu:
- CPU rendering on a worker (histograms, scopes, a small graph):
the worker renders pixels, calls
TextureHandle::set(or sends the pixels), asks for a repaint; the interface draws the texture as an image. Cost on the interface thread: the upload during the render (1.4), proportional to the pixels changed. This is the viewport’s CPU path today, except that its display transform runs on the interface thread at tile arrival. - GPU rendering on a worker: the worker holds clones of
DeviceandQueue, owns two or three textures it renders into (a ring), and registers each once with egui-wgpu (register_native_texture, under the renderer’s write lock, once). Per frame it submits its passes and posts “texture k is ready”; the interface draws texture k. Nothing heavy runs on the interface thread. The worker must not take the renderer’s lock per frame, and must keep a texture alive while the interface may still sample it (the ring’s size covers the frames in flight). - GPU work recorded on the interface thread (paint callbacks): what the viewport does today. Right for cheap draws (one quad per tile), wrong for heavy passes, which belong on a worker’s submission.
What egui-pop would provide, as a component of the viewport crate:
- a
Surface(a delegated display): a ring of textures registered with egui-wgpu, aSurfaceSinka worker renders into (begingives a free texture and the device and queue,presentmarks it ready and wakes the interface), the widget that draws the latest ready texture with the viewport’s mapping, and a CPU fallback (pixels set through a texture handle) for kittest and the web; - the viewport’s own tile path moved to it: f32 to f16 conversion and texture creation on the tile source’s side (the sink converts on the worker’s thread), the interface only binding ready textures;
- a frame budget for uploads (tiles per frame, bytes per frame), with the rest carried to the next frame and a repaint asked.
5. Measurements
The threading example of the gallery
(crates/egui-pop-gallery/examples/threading.rs, feature trace)
builds frames headless on its main thread at 60 Hz, as eframe would,
with no GPU (it measures the interface thread up to tessellation, not
the render), while worker threads load it. A minimal tracing
subscriber records egui-pop’s profiling scopes per thread. It runs on
the bench box as a timing job (the machine alone, its frequency capped).
First run (2026-10-13, comparable conditions, 360 frames per scenario, budget 16.7 ms). Frame build time on the interface thread, in ms:
| scenario | p50 | p95 | p99 | max | frames over budget | textures per frame | wakeups/s |
|---|---|---|---|---|---|---|---|
| idle | 1.02 | 1.03 | 1.05 | 1.26 | 0 | 0 | 0 |
| terminal, steady | 0.62 | 0.64 | 0.93 | 1.43 | 0 | 0 | 33 |
| terminal, flood | 3.61 | 6.12 | 7.12 | 8.07 | 0 | 0 | 60 |
| assist on a thread | 0.32 | 8.01 | 8.16 | 8.34 | 0 | 1 | 23 |
| assist on the interface thread | 0.31 | 38.33 | 38.50 | 38.58 | 60 | 1 | 23 |
| tile storm | 0.32 | 21.56 | 69.02 | 102.22 | 24 | 19 | 53 |
| jobs from the host | 0.29 | 0.42 | 0.49 | 0.84 | 0 | 1 | 60 |
| all three | 0.77 | 23.49 | 36.68 | 60.59 | 24 | 9 | 60 |
| idle, after | 0.54 | 0.55 | 0.59 | 0.95 | 0 | 0 | 0 |
What the scopes show:
- Tiles are the real problem.
pop.tiles.receivetakes up to 102 ms in one frame: every arrived tile is taken in, converted and uploaded on the interface thread, up to 19 textures (4.7 MB) in a frame. An upload budget per frame and the conversion on the worker side are the first fix (follow-ups 3 and 9). - The terminal flood costs the paint lock, not the paint:
pop.terminal.lockwaits up to 7 ms while the reader parses under it. Parsing outside the lock removes it (follow-up 2). - Highlighting spends up to 8 ms of a frame in its line budget
(
pop.editor.highlight); the budget holds, but a smaller one, or the highlighter on a worker, would halve the tail. - An assist provider answering on the interface thread blocks it (38 ms frames): the documented rule (“never answer on the interface thread”) matters, and a debug check would catch it (follow-up 7).
- The jobs journal is cheap on the interface thread (0.5 ms p99); its lock is contended on the worker side only.
- Wakeups reach 60 per second under load (one per frame), so coalescing them (follow-up 1) matters for power, not for frame time.
5.1 The tile intake off the interface thread (proof of concept)
Follow-up 3, as two settings of ViewportState, opt-in when measured
here and the default since (section 5.3):
set_prepare_on_worker(true): the tile sink converts each tile on the thread that delivers it, the source’s worker (the display transform on the CPU path, the f32 to f16 texels on the GPU path). The interface thread only hands a ready image to egui (or ready texels to the paint callback). A tile converted with a display transform replaced meanwhile is shown, marked stale and asked for again.set_upload_budget(UploadBudget::bytes(n))(or::tiles(n)): a frame uploads at most that much (at least one tile). Tiles wait in a queue ordered as GIMP orders its work: the visible area first (the proxy, then the view’s scale, then other scales), then the rest nearest the view’s centre. When the view pans or zooms the order changes, and nothing waiting is dropped (a test, “leftover tiles survive a pan”, holds it); only a changed region drops the waiting tiles it covers.
The threading example runs the tile storm in four variants (the
default, conversion on the workers, a 1 MiB budget, both), views held
for 30 frames so they can fill, and the combined load with both. It
also measures the cost side: the time from a view change to the first
full-resolution tile uploaded and drawn for it, and to every wanted
tile on screen (a view moved on before that is not counted; with a
0.1 s settle before exact tiles are asked for, 100 ms of each latency
is the settle).
Second run (2026-10-13, comparable conditions, the same job and machine, all rows from one run). Frame build time on the interface thread, in ms; uploads are textures handed to egui in one frame:
| scenario | p50 | p95 | p99 | max | over budget | uploads/frame (max) | MB/frame (max) | first full-res p50 / max | views with one | all tiles p50 / max | tiles served |
|---|---|---|---|---|---|---|---|---|---|---|---|
| tiles (documented baseline, first run) | 0.32 | 21.56 | 69.02 | 102.22 | 24 | 19 | 4.7 | ||||
| tiles (default) | 0.32 | 20.17 | 41.52 | 61.69 | 23 | 10 | 2.6 | 141 / 159 | 22 / 49 | 125 / 185 | 224 |
| tiles, budget 1 MiB | 0.32 | 22.31 | 24.82 | 25.86 | 27 | 5 | 1.0 | 140 / 157 | 22 / 49 | 125 / 156 | 226 |
| tiles, conversion on workers | 0.32 | 0.44 | 0.48 | 0.51 | 0 | 4 | 0.8 | 119 / 119 | 23 / 49 | 102 / 120 | 163 |
| tiles, both | 0.32 | 0.42 | 0.47 | 0.58 | 0 | 4 | 1.0 | 119 / 119 | 23 / 49 | 102 / 119 | 162 |
| views held (default) | 0.32 | 11.72 | 28.49 | 50.75 | 9 | 9 | 2.1 | 146 / 151 | 10 / 13 | 165 / 300 | 104 |
| views held, both | 0.31 | 0.39 | 0.44 | 0.48 | 0 | 4 | 1.0 | 135 / 136 | 10 / 13 | 170 / 337 | 104 |
| all (default) | 0.80 | 17.35 | 25.91 | 31.83 | 20 | 5 | 1.3 | 141 / 157 | 20 / 49 | 124 / 157 | 157 |
| all, both | 0.79 | 1.04 | 1.12 | 1.42 | 0 | 3 | 0.5 | 118 / 118 | 22 / 49 | 101 / 118 | 125 |
The default storm measured lower this run than the first (p99 42 against 69 ms): the same code, another run; compare rows of one run.
What the scopes show: pop.tiles.receive on the interface thread goes
from 61 ms at most to 0.013 ms; the work moves to the workers
(pop.tiles.prepare, 6.5 ms per tile at most), where it lengthens each
tile’s computation.
Verdict.
- Keep the conversion on the workers. It removes the tile storm from the interface thread entirely (p99 42 to 0.5 ms, no frame over budget, the combined load from 26 to 1.1 ms p99), and the first full-resolution tile shows sooner (141 to 119 ms after a view change, 146 to 135 ms with views held), since the interface no longer stalls the frame that draws it. Its cost is on the workers: in the storm they serve about a quarter fewer tiles (224 to 163) and more requests are cancelled before being served, so fewer views fill completely before the next move (21 to 9 of 49); with views held, a view fills slightly later (170 against 165 ms at the median). A source with spare workers does not see it. It should become the default once a source can opt out (one that already delivers display pixels from a GPU has nothing to convert).
- The upload budget alone is not enough: it caps the spike (max 102 or 62 ms to 26 ms) but each tile still costs its conversion on the interface thread, so frames stay over budget. With the conversion on the workers, it no longer limits anything in this harness (the workers deliver at most four tiles a frame here): the headless harness has no GPU, so the cost it bounds, the copy to the GPU at the render, is not measured. Keep it, off by default, as the guard for fast sources (a cache, a GPU pipeline) and slow uploads; its price is latency to fill a view (a 1 MiB budget is about 32 frames for a 4K view in 8-bit RGBA), which the visible-first order keeps away from what the user looks at.
- A worker rendering into its own wgpu texture (follow-up 9) could not be measured by this headless harness; section 5.2 measures it on a GPU.
5.2 On a real GPU
The viewport crate’s gpu_tiles example
(crates/egui-pop-viewport/examples/gpu_tiles.rs) measures what the
headless harness cannot: the render. It builds frames at 60 Hz as
eframe would, tessellates them, renders them with egui-wgpu into an
offscreen target, submits, then waits for the GPU (as a present at most
one frame ahead does). The view jumps every 8 frames (a storm) or every
30 (views held), over zooms 25 % to 200 % of a 4096 × 3072 image whose
tiles come from two worker threads. Each intake runs in its own process:
gpu-ui: the GPU path, as the old default: scene floats converted to half floats and copied into a new texture per tile, in the paint callback’sprepare, on the interface thread, all in one frame;gpu-worker: the GPU path, the new default: half floats made on the source’s workers, the texture created and filled inprepare, within the upload budget;gpu-render: the source’s workers render each tile on the GPU, into a texture of their own, with the demo image’s function ported to WGSL, and hand it over (TileSink::deliver_device, see device tiles): no pixel crosses the CPU, the interface thread only binds the texture;cpu-ui,cpu-worker: the same without the GPU path installed (the display transform on the CPU, egui textures), old and new default.
“Interface thread” is the frame’s build, tessellation, and the render’s recording and submit (texture uploads included), not the wait for the GPU, which stays under 2.1 ms at p99 everywhere. Latencies are from the view change; 100 ms of each is the settle before exact tiles are asked for. Memory: the tile textures the viewport holds at most, and the process’s peak resident memory.
First run (2026-10-13, the box’s timing job egui-pop-gpu-tiles on an
NVIDIA GeForce RTX 3070 through Vulkan, CPU frequency capped at 65 %,
conditions comparable; all rows from one run):
| intake | interface p50 / p95 / p99 / max (ms) | over 16.7 ms | uploads/frame max | first full-res p50 / max (ms) | views complete | tile textures max (MB) | peak RSS (MB) |
|---|---|---|---|---|---|---|---|
storm, gpu-ui (old default) | 0.38 / 14.28 / 14.92 / 18.12 | 4 | 5 (2.6 MB) | 133 / 136 | 18 of 45 | 91 | 199 |
storm, gpu-worker (default) | 0.38 / 11.93 / 12.06 / 12.65 | 0 | 4 (2.1 MB) | 131 / 133 | 18 of 45 | 90 | 167 |
storm, gpu-render | 0.40 / 0.57 / 0.65 / 1.69 | 0 | 24 (no copy) | 120 / 121 | 45 of 45 | 115 | 208 |
storm, cpu-ui (old default) | 0.36 / 26.37 / 49.49 / 76.86 | 26 | 10 (2.6 MB) | 147 / 156 | 25 of 45 | 49 | 179 |
storm, cpu-worker (default) | 0.37 / 3.33 / 3.45 / 6.05 | 0 | 4 (1.0 MB) | 122 / 123 | 14 of 45 | 34 | 168 |
held, gpu-ui | 0.38 / 7.49 / 14.41 / 15.17 | 0 | 4 | 135 / 144 | 12 of 12, p50 157 ms | 63 | 173 |
held, gpu-worker | 0.38 / 6.15 / 12.15 / 14.95 | 0 | 5 | 132 / 143 | 12 of 12, p50 158 ms | 63 | 170 |
held, gpu-render | 0.38 / 0.47 / 0.68 / 1.81 | 0 | 24 (no copy) | 120 / 121 | 12 of 12, p50 120 ms | 63 | 172 |
held, cpu-ui | 0.37 / 14.20 / 44.27 / 76.60 | 10 | 10 | 149 / 152 | 12 of 12, p50 161 ms | 32 | 179 |
held, cpu-worker | 0.38 / 3.20 / 6.09 / 7.10 | 0 | 4 | 123 / 139 | 12 of 12, p50 172 ms | 32 | 168 |
wgpu’s allocator report gave the same 201 MB reserved for every run (a block reservation, not a measure of use); the tile textures held are the better measure of GPU memory.
What the rows show:
- On the CPU path, the conversion on the workers is the whole gain: p99 49.5 to 3.5 ms in the storm, 26 frames over budget to none, the first full-resolution tile 25 ms sooner (147 to 122 ms). What is left on the interface thread is egui’s texture copy at the render (3 ms at p95 for 1 MB a frame).
- On the GPU path, the copy is the cost, not the conversion: moving
the f32 to f16 conversion to the workers saves 2 to 3 ms (p99 14.9 to
12.1 ms) and the frames over budget, but the interface thread still
spends up to 12 ms a frame in
prepare, creating one texture per tile and copying 2 MB of half floats into it. The upload budget does not bite here (8 MiB; the workers deliver at most 2.6 MB a frame). - Tiles rendered on the GPU by the workers take the tiles off the interface thread entirely: p99 0.65 ms, flat whatever the load, the first full-resolution tile sooner (120 ms, that is 20 ms after the settle), and every view of the storm filled (45 of 45, against 14 to 25): the GPU computes a tile far faster than two CPU workers. It costs more texture memory in the storm (115 against 90 MB: more tiles arrive, and the budget does not hold them back), and it needs a source whose pixels are on the GPU already.
5.3 Decision (2026-10-13)
- The default is the conversion on the source’s workers, with the
upload budget (
ViewportState::new:prepare_on_workeron,UploadBudget::DEFAULT, 8 MiB a frame). It removes every frame over budget in both paths and shows the first full-resolution tile sooner (2 to 25 ms), for the same memory or less. Its cost is on the workers (section 5.1: fewer tiles served in a storm). The opt-out stays:set_prepare_on_worker(false),UploadBudget::UNLIMITED. - A source whose pixels are on the GPU hands over textures
(
TileSink::deliver_device): no copy, the interface thread only binds, the best of the three by an order of magnitude. This is the path for an application whose pipeline renders on the GPU (Helios’s processing): its output should reach the viewport as textures on the shared device, not as floats read back and uploaded again. The prototype stays experimental until such a source uses it; the delegated surface of section 4 generalises it. - Next, for CPU sources on the GPU path: the 12 ms left in
prepareis the texture creation and the copy. The workers can do both (wgpu’s device and queue are shareable): the sink, given the device, creates and fills the texture on the delivering thread and hands it over asdeliver_devicedoes. A pool of tile textures reused instead of created would cut it further.
6. Proposal: a threading model for egui-pop
6.1 Rules
- The interface thread draws and decides; it never computes what can be computed elsewhere. Never on it: decoding, parsing a program’s output, highlighting a whole file, scanning a document, display transforms per pixel, f32 to f16 conversion, file I/O beyond a small settings document, waiting on a lock a worker holds while working.
- Every call egui-pop makes into application code from the frame
returns at once (
Host::dispatch,TileSource::request,TreeSource::load,AssistProvider::*,TerminalSource::write): the trait documentation says so already; egui-pop adds a debug check (a call over a threshold is reported through the debug bridge and the log, with the trait and the method). - Results come back through a queue egui-pop drains with a budget: the queue is drained at the start of the frame, up to a budget (count or bytes or time), the rest stays queued and asks for another frame.
- One wakeup per queue per frame: a producer wakes the interface only when its queue goes from empty to non-empty (an atomic flag the drain clears), not per item.
- No work under a lock the frame takes. A worker prepares its result outside any shared lock and swaps it in (a short lock, or a channel); the frame copies what it draws under a short lock, or reads a snapshot.
6.2 Cancellation and back-pressure
- Every request has a cancel token (the viewport and assist have one; the tree source and file chooser do not yet); egui-pop cancels what the view no longer needs and drops stale answers (all components check versions already).
- Queues are bounded where a producer can outrun the interface: the terminal (a byte budget per frame, the reader blocking when the backlog is full, as a PTY’s kernel buffer would), the viewport’s tiles (the source’s queue ordered by priority, cancelled jobs removed rather than skipped later), the tree’s edits.
- Unbounded thread creation goes: actionable notifications share one waiting thread; a provider’s slow requests share a pool.
6.3 The kernel-thread option
The application’s kernel on its own thread is the supported path
(ADR 0010), made easier by egui-pop: a thread-safe journal, a
channel-backed Host and snapshot reads (follow-ups 5 and 6).
egui-pop’s interface kernel stays on the interface thread; moving it is
a rewrite of the application API for a small gain (section 3.5). For
the owner to decide.
6.4 Delegated viewports
The viewport gets a delegated surface (section 4): its tiles converted and uploaded by the source’s workers into GPU textures, the interface only drawing them; the same surface offered to applications for graphs, scopes and histograms.
7. Follow-ups, by gain against cost
- Coalesce wakeups: one repaint per queue per frame (terminal sink, tile sink, tree sink, assist reply). Small, local.
- Terminal: feed the emulator on the interface thread from a bounded byte queue with a per-frame budget, or parse on the reader thread into a snapshot swapped under a short lock; never parse under the lock the painting holds.
- Viewport: an upload budget per frame (tiles and bytes), the rest carried over; the CPU display transform and the f32 to f16 conversion moved to the sink’s (worker) side. Done, and the default since 2026-10-13 (sections 5.1 to 5.3); next, the GPU path’s texture creation and copy on the workers too (section 5.3).
App::logicruns twice per eframe frame (fromeframe::App::logicand again fromApp::show): run it once. Done: a second call in the same pass does nothing.- A thread-safe journal (
SharedJournal) and a channel-backedHostadapter, so a kernel on its own thread is the paved road. - A snapshot service (an
Arcswapped per version) for state a kernel publishes and blocks read lock-free. - A debug check for calls into application code that do not return at once (dispatch, request, load, assist), reported through the debug bridge.
- Bounded queues and cancellation where missing: the demo source’s queue (drop cancelled jobs), the tree’s inbox, PTY input, one waiting thread for actionable notifications.
- The delegated surface (section 4) in the viewport crate, then the
viewport’s tiles on it. Measured first as tiles rendered on the GPU
by the source (
TileSink::deliver_device, section 5.2): the interface thread’s tile cost goes from 12 ms to under 1 ms at p99. - egui-pop’s interface kernel on its own thread: not recommended (section 3.5); for the owner to decide.
Threading survey: how photo and desktop applications keep the UI responsive
This survey feeds the threading design of egui-pop (immediate-mode UI on egui) and Helios (node-based raw editor on wgpu). It looks at how established applications split work between the UI thread, processing threads and the GPU. For each one it asks the same six questions: where the state lives, whether the UI blocks, whether there is a low-resolution path, how tiles are scheduled and cancelled, how GPU work reaches the screen, and what changed over time.
Sources are cited as repository-relative file paths with line ranges (and the commit or branch read), or as URLs. Line numbers drift; they are given so a reader can find the passage, not as a stable API.
Not checked against a source. A few statements come from general knowledge rather than a file or page opened for this survey; check them before relying on them:
- Krita’s 64×64 tiles and its use of
glTexSubImagefor canvas updates; - Blender’s Cycles display driver, the draw manager rewrite and the Vulkan backend details;
- Rerun decoding video off the UI thread and showing the last decoded frame;
- ART keeping RawTherapee’s processing engine;
- every note on Affinity;
- the exact egui-wgpu API names.
Versions read:
- darktable: master-based tree at commit
ce9ccb225(October 2026), https://github.com/darktable-org/darktable. - vkdt: commit
afc3425(October 2026), https://github.com/hanatos/vkdt. - RawTherapee:
devbranch (October 2026), https://github.com/RawTherapee/RawTherapee. - GIMP:
master(October 2026), https://gitlab.gnome.org/GNOME/gimp. - Krita:
master(October 2026), https://invent.kde.org/graphics/krita. - Blender, Zed/GPUI, Rerun, Adobe and Affinity: public docs and source, URLs inline.
Comparison table
| Application | Where the state lives | UI blocks on processing? | Low-res preview path | Tile / region scheduling and cancellation | GPU to screen |
|---|---|---|---|---|---|
| darktable | GUI thread owns dt_develop_t and history; pipes copy params under history_mutex | Briefly: backbuf_mutex in expose, history_mutex on sync. Never for a full run | Yes: a separate always-whole-image preview pipe at small scale, drawn as fallback | No tiles for display: full pipe renders only the visible ROI; restart via atomic shutdown flag checked between modules | OpenCL compute, result copied to host backbuf, painted by Cairo on the GTK thread |
| vkdt | Main (render) thread owns the graph; graph runs are recorded and submitted from it | No: GPU runs async, double-buffered display images | Not as a second pipe; whole graph is fast enough on GPU at full res; thumbnails at low res | No tiling; re-run from the changed module (runflags); the GPU finishes, results are just superseded | Graph output stays on the GPU, sampled directly by the UI renderer (no readback) |
| RawTherapee / ART | ImProcCoordinator owns params; GUI posts nextParams + change mask | No: processing in a coordinator thread; results posted via idle callbacks | Yes: main preview at a reduced “skip” scale; detail windows (crops) at 1:1 | Crops are ROIs, not tiles; updates coalesced with “pending” flags, no mid-run cancel | CPU only; pixbufs handed to GTK on the main loop |
| GIMP + GEGL | Main thread owns the image and the GEGL graph | Partly: projection is rendered in main-loop idle chunks sized to ~1/15 s; GEGL parallelises each chunk | Yes: GEGL buffer mipmap levels when zoomed out; canvas render cache | Chunk iterator with a priority rect (the viewport) served first; chunks can be stopped and the leftover region kept | CPU render into a Cairo surface cache, then GTK draw |
| Krita | KisImage and nodes, mutated only through strokes on the update scheduler’s worker threads | No for painting; some global operations take an exclusive lock and show a busy state | Yes: Instant Preview (level-of-detail strokes) paints on a downscaled copy, full-res catches up | Strokes queue with job types (sequential, concurrent, barrier, exclusive); updates by dirty rect; strokes cancellable with revert | Workers convert dirty tiles into texture update info; GUI thread uploads to OpenGL tile textures |
| Blender | Main thread owns original DNA; depsgraph evaluates a copy-on-write copy | Yes for depsgraph evaluation (parallel inside, but synchronous to the UI); no for wmJobs and render engines | Viewport render “start resolution” / pixel size; progressive refinement in Cycles | Cycles restarts the session on change; wmJobs are replaced per owner and asked to stop | Draw manager on the main thread; Cycles uploads its buffer to a texture through a display driver |
| Lightroom / Photoshop / Affinity | Not public in detail | Documented as asynchronous for previews; Photoshop has background save | Lightroom Smart Previews and preview cache; Photoshop cache levels (image pyramid) | Photoshop tile size setting; details not public | GPU display and processing toggles (Lightroom, Photoshop); Metal/DirectX compute (Affinity) |
| Zed GPUI | Main thread owns all entities in App; !Send foreground executor | No by convention: heavy work goes to the background executor and returns via the main-thread executor | n/a | Tasks are futures; dropping a Task cancels it | Scene built on main thread, rendered by the platform renderer each frame |
| Rerun (egui) | UI thread owns the viewer state; ingestion on background receivers | No: the store is queried every frame; ingestion and decoding are off-thread | Level-of-detail for large point clouds/plots; shows the last decoded video frame | Per-frame queries; work superseded rather than cancelled | re_renderer on wgpu, drawn inside egui via paint callbacks |
Per-application notes
darktable
Threads. darktable runs GTK on a single GUI thread and a pool of job
workers. src/control/jobs.h lines 27-52 define three reserved workers, one
per display pipe (DT_CTL_WORKER_ZOOM_1 for the full pipe, ZOOM_FILL for the
preview pipe, ZOOM_2 for the second window), plus five prioritised queues for
the general pool (user foreground, system foreground, user background, export,
system background). The scheduler in src/control/jobs.c lines 251-275 picks
the highest-priority queue head and ages the losers. Adding a job that already
sits in a queue moves it to the top instead of duplicating it, and queues are
capped at 30 jobs with the oldest discarded (jobs.c lines 440-480). Reserved
workers sleep on a condition variable (jobs.c lines 506-535).
State. The develop state (dt_develop_t, history stack, module params)
lives on the GUI thread. A pipe run copies parameters into its own per-node
“pieces” under dev->history_mutex (src/develop/pixelpipe_hb.c lines
898-937, dt_dev_pixelpipe_change). The pipe never reads live GUI state during
processing, which is what makes restarting safe.
Three pipes. src/develop/develop.c lines 296-330 schedule the full pipe,
the preview pipe and the second-window pipe as separate jobs on their reserved
workers. The preview pipe processes the whole image at small scale; the full
pipe processes only the visible region of interest at the current zoom. While
the full pipe is not ready, the view paints the preview pipe’s buffer, scaled,
as a fallback (src/views/view.c lines 1990-2010).
Cancellation. There is no per-tile cancellation. A pipe has an atomic
shutdown field set by dt_dev_pixelpipe_set_shutdown (pixelpipe_hb.c
lines 409-425). The recursive processor checks it between modules
(_module_pipe_stop, pixelpipe_hb.c lines 1461-1530) and long modules can
poll dt_dev_piece_shutdown (lines 1534-1552). The image job then restarts
from the top (develop.c lines 887-945). A recent refinement avoids
wasteful restarts: if a parameter change arrives less than half an average run
after the pipe started, the running pipe is not stopped, and the next run is
simply queued (develop.c lines 283-305, “How do we handle UI responsiveness”).
Some stop reasons are ignored when the pipe is close to finishing, since a
result that is slightly stale but visible is better than none
(pixelpipe_hb.c lines 1474-1508).
Cache. Each pipe keeps a per-module output cache keyed by a hash of
params and ROI; lines are weighted, and outputs of modules flagged as
“important” (the one being edited) are protected from eviction
(src/develop/pixelpipe_cache.c lines 199-297, 400). A slider drag therefore
re-runs only from the edited module down.
GPU. OpenCL devices are locked per pipe type with a configurable priority
list per pipe (image, preview, export, thumbnail, preview2). A pipe that does
not get its preferred device falls back to the CPU, or for “mandatory”
devices retries every 5 ms up to a timeout (src/common/opencl.c lines
1843-1979 for the priority parsing, 2012-2105 for dt_opencl_lock_device).
Results are always copied back to host memory: the pipe’s final buffer is
memcpy’d into pipe->backbuf under backbuf_mutex (pixelpipe_hb.c lines
3607-3639, with a FIXME about copying), and the GTK expose handler locks the
same mutex to paint it with Cairo (src/views/darkroom.c lines 576-592,
src/views/view.c lines 1861-2037). Signals raised from workers are marshalled
to the GUI thread with g_main_context_invoke_full (src/control/signal.c
lines 378-392).
Where the UI blocks. Never on a whole pipe run, but in a few short
critical sections: the expose handler waits on backbuf_mutex while a worker
copies a frame; history edits take history_mutex, which a pipe holds while
syncing pieces; leaving darkroom waits for running pipes (develop.c lines
185-200).
Change over time. The second-window pipe (preview2) was added later with its own reserved worker. OpenCL scheduling evolved from “first free device” to per-pipe priority lists with mandatory devices and scheduling profiles (see the darktable user manual, “memory & performance” preferences, https://docs.darktable.org/usermanual/development/en/preferences-settings/processing/). The shutdown mechanism grew from a boolean into a set of stop reasons with rules for ignoring late requests. The pixelpipe cache moved from a fixed number of lines to memory-based limits with “important” lines. The remaining pain points are visible in code comments: host round-trips for display, and pipe restarts that waste work.
vkdt
vkdt is Johannes Hanika’s GPU-first successor to darktable’s processing
model: every processing node is a Vulkan compute shader, and the whole DAG is
scheduled as one command buffer (src/pipe/readme.md; “this complete DAG of
all atomic nodes directly translates into vulkan/glsl with one compute shader
per node”).
State and threads. The GUI thread (GLFW + Nuklear in current versions;
early versions used Dear ImGui) owns the graph and decides each frame what to
re-run through a runflags bit set: recompute ROIs, re-create nodes,
re-allocate, re-record the command buffer, upload the source, download sinks,
wait for the fence (src/pipe/modules/api.h lines 24-37). A parameter change
usually only needs s_graph_run_record_cmd_buf, re-running from the changed
module onwards.
UI never blocks. src/gui/render_darkroom.c lines 1247-1258 run the graph
“double buffered async”: the graph is submitted without waiting for the fence,
on whichever of two output buffers the display is not currently using, and only
if dt_graph_display_have_free_process says one is free. Otherwise the request
stays in runflags for the next frame, which coalesces changes naturally.
src/gui/graph-display.h lines 1-23 explain the buffer protocol: the render
thread locks at most one buffer, and a third one may be needed briefly when the
graph topology (and thus image size) changes.
GPU to screen. The output never leaves the GPU: the display node’s image is sampled by the UI renderer in the same Vulkan device. This is the main structural difference from darktable.
Low-res path and tiles. There is no separate preview pipe and no tiled
display rendering; the design relies on the GPU processing the full image fast
enough per interaction. Thumbnails for the lighttable are generated by
background tasks on a small thread pool (src/db/thumbnails.c around line 400,
threads_task("thumb", ...)), tagged with a job timestamp so stale results are
ignored. Exports also run as thread-pool tasks
(src/gui/render_lighttable.c line 593).
Lesson. When the whole graph fits on the GPU, a single owner thread that records command buffers and never waits on fences gives responsiveness without any locking of image data. The cost is memory: everything is allocated up front in one big allocation per graph.
RawTherapee and ART
ART is a fork of RawTherapee and keeps the same engine structure
(ImProcCoordinator, crops), so the notes below apply to both.
State and threads. The GUI writes new parameters into nextParams and
ORs a change code into changeSinceLast, then calls startProcessing, which
spawns the coordinator thread if it is not already running
(rtengine/improccoordinator.cc lines 3491-3515). The coordinator’s
process() loops while changeSinceLast is non-zero, copying nextParams
into its working params at the start of each loop (lines 3517-3570). This is a
classic “latest wins” mailbox: intermediate slider values are dropped, and the
running pass is never interrupted.
Low-res path. The main preview is computed from the raw at a reduced
scale (“skip” factor), which keeps the editor interactive. Detail windows
(the 1:1 crop windows, and the main view when zoomed to 100%) are Crop
objects that process only their region at skip == 1
(rtengine/dcrop.cc lines 160-250).
Crops. Each crop is updated by the coordinator when a change affects it
(improccoordinator.cc lines 2749-2753), or by its own low-priority thread
when the user pans (rtgui/crophandler.cc line 453). Crop::tryUpdate and
Crop::fullUpdate (dcrop.cc lines 2237-2286) coalesce requests with an
updating / newUpdatePending pair: a request during an update only sets the
pending flag, and the running thread loops once more. Some expensive tools
(noise reduction) are computed tile-wise inside the crop, and the preview
shows an approximation computed on representative tiles.
To screen. Results are converted to 8-bit pixbufs and handed to GTK
through an idle callback (rtgui/crophandler.cc lines 303-420, idle_register).
There is no GPU path.
Known issues. The preview at reduced scale is not exactly the full result for scale-dependent tools (sharpening, noise reduction), which is why RawTherapee tells users to judge such tools in a 1:1 detail window (RawPedia, https://rawpedia.rawtherapee.com/Editor). The mailbox model also means a long pass (for example wavelets on a large file) delays the next update by up to a full pass.
GIMP with GEGL
State. The image, its layers and the GEGL graph live on the main thread. GEGL itself parallelises processing of a requested rectangle across a thread pool, but the request is made from the main thread.
Projection. app/core/gimpprojection.c lines 505-525 state the contract:
requesting a render is thread-safe, but “the actual projection painting will
happen in the main thread”, in chunks scheduled from a high-priority idle
source. GimpChunkIterator (app/core/gimpchunkiterator.c lines 38-54)
dispenses rectangular chunks whose size adapts so that each iteration takes
about 1/15 s (DEFAULT_INTERVAL), with power-of-two sides and a short history
of measured throughput. UI events are handled between iterations, never during
one (commit “app: add GimpChunkIterator”, January 2019,
https://lists.gnome.org/archives/commits-list/2019-January/msg04994.html;
adaptive chunk size,
https://mail.gnome.org/archives/commits-list/2019-July/msg10864.html).
Priority and cancellation. The iterator has a priority rect, set to the
visible viewport (gimp_projection_set_priority_rect, gimpprojection.c lines
483-493, 670-692). The iterator first exhausts the intersection of the dirty
region with the priority rect, then the rest (gimpchunkiterator.c lines
167-212). Stopping an iteration returns the unprocessed region so it can be
merged into the next one (gimpprojection.c lines 786-820): pan and zoom move
the priority rect instead of discarding work.
Low-res path and display. GEGL buffers have mipmap levels, so a
zoomed-out view renders at a lower level. The canvas keeps a Cairo surface
“render cache” with a valid region; exposes paint from the cache and only
missing chunks are rendered (app/display/gimpdisplayshell-render.c lines
70-250).
Change over time. GIMP 2.10 moved to GEGL with high bit depth and made the
projection asynchronous in chunks; later work (by the developer Ell in
2018-2019) added the adaptive chunk iterator, the render cache and
gimp_parallel_run_async for work such as histograms and font loading.
The design stays main-thread-centric: GEGL tiles are parallel, but scheduling
is in the GTK main loop, so a very slow single chunk (a large area filter)
still stalls the UI; the July 2019 commit raises the interval for area filters
precisely because they are sensitive to chunk size.
Krita
State. KisImage and its nodes are only mutated through strokes run by
KisUpdateScheduler on worker threads. The scheduler interleaves two queues:
strokes (user actions) and updates (recomposition of dirty rects), balanced by
a simple metric (Krita developer docs, “Strokes queue”,
https://docs.krita.org/en/untranslatable_pages/strokes_documentation.html).
Stroke strategies. A stroke strategy creates init, dab, cancel and
finish jobs. Dab jobs are SEQUENTIAL (no reordering, e.g. freehand),
CONCURRENT (any order in parallel, e.g. scaling each layer), or BARRIER (waits
for all pending updates). The EXCLUSIVE property blocks every other stroke and
update. Strokes can be cancelled at any time: unstarted jobs are dropped and a
cancel job reverts done work, which is why undo commands are registered only
after execution (KisPostExecutionUndoAdapter). A running job is never
interrupted (libs/image/kis_update_scheduler.cpp lines 193-202).
Low-res path. Instant Preview (formerly “level of detail strokes”, funded
by the 2015 Kickstarter) runs a stroke first on a downscaled copy of the image
(LOD N) for immediate feedback, then replays it at full resolution (LOD 0) in
the background (https://docs.krita.org/en/reference_manual/instant_preview.html;
kis_update_scheduler.cpp lines 215-278 for the LOD sync hooks). Known costs:
a visible “pop” when the full-res result differs (auto spacing, texture
brushes), and corner cases such as vector selections that cannot be previewed
(https://mail.kde.org/pipermail/kimageshop/2020-October/016062.html).
Tiles and canvas. Paint devices are tiled (64x64 copy-on-write tiles,
KisTiledDataManager, with a swapper to disk). The OpenGL canvas holds the
image as a grid of textures. When the image updates, sigImageUpdated is
connected with Qt::DirectConnection (libs/ui/canvas/kis_canvas2.cpp line
815), so startUpdateCanvasProjection runs on the worker thread: it converts
the dirty rect into display color space and prepares texture tile data
(kis_canvas2.cpp lines 1055-1061;
libs/ui/opengl/kis_opengl_image_textures.cpp lines 274-291). The result is
queued into a compressor; the GUI thread later takes all pending infos, uploads
them with glTexSubImage, and issues one repaint (kis_canvas2.cpp lines
1063-1100). Updates are throttled by signal compressors (lines 184-256).
Change over time. The strokes framework replaced direct, locking edits in the Krita 2.x era; the LOD system arrived in Krita 3.0 (2016); the region of interest for updates and multiple compressors were added to keep large canvases responsive. Exclusive strokes (e.g. some transforms and global filters) are still the place where the UI shows a busy cursor.
Blender
State. The main thread owns the original data (DNA). Since 2.80 the dependency graph evaluates a copy-on-write copy: “Dependency graph always performs evaluation on a copy of original data”; render engines and viewports read only evaluated data, which is “the way to solve threading conflicts between render and viewport threads” (https://developer.blender.org/docs/features/core/depsgraph/).
UI blocking. Depsgraph evaluation runs on the main thread’s event loop
iteration, parallelised internally with a task pool (TBB), but synchronous to
the UI: a heavy geometry-nodes tree or modifier stack freezes the interface
until evaluation ends. Long work that is meant to be asynchronous goes through
wmJob: startjob runs on a worker thread, while initjob, update, free
and endjob run on the main thread, update at most once per timer step;
jobs never draw, they send notifiers; a new job for the same owner signals the
running one to stop and reuses it (source/blender/windowmanager/WM_api.hh
callback comments; “Cleanup: Comments of wmJobs callbacks”, 2020,
https://lists.blender.org/pipermail/bf-blender-cvs/2020-March/137316.html).
Low-res path. The Cycles viewport starts at a reduced “start resolution” (pixel size) and refines progressively, sample by sample. Any change resets the session, which restarts at low resolution.
GPU to screen. The draw manager draws on the main thread (the GPU context
is single-threaded). Cycles renders in its own session thread and pushes its
buffer through a DisplayDriver (intern/cycles/session/display_driver.h;
Blender’s implementation in intern/cycles/blender/display_driver.cpp), which
maps a pixel buffer and updates a texture, using a separate GPU context, so
the main thread only draws a textured quad.
Change over time. The 2.80 copy-on-write depsgraph replaced evaluation on original data and enabled threaded render alongside the viewport. The draw manager was rewritten (“draw manager next”, with multithreaded mesh batch extraction) and a Vulkan backend was added in the 4.x series. Shader compilation moved to parallel workers to avoid UI hitches. The synchronous depsgraph remains the main source of UI freezes.
Lightroom, Photoshop, Affinity (public information only)
- Lightroom Classic builds and caches previews (standard and 1:1) and can edit from Smart Previews, lossy DNGs about 2560 px on the long edge, which makes Develop responsive and works offline (https://helpx.adobe.com/lightroom-classic/help/lightroom-smart-previews.html). Develop shows the cached preview first and refines to a full render. GPU use is split into “display” and “image processing” settings (https://helpx.adobe.com/lightroom-classic/kb/lightroom-gpu-faq.html).
- Photoshop exposes its tiling: “Cache Levels” (a pyramid of downscaled copies used to redraw zoomed-out views quickly) and “Cache Tile Size” in Performance preferences, plus background saving since CS6 (https://helpx.adobe.com/photoshop/kb/optimize-performance-photoshop.html).
- Affinity Photo advertises live, non-destructive filters rendered on the GPU (Metal on macOS, Direct3D compute on Windows) with the result kept on the GPU for display. Internals are not documented publicly.
Immediate-mode GUIs with heavy backends
Zed GPUI. All entities are owned by a single App on the main thread;
handles reach state through App::update and read, and emit/notify
are deferred and flushed at the end of an update, which gives
run-to-completion semantics (https://zed.dev/blog/gpui-ownership). Async
work uses two executors (crates/gpui/src/executor.rs): ForegroundExecutor
is deliberately !Send and polls futures on the main thread, while
BackgroundExecutor runs Send futures on a thread pool. The pattern is
“spawn on background, await, then update the entity on the foreground”. A
Task is cancelled when dropped, so storing the latest task in an entity field
cancels the previous one automatically. Recent work replaces the executors’
internals with a shared scheduler crate while keeping the split.
Rerun. The viewer is an eframe/egui app on wgpu. Each frame the whole GUI
is laid out from scratch and views “query the in-RAM data store, massage the
results, and feed it to the renderer” (ARCHITECTURE.md,
https://github.com/rerun-io/rerun/blob/main/ARCHITECTURE.md). Data arrives
on background receiver threads; a “ui_waker” thread calls
request_repaint when a message lands (crates/viewer/re_viewer/src/lib.rs).
The renderer re_renderer assumes “most data may change every frame” and is
drawn inside egui through paint callbacks. Video frames are decoded off the UI
thread and the view shows the most recent decoded frame while the requested
one is pending. No threads on wasm32.
egui itself. egui::Context is Send + Sync; any thread may call
ctx.request_repaint() or ctx.load_texture(). With the wgpu backend, the
wgpu::Device and Queue are shareable across threads, so a worker can render
into its own wgpu::Texture and the UI registers it once as a native texture
(egui_wgpu::Renderer::register_native_texture) and then draws it as an
image; or a egui_wgpu::CallbackTrait paint callback can draw custom wgpu
passes inside the egui frame (https://docs.rs/egui-wgpu).
Patterns for egui-pop and Helios
Patterns that recur
-
The UI thread owns the editable model; workers get snapshots. darktable (params copied into pieces under a mutex), Blender (copy-on-write evaluated copy), RawTherapee (
nextParams), GPUI (entities on the main thread). Processing never reads live UI state. For egui-pop and Helios this means the document (node graph, params, history) is plain data on the UI thread, and a run receives an immutable, cheaply cloned snapshot (Arcof the graph plus a generation number). -
Latest-wins mailbox instead of a queue of edits. RawTherapee’s
changeSinceLast, Krita’s update compressors, vkdt’srunflags, darktable’s “move duplicate job to top”. Slider drags produce dozens of changes per second; only the newest matters. One slot per pipe, a generation counter, and stale results dropped on arrival. -
A separate low-resolution preview pipe. darktable’s preview pipe, RawTherapee’s scaled preview, Krita’s Instant Preview, Lightroom’s Smart Previews, Cycles’ start resolution. The cheap result is shown first and kept as a fallback under the expensive one. Helios should run a small whole-image pipe and a viewport pipe; the view composes “full ROI if valid for this zoom, else scaled preview”. Known cost: scale-dependent nodes (sharpening, denoise) differ between the two, so the UI must say which one is shown.
-
Viewport-first scheduling, keep the leftovers. GIMP’s priority rect is the clearest model: pan and zoom move the priority rect, the leftover dirty region is kept rather than discarded. darktable renders only the visible ROI; Krita converts only dirty rects. For Helios tiles: a dirty-region set per zoom level, served visible-first, nearest-to-centre next.
-
Cooperative cancellation at node boundaries, with hysteresis. Nobody kills a running kernel. darktable checks an atomic flag between modules and lets long modules poll; Krita never interrupts a running job; GPUI cancels at await points. darktable’s later rule is worth copying: do not cancel a run that is close to done, since a stale frame now beats a fresh one later.
-
Cache per node output, keyed by a hash of inputs. darktable’s pixelpipe cache with “important” lines for the edited module, vkdt re-running from the changed module. A slider drag on node N re-runs only from N.
-
Results reach the UI thread by message plus repaint request. darktable via
g_main_context_invoke, RawTherapee via idle callbacks, Blender via notifiers, Rerun viarequest_repaint. Workers never touch widgets. -
Worker-side preparation, UI-side upload or no upload at all. Krita prepares texture tiles on workers and uploads on the GUI thread; Cycles uploads through its own context; vkdt keeps the image on the GPU and the UI samples it. On wgpu, the vkdt model is directly available: the processing thread writes into a wgpu texture on the shared device, and egui draws it through a registered native texture id. Double (sometimes triple) buffering of the display texture, as in vkdt’s
graph-display.h, avoids the UI waiting for the GPU or the worker overwriting a texture being sampled.
Patterns that fail or cost
- Processing on the UI thread, even chunked. GIMP shows the limit: a
chunk that takes longer than expected (area filters) stalls input. Blender’s
synchronous depsgraph is its main freeze source. In egui this is worse:
any blocking in
update()freezes every widget and the repaint loop. - Host round-trips for display. darktable copies the GPU result to a host
backbufand paints with Cairo, with aFIXMEon the copy. For Helios on wgpu, reading back to the CPU only to upload again to egui doubles memory traffic; keep display output on the GPU. - Shared mutable buffers guarded by a mutex the UI also takes. darktable’s
backbuf_mutexandhistory_mutexare short but are exactly where the GTK thread can wait on a worker. Prefer handing over ownership (swap anArc, or a texture index) over locking. - Restart storms. darktable needed restart counters (“LOOPING”) and rules to ignore late stop requests; RawTherapee’s no-cancel mailbox delays updates by a full pass. Both extremes hurt; cancel at node boundaries, with a “nearly done” exception.
- One global exclusive lock. Krita’s exclusive strokes and darktable’s pipe-wide mutex serialise everything; needed for topology changes, but they should be rare and visible (busy state), never on parameter edits.
- Preview and full results disagreeing silently. Krita’s “pop”, RawTherapee’s advice to check 1:1 crops. The UI should label which resolution is displayed and swap without flicker.
Fit for an egui app
- Kernel thread: fits. The egui
update()loop stays the owner of the model and of egui state; a “kernel” thread (Helios’s processing scheduler) owns the graph runtime, caches and wgpu command recording, and talks to the UI only through channels: snapshots in, results and progress out, withrequest_repainton arrival. This mirrors GPUI’s foreground/background split and vkdt’s single recording thread. - Preview pipe: fits and is cheap to add given a node graph: the same graph instantiated at a lower scale, scheduled at higher priority.
- Tile priority and cancellation: fits as GIMP-style priority regions plus darktable-style cooperative checks at node boundaries. Dropping a task handle (GPUI style) is a clean Rust idiom for “this request is obsolete”.
- Worker-rendered textures: fits well on wgpu (shared device, native texture registration, double buffering). On the egui glow backend it does not: OpenGL contexts are thread-bound, so the Krita model (prepare on worker, upload on UI thread) would be needed there.
- Fails in egui: anything that blocks inside
update()(waiting on a fence, a mutex held by a worker, or a synchronous evaluation), and per-widget locking of shared state, since immediate mode re-reads everything every frame.
File dialogs survey: what makes a good file picker
This survey feeds the in-app file picker of egui-pop (Choosing files). It compares the system dialogs (GTK and the desktop portal, KDE, Windows, macOS) and the applications that draw their own browser (Blender, darktable, Lightroom, JetBrains IDEs, VS Code, Total Commander, file managers), asks what each does about layout, preview, search, places, keyboard, saving, selection and remembered state, and ends with a ranked list of changes for egui-pop’s picker. egui-pop’s main user is a photo editor, so photo workflows weigh in the ranking.
Read on 2026-10-29. Behaviour quoted from bug trackers and forums is marked as such; it may have changed since.
Summary
- A dialog keeps its size; panes share it. Every system that has a preview pane (KDE’s F11 pane, the Windows Explorer preview pane, Finder’s preview column, Dolphin’s information panel) puts it inside the window and takes the room from the file view, behind a splitter. None grows the window when the pane appears. KDE’s long trail of bugs about a preview pane that “makes itself bigger” each time the dialog opens shows what people think of a pane that changes the dialog’s size. egui-pop’s picker widens its modal by the pane’s width when the preview is on: it should keep its width and narrow the list.
- The dialog is sized by the person, and remembered. GTK stores the
dialog’s size, the sidebar’s width, the view, the sort and hidden
files in its settings; Windows remembers the last folder per purpose
(
SetClientGuid), macOS per panelidentifier. egui-pop’s picker is a fixed 640-point modal with a list 280 points high. - Two ways in, one field. All good dialogs let the person either
browse (click, arrows) or type (a path, a name). Where they fail is
when typing has three meanings: GTK turned off type-ahead in 3.16
because it was “the third kind of navigation entry … after the
location entry and search, and it interacts badly with both”; Nautilus
replaced type-ahead with recursive search and people have patched it
back for ten years. egui-pop’s single field (a fuzzy filter that
becomes a path with
/or~,Tabcompletes) is already the pattern that avoids this; keep it. - Photo pickers are grids. GTK waited 18 years (2004 to GTK 4.10) for a thumbnail grid in its chooser; that wait is the most quoted complaint about it. Lightroom’s and darktable’s import dialogs, Blender’s browser and every file manager offer thumbnails with a size control. egui-pop’s picker shows names only, with one preview at a time.
- Saving has rules everybody follows: a proposed name with its stem selected, the extension following the chosen type, a confirmation before replacing a file, a button to create a folder. egui-pop’s picker has none of the last three.
- Photo specifics: RAW and JPEG (or RAW and XMP sidecar) shown as one item (Lightroom’s default, darktable’s sidecars, digiKam’s grouping), ratings and EXIF in the preview, “only new” in an import. The picker can carry the first two through hooks; the third belongs to the application’s import, not to a picker.
egui-pop today
From the code on main (crates/egui-pop-api/src/files.rs and
files/):
- A modal (
OverlaySpec::width) 640 points wide, pluspreview::PANE_WIDTH(240) when the preview is on; it is not resizable and its list is 280 points high. - Top: an Up button, a Bookmark button and the folder as monospace text.
Then one field: a fuzzy filter, or a path when it holds
/or starts with~;Tabcompletes, completions show as small buttons. - Left (150 points): Home, Recent places, Bookmarks.
- Middle: one name per row, folders first then files, sorted by name (case-insensitive, not natural). A single click on a folder enters it; on a file it highlights, toggles (choosing several) or copies the name into the field (saving).
- Right: the preview pane (providers off the interface thread, cached),
Alt+Por a check box, remembered infiles.preview. - Bottom: the type filter (combo), Hidden files, Preview, the verb and Cancel.
- Keys: arrows, Enter (enter a folder or choose), Backspace in an empty
field or
Alt+Up(parent),Ctrl+Enter(accept),Ctrl+Space(select, several),Ctrl+D(bookmark), Escape. - Saving: Enter in the name field chooses
folder/nameat once; no extension is added, an existing file is replaced without a question, and there is no way to create a folder.
The systems
GTK 4 and the desktop portal
- Layout. Places sidebar; a path bar of buttons that becomes a
location entry with
Ctrl+L, or when/or~is typed (thelocation-popupsignal’s default bindings, docs). A list with columns (name, size, type, modified; a sortable Type column since 2019), and since GTK 4.10 a grid with thumbnails (GTK blog, “A grid for the file chooser”; the request was bug 141154, opened in 2004). - Preview. GTK 4 removed the application preview widget of GTK 3,
because a sandboxed (portal) chooser cannot draw the application’s
widget; the advice is to embed a
GtkFileChooserWidgetand put one’s own preview beside it (GNOME Discourse). - Typing. Typing in the list starts a search (recursive, through the
indexer when present). Type-ahead was turned off in 3.16
(commit);
the complaints and the distribution patches restoring it ran for
years (Launchpad 1592177,
patch thread),
and the GTK 4 entry had its own bugs where
~searched instead of opening the location entry (issue 4911). - Remembered. The
org.gtk.gtk4.Settings.FileChooserschema keepswindow-size,sidebar-width,sort-column,sort-order,view-type(list or grid),show-hidden,sort-directories-first(schema).Ctrl+Htoggles hidden files. - Saving.
GtkFileDialogtakesinitial-name,initial-folder,initial-file, filters and an accept label (docs); GTK 4’s chooser always confirms an overwrite. - Portal.
org.freedesktop.portal.FileChooserpasses filters, a current filter,choices(combos and check boxes the dialog shows for the application),current_name,current_folder(which “the portal implementation is free to ignore”),current_file,directory,multiple;SaveFilessaves several names into one folder (spec). No preview, no per-purpose memory.
KDE (KFileWidget, Dolphin)
- Layout. Places panel; a breadcrumb navigator that becomes an
editable path (
Ctrl+L); icon, compact and detailed views with a zoom slider; a filter combo and a name field at the bottom. - Preview. An aside preview pane toggled with F11 (inline thumbnails with F12), inside the dialog behind a splitter (D10314). Its size has been a recurring bug: the pane grew each time the dialog opened (bug 185764, bug 160400), the places panel crept by a pixel per opening (D12592), and in 2026 people still report the pane opening at nearly the whole window and its size not kept (KDE Discuss). The lesson is twofold: the pane belongs inside a fixed window, and its width must be stored and restored exactly.
- Dolphin has the same Information panel (F11): preview, then metadata (size, dates, rating, tags, image dimensions), as a panel that narrows the view.
Windows (Common Item Dialog, Explorer)
- Layout. Navigation pane, a breadcrumb address bar that becomes
editable when clicked, Explorer’s views (details, list, icons of
several sizes), a name field and a type combo at the bottom. The
dialog hosts Explorer’s view, so sorting, columns and natural sort
(
StrCmpLogicalW: “3.txt” before “10.txt”) are Explorer’s. - Remembered. The dialog opens in the last folder used; since Vista
per purpose with
SetClientGuid, because “a video editing application would present the same folder in the Render As dialog as it would in the Import Media dialog”. Microsoft advisesSetDefaultFolder(first time only) overSetFolder(always), which hides the last location (Common Item Dialog). - Saving.
FOS_OVERWRITEPROMPTis on by default; the default extension is appended to a typed name and follows the chosen type (“If the user chooses a different file type, the extension automatically updates”).SetSaveAsItemopens in the edited document’s folder with its name. - Application controls.
IFileDialogCustomizeadds check boxes, combos, radio lists and choices on the Open button (“Open as read-only”);OnFileOklets the application refuse a choice and keep the dialog open. - Preview pane. In Explorer,
Alt+Pshows a preview pane on the right that narrows the file view (NinjaOne); the window keeps its size. - Typing in the list. By default typing selects the first item whose name starts with the letters; a Folder Options setting sends them to the search box instead (NinjaOne).
macOS (NSOpenPanel, NSSavePanel, Finder)
- Layout. Sidebar; icon, list, column and gallery views. In column
view the last column previews the selected file; Space opens Quick
Look from an open panel as from Finder
(Apple Community).
Typing
/or~opens “Go to Folder”, where Tab completes;Cmd+Shift+.shows hidden files (Macworld). - Saving. The save panel opens collapsed (name, tags, location
popup) and expands to a full browser (
isExpanded); it has a New Folder button (canCreateDirectories), a “Hide extension” box (canSelectHiddenExtension,isExtensionHidden), a format popup (showsContentTypes),allowsOtherFileTypes, anaccessoryViewfor the application’s options, and anidentifierunder which the panel keeps its state (NSSavePanel). - HIG. “Use the default file browser unless you have an important reason to create a custom one”; a custom one should let people reach the whole file system even if it opens on the most relevant place, offer recent items, filters and multiple selection, name the Open button after the task (“Insert”), and give the save interface a name, a format and a location; extensions are hidden by default but people can show them (Human Interface Guidelines, File management).
Blender’s file browser
- Layout (manual): a path region on top (back, forward, parent, refresh, new folder, path, search, display mode and settings), a source list on the left (Volumes, System, Bookmarks, Recent), the files, an execution region at the bottom (name, Cancel, the verb), and on the right the calling operator’s options (an import’s settings live in the browser).
- Views. Vertical list, horizontal list, thumbnails, with a Display Size; sort by name, extension, date or size; recursion of one to three levels shown flat; filters by type, hidden files.
- Keys.
Ctrl+Fsearch (wildcards), Backspace orAlt+Leftback,PorAlt+Upparent,Ctrl+Ledit the path with Tab completion, Tab completion in the name field,+and-change the trailing number of the file name (saving numbered versions).
darktable’s import dialog
- Three panes: places (home, pictures, mounted devices;
+and-), a folder tree from the place’s root, and the folder’s files, all selected at first. Thumbnails on demand (an eye icon per file). “Select only new” (not yet in the library), “recursive directory”, “ignore non-raw images”, a “from XMP” column, rating and metadata to apply. The last place and folder come back; Enter imports (manual). - Forum reports ask for faster listing and for choosing several folders at once (pixls.us).
Lightroom Classic’s import window
- Source panel (devices, folders, “include subfolders”), a grid of thumbnails with a check box each and a Thumbnails size slider, a loupe on one image, sort, and on the right the destination and options; a compact window without thumbnails (Adobe help).
- Files already in the catalogue show greyed out when “Don’t import suspected duplicates” is on (Adobe Community).
- RAW and JPEG of the same name become one photo, the JPEG a sidecar, unless “Treat JPEG files next to raw files as separate photos” is set (Adobe help). digiKam groups such pairs on demand (“Group Selected by Filename”) and hides declared sidecar extensions as part of the main file (digiKam docs).
JetBrains IDEs, VS Code, Sublime Text
- JetBrains’ chooser: a tree with a path field above it (
Ctrl+Phides or shows it), a toolbar toggle for hidden files, and dropping a file from the system’s file manager onto it navigates there (IntelliJ IDEA 2017.2 help). - VS Code’s simple dialog (
files.simpleDialog.enable, and the dialog of remote workspaces): a quick pick where one types a path, segment by segment, with completion; a missing folder can be created (“Would you like to create it?”); it was turned on for automation because “native macOS dialogs cannot be driven” by tools (PR 318488). This is egui-pop’s field, and its reason (an agent answers it) is egui-pop’s. - Sublime’s and VS Code’s Quick Open (
Ctrl+P): fuzzy matching over the whole project, not one folder. It suits a known project; a picker starting in a folder of photos does not need it.
Total Commander, Far, Nautilus
- Total Commander separates quick search (
Ctrl+Altand letters: jump to the next match) from quick filter (Ctrl+S: hide what does not match), and lets the person switch and remember which (forum). Far Manager works the same way (Altand letters). - Nautilus removed type-ahead in 2013 for a recursive search; the request to bring it back (issue 466, issue 1371) and patched builds (Linux Uprising) never went away.
Compared
| GTK 4 / portal | KDE | Windows | macOS | Blender | darktable import | Lightroom import | egui-pop today | |
|---|---|---|---|---|---|---|---|---|
| Views | list, grid (4.10) | icons, compact, details | details, list, icons | icons, list, columns, gallery | lists, thumbnails | files list + on-demand thumbnail | grid, loupe | names only |
| Thumbnail size | no | zoom slider | icon sizes | slider | Display Size | no | slider | no |
| Preview | none (app widget removed) | F11 aside pane, splitter | Explorer Alt+P pane | column view’s last column, Quick Look | thumbnails | eye icon | loupe | aside pane, Alt+P |
| Preview changes window size | no | no (bugs where the pane grew) | no | no | no | no | no | yes, +240 points |
| Path | path bar, Ctrl+L, /, ~ | breadcrumbs, editable | breadcrumbs, editable | Go to Folder on /, ~ | path field, Ctrl+L | folder tree | source panel | text label + field |
| Typing in the list | recursive search | jump | jump (or search, a setting) | jump | Ctrl+F filter | no | no | fuzzy filter in one field |
| Places | sidebar, bookmarks, recent | places panel | navigation pane, AddPlace | sidebar | bookmarks, system, volumes, recent | places + tree | sources | home, recent, bookmarks |
| Sort | columns, folders first (setting) | columns | columns, natural | columns | name, extension, date, size | name | capture time, name… | name, folders first |
| Save: extension | follows filter | auto-extension option | appended, follows type | hide extension box | n/a (operator) | n/a | n/a | not added |
| Save: overwrite question | always | yes | FOS_OVERWRITEPROMPT | yes | yes | n/a | n/a | no |
| New folder | yes | yes | yes | yes | yes | no | yes (destination) | no |
| App options in the dialog | portal choices | custom widget | IFileDialogCustomize | accessoryView | operator options | the import’s own | options panels | inline mode only |
| Remembered | size, sidebar, view, sort, hidden | size, view, pane width | last folder per GUID | state per identifier | per operator | last place and folder | last source | preview on/off, recent, bookmarks |
| Sidecars as one | no | no | no | no | no | XMP read on import | RAW+JPEG one photo | no (now: a hook, item 9) |
What egui-pop’s picker should take, ranked
Sizes: S is under a day, M a few days, L a week or more. The layering
note matters for several items: the picker lives in egui-pop-api (L3),
the data table in egui-pop-views (L4) and the thumbnail grid in
egui-pop-core (L2, moved down from egui-pop-viewport for item 6);
reuse means moving shared drawing down or the picker up, which is a
decision of its own (item 7 moved the header’s drawing down, not the table).
- Keep the dialog’s size when the preview is toggled; the preview
takes its room from the list. The modal’s width stops depending on
show_preview; the row beside the places splits its width between the list and the pane, and the pane’s width is a share (a default such as 35 %, with a minimum list width under which the pane is hidden rather than the list crushed). Every system in this survey does it this way; KDE’s bugs show the cost of not doing it. Size: S. - A resizable dialog whose size, pane widths and view are
remembered. The list’s 280-point height and the 640-point width
become the default of a size the person drags, stored with the
settings (as GTK’s
window-sizeandsidebar-width), restored exactly, and clamped to the window. A splitter between list and preview, its share remembered. Needs a resizable modal in the overlay layer (OverlaySpechas a width only). Size: M. - Saving done right. A confirmation before replacing an existing
file (on by default, as
FOS_OVERWRITEPROMPTand GTK 4; an application may turn it off when it asks itself); the active filter’s first extension appended to a name typed without one, and changed when the filter changes (Windows’ rule); the proposed name’s stem selected when the dialog opens; a New Folder button (andCtrl+Shift+N) in save and folder modes. Size: M. - Last folder per purpose.
FileRequest::purpose("import")(or an id) under which the picker keeps its last folder, so an import and an export do not share one, asSetClientGuidand the panelidentifierdo; the request’sdirectorybecomes the first-time default (SetDefaultFolder), with an explicit way to force it. Recent places stay global. Size: S. - Single click selects, double click or Enter opens. A single click
entering a folder is a file-manager habit of some Linux settings, not
of any dialog here; it makes a mis-click a navigation and breaks
multiple selection. With it, the usual selection keys for choosing
several:
Ctrl+click toggles,Shift+click andShift+arrows extend,Ctrl+Aselects all, and the footer says how many are selected (Ctrl+Spacestays). Size: S. - A thumbnail grid with a size control, for photos. A list / grid
switch (remembered), the grid drawing the preview providers’ images
as thumbnails (the cache and the off-thread worker exist), a size
slider and
Ctrl+wheel orCtrl+/-, virtualised for folders of thousands of raws, a placeholder until a thumbnail is there. This is the feature GTK users waited 18 years for, and the one a photo editor’s open and import dialogs need most. Decided:thumbnail_gridmoved down toegui-pop-core, for the picker and the viewport crate alike. Size: L. - Columns in the list: size, modified, type, sortable. Clicking a
header sorts, the sort is remembered, folders stay first (a setting,
as GTK’s
sort-directories-first), and names sort naturally (“IMG_9” before “IMG_10”, as Explorer). Photo folders are read by date as often as by name. Decided: the data table stays out, for three reasons. It lives a layer above the picker; it brings its own selection, which is not the picker’s highlight and selection; and its headers cycle through no order at all, which a listing does not have. What they share went down toegui-pop-core: the header’s drawing (widgets::SortHeader). The picker’s rows use the grid’s virtualisation (ThumbnailGrid, one cell to a row), so a row now reads its facts only when in view. A click sorts the largest and the newest first, as Finder and Nautilus; the headers stay above the grid, which has no other way to change the order. Natural order is our own 30 lines:natord’s last release is from 2015, andalphanumeric-sortcompares by Unicode scalar values, which leaves case apart. Size: M. - Breadcrumbs for the folder, editable on demand. The monospace
path becomes clickable segments (each opens its folder; a segment’s
menu lists its subfolders, as Windows’ address bar);
Ctrl+L, or typing/or~when the list has the focus, puts the path into the field. GTK and macOS both open path entry on/and~; egui-pop’s field already understands both, so this is the entry point, not a second field. Done: the segments sit beside the row’s controls and collapse from the start behind a…menu, so the deepest stay; a chevron after each is a stop of its own, which costs two Tab stops per segment against one with a key on the segment, for a menu anyone can find, by the pointer too. Its menu reads the folder as it opens, not each frame, and a press on a chevron or on List or Grid hands the keyboard back to the field.Ctrl+Lis the commandfile.edit_path. A crates.io search (2026-10-31) found no egui breadcrumb widget to adopt, andTextEditstays the field. Size: M. - Grouped files: RAW with its sidecars as one entry. A grouping
hook on the files service (an application declares that
x.xmp,x.cr3.xmporx.jpgbelong tox.cr3), the entry showing a badge (“+XMP”, “+JPEG”) and choosing it giving the main file (with the group available to the application). egui-pop provides the mechanism, the application the rules; Lightroom’s default and darktable’s sidecars show the need. Done:files::groups, aFileGroupinggiven withFilesPlugin::groupingorFiles::groupings, andSidecarRulefor the usual case by extension; egui-pop declares none, and no preset of photo extensions either. A chosen group gives the main file inpaths, its members throughfiles::chosen_groupsand thefile.chosenstep, whoever answered the choice (the system’s chooser too, whose window shows each file apart). Choices the item left open: the group forms over the whole folder and the filter judges its main file, so a filter refusing it leaves the members entries of their own; saving and choosing a folder never group; a switch in the picker lets each file be its own entry, the way to a member with the pointer, as Lightroom’s “treat as separate” does; the columns say the main file’s facts; and a member’s image stands in for a main file no provider previews, which a RAW without a provider is. Size: M. - Application options inside the dialog. A slot where the
application draws its options next to the buttons (Windows’
customize interface, the portal’s
choices,accessoryView, Blender’s operator options), first as the portal’s shape (combos and check boxes, given back with the paths) so that it works with the system’s chooser too, then as free drawing for the in-app picker. Helios’s import (“recursive”, “only new”) and export (format) need it. Size: M. - Richer places. The system’s folders (Pictures, Desktop, Downloads from the XDG user dirs, Known Folders, the macOS standard directories), mounted volumes and removable cards (a camera card is the first place of a photo import), bookmarks reordered and renamed, a folder dropped on the sidebar bookmarked. Size: M.
- Preview facts for photos. The preview pane already shows provider facts; make the fact list ordered and typed (dimensions, capture date, camera, lens, exposure, rating as stars) so that a raw provider from the application shows what Dolphin’s panel and Lightroom’s loupe show, the same way for every provider. Size: S.
- Small keyboard parity.
Ctrl+H(GTK, KDE) andCmd+Shift+.(macOS) for hidden files,F5to reload,Alt+LeftandAlt+Rightback and forward (Blender, Windows),Ctrl+Lto the field, theAlt+Palready there; listed in the dialog’s tooltips and in the keymap so they can be rebound. Size: S. - Accessibility. The list exposed as a list box (or a grid, in grid view) with its selected and current items, the folder change and the count of entries announced, the preview pane named, every action reachable by keyboard (already mostly true), and target sizes kept in the grid. Ongoing; size S per step.
What to skip, and why
- Recursive search as what typing does (GTK, Nautilus): the source of the longest-running complaints in this survey, and slow on a photo archive. Keep the field filtering the folder; a recursive search can come later as an explicit command, never as the default meaning of typing.
- A separate type-ahead next to the filter (Total Commander’s two modes, GTK 3’s three entries): one field with one meaning per prefix is clearer; the fuzzy filter already jumps the highlight to the best match.
- Column (Miller) view. macOS’s column view is loved by some, but it needs width the dialog does not have and adds little over breadcrumbs plus a list for picking one file.
- Full-screen Quick Look on Space. Space is taken (
Ctrl+Spaceselects), and the preview pane plus a larger grid covers the need; revisit if people ask. - Import features (copy and rename on import, duplicates greyed out, “only new”): they belong to Helios’s import, which can draw them through the options slot (item 10) and the grouping hook (item 9), not to a generic picker.
- Hiding extensions (macOS’s default): a photo editor’s users need to
see
.cr3from.jpg; show extensions always.
Sources
The sources are linked where they are used above. The main ones:
GTK’s location-popup
and GtkFileDialog
docs, the portal’s FileChooser,
Microsoft’s Common Item Dialog,
Apple’s NSSavePanel
and HIG,
Blender’s manual,
darktable’s manual,
and the KDE, GNOME and Launchpad bug reports cited in each section.
Keyboard survey: moving around without a mouse
This survey asks how far the keyboard alone gets you in egui-pop and in its main user, the photo editor Helios: Tab order, moving between panels and regions, menus, lists and trees, dialogs, the gallery’s side list, the node graph and the image viewport; what cannot be reached, where the focus gets lost or cannot be seen, and what eats a key. It compares that with VS Code, JetBrains IDEs, Blender, darktable, Lightroom, GIMP, Photoshop, Qt, GTK and the WAI-ARIA Authoring Practices, and ends with a ranked list of changes, one pull request each, split between egui-pop and Helios.
Read on 2026-10-30, against egui 0.36.2 (and 0.37.0 where it differs),
egui_dock 0.21.1 and egui-pop’s main.
How much of this was run. This study was first written without building anything. Its walk with the keyboard in a headless harness has since been run for egui-pop, on the gallery and a few small harnesses, on 2026-10-30, with real key presses (the walk, checks 1 to 18); Helios’s half, checks 19 to 26, is still owed. Every finding about today’s state says where it comes from:
- [walk]: seen by a keyboard walk (
egui_pop_test::walk), pinned or listed as a gap incrates/egui-pop-gallery/tests/it/keyboard_walk.rs. - [read]: from reading the code or a document; not seen happening. Treat it as a strong hypothesis.
- [test]: an existing kittest test asserts it, named where it helps.
Many of those tests put the focus on a widget through AccessKit
(.focus()) and then press keys. They show what a widget does once it
has the focus, not that the keyboard can get there. Behaviour quoted from
forums and bug trackers is marked as such.
Summary
- F6 was built and reached nothing, until item 5.
tab::scopeand F6 worked ([walk] on the gallery’s Inputs page), but no shell panel opened such a scope ([walk] in the gallery, [read] in Helios), and Tab through everything in drawing order was the only way across. F6 between regions is the one thing VS Code, GTK and the ARIA splitter pattern share; it now goes through the shell’s regions ([walk], inputs). - One focused panel, since item 3.
focusedPanelused to follow clicks andworkbench.focuswhile egui’s focus followed Tab, so in Helios Tab from the image to the filmstrip should have leftCadding a circle mask ([read], Helios’s walk is owed).workbench.focusnow hands over the widget focus andfocusedPanelfollows it ([walk]). - The way in could be closed. Where a palette floats and no widget has the focus, Tab hides the palettes instead of moving ([test]), and F6 was inert ([walk], until item 5). That is Helios’s usual state ([read]). The habit is right for a photo editor (Lightroom, Photoshop, GIMP and darktable all do it), so the answer is F6, not giving Tab back: F6 now goes in ([walk]) and Tab keeps its rule.
- The focus can land on nothing, or out of view. A side panel’s resize
line is a stop with no role and no name, and changes no pixel when focused
([walk]); a window frame’s caption, a flyout’s edge and an open menu’s frame
were too, until item 8. A focused plain button is seen, in the
accent’s outline in
pop-dark, but has the pressed button’s pixels ([walk]). A widget out of view used to keep the focus out of view ([walk]): 35 rows of the gallery’s side list on its first screen, the end of the settings page; since item 7 the keyboard’s focus brings it in. VS Code, Qt, GTK and ARIA all show an indicator, and GTK and Qt know whether the keyboard moved it. - The focus has little memory. A popover gives it back ([walk]); a dialog or the command palette closed by Escape does not, against what reading the overlay’s tests said ([walk]). After Escape, when the focused widget disappears, or when a button changes the panels, the next Tab used to start from the top of the window ([walk]); since item 6 it goes on from the place, and a widget removed hands the focus to its neighbour.
- Enter opens a dialog and answers it. Enter on a focused button that opens a dialog also accepts the dialog, unless it is a danger: the key is still there when the dialog is drawn in the same pass ([walk]). Space opens it and leaves it open. Reading did not see this.
- Menus are the weakest common part, and egui 0.37 fixes most of it.
Alt and a letter opens a menu ([walk]); after that egui 0.36 has no
arrow keys in it ([walk]). There is no F10, no underlined letter, and no key for
a context menu ([read]). egui 0.37 brings arrow keys inside menus
(#8548) and a
Menukey. - The data views are already right. Tree, list, table and grid take
one Tab stop and move with the arrows; tree and list add type-ahead
([test]). This matches ARIA, Qt and JetBrains. The gaps are the lists
drawn by hand from
selectable_label(the gallery’s side list, Helios’s Modules panel), where every row is a Tab stop. - Keys are complete, routes are not. Every command runs from the
palette (F1) and has rebindable keys, a resolver with a trace, and
surfaces: ahead of most of these systems. The study’s changes are about
moving focus, not about the keymap. The one exception read here, a
rebound key losing its
whenclause, has been fixed since ([walk]).
egui today
From egui 0.36.2’s source (memory/mod.rs, context.rs,
containers/menu.rs, input_state/mod.rs).
- One focused widget per window.
Focusholds one id and a filter (EventFilter, set byset_focus_lock_filter) saying which of Tab, the arrows and Escape the widget keeps. - Tab is drawing order. Each focusable widget registers as it is drawn; Tab gives the focus to the next one that registers, Shift+Tab to the one before, and both wrap across passes. Which layer or panel it is plays no part. A modal layer narrows it: below the top modal, widgets are not interested. There are no tab indices and no groups.
- What is focusable.
Sense::click(),Sense::drag()andSense::click_and_drag()all includeFOCUSABLE;Sense::DRAGalone does not. So anything draggable made with the helper is a Tab stop, whether or not it answers a key or draws focus. - Arrows are a spatial guess. With a plain arrow and no filter, egui looks through every focusable widget’s rectangle in a 90° cone and takes the best score (“There is a lot of room for improvement here”, its comment). It knows nothing of panels, and the rectangles include widgets not visible. With nothing focused, arrows do nothing.
- Escape drops the focus of any widget that has not claimed it, to nothing.
- A widget not drawn loses the focus, with no successor.
- Enter and Space click a focused widget that senses clicks.
input.key_pressedignores modifiers and counts key repeats, so Ctrl+Enter clicks too, and holding Space should click repeatedly. consume_key(NONE, k)also matches with Alt or Shift held (matches_logically), so the plain key consumed first takesAlt+k. This is why Alt+Up failed in the file picker.- Nothing scrolls to the focus. egui’s
Response::scroll_to_memust be called by the widget; no widget or container calls it on gaining the focus (sections.rs,files.rs,palette.rsanddialogs.rsin egui-pop call it themselves), and the target it sets reaches only the innermost scroll area. Since item 7, egui-pop’s focus plugin does it for every widget. - No focus ring.
Widgets::stylegives a focused widget theactivelook, the same as pressed.debug.show_focused_widgetexists as a debug tool. There is no record of whether the keyboard or the pointer moved the focus, so nothing like:focus-visible. - Menus.
containers/menu.rsin 0.36.2 reads no key; a button opens on Enter or Space (a click);Popupcloses on Escape. No focus moves into an open menu. There is no key for a context menu: 0.36.2’sKeyhas noMenu. - What 0.37.0 changes (release):
arrows inside menus (#8548:
Up and Down in tab order, wrapping; Left to the opener, Right and Enter
into a submenu; closes #8327,
focus escaping to the buttons behind a menu),
Key::Menu(in 0.37.0’s source, which egui-winit maps from the context menu key; the notes list new keys under #8373), unfocusable widgets out of the widget cache (#8653), aRole::Splitteron panel resize handles (#8578). Tab is the same as in 0.36 and Enter and Space still ignore modifiers (from the 0.37.0 source). - Downstream reports (other projects’ trackers, not egui’s own): parterre #387 wants one stop per control and a visible focus, and reads egui as above; ryucad #136: Tab over a viewport walks the menu bar and Enter then opens a menu; egui-charts #277: custom widgets draw no ring.
egui-pop today
From crates/egui-pop-core (tab.rs, focus.rs, keys.rs,
overlay.rs), crates/egui-pop-api and the docs named.
What exists
- Key resolution (ADR 0007): each pass rebuilds the focus chain from
the
focus::scopes around the focused widget, or the place last clicked; among bindings whosewhenholds, the nearest the focus wins. Text inputs keep plain keys, Escape has a fixed order, every resolution has a trace. [test]the_binding_nearest_the_focused_widget_wins,chords_wait_and_typing_keeps_plain_keys. - Tab scopes (
tab::scope,tab::stop): reading order, indices, groups; modal scopes cycle; F6 and Shift+F6 go between panel scopes and back to the stop last focused. [test]tab_puts_indices_first_skips_disabled_and_keeps_read_only,tab_follows_reading_order_and_groups_and_f6_moves_between_panels,tab_cycles_inside_a_modal. - The palette runs every command, and
<panel>.focusand<panel>.toggleexist for every panel. [test]panel_commands_show_hide_and_focus. - Focus mode: hover mode, where the pointer moves the keyboard between
surfaces. [test]
in_hover_mode_the_pointer_moves_the_keyboard_between_surfaces.
Tab order
-
[read] Inside a
tab::scope, only inputs and sliders are stops. A plain button, list or tab is not. Inside atab::scope, Tab from a stop goes to the next stop, so it jumps over anything that is not one (documented for modals, true of panels too). Wrapping shell panels intab::scopeas they stand would therefore lose their buttons: F6 cannot simply be turned on that way. -
[walk] Application order is drawing order: the menu bar, the top bar’s own widgets, the status bar, the activity strip, the areas, the centre last. The gallery’s first page is 72 stops: 57 of the side list, and its first eleven before any panel. The status bar comes before every panel. A popup’s widgets come where the code that opens it runs.
-
[walk] Stops that show nothing and answer no key (role
Unknown, no name; compared pixel by pixel, focused against not): a side or bottom area’s resize line (egui’sPanel,Sense::click_and_drag(), drawn only when hovered or dragged). Item 9 makes it a real splitter.Since item 8 these are no stops: the caption of an egui-pop window frame and a flyout’s edge, and an area’s edge lying over the centre, sense without
FOCUSABLE, as palette edges did; a dialog’s grips are focusable only on the handle meant for the keyboard. Any popup’s frame (a menu, a submenu, a context menu, a combo box’s list), not read at first, is egui 0.36’s: Tab went from File to it, then to the first item. The focus plugin moves on past it, and egui 0.37 drops it (upstream). -
[walk] Dock separators do answer, where an area is split: focused, they move 16 points with Shift or Ctrl and an arrow along their axis (egui_dock). A plain arrow leaves them. Nothing says so. They are role
Unknownwith no name too, and no default layout of the gallery has one. Since egui-pop moved to egui_stack: a plain arrow along the axis moves them 16 points, Shift 64, Enter puts them back in the middle, and they areSplitters named “Resize” with their fraction as value. -
[walk] Each dock tab is a stop. No close button ever is: the workbench sets
show_close_buttons(false). [read] Enter or Space activates the tab. There is no key for the next tab of an area.
Moving between regions
- [walk] Done, item 5: F6 through the shell. F6 used to do nothing in an
application: the plugin is installed by the first
tab::scope, and only the gallery’s Inputs page opened one. Nowworkbench.next_regionand.previous_regiongo through the regions (inputs). - [walk] Done, item 3: one focused panel.
workbench.focusand<panel>.focusgive the panel the widget focus (what it names withfocus::prefer, its first focusable, or the panel’s own stop), andfocusedfollows any widget taking the focus and any press (workbench). Until then only a command and a press in a dock wrote it: aftergallery.notes.focusnothing was focused, and after Tab from a panel to the next,focusedPanelhad not moved. - [read] No panel has a default focus key; an application binds them.
- [walk] A terminal keeps F6, as
tab.rssays. Readingbegin_passpredicted the opposite. In atab::scope, with another scope beside it, F6 from a field goes to the other scope; from a focused terminal the focus stays and the program readsESC [ 1 7 ~.
Where the focus gets lost
- [walk] Overlays give it back, modal or not.
an_overlay_closes_on_escape_and_gives_the_focus_backandescape_closes_only_the_top_overlay_and_focus_goes_backfor overlays that are not modal;escape_from_a_dialog_gives_the_focus_back_to_its_button,escape_from_the_palette_gives_the_focus_backfor the others. Until item 21, a modal left nothing focused: the stack asked for the focus in the pass it closed, and egui takes it off any widget drawn under the top modal layer, which is the previous pass’s; the stack now asks once the layer is gone. A focus requested for a widget gone since is dropped. - [read] egui’s menus are not overlays, so nothing restores the focus when one closes.
- [walk] After Escape on any widget egui drops the focus. The focus
chain keeps the place, so the surface’s keys go on working
([test]
a_palette_takes_the_keyboard_only_when_clicked_and_escape_gives_it_back). Tab used to start from the first widget of the window; since item 6 it goes on from the place, and since item 5 F6 goes on from the region. - [walk] When the focused widget disappears, the focus used to go to nothing and Tab to restart. Since item 6 a tab closed hands the focus to the next one, as ARIA advises, and a windowed section’s row scrolled out leaves nothing focused, with Tab going on from the place. After a menu closed, its layer is gone: Tab still starts from the top (item 11).
- [walk] A button changing the panels lost the focus it held, not read at first: “Open the demonstration panels” and “Close them” on the workbench page, by Enter, left nothing focused: they get a new id as the panels change. Since item 6 the focus goes to what stands in their place, which is them. A button that moved as well as changing id would hand it to a neighbour.
- [walk] A focused widget out of view stayed out of view in a plain
ScrollArea: the gallery’s side list from its 23rd row, the settings page past “Log level”. Since item 7, the keyboard’s focus brings it in, nested areas included (every_stop_of_the_first_page_comes_into_view_both_ways,crates/egui-pop-test/tests/focus_into_view.rs). Sections, the picker, the palette and dialogs’ choices had their own call, which stays ([test]the_sections_page_answers_the_keyboardfor the boundaries, since PR #99). - [walk] Windowed rows ended where they were drawn. With buttons as a windowed section’s rows, Tab went through those drawn, 11 of 500, then left the section. Since item 7 each row reached scrolls the next one into the drawn window, so Tab goes on through them, both ways. A row not drawn is still no stop: Tab cannot jump to it. The gallery’s own windowed rows are labels, not stops.
Where it cannot be seen
- [read] egui-pop’s own widgets paint a ring when the kit’s
focusstate gives one (paint_ring), and the views, tree, graph, viewport and sliders have theirfocusstates. - [read] egui’s widgets do not. The kit’s own loss report says it: “egui’s widgets draw no focus ring”, “egui’s text fields draw no focus ring”.
- [walk] A focused plain button has the pressed button’s pixels, and
those differ from rest: the accent’s outline, in
pop-dark, the only theme compared. So it can be seen, and is not told from a press. - [read] The ring has no idea who moved the focus, so what a click focuses also shows it.
- Since item 4, the focus plugin rings what the keyboard focused, egui’s widgets included, unless the widget shows its focus itself; a click focuses without that ring. egui-pop’s own kit rings still show on a click.
What eats a key
- [test] Tab, where palettes float, with no focused widget and no
overlay:
tab_hides_and_shows_the_palettes_but_not_a_pinned_one. It is documented and rebindable. [walk]overlayOpenreads egui-pop’s overlay stack, and egui’s menus are not on it: with a menu open and nothing focused, Tab hid the palettes behind it. Fixed by item 15: an open egui popup counts as an overlay. - [read] Key bindings beat focused widgets. The dispatcher consumes a key that resolves before anything is drawn. A global plain key therefore beats Space on a focused button or an arrow on a focused slider.
- [read] A broken chord swallows its last key
(
Ctrl+Kthen a key that continues nothing). Standard, and bounded by a two-second timeout. - [walk] Enter and Space click whatever the modifiers: Ctrl+Enter opens a side list’s page, and a held Space clicks at every repeat (four presses, four clicks). Fixed by item 14 for plain widgets, where the key dispatcher runs.
- [walk] Enter reaches a dialog it has just opened, which takes it as an answer: on a confirm, the page’s command ran and the dialog never showed. A choice and a form close the same way; a danger stays open, on Cancel.
- [test, known] Alt+Up in the picker was taken by the plain Up
consumed first; fixed, and the fix’s test is in
egui-pop-api’stests/it/files.rs. The trap stays for everyconsume_keyin the wrong order (widgets.rscomments on it: “Shift first: the plain key takes it too”). - [test, known] Tab in the picker’s path field stayed there until
PR #100:
tab_reaches_the_splitter_and_the_arrows_move_it,a_typed_path_completes_with_tab_and_backspace_goes_up. - [walk, fixed] The picker’s rows held the focus and nothing else: Tab
reached them, but the highlight stayed behind and the picker’s keys went
dead. The highlight follows now, and the arrows and Enter work from a row:
tab_through_the_rows_moves_the_highlight_and_the_keys_answer_there. - [walk, fixed] A rebound key keeps its
when, since this study was read: the gallery’sgallery.notes.ask_clear, rebound, does nothing outside the notes’ window. Model test incrates/egui-pop-model/tests/scopes.rs. - [test] Hidden by design: a terminal takes everything but Shift+Escape; an editor takes Tab and gives way on Escape.
Menus
- [test] Alt and a letter opens a menu, inside “…” too:
alt_and_a_hidden_menus_key_opens_it_inside_the_more_menu. - [read] The letter is not shown. It is given to AccessKit, not drawn.
- [walk] Then there is no way down by arrow. No widget is focused, so arrows do nothing. Tab starts at the top of the window and goes through what is drawn before the popup, which is drawn right after its button: from Alt+F, three presses reach File’s first item (File, the popup’s frame, the item). Escape closes it and leaves nothing focused.
- [walk] With a menu opened from a focused button (Enter), arrows use egui’s cone and leave the menu (egui’s #8327): the second Down from File goes to a row of the side list behind it, the next comes back to “Quit”.
- Since egui 0.37 (item 11), Down enters a menu opened by its letter or from its focused button, and the arrows stay in it: the walk’s gap tests pass. Since item 12, F10 opens the first menu and the letters are underlined while Alt is held.
- [read] No F10, nothing on a bare Alt, no Shift+F10.
context_menu_withanswers the secondary click only, so nothing on a list row, tree node or graph node opens by key.Alt+Spaceopens the system menu, and “at a point” exists for the application.
Lists, trees, tables, the grid
- [test] One stop, arrows inside, cursor apart from selection:
the_keyboard_moves_opens_closes_and_searches(tree: type-ahead, F2, Ctrl+A),a_list_selects_with_the_pointer_and_the_keyboard,the_keyboard_moves_by_cells_rows_pages_and_ends(grid and filmstrip). - [read] A focused view paints its
list-viewoutline and scrolls to its own cursor. Hand-drawn lists (selectable_label) have neither, though each row is a Tab stop.
Dialogs
- [read] First focus is chosen: the field, the primary action, or
Cancel when the action is dangerous (
dialogs.rs), as ARIA and the Windows guidelines ask. - [test] Alt+F7 and the arrows move a dialog
(
the_keyboard_moves_a_dialog_enter_keeps_the_place_escape_puts_it_back); the corner handle takes arrows (a_resizable_modal_follows_its_grips_and_the_arrows,the_corner_handle_resizes_with_the_arrows); the picker’s keys (the_keyboard_filters_enters_and_chooses). - [walk] Keys down when a modal comes up are not its own: the key that
opened it does nothing in it until released, repeats included
(
holding_the_key_that_opened_a_dialog_does_not_answer_it_until_released). - [walk] Tab in a dialog is egui’s order inside the modal layer: it
wraps, in drawing order, and F6 stays in. No dialog uses
ScopeKind::Modal. - [walk] A status popover takes Tab inward. Past its last stop, Tab used to go on to the status bar’s next item behind it, and on through the window, while the popover stayed open; since item 22 it comes back to the first stop.
The gallery’s side list
[walk] shell.rs draws one selectable_label per story, 57, so 57 Tab
stops before the page, none scrolling into view. Enter opens a page and
leaves the focus on its row. Up and Down go through egui’s cone, row by row;
Right leaves for the side area’s line beside it, and Left from that line
lands on a row out of view. [read] No type-ahead, no scope. Everything the study praises
in egui-pop-views is absent from the catalogue that shows it off.
Since this walk, the list is the tree view (item 10): one stop named “Pages”, with arrows, Home, End and type-ahead, Left and Right folding its groups.
The graph
[test] the_keyboard_picks_two_ports_and_connects_them: Enter on two
ports connects, Delete disconnects, arrows go through ports and to the
nearest node, Escape back to the node. The view follows the focus. The
keys are data (GraphKeys).
[read] Tab goes through the canvas and every node’s chevron, ports and sliders (docs). On a network of thirty modules that is well over a hundred stops before leaving, where ARIA asks for one stop per composite.
The viewport
[test] keys_walk_the_ladder_when_focused. [read] Focus comes from
a click, a drag or Tab; focused, the arrows pan, and +, -, 0, 1,
2 zoom. The before key and the loupe key also answer when hovered.
Overlay handles are pointer gestures.
Helios today
From crates/helios-gui and docs/gui.md.
- [read] No
tab::scopeand no F6. Helios depends on egui-pop’s shell for all of it. - [read] Keys are scoped by
focusedPanel(keys.rs): library, image, graph, culling. A test checks the default map has no conflict and no global letter:the_default_map_has_no_conflict_and_no_global_letter. The scopes are only as right asfocusedPanel, see above. - [read] A wrong panel after Tab, until item 3 reaches Helios. From the image, Tab to the filmstrip
should leave
C,E,G,PandMadding masks, and0to5not rating. The tests get to a panel by clicking (a_click_elsewhere_ends_typing_and_takes_the_focus) or by command (typing_in_a_field_fires_no_shortcut_and_an_agent_does_not_take_the_focuscovers an agent not moving the focus). - [read] Palettes float by default (
helios.masks,helios.scopes,helios.navigator), so Tab with nothing focused hides them (docs/gui.mdstill says “Tabmoves the focus” in its darktable table). After a start with no click, the keyboard’s ways in are menus (see above), the palette, and commands that move no widget focus.helios.vault.focusand the like make keys scoped to that panel work, but the grid’s own arrows need the widget focus. - [read] Culling’s keys beat the focus on purpose (“wherever the focus
is”): digits,
P,X,U, Left, Right, Space, Backspace, without!widgetFocus. So Space cannot press a focused button in culling, and Left and Right cannot step a focused slider. - [read] Hand-drawn lists: Modules (a
selectable_labelper module and one for its bypass), the stack review, the decisions’ options. Every row is a stop or two, with no arrows of their own or type-ahead. The mask tree and library use egui-pop’s views. - [read] Parameters are sliders in a
ScrollArea: stops, but scrolled out of view when reached (see above). [test]a_held_arrow_steps_a_slider_as_one_undo_step. - [read] Masks by key:
C,E,Gplace a shape at the view’s centre,Pbegins a path that needs clicks,Deleteremoves a point chosen by pointer. Shapes then move by pointer only. - [test] Typing wins:
typing_in_a_field_fires_no_shortcut_and_an_agent_does_not_take_the_focus; the palette gives the focus back:the_palette_lets_go_with_escape_and_gives_the_focus_back. - [read] Credo 10 says holding
H“will show” the keys of the current context; it does not yet.
The systems
VS Code
- Regions. F6 and Shift+F6 run
focusNextPartandfocusPreviousPart(source), through Editor, Panel, Secondary Side Bar, Status Bar, Activity Bar, Side Bar, skipping what is hidden. The accessibility docs recommend them “for quick navigation across the workbench”. - Direct keys. Ctrl+1 focuses the first editor group, with Ctrl+K Ctrl+Left and Right for the neighbours (defaults). Ctrl+0 for the side bar is widely quoted, but neither page read lists it: double-check.
- Tab. Moves between controls, with an indicator around each. Toolbars and tab lists are one stop: “Once a toolbar or a tab list has focus, you can use the arrow keys to navigate within them”.
- The trap. Tab in an editor inserts; Ctrl+M toggles it, and a status item says “Tab moves focus”. The terminal follows the same mode; read-only files never trap.
- Lists. Ctrl+Alt+F opens a find in any tree, and Down goes to the first match (docs).
- Keys. A binding made from a UI action carries its
when: “If the action has awhenclause, it’s automatically included”; the troubleshooting command logs what each key dispatched (docs).
JetBrains IDEs
- Direct keys over cycling. Alt+1 to Alt+0 open or focus numbered tool windows, Alt+F12 the terminal; Escape returns to the editor at the last caret, F12 jumps back to the last tool window, Shift+Escape hides the active one, Ctrl+Shift+F12 hides them all; Alt+Left and Right go through a window’s tabs (docs).
- Sashes. Ctrl+Alt+Shift and an arrow resizes the active tool window (docs).
- Speed search. In any tool window, tree, list or popup, start typing: a field appears over it, and the selection moves to the first match (docs).
Blender
- No focus, but the pointer. Many shortcuts “depend on which editor the mouse cursor is hovering over” (Areas), and property shortcuts work “while hovering” (common shortcuts). egui-pop’s hover mode is this model, as an option.
- Menus are the best here. Arrows, an underlined letter per item, number keys by position, Space to search, Enter, Esc (Menus).
- Fields. Tab and Shift+Tab go to the next and previous field while typing a value, Esc cancels (Fields).
- There is no Tab order across the interface in what was read, and F3 searches the menus (keymap).
darktable
- Tab hides the side panels
(shortcuts):
the predefined
tabrunsglobals/panels/all; Shift+Ctrl+L, R, T and B toggle one panel each (layout). - Focus is a module’s, not a widget’s: a key can “focus a module”, and
<focused>shortcuts drive that module’s first, second and later sliders, buttons and tabs. - Forum: asked about GTK-style navigation of panes, a reply says “dt has not implemented full accessibility access”; Tab cycles text fields, a focused slider or dropdown takes arrows, and Enter opens the numeric popup (pixls.us). A contributor proposed Up and Down in the module search to go through visible modules (pixls.us); whether it shipped is unconfirmed.
Lightroom Classic
Adobe’s pages refused a direct read; this comes from search excerpts of keyboard shortcuts and workspace basics. Double-check.
- Tab hides the side panels, Shift+Tab all panels; F5 the module picker, F6 the filmstrip, F7 the left panels, F8 the right.
- Panels by number: Ctrl+0 to 9 open or close the right panels in Library and Develop, Ctrl+Shift+0 to 5 the left, top to bottom.
- These are open and close, not focus: the model is visibility and direct commands.
Photoshop
From Adobe’s help (through a search excerpt) and forums.
- Tab hides or shows all panels, Shift+Tab all but Tools and the Options bar; Auto-Show brings them back at the window’s edge.
- Forum: Tab and Shift+Tab cannot be edited in its shortcut editor (Adobe community). egui-pop’s is rebindable.
GIMP
- Tab hides the docks, kept across restarts (Windows menu); Tab “jump to next widget” appears in the quick reference too, and inside a dock Tab navigates the dock (2.8 docs).
- The same collision as Helios’s: the manual warns that the shortcut can fail with the focus in a tool’s dialog, and advises putting the focus on the image or using the menu (2.10 guide, German).
Qt
- Tab follows construction order
by default,
setTabOrderchanges it; circular, per window; text editors take Tab and Qt maps Ctrl+Tab to Tab for them. It advises click-to-focus for text entry and against it for most others, toolbar buttons among them. - Focus policy is per widget:
TabFocus,ClickFocus,StrongFocus,WheelFocus,NoFocus. egui has only “focusable or not”. - Item views. Arrows move and select, Ctrl+arrow moves only, Ctrl+Space
toggles;
keyboardSearchis type-ahead withkeyboardInputInterval; Tab may move within bytabKeyNavigation(QAbstractItemView). egui-pop’s keys are these. - The ring knows.
State_KeyboardFocusChangesays “if the focus was changed with the keyboard”, andPE_FrameFocusRectis the “Generic focus indicator” (QStyle). - Menus:
&Filegives Alt+F and an underline, on Windows often shown only while Alt is held (QMenuBar). - Splitters: QSplitter’s page mentions drag only.
GTK
- Window bindings (gtkwindow.c): Tab, Ctrl+Tab and their Shift forms and the arrows (with or without Ctrl) move the focus; F10 activates the menu bar.
- Panes (gtkpaned.c): F6 and Shift+F6 cycle the children, F8 and Shift+F8 focus the handle; then arrows, Ctrl+arrows, Page Up, Page Down, Home and End move it, Return or Space accepts, Escape cancels. This is the fullest splitter here.
- Context menu: “Shift+F10 or Menu” throughout (FileChooserWidget), and a trigger for them (ShortcutTrigger).
- The ring knows:
GtkWindow:focus-visibleis kept by GTK from input, andhas_visible_focustakes it into account, with a state flag for CSS. Since 4.24 a timeout setting, marked unstable. - GNOME’s guidelines add F10 for the menu, F9 for a utility pane, Alt+arrows for back, forward and up; Alt+F7 and Alt+F8 move and resize a window, Alt+F6 switches the application’s windows. So Alt+F7 for a dialog (egui-pop’s) is that key’s meaning, but a window manager may take it.
Windows guidelines
The Windows 7 UX guide, old but still published: “Always show the input focus indicator”, with an exception when it appears on any keyboard input; Tab order follows reading order; a group has one tab stop, arrows move within and cannot leave it; “Don’t disable a control with input focus”; initial focus on the likely control; “Keyboard navigation shouldn’t change control values”. Access keys are underlined and documented on screen; Tab names use Ctrl+Tab.
WAI-ARIA Authoring Practices
- The rule.
Tab moves between components, arrows within a composite: “the tab sequence
should include only one focusable element of a composite UI component”.
Focus and selection are distinct and must look distinct. Roving tabindex
or
aria-activedescendant, the second keeping focus on the container (egui-pop’s views are this). When the focused element is removed, send focus “to the next logical item”. Shift+F10 opens a context menu. - Menu and menu bar. Focus goes to the first item on opening; Up and Down inside; Right and Left through submenus and to the next menu; Home, End; optional type-ahead; Escape returns focus to the opener. Tab leaves and closes.
- Tree and listbox. Type-ahead “recommended”, above all beyond seven items; Home and End. Selection following focus “can severely degrade accessibility” in some cases.
- Toolbar. One tab stop, arrows inside, optionally back to the control last focused.
- Tabs. One stop, arrows wrap; automatic activation only if the panel shows without latency; Delete optional; Shift+F10 for a tab’s menu.
- Window splitter. Arrows move; Enter collapses or restores; Home, End optional; F6 cycles the panes, optional.
- Modal dialog. Tab wraps; Escape closes; initial focus by content (the least destructive action for an irreversible step); return to the opener.
- Landmarks give screen readers regions to go between; the page does not mention F6.
- WCAG 2.4.7 and 2.4.13. A visible indicator is required; the AAA level asks for an area of at least a 2-pixel border, with a 3:1 change.
Comparison
“–” means not found in what was read, not proof of absence. egui-pop is as walked where the sections above say so; Helios is as read here, not as run.
| egui-pop | Helios | VS Code | JetBrains | Blender | darktable | Lightroom | Photoshop | GIMP | Qt | GTK | ARIA | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Regions by cycling | F6 | no | F6 | – | – | – | – | – | – | – | F6 in panes | F6, optional |
| Regions directly | commands, no default key | commands, no default key | Ctrl+1 | Alt+1..0 | pointer | module focus keys | F5–F8, toggles | Tab, toggles | Tab, toggles | Alt+letter | – | – |
| Back to the work | no | no | – | Escape, then F12 back | pointer | – | – | – | “focus on the image” | – | – | Escape to opener |
| Tab order | drawing, or scope | drawing | – | – | fields only | text fields (forum) | – | – | next widget | construction, editable | focus chain | author’s |
| Tab’s main job | moves, or hides palettes | moves, or hides palettes | moves | moves | fields | hides panels | hides panels | hides panels | hides docks | moves | moves | moves |
| Composite is one stop | views yes; toolbars, tabs, graph no | hand lists no | toolbars, tabs | – | – | – | – | – | – | – | – | yes |
| Type-ahead | tree, list | via views | find in tree | speed search | menus by Space | – | – | – | – | yes | – | recommended |
| Menus with arrows | egui 0.37 | same | – | – | yes | – | – | – | – | – | – | yes |
| Menu bar key | Alt+letter | same | – | – | – | – | – | – | – | Alt+letter | F10 | – |
| Letter shown | no | no | – | – | yes | – | – | – | – | yes | – | – |
| Context menu key | no (egui 0.37 has the key) | no | – | – | – | – | – | – | – | – | Shift+F10, Menu | Shift+F10 |
| Focus indicator | own widgets only | same | yes | – | – | – | – | – | – | yes | yes | required |
| Knows keyboard from pointer | no | no | – | – | – | – | – | – | – | yes | yes | (browser) |
| Sash by keyboard | sections, dialog, dock (hidden); not side panels | same | – | Ctrl+Alt+Shift+arrow | – | – | – | – | – | – | F8, then arrows | yes |
| Focus back from overlays | popovers, not modals | as read: yes | – | – | – | – | – | – | – | – | – | yes |
| Rebind keeps the clause | yes | yes | yes, from a UI action | – | – | – | – | – | – | – | – | – |
What egui-pop and Helios should change
Ranked by what it gives against what it costs, as read before the walk. Pure egui-pop items first. S is an afternoon, M a few days, L longer. Each is one pull request. Numbers stay as they are, since the walk’s tests name them; what the walk changes gives the order to follow now.
egui-pop
- Done: a Tab walk in the test kit, and the first walks.
egui_pop_test::walkandcrates/egui-pop-gallery/tests/it/keyboard_walk.rs(testing). - Done: a rebound key keeps its
when, inKeymap::rebindandrebind_all, before the walk ran. - Done: one focused panel.
workbench.focushands over the widget focus (what the panel names withfocus::prefer, else the panel’s own stop, from which Tab enters it; no longer its first focusable, which put the wheel on a slider);focusedfollows the widget focus however it arrived, and stays on the last panel when it goes to the menu, the status bar or nothing. Palettes and flyouts only borrow it; detached windows count. The widget last focused in the panel is not restored: that is item 5. (workbench). - Done: a focus you can see. The focus plugin paints a ring from the
focus.ringtoken around the focused widget at the end of the pass, unless the widget paints its own, and only when the keyboard last moved the focus, as GTK’s and Qt’s flags do. It stays within the widget’s clip. A widget says it paints its own withfocus::own_ring; a kit state fromState::from_responsesays it by itself, and egui’s text fields are left alone (inputs). - Done: F6 through the shell. Regions: the activity bar, each visible area,
the centre, floating palettes, an open flyout, the status bar, as commands on
F6 and Shift+F6. Built on focus scopes, not on
tab::scope, so that Tab stays as it is. A region remembers its last focus, and is passed over with nothing focusable; nothing moves behind a modal, nor with a menu or popover open (not asked at first: F6 would leave it behind the focus). A terminal keeps F6: its routing takes the key before any binding. The focusable marker first thought of was not needed: the last pass’s widget rectangles carry each widget’s sense in the order drawn, as the place’s neighbour (item 6) reads them. Atab::scopeof a region takes that region’s turn rather than keep F6 inside it (inputs). - Done: focus keeps its place. The focus plugin remembers the last focused widget and rectangle. Tab after Escape, or after that widget vanished, continues from that place, not from the window’s top; a removed row hands the focus on to its neighbour, the nearest stop in its scope first. A row scrolled away hands nothing on, not to chase the wheel (Tab order). A place in a layer gone leaves Tab as it was.
- Focus scrolls into view. Done, in one place rather than in each widget:
the focus plugin moves the scroll areas around a widget when anything but
the pointer focuses it, nested ones included, by the least that shows it and
without an animation (Tab order).
scroll_to_mecould not do it from outside a widget, and reaches only the innermost area (upstream). Windowed rows: a row not drawn is no stop, and each row reached draws the next, so Tab goes through them; a view with its own cursor stays one stop and scrolls to it itself. An area with hidden bars cannot be found, and what it holds keeps callingscroll_to_me. - Done: no stops that show nothing. The frame’s caption and a flyout’s edge
sense without
FOCUSABLE(Sense::CLICK | Sense::DRAG,Sense::DRAG), and so does an area’s edge lying over the centre, not listed at first; the walk checks it stays so. They had no key to lose, so a flyout’s width stays the pointer’s. An open menu’s frame is any popup’s, from egui: 0.37 no longer has it (itsPopupsensesSense::CLICK), and until then the focus plugin moves on past it. A side area’s line is still one, named and moved by keys since item 9. - Done: side areas’ sashes are real splitters. Amended: egui 0.37 already
makes a panel’s resize line a
Splitterwith a value and AccessKit’s increment, decrement and set value, and egui_stack’s dock separators take plain arrows, so egui’s line stays rather than being replaced. The workbench names it after its area (“Resize the start side bar”) and gives it the keys: an arrow across it moves it 16 points, Shift 64, Enter puts the default size back (as sections, GTK, ARIA, and the dock separators), handed to egui as a set value so that its clamping and storing apply. JetBrains’ Ctrl+Alt+Shift+arrows stay out. Its ring is item 4’s (workbench). - The gallery’s side list as a
ListView. One stop, arrows, Home, End, type-ahead; Enter opens the page and moves the focus into it. The catalogue should show the good pattern. Size: S. Done with the tree view rather than a list, its groups foldable; Enter opens the page and the focus stays in the list. - Done: egui 0.37. Menus with arrows (#8548), the
Menukey, severalRemove whenentries in the upstream register. Done as its own migration; the walk’s two menu gap tests pass on it and are no longer ignored. - Done, amended: F10 and visible letters. F10 opens the first menu, and the arrows go through it (egui 0.37’s menus); a menu’s access letter is underlined in the bar while Alt is held, as Windows and Qt do. Menu items are not given letters (planned at first): the arrows reach them, and every item’s letter would be a burden on translations, as “What to skip” says of dialogs; left until asked.
- Done: a key for context menus. Shift+F10 and
Menuopen the focused widget’s context menu under it (pointer::claim::context_menu, and somenus::context_menu_with), and a tree’s for its cursor row; Down then goes in. Lists and grids declare no context menu of their own, so there was nothing to open there; the graph’s node menus follow the same function. - Done: modifiers on Enter and Space. Enter or Space with Ctrl, Alt, Shift or Command, or a key repeat, does not click a focused plain button unless bound. Done in the dispatcher’s pass, after the keymap, for widgets that sense clicks and not drags (a slider, a splitter, a text field read their own keys); an application without the dispatcher keeps egui’s rule (upstream; the issue is not filed yet).
- Done:
overlayOpensees egui’s popups. The context key is true while egui-pop’s overlay stack holds anything or any egui popup is open (a menu, a combo box’s list), so Tab behind an open menu no longer hides the palettes, and Escape there closes the menu rather than leave zen mode or pop a mode. - Done: arrows stay in the region. A plain arrow that takes the focus out
of the F6 region holding it (a
focus::region, rather than anyfocus::scope: a region is what F6 crosses) is undone by the focus plugin in the next pass, before anything is drawn, so that egui’s cone cannot jump panels; Tab and F6 cross. A widget outside every region keeps egui’s rule (inputs, upstream). - Done: a roving helper, then toolbars and strips.
tab::roving: one stop, arrows inside, back to the last. Then one PR each: toolbars (toolbars.mdlists it), the activity bar, the status bar. Size: M, then S each. Done:tab::rovingis part of the focus plugin, its widgets whatever is drawn inside it that can take the focus (a greyed tool is passed over); Tab from any of them leaves past the group’s end, Tab coming in either way lands on the last focused, the arrows along it go round and Home and End go to the ends, ordered by place rather than drawing (the status bar draws its end items from the right). Toolbars, the activity bar (Up and Down) and the status bar (Left and Right) are drawn in one, and the status bar’s background, sensed for its context menu, is no longer an empty stop. Amended: the arrows wrap, as VS Code’s action bars and Windows toolbars do (ARIA leaves it open), and a dock’s tab bar is not one of these: it is a tab list, where an arrow also shows the tab, which egui_stack’sTabFocus::Rovingdoes (inputs, upstream). - Done: tabs by key.
workbench.tab.nextand.previousshow and focus the tab beside the focused panel’s, in its group, wrapping (Ctrl+Page Down, Ctrl+Page Up, as VS Code), through theworkbench.focusstep. Close buttons are not shown, so they are no stops today; one added later should not be a stop of its own (egui_stack’sTabFocus::Rovingmakes them none, item 17). - Done: the graph as one stop. A setting, on by default for large graphs: Tab
enters and leaves the graph, arrows go between nodes, Enter goes into a
node’s parts, Escape back, as ports already do. Size: M. Done:
GraphEditor::tab_stops(TabStops::Auto,One,Each), one stop from twelve nodes (graph::ONE_STOP_FROM). Tab enters on the node or the canvas focused there last and leaves from anywhere in the graph; the arrows stay the graph’s own (a roving group withAxis::Own, taking in the scene’s layer). Enter on a node goes into its parts (tab::parts: chevron, ports, sliders, header), where Tab goes round, and Escape comes back; Space still selects. A group’s band and a folded stack are the pointer’s in a one-stop graph (docs). - Done: the key that opens a dialog does not answer it. The dialog is
drawn after the page, in the pass of the press that clicked its button, and
reads the same press as its own; held, the first repeat clicks the button
the dialog focused, Space as much as Enter, Cancel as much as the action. A
modal overlay coming up now takes that pass’s presses out of the input, and
the keys down stay out of it until released, before egui reads them
(
overlay.rs, the walk’s dialog tests). - Done: a modal overlay gives the focus back, to the widget that held the focus when it opened, as a popover does and ARIA’s modal dialog asks, by Escape, an answer or a button. The stack did ask for it: egui’s focus rule undid it (see “Where the focus gets lost”).
- Done: Tab past a popover’s end. New from the walk. It cycles inside rather than close: a popover holds a small form or a list with actions, which closing would lose, and it is what a dialog’s Tab does here and a GTK popover’s there (“cycle around with (Shift+)Tab”); ARIA’s menu closes on Tab, and a menu has its own keys. Shift+Tab goes the other way, Tab from outside goes in, a focused widget taking Tab keeps it, and a popover with no stop closes as Tab goes on (GTK’s keeps the focus where it is; here that would leave the popover open behind it). A flyout is left out: it stays open as the focus leaves it, like a palette (inputs).
Helios
- Say what Tab is, and F6 is the way in. Keep Tab hiding the palettes where
nothing has the focus, as decided; correct
docs/gui.md; mention F6 in the tips. Size: S, now egui-pop 5 is done. - Keys for panels. A proposal:
Ctrl+1the image,Ctrl+2the graph,Ctrl+3the vault, then the Parameters, Modules, Filmstrip, as VS Code and JetBrains give direct keys; free in the default map as read. Not decided. Size: S, after egui-pop 3. - Culling’s keys give way to a control that takes them. Left, Right and
Space with a slider, a list or a button focused; a context key from egui-pop
for “the focused widget takes arrows”, or
!widgetFocuswith the image exempt. Size: S. - The Modules panel as a
ListView, with type-ahead; the bypass stays onCtrl+/. Then one PR each for the stack review and the decisions. Size: S each. - Hold
Hfor the keys of the context (credo 10). Size: M.
What to skip, and why
- Giving Tab back from the palettes in Helios. Lightroom, Photoshop, GIMP and darktable teach that Tab hides panels; it is rebindable, and F6 gives a keyboard user the way in. GIMP’s own warning shows the collision needs a rule: nothing focused, not “always”.
- Blender’s pointer as the only focus. egui-pop’s hover mode exists as a choice. A keyboard user cannot use it.
- Access keys on every dialog control (the Windows rule). Plenty of work, and a burden on translations, for dialogs that are short and already start in the right place. Menus only.
- A speed-search field on every list (JetBrains). Type-ahead is there; add the field where a list is long and people ask.
- Per-cell focus in the grid and per-row in the tree. Keeping the focus on
the view, as
aria-activedescendantdoes, is correct, scales to tens of thousands of cells and already works. - Tab indices on shell widgets. Reading order is right for most of it; the status bar’s place is fixed by F6, not by renumbering.
- Ctrl+M for Tab trapping (VS Code). Escape already leaves an editor and Shift+Escape a terminal; Tab moves on after. One rule, no mode.
- Dragging tabs by keyboard.
workbench.moveand the palette do it. - Moving and reshaping masks by keyboard, for now. A pointer task in all of these editors; no one asks. The commands that place a shape remain.
- Arrow keys between regions, tmux-style. F6 and direct keys are enough.
The walk
Run on 2026-10-30 for egui-pop: 18 checks on the gallery at 1100 by 720 in
pop-dark, on egui 0.36.2, and on small harnesses where the gallery has no
such case, all by real key presses through kittest
(crates/egui-pop-gallery/tests/it/keyboard_walk.rs, crates/egui-pop-test/tests/walk.rs).
Item 5’s round was added after it (f6_goes_through_the_regions_in_order...).
Each confirmed gap is an ignored test whose reason names its item:
cargo test -p egui-pop-gallery --test it keyboard_walk:: -- --ignored lists them.
“Right” says whether reading predicted the result. None of it ran in a real
window; item 20 and check 9’s pixels are worth seeing once in a nested
compositor.
Gallery and shell
| # | Check | Predicted | Result | Right? |
|---|---|---|---|---|
| 1 | Tab until the focus returns; where is the status bar? Any stop unseen or unnamed? | status bar before the panels | Status bar before the panels. 72 stops on the first page, looping to File; 35 out of view (side list); 2 unnamed, the side lines | yes |
| 2 | Caption, side line, flyout’s edge are stops | yes, nothing shown | All three; caption and side lines change no pixel. Also an open menu’s frame. Since item 8, only the side lines | yes, and one more |
| 3 | Dock separators are stops; Ctrl and an arrow moves them | yes | Yes, Ctrl or Shift, along their axis, 16 points. No default layout has one (tested on a split area) | yes |
| 4 | Focus a button, Escape, Tab | the window’s first stop | File; since item 6, the stop after the button | yes |
| 5 | A tab’s close button, Enter, Tab | the same | No close button exists (show_close_buttons(false)). A focused tab closed by its command: nothing focused, Tab goes to File; since item 6, the next tab takes the focus | premise wrong, result as said |
| 6 | Inputs page F6, Shift+F6; other pages F6 | works there, nothing elsewhere | As said: Street, Tags, Street; on overview, workbench, menus, terminal, settings, nothing. Since item 5, a region on every page, and the page’s scopes in the centre’s turn | yes |
| 7 | Up, Down in the side list; Left, Right | leaves for the page | Up and Down go row by row. Right goes to the side line, not the page; Left from there to a row out of view | nearly |
| 8 | Side list’s stops | one per story | 57 for 57 | yes |
| 9 | Focused button against pressed; Ctrl+Enter; held Space | same pixels; clicks; repeats | Same pixels, and different from rest, so it is seen; Ctrl+Enter clicks; 4 presses, 4 clicks | yes, the look less bad than said |
| 10 | Long form, Tab past the fold | out of view | Settings page: out of view from “Language” | yes |
| 11 | A windowed row: focus it, scroll it away | (open) | The gallery’s rows are not stops; with buttons as rows, focus goes to nothing, Tab restarts at the first stop; since item 6, at the visible row nearest to the place. Also Tab cannot reach rows not drawn | new |
| 27 | Scroll areas (added with item 6 of the scrolling survey): a stop with nothing focusable and something to scroll; the keys; a binding on them | only the first | As said, on small harnesses (crates/egui-pop-test/tests/scroll_keys.rs): no stop with a button inside or nothing to scroll, a ring when focused; a binding wins, held too | new |
Menus and overlays
| # | Check | Predicted | Result | Right? |
|---|---|---|---|---|
| 12 | Alt and a letter, Down, Tab, Escape | Down nothing, Tab from the top, Escape closes | As said; File’s first item is 3 Tabs away, since item 8 two. Nothing focused afterwards | yes |
| 13 | Menu from its focused button, arrows | the focus can leave | Second Down goes to the side list behind the menu | yes |
| 14 | Tab with a menu open and a floating palette | the palette hides | It hides; since item 15, it stays | yes |
| 15 | Status popover, Tab past its last stop | (open) | Goes on through the window behind, popover still open; Escape returns to the item; since item 22, back to its first stop | new (item 22) |
| 16 | Confirm dialog, danger on and off: first focus, Tab round | as dialogs.rs | Action first, Cancel for a danger, Tab wraps, F6 stays. Also Enter from the opening button answered a dialog at once (item 20, fixed), Escape left nothing focused (item 21, fixed) | yes, and two bugs |
Keys
| # | Check | Predicted | Result | Right? |
|---|---|---|---|---|
| 17 | Rebind a when-scoped command, press it elsewhere | fires | Does not fire: fixed since it was read | no longer |
| 18 | F6 with a focused terminal in a scope | the terminal does not receive it | The terminal receives it and keeps the focus, as tab.rs promises. F6 from a field beside it moves. Since item 5, the same in an application’s panel | no |
Still owed: Helios
It did not run, as this pull request stays in egui-pop. Each check confirms or
removes a finding above; the expected result is what reading predicts. The
answer to check 19’s first half is already expected from egui-pop’s own
result, before item 3: focusedPanel did not follow Tab.
- From the image (clicked), Tab until the filmstrip, press
C(expected: a circle mask), press3(expected: no rating). helios.vault.focusfrom the palette, then Up, Down,3(expected:3rates, Up and Down nothing until a click).- Fresh start, floating palettes, no click: Tab (expected: palettes hide, no focus). What is the shortest keyboard route to a slider?
- Culling: focus a slider, press Left; focus a button, press Space (expected: the image changes, the control does not).
- Modules panel: stops per module, arrows, type-ahead (expected: two, cone, none).
- Parameters: Tab through a long module (expected: out of view).
- Graph of thirty modules: stops, entry and exit, and the view following the focus.
- Viewport: focus by Tab; arrows pan;
C, then Enter and Escape; what reaches a placed shape.
What the walk changes
The order to follow for egui-pop now, by the same measure:
- Done: item 20, Enter answers the dialog it opens. A bug skipping a confirmation. New, and first.
- Done: item 21, modal overlays give the focus back. Every dialog and palette use lost the place. New.
- Done: item 3, one focused panel. What Helios’s keys depend on.
- Done: item 7, focus scrolls into view, up from seventh: it is the first thing a Tab user meets, 35 stops out of view on the gallery’s first screen. Windowed rows follow, each one reached drawing the next.
- Item 10, the side list as a
ListView. Up from tenth, for the same reason: 57 stops before any page, and it removes the worst of the rows out of view. - Done: item 6, focus keeps its place, also after a button changing the panels.
- Done: item 8, no stops that show nothing, with the menu’s frame.
- Done: item 5, F6 through the shell. After 3 as planned. A terminal is not the risk it was read to be.
- Done: item 22, a popover’s end; then done: item 15. Small, confirmed.
- Done: item 4, a focus you can see, down from fourth: a plain button does show the focus, the gap is telling it from a press and from the pointer’s, and the stops that show nothing are item 8’s.
Items 9, 11 to 14, 16 to 19 keep their order after these (9 done); 9, 11, 14 and 16 are confirmed by the walk, 12, 13, 17 and 19 were not walked. Item 2 is done.
Sources
The sources are linked where they are used. The main ones: VS Code’s accessibility docs and navigation actions, JetBrains’ tool windows, Blender’s menus, darktable’s shortcuts, Qt’s focus, GTK’s panes, the ARIA practices on keyboards and egui’s #8548 and 0.37.0.
To double-check: Adobe’s pages (read through search excerpts only), VS Code’s Ctrl+0, and anything marked as a forum’s.
Scrolling survey: when a scroll bar shows, and what the wheel does
This survey settles how egui-pop’s scroll bars and wheel should behave. It starts from a page list in the gallery that ran past the window’s bottom with nothing to say so. It reads what egui gives and what egui-pop does with it, compares the desktops (GNOME and GTK, macOS, Windows 11) and the applications (VS Code, JetBrains IDEs, Blender, darktable, Lightroom Classic, Photoshop, Qt), and ends with a recommended default, the tokens and settings it needs, and a ranked list of changes. egui-pop’s main user is a photo editor, whose panels are long and full of sliders, so that weighs in the ranking.
Read on 2026-10-30, on egui 0.36.2 (with a look at 0.37.0). Nothing was built or run for this page: what it says of egui-pop comes from reading the code, and the first change confirms it in a test. Claims from forums and bug trackers are marked (forum); the rest come from vendors’ documents or source code.
Summary
- Bars should be visible at rest by default, when the content overflows. Thin and quiet, widening under the pointer, not egui’s “nothing until hovered”. Nothing in today’s default tells someone who has not moved the pointer over a list that it continues.
- The hidden bar is the industry’s default, and its most lasting complaint. GNOME, macOS with a trackpad and Windows 11 all hide bars at rest, and all three had to add a way back. Applications that draw their own interface moved the other way: Blender went from hidden (2018) to “always visible, but thin and dim” (2022); darktable shows its panels’ bars by default.
- Follow the system one way only. A person who turned on “always show” in the system gets full bars. A system left at its default of hiding does not hide ours, since most people never chose it. A setting in the application covers the rest.
- The evidence is thinner than the opinions. Nielsen Norman Group’s guidance is clear (“offer a scrollbar if an area has scrolling content”) but dates from 2005 and is not an experiment on overlay bars. No controlled study of hidden or overlay bars was found. The case rests on guidance, vendors’ own reversals and years of complaints.
- Width at rest and hit area are two things. egui already senses the bar’s full width while drawing it thin, which is what the complaints about thin bars ask for. The complaints that remain are about what lies next to the bar: darktable’s and Lightroom’s panel-hiding controls, right beside it.
- The gallery’s list has a second problem under the first. As the code reads, a shell panel alone in its area is drawn bare, with no scroll area, and the gallery’s page list adds none: it is cut at the window’s bottom and does not scroll at all. Visible bars would not have helped it. Most of the gallery’s pages are in the same case.
- The other gaps are small and separate: plain scroll areas take no keyboard at all, the wheel’s containment exists only in sections, its speed has no setting, and the system’s reduced motion is not read.
egui-pop today
What egui 0.36 gives
From containers/scroll_area.rs, style.rs and
input_state/wheel_state.rs:
| Subject | Behaviour |
|---|---|
| Presets | ScrollStyle::floating(), the default: no bar at rest (opacity 0), floating_width 2, bar_width 10, the thumb at 0.6 under the pointer and 1.0 over the bar. solid(): takes room, 6 wide, 4 from the content, opaque. thin(): floating with 6 points of room kept for it, opaque at rest, translucent once widened |
| When a bar exists | ScrollBarVisibility: VisibleWhenNeeded (the default), AlwaysVisible, AlwaysHidden, per scroll area |
| Hit area | The whole bar_width, whatever is drawn: “We always sense interaction with the full width” |
| Thumb | handle_min_length 12 |
| Click on the track | Jumps there, the thumb centred on the pointer, and goes on as a drag. No page-by-page option |
| Keyboard | None: scroll_area.rs reads no key, and egui’s sources handle Home and End only in text. scroll_to_* is for code |
| Hints | ScrollFadeStyle: a fade at each cut edge, on by default (strength 0.5, size 20), in the colour of the frames around (ui.stack().bg_color()) |
| Wheel | Taken only with the pointer over the area, and cleared from the input only if the area moved. So at its end it goes to the area around: nothing asks to keep it (0.37 is the same for a mouse wheel) |
| Speed | line_scroll_speed, 40 points a line on native; MouseWheelUnit::Point as given. ScrollArea::wheel_scroll_multiplier per area |
| Smoothing | A wheel’s lines go in over several frames (90 % in 0.1 s, a constant, “TODO: parameterize”); a trackpad’s small deltas do not |
| Sideways | horizontal_scroll_modifier Shift, vertical_scroll_modifier Alt, zoom_modifier Ctrl. always_scroll_the_only_direction is off: a horizontal-only area needs Shift |
| Inertia | None in 0.36 beyond what the system sends. 0.37 adds KineticScrollStyle (decay_time 0.5 s, rubber_band on, trackpads and touch) and MouseWheelSource |
A theme can set all of ScrollStyle. It cannot set the thumb’s or track’s
colours in it: those are the widget states’ (see
the upstream draft), which
UiPop::scroll_area works around with a scope. egui has no “while scrolling”
state either; the wheel needs the pointer over the area anyway, so it would
differ from “hover” only for keys and code.
What egui-pop does with it
ScrollBarKit(crates/egui-pop-core/src/kit/scroll.rs, the kit’sscroll-bar) defaults to egui’sfloating(), and a test holds every built-in theme to that.scroll-bar.visibilityishover,alwaysorscroll(drawn ashover, and reported).alwaysis loud. It draws the bar at full width with the thumb at opacity 1, intext.defaultby default, about 13:1 onpop-dark’s panel, over an opaquesurface.sunkentrack. Switching a theme toalwaysis available, but it is not a default anyone would keep. There is no value for “thin and quiet at rest”, andfloating_allocated_widthis forced to 0, so a bar at rest always lies over the content.- Sections force the bar on when the whole stack overflows, and only
then. A wheel over a body stops there (
contain_wheel, see Collapsible sections). This was the only place with containment as this page was written, until item 7, and is the only forced bar. - Keys. The data views (
views::nav, the list, the tree, the library’s grid), the terminal and the editor read Page Up/Down and Home/End. A plain scroll area did not, as this page was written;UiPop::scroll_areadoes since item 6. - Profiles (Pointer gestures) set the three
modifiers through
InputOptions, not the speed.input.wheel_devicesorts mice from trackpads for canvases. - Reduced motion sets
animation_timeto 0 andscroll_animationto none (theme.rs). It covers bars’ widening andscroll_to_*, not the wheel’s smoothing, which is egui’s constant; since item 14, egui 0.37’s coasting and rubber band too. Nothing in egui-pop reads the system’s preference:ThemeSpec::reduced_motionis up to the application. - Colours reached few areas, as this page was written. Two call sites used
UiPop::scroll_area(sections, the gallery’sscopedpage); about 25 library scroll areas calledegui::ScrollAreadirectly and kept the button’s colours. Since item 9 they all go through it.
Where the gallery and Helios scroll, and whether anything says so
| Where | Scrolled by | Says so at rest? |
|---|---|---|
| Gallery, page list (side bar) | Nothing, as the code reads: a bare panel (below), and pages adds no scroll area | No bar and no scroll: cut at the window’s bottom |
| Gallery, pages | Read before item 2, which gave them a scroll area: the 12 page files with their own ScrollArea; the other 46 have none, or none around the whole page (table.rs, for one) | No. Those without are cut if the window is short |
| Gallery, Lists and tables | DataTable (egui_table’s SplitScroll), ListView (views::rows) | No; for the table, rows cut at its edge |
| Gallery, Sections | Each body, and the stack when too short | Only the stack’s bar |
Gallery, scoped page | A demonstration of a kit with always | Yes |
| egui-pop’s panels and dialogs: file picker, settings, palette, jobs, history, theme editor, tips | Plain ScrollArea | No |
| Library grid, thumbnails, viewer, editors | Plain ScrollArea, drawn by the view | No |
| Helios: parameters, modules, queue, decisions, duplicates, stacks | Plain ScrollArea (six in helios-gui) | No |
| Helios: library, mask tree | egui-pop’s grid and tree | No |
Bare panels. The shell’s panels (PANEL_SIDE_BAR, PANEL_MAIN,
PANEL_INSPECTOR) go through zone_panel, which declares them bare. Alone in
their area, draw_area calls show_panel directly: no dock, and no scroll area
from anyone (show_zone, show_story and show_panel add none). Beside another
panel, the same content is in a dock tab, and egui_dock wraps a tab’s body in a
ScrollArea on both axes, as the workbench’s Viewer does not override
scroll_bars. So whether a block overflowing a panel scrolls depends on whether
a second panel shares the area. The same goes for an application’s blocks in
those zones.
Helios’s three themes extend pop-* and set no scroll-bar token, so it has
the default everywhere. A list or a panel says nothing until the pointer comes
over it. And in its darktable profile, where the wheel over a slider changes
the value, a parameter panel’s bar is the plain way to move it.
The systems
GNOME and GTK
- What it does. Scrollbars are “scrolling indicators” that fade out and
grow when approached: “the size of the scrolling indicator increases to
present a larger target” (Emmanuele Bassi, GTK developer, on
GNOME Discourse)
(forum). GTK’s source fades them after 2 seconds
(
INDICATOR_FADE_OUT_DELAY,gtkscrolledwindow.c). - The way back.
gtk-overlay-scrolling: “If this is set to FALSE, scrolled windows will have permanent scrollbars”. An application can opt out for one window (set_overlay_scrolling). For users the key isorg.gnome.desktop.interface overlay-scrolling, hidden from GNOME 3.34 (Linux Uprising) (forum), then an accessibility switch, “Always show scrollbars” (libadwaita issue 859), said to be in Accessibility › Seeing (forum). - Complaints. GTK issue 1907, “Option to always show scrollbars”: “some users don’t feel comfortable with this behaviour”. The Discourse thread above: “they should also ALWAYS be visible”. GIMP issue 1796: “Overlay effect on scrolling bars impedes to slider controls”. Launchpad 782754 (Ubuntu’s overlay bars, 2011), “unusable to people with color blindness/bad eye sight” (all forum).
- Track.
gtk-primary-button-warps-sliderchooses between jumping there and moving by a page. - Wheel. A notch moves
pow(page_size, 2/3), so a taller view steps further; Shift swaps the axes; a wheel event is stopped unless it scrolled in a direction the area cannot, or overshoot is under way (source).
macOS
- Setting. Appearance settings, “Show scroll bars”: “Automatically based on mouse or trackpad”, “When scrolling”, “Always”. So a mouse gets bars and a trackpad does not by default: the only system here that decides by the device.
- Track. Same page, “Click in the scroll bar to”: “Jump to the next page” or “Jump to the spot that’s clicked”.
- HIG. Scroll views: “Make it apparent when content is scrollable. Because scroll indicators aren’t always visible […] displaying partial content at the edge of a view indicates that there’s more content”. “Avoid putting a scroll view inside another scroll view with the same orientation”. “Support default scrolling gestures and keyboard shortcuts”. Page-by-page scrolling should keep “a unit of overlap”. “Use small or mini scroll bars in a panel”. An older edition, still in mirrors, added “Avoid moving window content when transient scroll bars appear”; today’s page no longer says it.
- Scroll edge effects are not a hint: “Only use a scroll edge effect when a scroll view is behind floating interface elements.”
Windows 11
- Look. A 2-pixel panning indicator that morphs into the scroll bar when
the mouse or pen comes over it (Scroll viewer controls).
“When the scrollbar is visible it is overlaid as 16px on top of the content
[…] leave 16px of padding on the edge of the viewport”. Even
Visible“appears only when the mouse cursor is over it unless the viewport cannot display all of the content”. - Setting. The API is
UISettings.AutoHideScrollBars, “intended for handling mouse cursor proximity in custom UI frameworks and custom scroll bar implementations”, with a change event. Its documentation names Ease of Access › Display › “Automatically hide scroll bars in Windows”. On Windows 11 the switch is Accessibility › Visual effects › “Always show scrollbars” (Windows Central) (press; no Microsoft page found). - Complaints. “Why is the scroll bar in Windows 11 so narrow? In what world is this an improvement?” and “Is there a fix yet for the narrow scrollbars”; the switch reportedly does nothing for older applications (forum).
- Wheel.
WHEEL_DELTAis 120 and each one should give “one increment” (WM_MOUSEWHEEL); the person sets the lines per notch, 3 by default (SPI_GETWHEELSCROLLLINES). winit divides byWHEEL_DELTAand does not read that setting, so egui-pop ignores it today.
VS Code
From its sources, which are the reference for these defaults:
- Bars.
editor.scrollbar.verticalandhorizontal:auto,visible,hidden;verticalScrollbarSize14,horizontalScrollbarSize12; arrows off;useShadowson, a shadow along a scrolled edge (editorOptions.ts).autohides it 500 ms after the pointer leaves, unless dragged (HIDE_TIMEOUT,scrollableElement.ts). - Track.
scrollByPageoff: a click jumps; on, it pages. The same for lists (workbench.list.scrollByPage,listService.ts). - Wheel.
alwaysConsumeMouseWheelis on for the editor and for lists, even with nothing to scroll (listView.ts).mouseWheelScrollSensitivity1,fastScrollSensitivity5 with Alt,smoothScrollingoff,scrollPredominantAxison, so a trackpad’s drift does not move the other axis. Shift turns the wheel sideways, except on macOS, which does it itself.
JetBrains IDEs
Scrollbar guidelines, the clearest rule found: “Always show the scrollbar when it is important to understand which part of the content is currently shown”, else “Respect the OS settings when showing the scrollbar”. “Reserve the space for a vertical scrollbar if there is a column on the right side”. On a Mac, people missing a bar are told to set macOS to “Always”, and object to changing the whole system for one program (JetBrains community) (forum).
Blender
Draws its own interface, so its path is the closest to egui-pop’s:
- 2018: “Hide & shrink scroll-bars based on cursor position”.
- 2022: reversed, “always visible, but thin and dim, and widen and become more visible as your mouse approaches”.
- People on its design thread found the thin bars hard to catch (forum, seen only in search results: the page refused the fetch).
- Wheel: “if the region has no zoom level, it can also be scrolled by using the Wheel”; middle drag is the main way. Ctrl and the wheel cycle a menu’s value or a tab.
darktable
- Preferences › miscellaneous: “always show panels’ scrollbars”, on by default, restart needed. So a photo editor’s panels show their bars. A separate option covers the centre view (off).
- “Mouse wheel scrolls modules side panel by default” is off: the wheel changes values, Ctrl+Alt and the wheel scroll the panel. With the wheel on values, the bar matters more.
- Complaints are about the bar’s width and neighbours, not its presence: 2026, version 5.6, hard to hit, so people “accidentally hit on the area which hides the modules”, fixed by a CSS tweak; one user pushes the pointer against the screen’s edge. 2025: “The scroll bar is very narrow”, and what people liked was going to the edge and using the wheel (forum).
Lightroom Classic and Photoshop
- Lightroom. No Adobe document found. The same complaint as darktable’s, open since 2015: “The panel scroll bar and close panel bar arrow section are annoyingly close together”, thin on 4K, 118 replies, the last in October 2026: “11 years and this annoyance still exists”. The bar also comes and goes with the panel’s fit (thread) (forum).
- Photoshop. Nothing was found on its panels’ bars, and this page makes no claim on them. The “Zoom with Scroll Wheel” preference decides what the wheel does on the canvas, Alt reversing it (Adobe Community) (forum).
Qt
QAbstractScrollArea: “The default policy is Qt::ScrollBarAsNeeded”, per area.QStyle:SH_ScrollBar_Transient(transient bars are the style’s choice),SH_ScrollBar_LeftClickAbsolutePosition(jump or page),PM_ScrollBarExtent(width). A theme decides what egui-pop’s kit decides.QApplication::wheelScrollLines: 3 by default.- On a Mac,
ScrollBarAlwaysOnalone reportedly did not help, and a proxy style returning false for the hint did (Qt interest list) (forum).
The evidence
- Nielsen Norman Group. Scrolling and Scrollbars (Nielsen, 2005): “Offer a scrollbar if an area has scrolling content”, “Hide scrollbars if all content is visible”, “use scrollbars that look like scrollbars”. The Illusion of Completeness (Flaherty, 2016): when “the visible content on the screen appears to be complete”, people stop; show content bleeding off the edge. It does not mention fades. Scrolling and Attention: “Include signifiers (such as cut-off text)”, “Beware of false floors”.
- No controlled study of hidden or overlay bars was found. A search of the open web gave opinions and bug reports; the ACM Digital Library was not searched.
- WCAG 2.2. Non-text contrast asks 3:1 for what is “required to identify” a component, and exempts what the user agent draws. It does not name scroll bars: that it applies to a thumb is this survey’s reading. Target size (minimum) asks 24 by 24 CSS pixels with exceptions, and gives a browser’s scrollbars as the exception for what the user agent draws. Bars egui-pop draws are not the user agent’s, and these criteria are written for the web: a target to aim at, not a legal bar on a desktop application.
- MDN.
scrollbar-width:thinornone“can make content hard or impossible to scroll”; “Avoid usingnone”.scrollbar-gutter:stablekeeps the room so that the bar’s arrival does not shift the layout.
Hints without a bar
- Partly visible rows. Recommended by Apple’s HIG and NN/g above, and by Jared Spool’s “cut-off look”. But a list of same-height rows ends on a whole row by chance, and a sized panel may too: it cannot be a guarantee. A list that wanted one would have to pick its height for it, which layouts do not allow.
- Fades and shadows. VS Code has
useShadows; egui’s fades are on by default. No usability evidence was found for or against them. They say that there is more without saying how much, and they do not help find the end. A complement, not a substitute.
The wheel
- Chaining or containment. The web chains by default: “once the dialog
box’s scroll boundary is reached, the underlying page will then start to
scroll”.
overscroll-behaviorcontainstops it. VS Code contains by default. GTK contains unless a direction cannot scroll. egui chains and offers no option, 0.37 included. The harm is greatest in a nested list: a notch too many moves the whole panel under the pointer, and the next notch lands on another widget. - Smooth or stepped. VS Code: stepped by default, smooth in a setting. egui: smoothed and constant. Scrolling a list of sliders with smoothing means the row under the pointer changes for 0.1 s after the notch; Helios’s guarded wheel keeps that harmless.
- Sensitivity. Windows and Qt: lines per notch, 3. VS Code: a multiplier. GTK: by the view’s height. egui-pop: fixed at 40 points a line.
- Shift for sideways. Common ground (GTK, VS Code, Windows applications; macOS does it in the system). egui-pop’s profiles keep it and may change it.
- Trackpad inertia. The system’s on macOS, as egui’s sources say of its momentum phase; 0.37 adds kinetics and a rubber band in egui. Not checked on Linux or Windows.
- Reduced motion.
prefers-reduced-motionmaps to a setting on every system. The portal has a standard key (org.freedesktop.appearance reduced-motion), and WindowsSPI_GETCLIENTAREAANIMATION. WCAG 2.3.3 (AAA) treats the movement that brings content into view as essential to scrolling; only what is added to it must be possible to turn off. - Keyboard. MDN on
overflow: “In some browsers, scrolling content areas are not keyboard-focusable, so they cannot be scrolled by a keyboard-only user”. axe flags it as WCAG 2.1.1. Chrome and Firefox now make scrollers focusable themselves (version 127 or 130 for Chrome: the sources disagree).
Compared
| GNOME / GTK | macOS | Windows 11 | VS Code | JetBrains | Blender | darktable | Qt | egui-pop today | Recommended | |
|---|---|---|---|---|---|---|---|---|---|---|
| At rest | hidden | hidden on a trackpad, shown with a mouse | 2 px or hidden | hidden | follows the OS; editor shown | thin, dim (since 2022) | shown | by the style | hidden | thin, quiet |
| Setting | system switch | system, 3 values | system switch | per view | OS | none found | preference | per area, style | theme only | application + system’s “always” |
| Under the pointer | grows | as the setting | morphs to a bar | shows | not found | widens | not found | by the style | fades in thin, widens over the bar | widens over the bar |
| Takes room | no | no (transient) | no: “leave 16px” | no | “reserve” by a column | not found | not found | by the style | no | a little, kept for it |
| Width | grows on approach | small, mini in panels | 2 to 6 px | 14 / 12 | not given | not given | narrow, a CSS tweak | PM_ScrollBarExtent | 2 to 10 | 4 to 10 |
| Click on the track | a setting | a setting | not checked | jump, or scrollByPage | not found | not found | not found | style hint | jump | jump |
| Wheel at the end | stops (see above) | not checked | not checked | stops | not found | not found | not found | not checked | chains; stops in sections | stops in nested views and popups |
| Wheel speed | by view height | system | system: 3 lines | multiplier | not found | not found | not found | 3 lines | fixed | a setting |
| Keyboard on a plain area | not checked | HIG: expected | documented input | not checked | not found | not found | not found | not checked | none | Page Up/Down, Home/End |
“Not found” means the search did not give it, not that it lacks it.
The recommended default
Should bars be visible at rest by default? Yes. A bar is drawn at rest whenever the content overflows, in every built-in theme:
-
4 points wide at rest, 10 under the pointer, as it is today: the hit area stays 10 at all times, and the pointer against the window’s edge reaches it.
-
Dim, but 3:1 against the panel. In the thumb’s default colour,
text.default:Theme and surface 0.4 0.45 0.5 0.55 0.6 0.65 pop-dark, panel#1b19163.12 3.62 4.17 5.44 pop-light, panel#f2f0ec2.73 3.06 3.46 3.98 So 0.45 and 0.6, each theme’s own, held by a test computing the ratio through the same blending as the painter (these figures use a plain alpha blend, so they are approximate). For comparison, the thumb in the kit’s example,
#4b4b4b, is 2.0:1 onpop-dark’s panel. -
No track at rest. Over the bar, the track as egui draws it today.
-
6 points kept for it (egui’s
floating_allocated_width, as itsthin()), so that text and a slider’s end do not lie under the thumb, and widening covers the content by 4 points without moving it. Content narrows only when it starts to overflow; for a list, that is once. -
A thumb at least 24 points long (egui’s 12 is small on a long list).
-
No bar when the content fits, as egui does (
VisibleWhenNeeded, and NN/g).
Is it a setting? Yes, appearance.scroll_bars:
auto(default): what the theme says, raised toalwayswhen the system asks for it.always: full width, opaque thumb, a track, for those who want the old bar or a better target.hover: egui’s own, today’s behaviour, for those who prefer a clean panel.
Does it follow the system? One way only. The system’s “always show”
(GNOME’s switch, Windows’ switch, macOS’s “Always”) raises auto to always:
someone asked for that, often for a reason of sight. The system’s default of
hiding does not lower it: GNOME’s, Windows’ and a Mac trackpad’s hide by default
and nobody chose that, so following them gives this very bug on every fresh
install. JetBrains respects the OS in both directions and keeps the bar in the
editor because “it is important to understand which part of the content is
currently shown”; for a photo editor’s panels and grids, that is always.
A kit decides for itself: a theme with visibility: hover keeps its look and
its contract. pop-high-contrast takes always, 14 wide, its thumb at opacity
- Pointer profiles do not touch the bars: a profile is gestures, not a look.
The wheel: contained in nested views, popups and dialogs, chained in plain panels (next section’s item 7), its speed a setting. The track: a click jumps, as today, as on GTK’s and VS Code’s defaults. Keys: Page Up/Down and Home/End on every plain scroll area.
Tokens and settings needed
| Name | Meaning | Default |
|---|---|---|
scroll-bar.visibility | adds rest: thin and quiet at rest, wide over the bar | rest in the built-in themes (hover today) |
scroll-bar.width | as today: the bar at its widest, and its hit area | 10 |
scroll-bar.width-rest | the bar’s width at rest, under rest (egui’s floating_width) | 4 |
scroll-bar.opacity-rest | the thumb’s opacity at rest, in every scroll area (egui’s dormant_handle_opacity) | 0.45 dark, 0.6 light |
scroll-bar.room | room kept for a floating bar (floating_allocated_width) | 6 |
scroll-bar.min-length | the thumb’s least length (handle_min_length) | 24 |
scroll-bar.fade-strength, fade-size | the cut edge’s fade, late and optional (ScrollFadeStyle) | egui’s |
appearance.scroll_bars (setting) | auto, always, hover | auto |
input.wheel_speed (setting) | a multiplier on line_scroll_speed; a trackpad’s points are left alone | 1 |
What egui-pop should take, ranked
Sizes: S is under a day, M a few days. One pull request each.
- The gallery’s page list scrolls, and says so. First a test at a short
window, to confirm what this page only read: the list is cut and does not
scroll.
pagesthen gets a scroll area of its own, filling the side bar, its bar forced on asSectionsdoes, with a snapshot at a short size. Item 4 makes the forcing needless and removes it; the scroll area and the snapshot stay. Size: S. - Done: nothing in the gallery is cut without a way to it, and panels say what
they give. The gallery’s
pageandplaygroundwrap a page in a scroll area unless it stays inside the zone itself, by a list in the gallery’s shell (shell::FILLS_THE_ZONE) rather than a flag on the story, so the library does not change. Read as a whole, few pages fill the zone: most canvases, stacks and editors stand among text and controls, at sizes of their own, and scroll with the page, keeping the wheel over themselves. A test walks every page at a short window. Workbench says that a panel alone in its area has no scroll area and one in tabs has. Whether the shell’s panels should always scroll is a question for that page, not settled here: a viewport inMAINmust not. - Done: the kit learns “thin and quiet at rest”.
visibility: restand the tokens above inScrollBarKit, no theme using them yet, so the pictures that change are those of the forced bars, which take the quiet look: the sections’ stack, and the gallery’s list and pages.ScrollBarKit::seen_at_restis that forcing, and leaves analwaysbar as it is. - Done: visible at rest in the built-in themes. The themes set it, the test
that held them to
floating()is replaced by a 3:1 test per theme on every surface, through egui’s blending, which raisesopacity-restwhere a theme’s text is close to its surfaces. The high contrast themes takealways,besidethe content so that it covers nothing. The gallery’s list loses its forcing. The snapshots are regenerated. - Done: the
appearance.scroll_barssetting.auto,always,hover, on the settings page, written into the theme’s spec and taking overscroll-bar.visibilityandplacementwhen the theme resolves, so that it reaches the style with the theme and keeps across a change of theme.alwaysgoesbesidethe content, as a full bar over it would hide it, and brings a track where a theme has none;hovergoesoverit, as egui always shows a bar beside the content. The rule that a system only raisesautois in, throughAppBuilder::system_always_shows_scroll_bars; item 10 is what reads the system and gives it. - Done: keys on plain scroll areas. Page Up/Down (the view’s height less a
row, Apple’s “unit of overlap”), Home/End, the arrows by a row, in
UiPop::scroll_area; item 9 brings the others. A stop only when something overflows with nothing focusable inside, as browsers do. The area holding the focus goes first, the one under the pointer only with nothing focused, as a widget elsewhere may be reading the key. A binding wins as the dispatcher takes the key first, in whichever scope it is bound, and what it sends while held: the area opens no focus scope of its own, as one would change what F6, hover mode and the focus’s place read as the panel’s, so nothing can be bound to “in a scroll area”. egui’s widgets read keys without taking them, so a focused widget keeps them by sensing drags or byfocus::takes_keys, and the arrows stay egui’s while one is focused (inputs). - Done: containment as an option, used by what nests.
contain_wheelmoved out of sections tocore::ui, withUiPop::scroll_area_containedfor an area drawn through the kit, asScrollAreais egui’s type and takes no option of ours. Until item 9 the views callui::contain_wheelafter their own area: the list and the tree (views::rows), the library’s grid, the thumbnail grid, the editor, and the table throughcontain_wheel_in, asegui_tablehides its area. So do the file picker’s previews, in their pane’s own area. It holds only the ways with something to scroll, so a short list hands the wheel on, as a section’s body does. Two the plan named take nothing. The terminal already took every wheel over it, whether its scrollback moves or not. A popup or a dialog is a layer of its own, and an area under it does not see the wheel, which a test holds. A plain panel with no scroll around it has nothing to chain to. Plain bodies keep chaining: a sizeable text in a panel should not trap the wheel. - Done: wheel speed.
input.wheel_speed, in Settings › Input, multiplyingline_scroll_speed, published with the pointer map, and 0.25 to 5 by quarters. Canvases read it too, throughwheel_inputs, so their wheel zoom follows; a slider’s wheel still steps once a notch. Its default on Windows comes from the lines a notch (3 lines being today’s 40 points), throughAppBuilder::system_wheel_linesas egui-pop reads nothing itself, andegui_pop_platform::wheel_linesreadsWheelScrollLinesfrom the registry rather than callingSPI_GETWHEELSCROLLLINES, astext_scaledoes, which keeps the crate free ofunsafe. “One screen at a time” counts as 3. - Done: the library’s scroll areas go through
UiPop::scroll_area. All 27 inegui-pop-api,-core,-viewsand-editors(-viewporthad none), and the gallery’s pages, so a kit’s thumb colours and item 6’s keys reach every list, panel and dialog. The forms a view needs are added:scroll_area_viewport(show_viewport: the list, the tree, the library’s grid and filmstrip, the editor) andscroll_area_rows(show_rows: the thumbnail grid, the theme editor’s font list). The views keep callingui::contain_wheelafter their area, and the file picker’s previews takescroll_area_contained. A view whose focusable widget lies around its area (the list, the tree, the grid) callsfocus::takes_keysinside it, so that the area does not become a second Tab stop; with nothing focused, the pointer over such a view pages it. - The system’s “always show”. In
egui-pop-platform, alongsidetext_scale, with the same sources: on GNOME the portal’sorg.gnome.desktop.interfaceoverlay-scrolling(and its change signal), on WindowsUISettings.AutoHideScrollBars, or the registry astext_scaledoes, on macOSNSScroller’s preferred style. Feedsauto, throughAppBuilder::system_always_shows_scroll_bars. Size: M. - The system’s reduced motion. The portal’s
reduced-motion,SPI_GETCLIENTAREAANIMATION, macOS’s accessibility flag, intoThemeSpec::reduced_motionuntil the user sets it. Wider than scrolling, and worth doing for itself. Size: S. - Done: only one direction, any wheel.
always_scroll_the_only_directionon in the theme’s style (theme::style_with), so that a horizontal strip takes a plain wheel; egui’s default wants Shift, and nobody finds that on a strip with no bar. Sections andcontain_wheel_inalready read this flag. It reaches every scroll area moving one way only, the filmstrip among them, and at its end the wheel goes on to the area around it. The dock’s tab strip and the timeline already took a plain wheel, by their own code. - Upstream, as drafts for a person to post. A
ScrollAreaoption to keep the wheel at its end (docs/upstream.mdhas “not filed yet”), and a way to turn off the wheel’s smoothing, for reduced motion. Size: S. - Done: egui 0.37’s kinetic scrolling, checked. Tests (
kinetic.rs) found it as egui documents it: a trackpad stretches an area past its end while the fingers push and it springs back, a touch drag coasts after the release, and a mouse wheel does neither, whatever the theme. Under reduced motion it was all still on, as the theme set onlyanimation_timeandscroll_animation: the theme now turnsrubber_bandanddecay_timeoff with them, and gives egui’s back when motion returns. The bounce on panels of sliders is left on: it shows only on a trackpad or a touch screen past an end, moves no value (a slider holding the wheel takes it before the area sees it), and a panel that wants it off setskinetic.rubber_bandon its ownUi(inputs).contain_wheelholds againsthas_scrolling_ancestor: egui 0.37 hands a trackpad at an area’s end on to the area around it, and containment keeps it there, which a test holds. - Fade tokens. Only if a theme asks. Also check that a fade’s colour is right on a list drawn over another fill than the frames’, as egui takes the frames’. Size: S.
What to skip, and why
visibility: scrollmade real. The wheel needs the pointer over the area, sohoveralready shows then; withrestas the default, it is a fourth look nobody asked for. Keep it reported ashover.- Page-by-page on a track click, Shift+click. Jump is GTK’s way, VS Code’s
default and egui’s own; paging needs an egui change for a habit few have. If
asked, it is one setting, as
scrollByPage. - Arrows on the bar. VS Code has them off by default. They take room for a use the wheel and the keys cover.
- Hiding on a timer (VS Code’s 500 ms, GTK’s 2 s). A cost in repaints, for a
look the
hovermode already gives. - A choice between smooth and stepped. egui’s constant cannot be set from outside, and a canvas already has the raw wheel. Item 13 asks for what is needed.
- Fast scrolling with Alt (VS Code’s 5 times). Alt is the vertical modifier and steps a slider in the default profile. A person who wants speed has item 8.
- Device-based bars (macOS’s “automatically”). winit does not tell a mouse
from a trackpad, which is why
input.wheel_deviceexists. It would hide bars on laptops, the very bug, for a small gain. - Copying each app’s bar in its pointer profile. A profile is gestures; bars are the kit’s. Lightroom’s habits do not need Lightroom’s bar.
- A guaranteed partly visible row. It would mean sizing lists by rows; layouts decide their height. The bar does the job.
- A minimap or a scrub bar with dates. Each is a widget of its own, for a view that asks for it.
What belongs to Helios
- Nothing to change for the default. Its themes extend
pop-*and get it with the update; its snapshots are regenerated then. - Blocks in shell zones. Anything it puts in
SIDE_BAR,MAINorINSPECTORhas no scroll area when alone there: to check against item 2. - Its six plain
ScrollArea(params,modules,queue,decisions,duplicates,stack_review) move toui.scroll_area, as item 9 did for egui-pop’s own, so that keys and colours reach them. - The parameter panel’s edge. The complaints of darktable and Lightroom are
about this very place: a thin bar next to something that hides the panel. Helios
should keep the panel’s grip and any hide control away from the bar: its
docs/dpi.mdalready notes that a bar at the window’s edge loses 5 points to the grip. The pointer against the edge should land on the bar, as darktable’s users like. egui-pop gives the room token; the layout is Helios’s. - The wheel over a slider keeps its rule (decided 2026-10-12): the guarded wheel scrolls the panel, the darktable profile changes the value. Under that profile the bar is the plain way to scroll, which argues for it the more.
- The library grid at 100,000 images is where the position matters most, and where a minimum-length thumb stops being proportional. A larger grid control (a date beside the thumb) would be a decision of its own, not decided.
- Settings. Its Settings › Input should list
input.wheel_speed, its Appearanceappearance.scroll_bars, if it does not take egui-pop’s pages as they are.
Sources
The sources are linked where they are used above. The main ones:
Apple’s HIG
and Mac settings,
Microsoft’s scroll viewer
and AutoHideScrollBars,
GTK’s settings
and source,
VS Code’s source,
JetBrains’ guidelines,
Blender’s 2022 commit,
darktable’s manual,
Qt’s QStyle,
NN/g,
WCAG 2.2,
and egui 0.36.2’s and 0.37.0’s own sources.
Web survey: the gallery in a browser, and reporting from it
This survey lists every problem egui-pop has, or can have, in its web
build (wasm32-unknown-unknown, eframe’s web runner), and ranks them by
one goal: the gallery on the web
(quazardous.github.io/egui-pop/gallery)
should be an easy way for anyone to report a bug or suggest an
improvement. A problem that stops a visitor from reaching the inspect
picker, copying what they see, or opening an issue weighs more than one
that only makes a page differ from the desktop.
It covers the reporting path itself, keys, platform services, storage, rendering and performance, media and embeds, accessibility, and a walk through every gallery page, and ends with proposed follow-ups ranked by value for that goal and by cost.
Read and run on 2026-11-04, against egui-pop’s main (a6e6ed24), egui
and eframe 0.37.0, wgpu 30.
How much of this was run. The gallery was built for the web from
main (release, wasm32-unknown-unknown, wasm-bindgen 0.2.129: the same
crate and features as the CI job “Gallery for the web”, without Trunk’s
packaging), served locally and driven headless with Playwright in three
browsers on Linux: Chromium 140 (Playwright’s headless shell, WebGL 2
through SwiftShader), Chrome 157 (headless, WebGPU on SwiftShader) and
Firefox 141 (Playwright’s build, WebGL 2). The deployed site was loaded
once more to time its start. Safari, Windows and macOS were not run;
what is said of them is read. Every finding says where it comes from:
- [browser]: reproduced in the headless browsers above (the browsers named when they differ).
- [read]: from egui-pop’s or eframe’s source, or a document; not seen happening. Treat it as a strong hypothesis.
- [upstream]: documented by egui, eframe, a browser or a standard, linked.
Headless browsers inject keys into the page, below the browser’s own
shortcuts: a run shows what the page receives and whether eframe cancels
the browser’s default action (defaultPrevented, read by a capture
listener on window), never what the browser itself then does with a
key it keeps. That last part is read from the browsers’ documentation.
Already in progress (a separate change, not repeated here): the
browsers take Ctrl+Shift+C (inspect) and F12 (devtools) for themselves;
the gallery turns devtools on by default; and on the web the user’s
keymap and settings are lost on reload, because App::builder().persist(dir)
needs a folder and only the layout goes to eframe’s storage. Rows that
touch them say “in progress”.
Already known: the application knows it is on the web only at
compile time (cfg!(target_arch = "wasm32")); keymap when conditions
have no isWeb; egui knows the operating system under the browser
(Context::os), but nothing knows which browser.
Summary
- The gallery runs everywhere it was tried. It starts in under 3 s locally and on the deployed site (Chromium, a fast link), and all 58 pages draw in Chromium and Firefox with no panic and no error, only warnings ([browser]).
- The reporting path exists but is hidden and split. Inspect,
Copy, and About > Copy version info all work on the web ([browser]),
but the inspect chord belongs to the browser and devtools are off (both
in progress), the inspect text has no version or platform, the version
info says
web (wasm32)without the browser or the OS, “Report a problem” opens the bare issue list with nothing filled in, the Help menu has no entry for it, and the repository has no issue template. - Most bound keys also reach the browser. eframe cancels the
browser’s action only for a fixed list (Ctrl with S, O, P or Comma;
Space; Tab; Backspace; the arrows; text). Its
should_prevent_defaultoption is never asked for key presses ([browser], [read]). So Ctrl+F opens the find bar as well as the editor’s search, F6 sends the focus to the address bar, F5 reloads the page and loses the session, Ctrl+Plus zooms the page, Ctrl+D offers to bookmark, Ctrl+Shift+Delete opens “clear browsing data” ([read], from each browser’s shortcut list). - A reporter cannot point at a page. There is no URL per page: a link always opens the overview, and a reload goes back to it ([browser], [read]).
- The first load is heavy. The deployed module is 33.6 MB (13.3 MB gzipped on the wire); nothing shows while it loads ([read], measured).
- No screen reader can read the canvas. eframe’s web runner drops AccessKit’s updates ([read], [upstream]).
- Platform services degrade quietly, mostly well. Copy and paste of text work ([browser]); notifications fall back to toasts; files come from an in-memory demo folder; there is no file drop, upload or download; full screen, quit and window commands do nothing on the web but stay enabled ([browser]).
The reporting path today
What a visitor does now to report a bug from the web gallery, step by step, with what each step costs. Measured in headless Chromium unless said otherwise.
- Know that the tools exist. Nothing on the landing page or in the gallery says how to report: the Help menu has “egui-pop on GitHub”, “Documentation”, “Tips…” and “About egui-pop gallery”; the “Report a problem” link is inside the About dialog and the About page only ([browser]). The Debug bridge page is the one place that says “Turn on Settings > Developer > Devtools to inspect” ([browser]).
- Turn devtools on. Settings (Ctrl+Comma) > Developer > Devtools. Until then View > Devtools (F12) and View > Inspect an element (Ctrl+Shift+C) are greyed with no reason given, and the chords do nothing at all, not even a toast ([browser]). On by default: in progress. The setting is lost on reload (in progress).
- Enter the inspect mode. Ctrl+Shift+C works in a headless browser ([browser]); in a real Chrome or Firefox the browser opens its own element picker first (in progress). The View menu entry works.
- Pick and copy. A click picks; the dialog’s Copy puts a text block
on the clipboard ([browser]): element, role, egui id, rectangle,
window, layer, zone, block, panel, plugin, theme, kit part, focus,
page, story and how it was picked. It has no version, platform,
browser or renderer. A swatch on the overview is named only as its
container (
GenericContainer (container)), as the debugging guide says of custom-painted elements. - Copy the version. A second copy, from the About page or dialog:
egui-pop gallery 0.3.0 (a6e6ed24), egui-pop and egui versions,Platform: web (wasm32),Renderer: wgpu: Gl, ANGLE (...)([browser]). The browser, its version and the operating system are missing; the commit is there. - Open an issue. “Report a problem” opens
https://github.com/quazardous/egui-pop/issuesin a new tab ([browser]: the page calledwindow.openwith that URL and_blank). No title, no body, no labels; the visitor must paste both copies and write the steps by hand. - Attach a screenshot. Only with the operating system’s or the
browser’s own tool (Firefox: Take Screenshot; Chrome: devtools’
“Capture screenshot”). The gallery has no screenshot command, though
eframe’s web runner does honour
ViewportCommand::Screenshot([read]:handle_viewport_commandskeeps that one). - Say where. The page cannot be given as a link (no URL per page), so the steps must say “click X in the side list”.
What a reporter must know beforehand, today: that devtools exist and where their setting is; that the browser’s Ctrl+Shift+C must be avoided (use the View menu); that two separate copies are needed; that “Report a problem” is in the About dialog; and that the page is not in the URL.
Reporting path problems
| # | Problem | What it breaks for a reporter | Evidence | Fix (size) |
|---|---|---|---|---|
| R1 | Ctrl+Shift+C and F12 belong to the browser | The documented inspect chord opens the browser’s inspector instead | in progress | in progress |
| R2 | Devtools off by default, the menu entries greyed with no reason, the chords silent | A reporter never finds inspect | [browser] | in progress (on by default); also a toast or tooltip saying which setting enables them (S) |
| R3 | The devtools setting is lost on reload | Each visit starts over | [browser]: on after the toggle, Ctrl+Shift+C did nothing after a reload | in progress |
| R4 | “Report a problem” opens the bare issue list | The reporter writes everything by hand; most will not | [browser] | done (2026-11-04): help.report opens issues/new with the issue form bug.yml filled field by field (template=, then title, version, platform, page, pick), or a body without a form, under 8 KB with the pick trimmed first |
| R5 | No “Report a problem” in the Help menu, the palette or the inspect dialog | The entry point is two clicks deep in About | [browser] | done (2026-11-04): help.report in Help and the palette, a Report… button beside Copy in the inspect dialog, and the About dialog’s link through the same command |
| R6 | The inspect copy has no version, platform, browser or renderer | Two copies to paste; half the reports will miss one | [browser] | Append the version info to the inspect text, or make the report one block (S) |
| R7 | The version info says web (wasm32): no browser, no browser version, no OS | Browser-specific bugs (keys, clipboard, WebGL vs WebGPU) cannot be told apart | [read] AppInfo::platform, [browser] | done for the browser and the OS (2026-11-04): the platform line reads navigator.userAgent (web (wasm32), Firefox 132 on Linux) |
| R8 | No URL per page | Steps cannot link the page; a reload loses it | [browser]: reload shows the overview; [read]: the web main uses Options::default() | Read and write the page in the URL’s hash (#page=files), as --page does on the desktop (S) |
| R9 | No screenshot from the app | The reporter needs an outside tool; many reports come without one | [read] | A “Copy screenshot” or “Save screenshot” command through ViewportCommand::Screenshot (supported by eframe’s web runner) and Context::copy_image or a download (M) |
| R10 | No issue template in the repository | A prefilled URL has nothing to aim at; free-form reports | [read] .github/ holds only the pull request template | done (2026-11-04): .github/ISSUE_TEMPLATE/bug.yml (what happened, expected, steps, version info, platform, page, inspected element), a light feature.yml and config.yml |
| R11 | Keys lost after a click outside the canvas | After the address bar or the browser’s devtools, chords do nothing until the canvas is clicked; a reporter thinks the key is broken | [browser]: after a blur, Alt+Down changed nothing; a click on the canvas restored it | Focus the canvas when the pointer enters it, or show a “click to use the keyboard” hint while it has no focus (S) |
| R12 | A panic shows a message but no way to report it | The one report that matters most is the hardest | [read] main.rs failed | Add a prefilled issue link with the panic text to the failure message (S) |
| R13 | Console noise a reporter will paste | logging to egui-pop-gallery-0/gallery.log (no file on the web), crash reports: ... operation not supported on this platform, Unhandled egui viewport command: Decorations(true) at every start | [browser], all three browsers | Skip the log file line, the crash plugin’s warning and the decorations command on the web (S) |
| R14 | Commands that do nothing on the web stay enabled | View > Full screen (F11), Zen mode, File > Quit (Ctrl+Q) look broken; a reporter files them | [browser]: Fullscreen(true) and Close are logged as unhandled | Disable them on the web with a reason, or implement full screen with the Fullscreen API (S) |
| R15 | The landing page and the gallery do not say how to report | The goal is invisible | [read] tools/site/index.html | A line and a link on the landing page and in the gallery’s first page (S) |
Keys
Every default binding, in a browser
The bindings below are every key given by CommandSpec::key and
CommandSpec::key_with in egui-pop’s crates and the gallery (the
gallery’s pages and the minimal example included), plus the file
picker’s own keys. egui-pop’s Ctrl is the Command key on macOS too
(egui_pop_core::keys::chord_of).
Column Prevented is measured ([browser], identical in Chromium 140, Chrome 157 and Firefox 141): whether eframe cancelled the browser’s default action. Column The browser’s own use is read from the browsers’ shortcut lists (Linux and Windows first, macOS with Cmd after the semicolon); reserved means the page never sees the key, or sees it but cannot cancel it.
| Chord | egui-pop command | Prevented | The browser’s or the system’s own use | Class |
|---|---|---|---|---|
| Ctrl+B | toggle primary side bar | no | Firefox: bookmarks sidebar; Safari (Cmd+Shift+B: favourites bar) | leaks in Firefox |
| Ctrl+J | toggle panel | no | Chrome, Firefox on Windows: downloads; Safari Cmd+J: jump to selection | leaks |
| Ctrl+Alt+B | toggle secondary side bar | no | Windows: AltGr+B on some layouts; Chrome macOS Cmd+Option+B: bookmark manager | leaks on macOS |
| Ctrl+G | palette’s go to / editor go to line | no | find next (all) | leaks |
| Ctrl+E | zones page’s extender (gallery) | no | Chrome, Firefox: focus the search box; Safari: use selection for find | leaks |
| Ctrl+F | editor and viewer find | no | find in page (all) | leaks |
| F3, Shift+F3 | find next, previous | no | find next, previous | leaks |
| Ctrl+H | editor replace | no | Chrome: history; Firefox: history sidebar; macOS Cmd+H hides the browser | leaks; reserved on macOS |
| Ctrl+S | editor save | yes | save page | fine |
| Ctrl+L | file picker: path field | no | focus the address bar | leaks, takes the focus away |
| Ctrl+D | file picker: bookmark folder | no | bookmark this page | leaks |
| Ctrl+A | file picker: select all | no | select all (nothing selectable but the canvas) | harmless |
| Ctrl+Shift+N | file picker: new folder | no | Chrome: incognito window; Firefox: reopen closed window; Safari: private window | reserved |
| Ctrl+Space | file picker and editor: toggle, complete | yes | Windows: IME toggle (CJK); macOS (Cmd+Space): Spotlight | reserved on macOS by the system |
| Ctrl+Enter | file picker: choose | no | none | fine |
| Alt+P | file picker: preview pane | yes (as text) | none | fine |
| Ctrl+Comma | settings | yes | macOS Cmd+Comma: browser preferences | fine |
| Ctrl+Z, Ctrl+Shift+Z, Ctrl+Y | undo, redo | no | none outside a text field | harmless |
| Ctrl+C, Ctrl+X, Ctrl+V, Ctrl+Insert, Shift+Insert, Shift+Delete | copy, cut, paste | no (on purpose: eframe needs the browser’s copy, cut and paste events) | copy, cut, paste | fine |
| Ctrl+Shift+V | paste special | no | Chrome, Firefox: paste as plain text | harmless |
| Ctrl+Shift+C | inspect | no | devtools’ element picker (Chrome, Firefox; Chrome macOS Cmd+Shift+C) | in progress |
| F12 | devtools | no | browser devtools | in progress |
| Ctrl+Shift+P, F1 | command palette | Ctrl+Shift+P yes, F1 no | Ctrl+Shift+P: Firefox private window (reserved); F1: Chrome help page | reserved in Firefox; F1 leaks in Chrome |
| Ctrl+Shift+T | next theme (gallery) | no | reopen closed tab | reserved |
| Ctrl+Shift+G | show grid (gallery menus page) | no | find previous | leaks |
| Ctrl+Shift+K | terminal clear, minimal example | no | Firefox: web console | leaks in Firefox |
| Ctrl+Shift+Delete | workbench reset (gallery) | no | clear browsing data dialog | leaks |
| Ctrl+Shift+[, Ctrl+Shift+] | editor fold, unfold | no | macOS Cmd+Shift+[ ]: previous, next tab | reserved on macOS |
| Ctrl+Period | editor code action | no | Linux (IBus, GNOME): emoji picker; macOS Cmd+Period: stop | leaks on Linux |
| F9 | editor breakpoint | no | none | fine |
| Ctrl+PageDown, Ctrl+PageUp | next, previous document | no | next, previous tab | reserved in Chrome |
| Ctrl+Alt+Equals, Ctrl+Alt+Plus, Ctrl+Alt+Minus, Ctrl+Alt+0 | interface zoom | no | Windows: AltGr with 0, =, - types characters on many layouts (} @ on AZERTY, } on German) | collides with AltGr |
| Ctrl+Plus, Ctrl+Equals, Ctrl+Minus, Ctrl+0 | viewer zoom | no | page zoom (all) | leaks: page and viewer zoom together |
| Ctrl+Alt+S | toolbar save (gallery) | yes | none | fine |
| Ctrl+Alt+G | global shortcut demo (gallery) | no | none (no global shortcuts on the web) | fine |
| Ctrl+Q | quit | no | Firefox Linux and Windows: quit (reserved); macOS Cmd+Q: quit the browser | reserved; does nothing on the web anyway |
| Alt+Left, Alt+Right | back, forward (context stack, viewer) | yes | back, forward; macOS uses Cmd+Left | fine (eframe cancels arrows) |
| Alt+Up, Alt+Down | previous, next page (gallery) | yes | none | fine |
| Alt+Shift+Up | context stack up | yes | none | fine |
| Alt+Space | window menu | yes | Windows and GNOME: the window menu (system) | reserved by the system |
| Alt+F7 | dialog move | no | GNOME: move the window (system) | reserved on GNOME |
| F5 | viewer refresh | no (on purpose) | reload the page | leaks: the session is lost |
| F6, Shift+F6 | next, previous region | no | focus the address bar, cycle browser panes | leaks, takes the focus away |
| F11 | full screen | no | browser full screen | works by accident; the app’s command does nothing |
| Shift+F11 | zen mode | no | none | fine |
| Tab, Space, Backspace, arrows | focus and widgets | yes | fine |
Reserved keys come from the browsers, not from egui: Chrome keeps Ctrl+N, Ctrl+T, Ctrl+W, their Shift forms, Ctrl+Tab and the tab-switching keys from pages (Chromium’s browser keys note), and Firefox similarly reserves new window, new tab, close, quit and the private window. The only way around them is the Keyboard Lock API, Chromium only, and only in full screen.
Keys: problems
| # | Problem | What it breaks | Evidence | Fix (size) |
|---|---|---|---|---|
| K1 | eframe cancels the browser’s action only for its own list; WebOptions::should_prevent_default is consulted for text, paste, pointer and wheel events, never for key presses | Every bound chord outside that list runs twice: in egui-pop and in the browser (find bar, address bar, bookmark dialog, page zoom, reload) | [browser]: the table above; [read]: should_prevent_default_for_key | egui-pop’s web glue adds its own keydown listener on the canvas that cancels a key when the keymap resolves it (the dispatcher already knows), or upstream: let should_prevent_default see Event::Key (M; the upstream request S) |
| K2 | Reserved chords bound by default: Ctrl+Shift+N, Ctrl+Shift+T, Ctrl+Shift+P (Firefox), Ctrl+PageUp/PageDown (Chrome), Ctrl+Q | The command never runs from its key on the web; the browser opens a window or switches tabs | [read], [upstream] (links above) | isWeb alternatives in the default keymap (palette: F1 or Ctrl+K style; next theme: none), and a check that warns when a default web binding is reserved (S) |
| K3 | F5 bound to the viewer’s refresh | The page reloads and the session is gone | [read]; eframe never cancels F5 on purpose | Bind the viewer’s refresh to something else on the web (S) |
| K4 | F6 regions and Ctrl+L | The browser takes the focus to its address bar; keyboard navigation between regions is gone and the canvas loses the focus (see R11) | [read] | Cancel them through K1; check by hand that each browser lets a page cancel F6 (with K1) |
| K5 | Ctrl+Plus, Ctrl+Minus, Ctrl+0 bound to the viewer’s zoom | The page zooms with the viewer: the whole interface changes size | [read] | Cancel through K1 (with K1) |
| K6 | Shortcuts shown as Ctrl on macOS | A Mac user reads Ctrl+B and presses Ctrl (which works, as egui-pop maps both) but every Mac convention says Cmd; reports will say “Ctrl+B does nothing” when the browser took Cmd+B | [read]: no Cmd label anywhere | Show Cmd (or ⌘) when Context::os is macOS, on the web too (S) |
| K7 | Ctrl+Alt chords on Windows collide with AltGr | Typing } or @ on French or German layouts may reset the interface zoom; on the web as on the desktop | [read] | Leave Ctrl+Alt+digit and symbol chords alone while a text input owns the keyboard, or move the interface zoom off AltGr chords (S) |
| K8 | Dead keys and IME | Composition goes through eframe’s hidden text agent: an IME commit (にほん to 日本) reached a text field in Chromium; dead keys and AltGr were not run | [browser] (IME, Chromium only); [read] the rest | Run the keyboard walk with a dead key and AltGr in the browser harness (S) |
| K9 | Keys before the first click | In all three browsers the canvas had the focus at load and Alt+Down worked before any click ([browser]); after a click elsewhere it does not (R11). In an iframe or an embedding page it would not have it | [browser] | See R11 |
| K10 | No isWeb or isMac in when conditions | A keymap cannot give the web or macOS another key | known | Add isWeb (compile time) and isMac (Context::os, on the web the browser’s OS) to AppHandle::when_context; cheap, and K2, K3 need isWeb (S) |
Are isWeb and isMac worth adding? Yes, both, and cheaply:
when_context already sets base keys each pass. isWeb is what K2 and
K3 need (a web-only default without changing the desktop’s). isMac is
less pressing, since Ctrl already means Command, but it lets a keymap
avoid macOS’s own chords (Cmd+H, Cmd+Q, Cmd+Space, Cmd+Shift+[ ]) and it
is what K6’s labels read. A browser name (isFirefox) is not worth a
condition: K1 removes most of the differences.
Platform services
| # | Service | What it breaks | Evidence | Fix (size) |
|---|---|---|---|---|
| P1 | Clipboard, text | Copy (Copy version info, inspect’s Copy, a text field’s Ctrl+C) and paste (Ctrl+V into a text field) work in Chromium. Needs a secure context (the deployed site is HTTPS; a local http:// address other than localhost is not) | [browser] Chromium; [upstream] MDN, secure contexts | none |
| P2 | Clipboard in Firefox and Safari | Not read back in Firefox (the harness cannot grant clipboard reading there); Safari only writes inside a user gesture, which eframe handles since egui#3621 (issue #3480) | untested | Check by hand once in each (S) |
| P3 | Clipboard: custom formats and reading | No backend reads the system clipboard on the web: a paste knows only the text the browser hands over; egui-pop’s typed formats (inspect JSON, colours, nodes) stay inside the page. Reading needs the async Clipboard API and a permission prompt | [read] docs/clipboard.md, EguiText | A web SystemBackend over navigator.clipboard.read/write with text/plain and web -prefixed custom formats (M) |
| P4 | Files: no file system | The picker reads an in-memory demo folder; Save writes nowhere; a visitor cannot open their own file to reproduce a bug | [browser] files page; [read] MemoryFs | An upload (<input type=file>) into the memory file system and a download for Save (M) |
| P5 | File drag and drop | eframe delivers dropped files (bytes on the web), but nothing in egui-pop reads dropped_files or hovered_files | [read] | Read drops into the memory file system and the viewer (S to M) |
| P6 | Open URL | Links open a new tab ([browser]: window.open(url, "_blank")); mailto: in the same tab; local files and “Show in folder” are refused with a reason | [browser], [read] docs/links.md | none |
| P7 | Notifications | Toasts only; the platform page shows the raw error (“no thread to show desktop notifications: operation not supported on this platform”) | [browser] | Optional: the Notifications API behind a permission (M); reword the page (S) |
| P8 | Multiple viewports | Detached panels are embedded as egui windows inside the canvas (egui’s default when the backend has no viewports) | [read] eframe sets embed_viewports only on native | Check the detach paths draw well embedded (S) |
| P9 | Full screen, window commands | Fullscreen, Close, Decorations, Minimized, Maximized, StartDrag, RequestUserAttention are logged as unhandled and ignored | [browser] (Fullscreen(true), Close, Decorations(true)); [read] handle_viewport_commands | Full screen through Element.requestFullscreen in egui-pop’s web glue; others disabled on the web (S, see R14) |
| P10 | Cursor and hiding it | System cursors map to CSS; CursorIcon::None hides it; bitmap cursors are dropped, so painted tool cursors fall back | [read], [upstream] egui#3848 (in docs/upstream.md) | upstream |
| P11 | Pointer lock | Not used by egui-pop; nothing to break today | [read] | none |
| P12 | Single instance, deep links, tray, global shortcuts, focus mode, system text scale, system thumbnails, terminal shell | None on the web; each says so (tray and global shortcuts simulated on the platform page; terminal’s shell section absent) | [browser] platform and terminal pages; [read] | none; R14 for wording |
| P13 | Logs and crash reports | The log file and crash reports need a folder: on the web only the log tail in memory; a panic replaces the canvas with a message | [browser] console; [read] | R12, R13 |
Storage
What each part keeps, and where it goes on the web.
| Part | Desktop | Web today | Evidence |
|---|---|---|---|
| egui’s memory (folds, panel sizes, scroll offsets) | eframe’s file | localStorage["egui_memory_ron"], about 8 KB | [browser] |
| Workbench layout | eframe’s storage | localStorage["gallery.layout"], about 0.6 KB | [browser] |
Settings (theme, density, devtools, picker’s recent places and bookmarks settings/files.*) | persist(dir) documents | lost (in progress) | [read] AppBuilder::persist, save_later |
| User keymap | persist(dir) | lost (in progress) | [read] |
| Contexts’ view document | persist(dir) | lost: save_view returns without a directory | [read] contexts.rs |
| User kits, token cache | folders | none | [read] |
| Journal, history | memory | memory | [read] |
| Log file, crash reports | folders | none | [browser] console |
| # | Problem | What it breaks | Evidence | Fix (size) |
|---|---|---|---|---|
| S1 | persist(dir) writes files; nothing writes eframe’s storage but the layout | Settings, keymap, bookmarks, recent places, the context view lost on reload | [read] | in progress |
| S2 | Is a library-level backend over eframe::Storage right? | Yes: make the persistence writer a trait with a folder implementation and an eframe::Storage one (one key per document, egui_pop.<name>), chosen by run_web/run_native; the debounced writer, the documents and their schemas stay as they are. A host with its own store gives its own. Keeps the gallery out of it (M; overlaps the in-progress change) | ||
| S3 | localStorage is shared by the whole origin | The gallery lives on quazardous.github.io: every project page of that account shares the origin, and egui’s key egui_memory_ron is the same in every eframe app, so another eframe app published there would read and overwrite the gallery’s memory | [read] eframe storage.rs; [upstream] MDN, storage quotas | Prefix egui-pop’s own keys with the application id; for egui’s key, an upstream option for its name (S, upstream S) |
| S4 | Limits | About 5 MB per origin for localStorage, synchronous; a large keymap or kit fits, a document library would not; private windows clear it at the end | [upstream] same | IndexedDB if documents ever grow (L, not needed now) |
| S5 | No reset on the web | A broken stored layout or setting can only be cleared through the browser’s site data; a reporter cannot say “it works after a reset” | [read] | A “Reset everything stored” command (S) |
| S6 | Saved on blur and every 30 s | A tab closed within 30 s of a change keeps the old state; Chrome 157 had nothing stored after the short probe while Chromium 140 and Firefox had both keys | [browser], [read] eframe’s auto_save_interval | Save on pagehide/visibilitychange too (eframe already listens for visibilitychange); verify (S) |
Rendering and performance
| # | Problem | What it breaks | Evidence | Fix (size) |
|---|---|---|---|---|
| G1 | WebGPU or WebGL 2 | eframe’s wgpu painter takes WebGPU where the browser has it (Chrome 157: BrowserWebGpu) and WebGL 2 otherwise (Chromium 140 headless, Firefox 141: Gl); both drew every page. The viewport’s buffer device tiles need fragment storage that WebGL 2 lacks and fall back, as documented | [browser]; [read] docs/viewport.md; [upstream] WebGPU status | none; the renderer line in the version info tells them apart |
| G2 | Software rendering | On a machine without a GPU the browser uses SwiftShader; egui-wgpu warns “Software rasterizer detected”; slow but correct | [browser] | none |
| G3 | Module size | 33.6 MB deployed (13.3 MB gzipped on the wire), 38.6 MB in this build; no opt-level = "z", no LTO, no wasm-opt; fonts are only about 2 MB of it | [read] measured with curl and ls | A [profile.release] for the web build (lto, codegen-units = 1, opt-level = "s"), Trunk’s data-wasm-opt, and check panic = "abort" size; measure each (M) |
| G4 | Load time and nothing to see while loading | 2.6 s to start from the deployed site in Chromium on a fast link; a slow link takes several times that over a dark empty page | [browser] | A loading message and progress in index.html (S) |
| G5 | Caching | GitHub Pages serves max-age=600; Trunk’s hashed file names make a new deploy load fresh; a reporter may run a build up to 10 minutes old, and the version info’s commit says which | [read] response headers | none |
| G6 | No std::thread | Every thread path in the gallery’s web build is gated (cfg!(target_arch = "wasm32")): previews, latest, tree and editor demos, the viewport’s workers (0 on the web). A spawn would panic at run time, not at build time; nothing catches a new ungated one | [read] all spawns listed; [browser] no panic on any page | A CI check: run the web smoke test over every page, as the walk here did (S) |
| G7 | Blocking calls | std::time::Instant::now panics on wasm32-unknown-unknown; runtime code uses web-time, the remaining Instant::now are in tests | [read] | Lint: clippy::disallowed_methods for std::time::Instant::now and SystemTime::now (S) |
| G8 | Work runs in the frame | Previews, the slow linked-panel computation and tile production run on the interface thread, one per frame; a heavy page stutters where the desktop does not | [read] docs/linked-panels.md, files/preview.rs | Accept; or web workers later (L) |
| G9 | Timers in background tabs | eframe paints on requestAnimationFrame, which browsers pause in hidden tabs: toasts, jobs, the motion clock and debounced saves wait until the tab is back | [read]; [upstream] MDN, requestAnimationFrame | none needed; note it for job pages (S) |
| G10 | Glyphs missing from the bundled fonts | Drawn by eframe’s canvas fallback (canvas_glyphs): Japanese typed in a field showed ([browser]); the look differs from the desktop’s system fallback | [browser], [read] | none |
Media and embeds
| # | Problem | What it breaks | Evidence | Fix (size) |
|---|---|---|---|---|
| M1 | Video viewer (GStreamer) | Not built for the web: a video link opens outside, in a new tab | [read] viewer/mod.rs gates gst_player on non-wasm; docs/links.md | An HTML <video> element over the canvas, positioned on the panel’s rectangle (M to L) |
| M2 | Web view (wry, WebKitGTK) | Not on the web: HTML pages beyond the safe subset open in a new tab | [read] docs/links.md | An <iframe> over the canvas (same technique as M1) (M) |
| M3 | YouTube as an iframe over the canvas | Feasible: position an absolutely placed <iframe> on the panel’s rectangle each frame, hide it when the panel is covered (menus and popups are drawn on the canvas, so an overlay on top of the iframe is impossible: it must hide while one is open); keyboard and focus go to the iframe while inside it | [read] | M, after M1’s overlay helper |
Accessibility
| # | Problem | What it breaks | Evidence | Fix (size) |
|---|---|---|---|---|
| A1 | AccessKit on the web | eframe’s web runner ignores accesskit_update (“not currently implemented”): screen readers see one canvas; egui’s built-in speech (screen_reader option, Web Speech API) is the only voice | [read] app_runner.rs; [upstream] AccessKit lists a web adapter as planned | upstream (L); meanwhile say so on the landing page (S) |
| A2 | The inspect picker still works | egui builds the AccessKit tree in every backend (always on in egui 0.37), so the inspect dialog has roles and names on the web too | [browser] | none |
| A3 | IME text input | Through eframe’s hidden <input>: an IME commit reached a text field in Chromium; the candidate window’s position follows ime output | [browser] Chromium; [read] | Run in Firefox and with a real IME (S) |
| A4 | Browser zoom and text size | Page zoom changes the device pixel ratio and egui follows; the browser’s minimum font size and text-only zoom do nothing to a canvas | [read] | none |
Gallery pages on the web
All 58 pages were walked with Alt+Down in Chromium 140 and Firefox 141, a screenshot and the console of each ([browser]). None panicked or logged an error; the only page warning was a Canvas2D readback hint on the font pairs page (Chromium), probably from eframe’s canvas fallback for glyphs. Differences from the desktop:
| Page | On the web | Evidence |
|---|---|---|
| overview, tokens, builtins, scoped, icons, indicators, sections, motion, values, history, sliders, inputs, menus, toolbars, dialogs, toasts, tips, about, progress, placeholders, roles | as on the desktop | [browser] |
| theme-editor | Export as a token file writes nowhere (no folder) | [read] |
| fonts | as on the desktop; a Canvas2D readback warning in Chromium | [browser] |
| files | the in-app picker over an in-memory demo folder; “Recent: none, Bookmarks: none” and nothing kept; no system chooser, no thumbnails, no upload or download | [browser] |
| viewport, navigator, images, grading, cursors, node-graph, graph-file, preview | draw; procedural tiles made in the frame (no workers); painted tool cursors only where egui-pop paints them | [browser], [read] |
| display | the wide gamut and HDR surfaces are not offered (desktop only); the page reports sRGB | [browser], [read] lib.rs |
| tree, table, library, linked-panels | answers come in the same frame (no threads); the linked panel’s slow preview blocks the frame instead of sleeping | [read] |
| text-editor, code-editor | as on the desktop; Ctrl+F, Ctrl+H, Ctrl+G, F3 also reach the browser (K1) | [browser], [read] |
| terminal | the build log and echo demos; the shell section is absent (no pseudo-terminal) | [browser] |
| zones, layout, arrangements, workbench, contexts, strips, clipboard, palettes, links | draw; detaching a panel embeds it in the canvas (not tried) | [browser], [read] |
| frame | the window frame preview draws; no real window to frame | [browser] |
| i18n | as on the desktop | [browser] |
| viewer | help pages, markdown and safe HTML; no video, no web view; F5 reloads the page (K3) | [browser], [read] |
| scale | as on the desktop; Ctrl+Alt+Plus and Minus do not zoom the page | [browser] |
| pointer | as on the desktop; Ctrl+wheel goes to egui-pop (the gallery cancels every wheel event) | [read] web_prevent_default |
| platform | says “Run with –platform to use the real one” and shows a gallery://page/<name> deep link, neither of which exists on the web; notifications show the raw error; logs warn “another logger is installed” | [browser] |
| settings | as on the desktop; nothing survives a reload (S1) | [browser] |
| debug | the collectors draw; the only place that says how to enable inspect | [browser] |
| jobs | timers pause in a background tab (G9) | [read] |
What could not be tested
- Safari (any platform), and every browser on Windows and macOS: the key table’s browser columns for them are read, not run.
- What a real browser does with a key it keeps (reserved keys, F5, F6, Ctrl+Shift+C): headless runs show only what the page receives.
- Reading the clipboard in Firefox (no permission in the headless harness); Safari’s clipboard.
- Dead keys, AltGr and a real IME’s candidate window.
- Screen readers.
- A real GPU: every run used SwiftShader.
- Detached panels, file drop and background tabs.
- The CI job’s Trunk packaging itself: Trunk did not build on this machine, so the module was packed with wasm-bindgen directly (same crate, features and profile).
Proposed follow-ups
One per fix worth doing, ordered by value for the reporting goal first, then by cost. The three items in progress are left out.
- Prefilled issue from the app (R4, R5, R10; done 2026-11-04, R7’s
browser line with it): a
help.reportcommand in Help, the palette and the inspect dialog that opensissues/newwith a title, the version info, the browser, the page and the last pick, plus a bug issue form in the repository. S. - One report block (R6, R7): the inspect copy carries the version info; the platform line names the browser, its version and the OS on the web. S.
- Page in the URL (R8): the page read from and written to the URL’s hash on the web. S.
- Cancel every bound key (K1, K4, K5): a canvas
keydownlistener that cancels a key the keymap resolves, and an upstream request forshould_prevent_defaulton key events. M (upstream request S). - Web-safe default keys (K2, K3, K10):
isWebandisMacinwhenconditions, web alternatives for reserved chords and F5, and a test listing reserved chords in the default keymap. S. - Keyboard focus hint (R11, K9): focus the canvas on pointer entry, or show a “click to use the keyboard” hint while it has no focus. S.
- Say why devtools are greyed (R2): the disabled entries and chords say which setting enables them. S.
- Screenshot command (R9): copy or download a screenshot through
ViewportCommand::Screenshot. M. - Panic page with a report link (R12). S.
- Quiet the web console (R13): no log-file line, crash-plugin
warning or
Decorationscommand on the web. S. - Disable or implement desktop-only commands (R14, P9): full screen through the Fullscreen API; quit and window commands disabled with a reason; platform page wording. S.
- Say how to report on the landing page (R15), with a note on screen readers (A1). S.
- Persistence backend over
eframe::Storage(S2, S5, S6): the writer as a trait, aneframe::Storageimplementation, a reset command, a save on page hide. M (after the in-progress change). - Smaller, announced first load (G3, G4): a web release profile,
wasm-opt, and a loading message. M. - Origin-safe storage keys (S3): egui-pop’s keys prefixed with the application id; an upstream option for egui’s memory key. S.
- Mac labels (K6):
Cmdin shortcut labels on macOS. S. - AltGr-safe interface zoom (K7). S.
- Every page in CI’s web smoke test (G6) and a lint for
Instant::now(G7). S. - Upload, download and drop (P4, P5): a visitor’s own file in the picker and the viewer. M.
- Web clipboard backend (P3): typed formats through the async Clipboard API. M.
- Video and pages over the canvas (M1, M2, M3): an overlay helper
for
<video>and<iframe>on a panel’s rectangle. M to L. - Manual checks (P2, K8, A3): Safari, Windows and macOS, dead keys and an IME, once by hand. S.
- AccessKit on the web (A1): upstream, follow AccessKit’s web adapter. L.
Video survey: what egui-pop needs, and whether embedded players can play inside
This survey asks what egui-pop’s applications need from video, which native players could serve them, and whether videos hosted online (YouTube, Vimeo, Dailymotion, PeerTube, Twitch, plain video files on the web) can be shown inside an application rather than in the browser. It covers the use cases and what each needs, what other applications do, the native playback backends for the desktop, every way of showing an online video inside (the service’s own player in a web view, our own player, the web build), the terms of service of each video host, and ends with ranked follow-ups.
It feeds the native Video widget planned after the viewer’s video page
(Links and outside content) and decides what
happens to the YouTube trial of
ADR 0017.
The web side extends the web survey’s rows M1 to M3 and
its follow-up 21.
Read and run on 2026-11-04, against egui-pop’s main (cc28fc41), egui
0.37, wgpu 30, on Fedora 44 with GStreamer 1.28.8 and WebKitGTK 2.54.2,
an AMD Radeon 680M (Rembrandt) with Mesa’s VA-API driver. Windows and
macOS were not run; what is said of them is read. Every finding
says where it comes from:
- [code]: read in egui-pop’s source, or a crate’s source.
- [docs]: read in a document, linked.
- [tried]: run on the machine above, headless (
gst-launch-1.0andffmpegon generated clips,vainfo,dnf); no window was opened.
Summary
- YouTube can play inside the application, but only in YouTube’s own
player, in a web view. YouTube’s terms allow an application to show
YouTube content through its embedded player and forbid everything else:
reaching the streams by other means, keeping them, separating sound from
picture, hiding ads or branding, or covering the player. So a native
YouTube player (a stream extracted the way
yt-dlpdoes it, played by GStreamer or mpv) is ruled out, however well it would work. The web view trial (wry over WebKitGTK, Linux) already does it the permitted way, and it plays [tried in ADR 0017’s trial]. Vimeo, Dailymotion and Twitch are in the same position; PeerTube and plain video files on the web are not, and our own player can play them. - A web view inside a panel is a native window on top of egui. It
plays well, but egui’s menus and popups go under it, and the keyboard
leaves egui while it has the focus. On Linux it can be inside the panel
only on X11; on Wayland it opens in its own window. Windows (WebView2)
and macOS (WKWebView) can host it inside the panel. Drawing a web page
into a texture instead (CEF, Servo, Ultralight, WPE) would fix the
overlay, at the price of a second browser engine of 100 MB or more, or a
licence
deny.tomlrefuses: not worth it for a help video. - For local files, GStreamer stays the best backend, and the cheapest
improvement is in how we use it: on this machine the viewer’s pipeline
plays a 4K VP9 clip at about 22 frames a second, under real time,
because the hardware decoder’s frames are copied back and converted to
RGBA on the CPU; converting them on the GPU first (
vapostproc) brings it to about 104 frames a second [tried]. libmpv is a fine player but is GPL as distributions build it, and its usual Rust crates are LGPL; FFmpeg’s crates are a decoder without a player, under the WTFPL; the egui video crates found are old, tied to another egui, or new and untried. - What egui-pop’s applications need is mostly small, quiet video: a preview that loops without sound, a clip in a photo library with a poster frame and a scrub bar, a tutorial with full controls. Helios’s own minimum, like the darktable request it echoes, is to show that a video is there (a thumbnail and a badge), before playing it at all.
- Ranked follow-ups are at the end: the native
Videowidget first, the GPU conversion with it, the YouTube trial kept as an opt-in, the other hosts’ players behind the same opt-in, plain web videos through our own player, and the web build’s overlays.
egui-pop today
- The viewer’s video page (feature
video) plays a local file in a panel: Play and Pause, a position slider, the volume, the time; Space, Left, Right, Up and Down on the picture; it opens paused, stops when its panel is hidden and comes back at the same place (links.md) [code] (crates/egui-pop-views/src/viewer/video.rs). - Behind a trait:
VideoBackendopens aVideoPlayer(poll, frame, play, pause, seek, volume); a host can give its own, a test a pretend one. The page knows nothing of GStreamer [code]. - GStreamer (
gst_player.rs) builds aplaybin, gives it anappsinkthat asks for RGBA, keeps only the last frame, and asks egui for a repaint; the bus wakes the interface on errors, end of stream and state changes [code]. Each frame then goes throughrgba_image(a copy into a new buffer),ColorImage::from_rgba_unmultiplied(a pass to premultiply) andTextureHandle::set(egui-wgpu’s upload): with GStreamer’s own conversion, four passes over every frame on the CPU [code]. - No widget: a page or a panel cannot place a video of its own, and there is no bare mode (autoplay, loop, muted, no controls) [code].
- YouTube (feature
webview, Linux): a YouTube link plays in a web view, wry over WebKitGTK, YouTube’s privacy-enhanced player loaded as the page with aRefererheader (without one YouTube answers its error 153); a child window over the panel on X11, a window of its own on Wayland or for a detached panel; every other navigation goes outside (links.md) [code], and it played in the trial (ADR 0017’s analysis) [tried there]. - Everything else online (Vimeo, a remote
.mp4) opens in the browser; the web build has no video and opens video links in a new tab (web survey, M1 to M3) [code]. - The file picker previews videos only through the system’s
thumbnailers (feature
platform-thumbnails): on this machinetotemandgst-video-thumbnailerare installed for that (files.md) [code], [tried] (/usr/share/thumbnailers).
Needs
Use cases
| Use case | Who | What it shows | Where |
|---|---|---|---|
| U1. Clips in a photo library | Helios | short clips and timelapses shot with the photos, beside them in the library | the library grid (a thumbnail), the single-image view (playback) |
| U2. Timelapse review | Helios | an image sequence or an exported timelapse, played to check flicker and pacing | a viewer, frame by frame |
| U3. Tutorials and help | every application | a “how to” video linked from a tip, a help page or the about page; often on YouTube | the viewer, a help panel |
| U4. Gallery demos | egui-pop | a widget’s behaviour as a short looping clip; the video widget itself | gallery pages |
| U5. File picker preview | every application | the selected video’s first frame, maybe playing muted | the picker’s preview pane |
| U6. Onboarding and empty states | every application | a short silent loop showing a gesture | a welcome page, an empty panel |
Helios’s own context: it is a raw photo editor first; video as a domain is explicitly not built, only kept possible (Helios’s roadmap). The users it comes from asked darktable for basic support for video files in the lighttable: the request, closed without an answer, wants clips imported and shown as a thumbnail or a badge so they are not forgotten on the card, and explicitly not playback (darktable#11576) [docs].
What each use case needs
| Need | U1 library | U2 timelapse | U3 tutorial | U4 demo | U5 picker | U6 onboarding |
|---|---|---|---|---|---|---|
| Controls | compact (play, scrub, time) | full, plus frame step | full | none | none or compact | none |
| Autoplay | no | no | no (a click first) | yes | on hover or selection | yes |
| Loop | optional | yes | no | yes | yes | yes |
| Muted | starts muted or not at all | no sound | sound | muted | muted | muted |
| Poster frame | yes, also as the library thumbnail | first frame | the host’s thumbnail, after a click (ADR 0017’s rule) | first frame | yes | first frame |
| Scrub with thumbnails | nice to have | yes | the host’s player | no | no | no |
| Frame-accurate stepping | no | yes | no | no | no | no |
| Audio | yes | no | yes | no | no | no |
| Subtitles | no | no | yes (the host’s player has them) | no | no | no |
| HDR | phones record HLG and Dolby Vision: shown tone-mapped, not wrong | no | no | no | no | no |
| Formats | H.264, HEVC (phones), AV1, ProRes and camera MOV/MP4/MTS | image sequences, MP4, ProRes | the host’s | WebM or MP4 we ship | whatever is on disk | WebM or MP4 we ship |
| Online | no | no | yes (YouTube first) | no | no | no |
Two things follow. Most uses want a bare, muted, looping picture (U4, U5, U6), which today’s viewer page cannot be: that is the case for a widget with a “no controls” mode. And only U3 needs online video, and there the host’s own player, with its subtitles, quality menu and captions, is what the user expects anyway.
What other applications do
| Application | Video | What carries over |
|---|---|---|
| Lightroom Classic | plays clips in the Library module, trims them, sets a poster frame (Frame > Set Poster Frame) and captures a frame as a JPEG stacked with the clip; AVI, MP4, MOV, AVCHD (Adobe) [docs, from search excerpts: the page refused the fetch] | a compact player in the single-image view; the poster frame is also the grid thumbnail; frame capture is a photo editor’s natural video feature |
| darktable | no video: it does not import, show or edit clips (forum); the request for basic support was closed unanswered (#11576) [docs] | the gap Helios can fill cheaply: show clips, then play them |
| digiKam | plays videos in its preview and slideshow; it dropped QtAV, Qt 6 builds use QtMultimedia over FFmpeg or the system’s backend (digikam-users, 2024-10) [docs] | a system-level player behind a toolkit layer, as VideoBackend |
| VS Code | its built-in media preview opens images, audio and video files in Electron’s <video>; MP4 “does not support aac audio tracks” (Electron’s codecs) (extension’s README, a mirror) [docs] | a preview with the platform’s codecs, honest about what it cannot play |
| Obsidian | a YouTube link written as an image () shows YouTube’s player as an <iframe> inside the note (help); the Web viewer core plugin, desktop only, off by default, opens pages in tabs (help) [docs] | the host’s player in place, in the content, for online video; local files in the app’s own player |
So: the photo applications (Lightroom, digiKam) play local clips with compact controls and a poster frame; none plays online video; the note-taking and editor applications built on a browser engine show YouTube’s player in place, because they have the engine anyway.
Native playback
What was measured
GStreamer’s pipelines were timed headless with gst-launch-1.0, every
sink unsynchronised (sync=false) so the time is what decoding and
conversion cost, on two clips made with ffmpeg’s test source: 10 s of
4K (3840x2160) VP9 at 30 frames a second (300 frames) and 10 s of
1080p H.264 (OpenH264) [tried]. The viewer’s own shape is playbin with
a video sink that only accepts RGBA, as its appsink does.
| Pipeline (4K VP9, 300 frames) | Time | Frames a second |
|---|---|---|
software decode (vp9dec), frames left as decoded | 4.35 s | 69 |
software decode, converted to RGBA (videoconvert) | 5.64 s | 53 |
hardware decode (vavp9dec), frames left on the GPU | 2.10 s | 143 |
hardware decode, converted to RGBA on the GPU (vapostproc), then in memory | 2.69 s | 111 |
| hardware decode, copied to memory as NV12, converted on the CPU | 13.77 s | 22 |
playbin, an RGBA sink: the viewer’s shape today | 13.33 s | 22 |
| the same with the VA decoder’s rank set to none (software decode) | 4.35 s | 69 |
playbin, the sink videoconvert n-threads=0 ! RGBA (all 12 threads) | 5.07 s | 59 |
playbin, the sink vapostproc ! RGBA | 2.89 s | 104 |
playbin, 1080p H.264, RGBA sink | 1.15 s | 261 |
So today’s backend cannot play this 4K clip in real time on this
machine: playbin picks the hardware decoder (vavp9dec’s rank is
primary + 1, above vp9dec’s primary), then its own videoconvert copies
every frame back and converts it on one CPU thread (its n-threads
defaults to 1) [tried, gst-inspect-1.0]. Asking the GPU to convert
(vapostproc, or GL with glcolorconvert and gldownload) is five times
faster; letting videoconvert use every thread, or turning the hardware
decoder off, is two to three times faster. 1080p is fine either way.
That is before egui’s side, which adds two more passes and an upload of
33 MB per 4K frame [code].
What decodes in hardware here [tried, gst-inspect-1.0, vainfo, rpm]:
Fedora’s Mesa VA-API driver offers VP9 and AV1 but not H.264 nor HEVC
(vavp9dec, vaav1dec exist, vah264dec, vah265dec do not), as
Fedora leaves those codecs out of its own Mesa build; H.264 is decoded in
software by avdec_h264 (from gstreamer1-plugin-libav) or
openh264dec. Hardware decode therefore depends on the distribution and
the driver, not on us: the backend must work well in software and use
hardware when it is there.
HLS plays: playbin3 on a public HLS test stream
(test-streams.mux.dev) buffered and went to PLAYING within 20 s, with
hlsdemux2 and dashdemux2 both installed [tried].
Getting frames to the screen
Three ways exist for a decoded frame to reach egui [code], [docs]:
- RGBA in memory, uploaded by egui (today): the player converts to RGBA, egui uploads it as a managed texture. Simple and portable; at 4K about 33 MB a frame crosses the CPU several times.
- YUV planes in memory, converted on the GPU: the player hands NV12
or I420 (1.5 bytes a pixel instead of 4), egui-pop uploads the planes to
its own wgpu textures and converts in a shader, registered with
egui_wgpu::Renderer::register_native_textureor drawn through a paint callback (CallbackTrait), both in egui-wgpu 0.37 [code]. This isiced_video_player’s design (repository) [docs]. Safe Rust, one CPU copy, no CPU conversion. - Zero copy: the hardware decoder’s surface imported into wgpu
(DMA-BUF on Linux, a shared D3D11 handle on Windows, an IOSurface on
macOS). wgpu 30 can import DMA-BUF on Vulkan through
create_texture_from_hal(changelog) [docs], which isunsafe, and the workspace forbidsunsafe; wgpu’sFeatures::EXTERNAL_TEXTURE(multi-plane YUV sampling) lists only DX12 and Metal in wgpu-types 30 [code]. Helper crates exist (wgpu-external-frame0.4.0, MIT OR Apache-2.0) [docs], untried. Not now: way 2 removes most of the cost.
Backends compared
| Backend | Licence (crate; library) | Platforms and what to install | Hardware decode | Frames to the texture | Verdict |
|---|---|---|---|---|---|
GStreamer through gstreamer 0.25.4 (2026-09-21), gstreamer-app, gstreamer-video | MIT OR Apache-2.0; GStreamer LGPL-2.1+, a system library | Linux: the distribution’s packages; Windows: the official installer (517 MB for x86_64 with development files, a runtime-only install type since 1.28); macOS: a 149 MB runtime package (downloads) [docs] | va on Linux (gstreamer-vaapi deprecated in 1.26), d3d11 and d3d12 on Windows, vtdec on macOS, nvcodec, Vulkan Video [docs]; VP9 and AV1 here, not H.264 [tried] | appsink in memory (ways 1 and 2); GL or DMA-BUF memory for way 3; no wgpu sink exists; gtk4paintablesink does zero copy for GTK 4 but is MPL-2.0 and GTK only [docs] | keep ours: the player is GStreamer’s (playbin), adopted; the widget, the controls and the texture path are ours. Fix the conversion (follow-up 2) |
libmpv through libmpv2 7.0.0 (2026-10-30) | LGPL-2.1 crate, refused by deny.toml; mpv is GPLv2+ unless built with -Dgpl=false; Fedora’s mpv-libs 0.41.0 is GPL-2.0-or-later AND LGPL-2.1-or-later [tried, dnf] | Linux packages (3 MB installed here, plus FFmpeg); Windows and macOS: ship a libmpv build | hwdec (VA-API, D3D11, VideoToolbox) [docs] | render API: OpenGL into a caller’s framebuffer, or software (“extremely simple (but slow)”); a D3D11 backend landed on mpv’s master on 2026-10-15, unreleased; no Vulkan, Metal or wgpu [docs] | reject as default: the crate’s licence, a GPL library on most systems, and OpenGL where egui-pop draws with wgpu. Permissive bindings exist since 2026-09 (rsmpv 0.2.1 and mpv-engine 0.2.1, MIT OR Apache-2.0, wgpu 30 import of mpv’s GL output, zero copy by its README): watch, a possible host-supplied VideoBackend for a GPL application such as Helios |
FFmpeg through ffmpeg-next 9.0.0 (2026-08-05), or rsmpeg 0.18 | ffmpeg-next WTFPL (not on the allow-list), “maintenance-only mode”; rsmpeg MIT, no release for 14 months; FFmpeg LGPL-2.1+, GPL with GPL parts | the FFmpeg libraries, at build and run time | hwaccel (VA-API, d3d11va, VideoToolbox) through the bindings [docs] | frames in memory; zero copy would be ours | reject: a decoder, not a player; sound output, the clock, seeking and buffering would all be ours |
video-rs 0.12.0 (2026-09-09) | MIT OR Apache-2.0, over ffmpeg-next (WTFPL) | FFmpeg’s libraries | through FFmpeg | ndarray frames in memory | reject: no playback, no sound |
AVFoundation through objc2-av-foundation 0.3.2 | Zlib OR Apache-2.0 OR MIT; the system’s | macOS, nothing to install | VideoToolbox, implicitly | AVPlayerItemVideoOutput gives IOSurface-backed pixel buffers: zero copy is possible, through unsafe wgpu-hal; a copy otherwise [docs] | later, wrap: a VideoBackend for macOS when GStreamer’s installer is too heavy there; not before a macOS user |
Media Foundation through windows 0.62.2 | MIT OR Apache-2.0; the system’s | Windows, nothing to install | DXVA | IMFMediaEngine::TransferVideoFrame into a D3D11 texture, then a shared handle or a read-back [docs] | later, wrap, as AVFoundation |
alhazen-core 0.7.1 (2026-11-02) | Apache-2.0 | pure Rust AV1, VP9, VP8, ProRes; Media Foundation, VideoToolbox, NVDEC; everything else through an ffmpeg program the user installs; sound through cpal | the systems’ decoders | BGRA, YUV, an IOSurface on macOS | watch: first released 2026-10-08; on Linux without NVIDIA, H.264 needs a separate ffmpeg |
gpu-video 0.4.0 (ex vk-video) | MIT | Vulkan Video, Linux and Windows, no macOS | H.264 decode only | frames stay on the GPU; wgpu 29 (a fork for 30) | reject: a bitstream decoder, no container, no sound |
Sources [docs]: crates.io’s API for every version and date, each linked repository for its activity.
The egui video crates today
| Crate | Version, date | Licence | egui | Backend | Verdict |
|---|---|---|---|---|---|
egui-video | 0.9.0, 2024-10-28 | MIT | 0.29 | FFmpeg (ffmpeg-the-third, WTFPL), SDL2 for sound | reject: unmaintained, three eguis behind |
egui-sharkplayer | 0.5.1, 2026-07-05 | Unlicense | eframe 0.35 | libmpv2 (LGPL crate); fast on glow, through memory on wgpu | reject: licence, egui version |
door_player | 0.3.23, 2026-10-25 | Apache-2.0 | 0.37 | ffmpeg-next (WTFPL), cpal | reject: an application more than a widget; FFmpeg and WTFPL |
re_video (Rerun) | 0.41.0, 2026-10-28 | MIT OR Apache-2.0 | none | AV1 through re_rav1d, H.264 through an ffmpeg program; no sound | reject: a decoder for Rerun |
ironav-player | 0.1.2, 2026-11-03 | AGPL-3.0 | eframe 0.37 | its own codecs | reject: licence |
playa | 0.1.142, 2025-12-25 | MIT | eframe 0.33 (glow) | image sequences, FFmpeg | reject: an application; worth reading for timelapse review (U2) |
None is a widget we could adopt: keep ours, as ADR 0017’s appendix already concluded for the viewer page (analysis).
Online video: can it play inside?
What the hosts allow
The question is not only technical. Every big host lets others show its videos through its own embedded player and forbids reaching the streams any other way. What matters for a desktop application:
| Host | The permitted way | What its terms forbid | Own player possible? |
|---|---|---|---|
| YouTube | the embedded player (the IFrame player, youtube.com/embed/<id> or youtube-nocookie.com/embed/<id>), in a web view; oEmbed for title and thumbnail | downloading, caching or storing the content; separating or modifying sound and picture; modifying or blocking the player or its ads; hiding links, attribution or branding; overlays in front of the player; a player under 200x200; more than one autoplaying player; autoplay before the player is visible; masking the client’s identity | no |
| Vimeo | the embeddable player (player.vimeo.com/video/<id>), its Player SDK (@vimeo/player, MIT); oEmbed | accessing, downloading or framing beyond what is authorised; automated access; circumventing DRM; removing logos | no, except an account’s own videos, whose file links the API gives “for use with third-party media players” |
| Dailymotion | its player; oEmbed (now needs a player id made in Dailymotion Studio) | modifying, building upon or blocking the player; automated access; scraping, extracting, downloading | no |
| Twitch | the embed (player.twitch.tv), with a parent parameter naming the embedding domain, over HTTPS | the embed obscured by other elements; under 400x300; scraping and downloading (Twitch’s terms of service, as quoted by a third party; its developer agreement could not be read) | no |
| PeerTube | its embed (/videos/embed/<id>, a JavaScript API with api=1) | each instance sets its own terms, each video its own licence | yes: its videos are plain MP4 files (“web videos”) or HLS playlists, given by its REST API |
A plain file (.mp4, .webm, an HLS .m3u8 or DASH .mpd) | any player | only the content’s own rights | yes |
Sources [docs]:
YouTube’s API Services Terms of Service
(section 16.3: no right to make content available “in any manner other
than through the use of the YouTube API Services”), its
Developer Policies
(III.E.1(a): do not “download, import, backup, cache, or store copies of
YouTube audiovisual content”; III.I.5: do not “modify, interfere with,
replace, or block advertisements”; III.I.6: do not “modify, build upon,
or block any portion or functionality of a YouTube player”; III.I.7: do
not “separate, isolate, or modify the audio or video components”; III.D.1.a:
do not “mask or misrepresent your identity or your API Client’s identity”;
III.B.1: an installed application “must be capable of being remotely
updated”), its
Required Minimum Functionality
(a viewport of at least 200 by 200 pixels; identification “through the
HTTP Referer request header”, which “in WebView integrations such as a
mobile app or desktop app … is empty by default” and must be set, as a
header or through the page’s base URL; no overlays, frames or other
visual elements “in front of any part of a YouTube embedded player”; no
automatic playback “until the player is visible”; non-compliance “might
result in reduced functionality”), its
player parameters
(origin, widget_referrer), and the
YouTube Terms of Service
(“You may also show YouTube videos through the embeddable YouTube
player”; no access by “automated means”, no circumventing what restricts
copying).
Vimeo’s terms (sections 2 and 5.4), its
API addendum, its
file links for third-party players
and its domain-restricted embeds.
Dailymotion’s terms
(sections 2.6, 6.1, 6.6) and its
oEmbed.
Twitch’s embed documentation and
its size rule.
PeerTube’s embed API
and its 6.0 release
(“web videos” in place of WebTorrent, HLS recommended).
In our own player: ruled out for the big hosts
Extracting a stream’s address the way yt-dlp does and handing it to
GStreamer or mpv would give a native picture with our own controls, no
web engine, and no overlay problem. It is ruled out for YouTube, Vimeo,
Dailymotion and Twitch: it is access by means other than their player,
it separates the picture from the player, its ads and its branding, and
for YouTube it breaks section 16.3 of the API terms and III.I.5 to III.I.7
of the Developer Policies quoted above. It would also break whenever the
host changes its pages, which is how yt-dlp lives. egui-pop does not
do it, does not document how, and does not take a dependency that does.
What can play in our own player: a plain video file on the web, an
HLS or DASH stream (GStreamer’s hlsdemux2 and dashdemux2, with
playbin3, from the good plugins since 1.22,
design)
[docs], [tried: HLS plays]; a PeerTube video through its file or HLS
address; a Vimeo account’s own videos through their file links. These
need nothing new in the backend: GStreamer opens https: addresses
(souphttpsrc, installed) as it opens files. What they need is a policy
change: today a remote video always opens outside
(ADR 0017).
Inside, through a web view
The host’s player is a web page; showing it inside the application means a web engine. Two ways exist: a native web view placed over the panel, or a web engine drawing into a texture egui shows.
Native web views (wry). wry 0.57.1 (MIT OR Apache-2.0) wraps the system’s engine [docs]:
| System | Engine | In the panel? | Media |
|---|---|---|---|
| Linux, X11 (and Xwayland) | WebKitGTK | yes: a child window over the panel; wry’s build_as_child is “X11 only”, the trial makes the child with x11rb because the workspace forbids unsafe [code] | through GStreamer: the codecs installed decide; YouTube needs MSE and VP9 or AV1 (WebKit bug 261892) [docs]; played in the trial [tried there] |
| Linux, Wayland | WebKitGTK | no: Wayland has no foreign child windows; wry needs a GTK container (build_gtk), so the trial opens a GTK window of its own [code], [docs] | same |
| Windows | WebView2 (Edge’s Chromium) | yes: a child window of the main window [docs] | Chromium’s codecs; no native HLS (WebView2Feedback#5092) [docs]; not run |
| macOS | WKWebView | yes: an NSView subview of the window’s content view [docs] | the system’s (VideoToolbox), HLS natively in Safari; not run |
wry’s build_as_child
states the three systems and the X11 limit. On Linux, wry still uses the
GTK 3 bindings (gtk 0.18 in our lock file [code]), whose repository
gtk-rs/gtk3-rs is archived [docs].
What a native web view costs, everywhere:
- It is on top. A web view is a native window or view above egui’s surface: egui’s menus, popups, tooltips and toasts over the panel are drawn under it (the “airspace” problem; gpui-wry’s README says the same for GPUI) [code], [docs]. For a YouTube player this is, oddly, what its terms want: nothing may be drawn in front of the player. The fix is to hide or shrink the web view while a popup crosses it, or to accept the gap.
- Focus and keys go to the web view while it has the focus: egui’s
shortcuts stop until the user clicks back into egui; WebView2 hands
accelerator keys back (
AcceleratorKeyPressed), WebKitGTK and WKWebView do not by themselves [docs]. - Screenshots and the debug bridge see a hole where the web view is: egui never had its pixels [code].
- On Linux, WebKitGTK (about 96 MB installed on Fedora) and GTK 3
are required at build and run time, and GTK’s loop is pumped from
egui’s thread [tried,
dnf], [code].
Offscreen engines, drawn into a texture. They solve the overlay, the screenshot and the Wayland problems, at a price:
| Engine | Licence | Size and state | Verdict |
|---|---|---|---|
CEF through cef (tauri-apps/cef-rs) 156.3.0, 2026-11-01 | Apache-2.0 OR MIT; CEF BSD-3-Clause, Chromium BSD and many more | Chromium shipped with the application (on the order of 100 MB or more per platform, not measured), its own processes; shared-texture offscreen rendering (osr_texture_import, dmabuf on Linux); the official builds leave out H.264 (gstcefsrc), YouTube still plays through VP9 and AV1 | reject: a second browser for a help video |
Servo (servo 0.7.0, 2026-10-05) | MPL-2.0: deny.toml refuses it | media through servo-media over GStreamer; whether YouTube plays not verified | reject (licence), watch |
| Ultralight | proprietary; the free tier “does not include … media playback” | reject | |
| WPE WebKit | LGPL system library, Linux only | no maintained Rust binding found | reject |
egui_chromite 0.0.1, 2026-10-23 | MIT OR Apache-2.0 | “Chromium web views as egui widgets”, 12 downloads | watch |
egui_webview (hello_egui) | MIT | wry, unreleased, unsafe around Send and Sync | reject |
And a texture would let egui draw over the YouTube player, which its terms forbid: the overlay problem becomes a rule to enforce rather than a problem solved.
On the web build
The page is already in a browser, so the host’s player is an <iframe>
and a plain video is a <video> element, both positioned over the canvas
on the panel’s rectangle (web survey,
M1 to M3, follow-up 21) [docs]. The same overlay rule holds: egui’s popups
are drawn in the canvas, under the element, so the element hides while
one is open. Drawing the video into egui’s own texture instead
(copyExternalImageToTexture, WebGPU’s importExternalTexture) only
works for a video the page may read: a cross-origin video without CORS
throws a security error
(MDN),
and no web API draws an <iframe> into a canvas at all [docs]. So the
host’s players can only be overlays; our own files, served with the
gallery, could go either way.
Per host
| Host | Desktop, Linux | Desktop, Windows and macOS | Web build |
|---|---|---|---|
| YouTube | the trial: wry, privacy-enhanced player, Referer set; inside on X11, own window on Wayland | same through wry’s WebView2 and WKWebView backends (not written, not run) | an <iframe> over the canvas |
| Vimeo | the same shape works technically (player.vimeo.com/video/<id>); a domain-restricted video plays only if the Referer names an allowed domain (inferred from Vimeo’s help, not tried) | same | <iframe> |
| Dailymotion | the same shape, with a player id from Dailymotion Studio | same | <iframe> |
| Twitch | not worth it: parent must name the page’s domain over HTTPS, a file:// page fails (forum), at least 400x300; live streams are no help-video use case | same | <iframe>, with the site’s domain as parent |
| PeerTube | our own player on the video’s MP4 or HLS address | same | <video> (HLS needs a script outside Safari) |
| Plain file, HLS, DASH | our own player | same | <video> |
Is the trial compliant?
Read against the Required Minimum Functionality [docs], [code]:
- Identity: the trial sends
https://localhost/unless the application setsViewerPlugin::embed_referrer. The rules ask for aRefererthat identifies the application, a stable HTTPS address whose domain is the application’s id (reverse-DNS in Google’s examples), and forbid masking it.localhostidentifies nobody: the default should be derived from the application’s id, and an application should be told to set its own. Since follow-up 4 (2026-11-04) it ishttps://<app id>/, fromAppBuilder::app_id. - Size: the player must be at least 200 by 200 pixels; a narrow panel can be smaller. Below that the page should show the card with “Open outside” instead. Since follow-up 4 it does.
- Autoplay: the trial loads
autoplay=1, after the user clicked the link, with the web view visible; it closes when its panel is hidden. That fits “not until the player is visible” and “one autoplaying player”. - Nothing in front: egui cannot draw over a native web view, so this holds by construction on X11, Windows and macOS.
- Links and branding: the player is loaded unmodified; its links go outside through the links service.
- Remote update: installed applications “must be capable of being remotely updated”; that is the application’s packaging, not egui-pop’s, and worth a line in the documentation.
Follow-ups, ranked
Sizes: S (a day or less), M (a few days), L (more). “Decided” means the owner already settled it; everything else is a proposal.
- The native
Videowidget (the plan already proposed for it):Video::new(source)withcontrols(Full | Compact | None),autoplay,looping,muted,fit(Contain | Cover), a poster frame, its own player per widget on the existingVideoBackend; the viewer’s page rebuilt on it; the gallery showing full, compact and bare; a placeholder with “Open outside” without thevideofeature. It serves U1, U4, U5 and U6. M. Not decided: the plan waits on this survey. Two additions from it:VideoBackend::opentakes a URI rather than a path (follow-up 5), and the player can pre-roll paused to give a poster frame without playing (it already opens paused on its first picture [code]). - The frame path: YUV to the GPU. Ask
appsinkfor NV12 or I420, upload the planes to wgpu textures, convert in a shader, drop the CPU RGBA conversion and the two egui-side copies (way 2 above). Until then, a one-line stopgap:videoconvert n-threads=0in the sink, which took the 4K clip from 22 to 59 frames a second here [tried]. S for the stopgap, M for the planes. Not decided. - Frame stepping and loop without a gap (U2): GStreamer’s step event
(design)
behind
VideoPlayer::step, a segment seek for seamless loops; with the widget’sFullcontrols. S to M. Not decided; only if Helios takes timelapse review. - Keep the YouTube trial, opt-in, and make it comply: the default
Refererderived from the application’s id (notlocalhost), a minimum of 200 by 200 pixels below which the card with “Open outside” shows, a line in the documentation on the terms (no extraction, nothing over the player, an application that can be updated). S. Done (2026-11-04, the owner chose to keep the trial, opt-in): theRefererishttps://<app id>/fromAppBuilder::app_id, the card shows below 200 by 200 of the web view’s pixels, and links.md says what the terms allow. - Plain web videos in our own player: a remote
.mp4,.webm,.m3u8or.mpd, and PeerTube videos through their file address, played by the same widget (GStreamer openshttps:), after a click as any remote content. A change to ADR 0017’s policy (“remote video stays outside”). M. Not decided: it is a policy change for the owner. - Vimeo and Dailymotion in the same web view: the embed URL per
host in
EmbedBackend’s request, the sameReferer, the same rules. S once follow-up 4 is done. Not decided; only if an application links tutorials there. - Windows and macOS web views: wry’s WebView2 and WKWebView backends
for the same
EmbedBackend, inside the panel (build_as_childworks there without the X11 dance). M, and run on those systems by hand. Not decided; after a Windows or macOS user. - The web build’s overlays (web survey follow-up 21):
<video>for files and<iframe>for the hosts, on the panel’s rectangle, hidden while an egui popup is open. M to L. Not decided; already ranked in the web survey. - Hide a native web view while an egui popup crosses it, so menus stay usable over a playing YouTube panel. S to M. Not decided.
What to drop
- Extracting streams from YouTube, Vimeo, Dailymotion or Twitch to play them in our own player: against their terms. Dropped, not to be revisited.
- Twitch inside the application: its
parentrule, HTTPS origin and 400 by 300 minimum fit a website, not a desktop panel, and live streams are not a use case here. Outside, always. - An offscreen browser engine (CEF, Servo, Ultralight, WPE) to fix the overlay: 100 MB or more, or a refused licence, for help videos; and YouTube’s terms forbid drawing over its player anyway. Dropped unless a real need for full web pages inside appears.
- libmpv, FFmpeg or an egui video crate in place of GStreamer: none
is a better player under our licence policy today. Watch
mpv-engineandalhazen-core; a GPL application may plug libmpv in throughVideoBackendon its own. - Zero-copy import (way 3) for now:
unsafe, platform by platform, and way 2 gets most of the gain.
For the owner
- Decided already: local video plays inside with the
videofeature (2026-11-01); the YouTube page exists as an opt-in trial (2026-11-03);option-extis allowed as a narrow MPL exception for it (2026-11-03). - Decided since: the YouTube trial stays, opt-in, made to comply (4, 2026-11-04, done).
- To decide: the
Videowidget’s plan (1); whether remote video files and PeerTube may play inside (5); whether the WTFPL (ffmpeg-next) ever joins the allow-list (only if an FFmpeg backend is wanted, which this survey does not recommend).
Sources
The sources are linked where they are used above. The main ones:
YouTube’s API Services Terms of Service,
Developer Policies
and Required Minimum Functionality;
Vimeo’s terms,
Dailymotion’s terms,
Twitch’s embed documentation,
PeerTube’s embed API;
wry’s WebViewBuilder;
GStreamer’s releases
and downloads;
mpv’s copyright notice;
FFmpeg’s legal page;
crates.io for every crate’s version, date and licence.
Graph wires survey: editing connections in node editors
How do node editors let people edit the wires themselves: hover, select, delete, cut, detach and reconnect from either end, move all of a port’s wires, reroute, insert a node on a wire, mute, and reach all of it from the keyboard and a screen reader? This study surveys Blender, Houdini, Nuke, DaVinci Fusion, TouchDesigner, Unreal Blueprints, Unity Shader Graph, ComfyUI (LiteGraph), Max, Pure Data, React Flow, Rete.js and vkdt, compares them with egui-pop’s node graph editor, and ends with a ranked plan. It answers issue #227, “diagram connectors cannot be edited” (select, delete, disconnect, reconnect).
Status: items 1 and 2 of the plan below are built (2026-11-06; see node-graph.md); items 3 to 7 are not started.
Read on 2026-11-06, against egui-pop’s main. Nothing was built or run:
every point about another editor comes from its documentation (linked),
its source, or, where marked (community), a forum or third-party page.
“Not documented” means the sources read do not say, not that the feature
is missing.
Summary
- egui-pop has no wire as an object. Wires are edited only through their ports: drag off a connected input, Delete on a focused port, a port’s menu. A wire cannot be hovered, clicked, selected, deleted on its own, or picked up from its output end when the output has several.
- Almost every editor surveyed makes the wire a first-class target: it highlights under the pointer (Max, TouchDesigner, LiteGraph, React Flow), a click selects it and Delete removes it (Houdini, Max, Pure Data, Shader Graph, React Flow), a right click opens a wire menu (Houdini, TouchDesigner, Max, Shader Graph, LiteGraph). Blender is the exception: links are never selected, only cut with a stroke.
- Reconnecting from either end is common: Fusion splits a wire into an output half and an input half, Max shows two handles on a selected cord, Nuke drags head or tail, React Flow lets each end be reconnectable. Dropped nowhere, the wire is removed (Fusion, Nuke, React Flow’s example, egui-pop today).
- Moving all of a port’s wires is a modifier on the port drag: Ctrl in Unreal and Blender (outputs), Shift in ComfyUI.
- Inserting a node by dropping it on a wire is near universal in compositing tools (Blender, Nuke, Houdini, vkdt) and matters most for an image pipeline.
- Cut strokes (Blender Ctrl+right drag, Houdini Y+drag) are fast but invisible; they belong in a profile, not the default.
- Keyboard and screen reader access to wires is rare. React Flow makes edges focusable with a spoken hint; Pure Data cycles through selected cords with Tab. egui-pop already announces wires on ports and can do better than most.
Recommended first pull request (M): wire hit-testing, hover highlight
and tooltip, click and Ctrl/Shift selection, Delete as one Disconnect,
a wire menu, end handles on a selected wire to reconnect either end, and
the wire in the keyboard path, the accessibility tree and agent
commands. It closes #227. Insert-on-wire and moving all wires follow.
egui-pop today
From crates/egui-pop-viewport/src/graph/mod.rs and
node-graph.md:
| Action | Today |
|---|---|
| Draw a wire | Drag from a port (type-checked while drawn); or click a port then another; or Enter on two focused ports |
| Replace an input’s wire | Drop a new wire on it: Connect { replaces } |
| Detach from the input end | Drag off a connected input: the wire follows; dropped on a port it reconnects, nowhere it disconnects |
| Detach from the output end | Not possible: a drag from an output always starts a new wire (fan-out) |
| Hover a wire | No feedback |
| Select a wire | Not possible (GraphState::selection holds nodes only) |
| Delete a wire | Delete on a focused port (all its wires), a port’s context menu, or deleting a node |
| Cut, reroute, insert on wire, mute | None |
| Keyboard | Tab to a port, Delete disconnects it; Enter/Space picks it as a wire’s end |
| Accessibility | A port is a button whose value lists its type and wires; wires begun, made or refused are announced |
| Agents | graph.edit with a disconnect or connect edit; graph.read lists edges |
| Undo | Each Edit is one finished gesture; the application makes it one step (Helios: one network.* command, one undo step) |
The model already fits wire editing: Edit::Disconnect { edges } takes
several wires, Edit::Connect { replaces } expresses a reconnect as one
edit, and every edit passes the on_edit hook and the graph.* steps.
What is missing is on the drawing side: hit-testing a wire, a wire
selection in GraphState, and the gestures on it. Wires are drawn as
curves, straight segments or orthogonal routes (wires.rs), the routes
kept in Drawn::routes, so a hit test has the polyline at hand for
every style.
Per-system notes
Blender (node editors)
- Links are never selected. Cut: Ctrl+right drag a stroke across links deletes them; Ctrl+Alt+right drag mutes or unmutes them (a muted link is drawn red and passes nothing). Detach: Alt+left drag on nodes cuts all their links. Drag a link off an input and release: disconnected.
- Ctrl while dragging from an output moves its outgoing links; Alt while moving a link swaps links of a similar type.
- Drop a node on a link: the link highlights, the node is inserted, and auto-offset pushes the downstream nodes aside (T flips the side, Alt disables the attachment).
- Ctrl+Delete deletes a node and reconnects its inputs to its outputs.
- Shift+right drag across a link inserts a reroute node (one input, many outputs).
- Releasing a link over empty space opens a search of compatible nodes (link drag search).
- Keyboard: J / Shift+J make links between selected nodes. No screen reader support.
- Sources: Editing nodes, Arranging nodes, Reroute node, Link drag search commit.
Houdini (network editor)
- A wire can be selected and Del deletes it; right click opens a wire menu (Disconnect among others).
- Y+drag across wires cuts them; shaking a node disconnects it.
- Alt+click a wire adds a dot (a reroute point), Alt+click a dot pins it; Alt+drag a dot gathers the wires it crosses.
- Drop a node on a wire to insert it (hold 8 to prevent); select a wire and press Tab to insert a node there; right click a connector to insert before, middle click to branch.
- Sources: Wires, Network editor shortcuts.
Nuke (node graph)
- Drag the head or the tail of a pipe: dropped on a node it reconnects, in empty space it disconnects. Ctrl/Cmd+D disconnects the selected node’s inputs.
- Shift+drag a pipe end duplicates the connection (the original stays).
- Ctrl/Cmd+click the yellow dot at a pipe’s middle inserts a Dot node.
- Drag a node between two connected nodes: the pipe lights up, release inserts it.
- Source: Connecting nodes; shake to disconnect: Foundry.
DaVinci Resolve Fusion (node editor)
- A connection has two halves: click the input half once to break it; drag either half onto another node’s socket to move that end (the old link goes, one gesture); drag it to empty space to disconnect.
- Routers (reroute points) reshape and branch connections; pipes can be direct or orthogonal.
- Source: Resolve 18.6 manual, Fusion “Connecting and disconnecting nodes” (Blackmagic Design); summary in Mixing Light (community).
TouchDesigner (network editor)
- A wire turns yellow under the pointer. Right click a highlighted wire: insert an operator, select the source node, select the destination node, disconnect. Middle click shows the source’s info.
- Wires are drawn by drag or by two clicks (as egui-pop does).
- Source: Wire.
Unreal Engine Blueprints
- Hovering a pin emphasises its wires. Alt+click a pin breaks all its connections; Ctrl+drag from a pin moves all its connections to another pin; right click a pin for a menu (break a single link by name).
- Double click a wire adds a reroute node (community); dropping a wire in empty space opens the action menu filtered by the pin’s type.
- Sources: Blueprint editor cheat sheet; double click and Alt+click on the wire: Epic forum (community).
Unity Shader Graph
- Edges are selected and deleted with Delete (Cmd+Backspace on macOS) or the context menu; dropping a dragged edge in empty space opens the Create Node menu.
- A redirect (elbow) node: double click a wire, right click it and “Add Redirect Node”, or select it and Ctrl/Cmd+R.
- Sources: Edge, Redirect node.
ComfyUI and LiteGraph
- LiteGraph highlights the links of the selected nodes and draws a marker
at each link’s middle; a click on it opens a menu (Add Node, which
inserts the node on the link, and Delete). Dragging a connected input
takes its link along (
allow_reconnect_links). - ComfyUI: a setting picks what a link released on empty space does (context menu, search box, nothing; Shift gives the other); Shift drags several links at once (frontend 1.2.7).
- Sources: LiteGraph source
(
showLinkMenu,allow_reconnect_links), ComfyUI LiteGraph settings, ComfyUI shortcuts.
Max (Cycling ’74)
- Cords highlight under the pointer when the patch is unlocked. A click selects a cord; Alt-drag selects cords with a rectangle. A selected cord shows a handle at each end: drag one to change the source or the destination. Right click: colour, Align (segments).
- Source: Patch cords.
Pure Data (vanilla)
- Click a connection to select it, Backspace or Delete removes it; cords cannot be rubber-banded. Tab and Shift+Tab cycle through the selected cords.
- Shift+click another cord swaps the two; Ctrl+K inserts the selected box into the selected connection (and bypasses a middle box); Ctrl+T on a selected connection inserts a pass-through object; Ctrl+D duplicates a connection.
- Source: Pd manual, chapter 2 (2.2.6, 2.3).
React Flow (web library)
- Edges are selectable by click (
elementsSelectable), with Ctrl/Meta for several (multiSelectionKeyCode) and by the selection box (selectionKeyCode);deleteKeyCode(Backspace) deletes selected nodes and edges; per edgeselectable,deletable,focusable. - An invisible wider path makes thin edges easy to hit
(
interactionWidth), which also serves touch. - Reconnect:
edgesReconnectableandonReconnect, per edgereconnectable: true | "source" | "target"; an example deletes an edge dropped on the pane (onReconnectStart/onReconnectEnd). - Keyboard: edges are Tab stops (
edgesFocusable), Enter or Space selects, Delete removes, Escape clears; a spoken description says so (ariaLabelConfig,edge.a11yDescription.default), and each edge has anariaLabel. - Sources: ReactFlow props, Edge type, Reconnect edge, Delete edge on drop, Accessibility.
Rete.js
- The connection plugin’s presets pick up an input’s connection on press
(a pseudo-connection follows the pointer, as egui-pop does); the
connectionpickandconnectiondropevents can be vetoed. Selectable connections and reroute pins are separate plugins (rete-connection-reroute-plugin). - Source: Connections guide.
vkdt and darktable
- vkdt’s graph editor: drag an output pin to an input to connect; right
click an input’s ball to remove its connection; drag a disconnected
node onto a link to insert it, when the node has a plain
inputtooutputchain. No wire selection. - darktable has no graph: its pipeline is an ordered stack; modules are moved in the stack, not rewired.
- Source: vkdt GUI basics.
Comparison
Y: documented; –: not offered; ?: not documented in the sources read.
| Hover | Select wire | Delete wire | Cut stroke | Move either end | All of a port | Reroute | Insert on wire | Mute | Wire menu | Keyboard on wires | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Blender | ? | – | cut / drag off | Ctrl+RMB | input end | Ctrl (output) | Shift+RMB | drop node | Ctrl+Alt+RMB | – | – |
| Houdini | ? | Y | Del, menu | Y+drag | via dots | ? | Alt+click dot | drop, Tab | – | Y | Tab inserts |
| Nuke | ? | ? | drag off | – | head and tail | ? | Ctrl+click dot | drop node | – | ? | – |
| Fusion | ? | ? | click input half | – | both halves | ? | routers | ? | – | ? | – |
| TouchDesigner | Y | ? | menu | – | ? | ? | ? | menu | – | Y | – |
| Unreal | pin hover | ? | Alt+click | – | Ctrl+drag | Ctrl+drag | double click | ? | – | pin menu | – |
| Shader Graph | ? | Y | Delete | – | ? | ? | double click, Ctrl+R | ? | – | Y | – |
| ComfyUI | selected nodes’ | – | midpoint menu | – | input end | Shift | Y | midpoint menu | – | Y | – |
| Max | Y | click, Alt+box | Y | – | handles | ? | Align | ? | – | Y | – |
| Pure Data | ? | click | Delete | – | ? | Shift (fan) | – | Ctrl+K, Ctrl+T | – | – | Tab cycles |
| React Flow | style | click, box | Backspace | – | each end | – | (custom) | (custom) | – | (custom) | Tab, Enter, Delete |
| vkdt | ? | – | right click input | – | – | – | – | drop node | – | – | – |
| egui-pop | – | – | port only | – | input end | – | – | – | – | port menu | port only |
Undo granularity: where documented, a gesture is one undo step (Blender’s operators, Pd’s edits); in React Flow and Rete the application decides. Touch: only React Flow addresses it (the wide hit path); the desktop tools assume a mouse.
Recommended for egui-pop
Ranked by value for size. S: a day or less; M: a few days; L: more.
- The wire as a target (M, closes #227).
- Hit test: distance from the pointer to the drawn polyline (curves
flattened, orthogonal routes from
Drawn::routes), within 6 screen points, ports and nodes winning over wires. On touch, 12. - Hover: the wire drawn thicker in
graph.wire-hover(a new token), its two ports ringed, a tooltip “Load · Image → Blur · Image”, and the hint line says what a click and a drag do. - Select: a click selects the wire (clearing nodes), Ctrl/Shift
toggles it into the selection; selected wires drawn in
graph.node-selected.GraphStategainsselected_edges: BTreeSet<Edge>;GraphEvent::Selectionreports nodes and edges. The rubber band keeps selecting nodes only (Pd and Max make box selection of wires a separate gesture; it adds little). - Delete: Delete/Backspace with wires selected emits one
Edit::Disconnectwith all of them (one undo step); with nodes and wires selected, oneDeletewhoseedgescarry both. - Wire menu (secondary click): Disconnect, Select source node, Select destination node, Insert node… (once item 3 lands).
- Reconnect either end: a selected or hovered wire shows a handle near
each end (Max, Fusion’s halves, React Flow); dragging a handle
detaches that end, dropped on a port it emits
Connect { replaces: [old] }(one edit), dropped nowhere it emitsDisconnect, as a drag off an input does today. This is also how one wire of a fanned-out output is picked up. Escape puts it back.
- Hit test: distance from the pointer to the drawn polyline (curves
flattened, orthogonal routes from
- Keyboard, screen reader and agents for wires (S, in the same PR if it fits). See the next section.
- Insert a node on a wire (M). Dragging a node with a free input and a
free output over a wire highlights it; release inserts (Blender, Nuke,
Houdini, vkdt). Alt held suspends it (Blender). Needs one compound edit
for one undo step:
Edit::Insert { node, edge, input, output }, type-checked like a connect, which the application may veto or turn into its own command. The wire menu’s “Insert node…” opens the add menu and inserts the new node the same way (LiteGraph, TouchDesigner). - Move all of a port’s wires (S–M). Ctrl (Cmd) + drag from a connected
port takes all its wires to another port of the same side (Unreal; Blender
for outputs). One edit:
Edit::Reconnect { moves: Vec<(Edge, Edge)> }, orConnectgeneralised to several pairs. Dropped nowhere: all disconnected. - Delete and heal (S). A node deleted with Ctrl+Delete reconnects its
main input’s source to its main output’s consumers (Blender
Ctrl+Delete, Houdini “reconnect around”, Pd Ctrl+K). An option on
Edit::Delete(heal: true) so the application applies it in the same step. - Release on empty canvas opens the add menu (S). A wire dropped nowhere from an output opens the add menu filtered by type, and the new node is connected (Blender link drag search, Unreal, Shader Graph, ComfyUI). Today it is a silent cancel for a new wire, so nothing is lost.
- Cut stroke (S), profile-bound. Ctrl + secondary drag draws a line;
wires crossed are cut as one
Disconnect. Bound in the “Blender / node editors” pointer profile only (its secondary drag already pans the graph; Ctrl keeps them apart), unbound in the others.
Skipped, and why:
- Reroute points / dots (L): the model has no point on a wire, and the orthogonal router already keeps wires off nodes. An application that wants them can offer a “dot” node kind. Revisit if users ask.
- Muting a wire: Helios bypasses nodes, not wires, and a muted wire is an
engine concept the editor cannot own. An application could draw a muted
wire through a style on
Edgelater. - Shake to disconnect: undiscoverable and easy to trigger by accident; Ctrl+Delete heal covers the same need.
- Swapping wires (Pd, Blender Alt): rare; two reconnects do it.
- Duplicating a wire (Nuke Shift+drag): a new drag from the output already fans out.
- Box selection of wires: deleting nodes already takes their wires; a wire is selected where it is seen.
Accessibility and agents
- Keyboard. A wire belongs to its input port (an input has at most one
wire unless
multiple), so no new chord is needed: inside a node’s parts (Enter on the node withTabStops::One), Tab goes through the ports and, after each connected input, its wires. A focused wire: Delete disconnects it, Enter picks its input end for reconnecting (then a port is chosen as today, Enter on it reconnects, Escape cancels), Shift+Enter picks its output end, the menu key opens the wire menu, Escape goes back to the port. Pure Data’s Tab through selected cords and React Flow’s focusable edges are the precedents. - Screen reader. Each wire is an AccessKit node under its input port: role button, role description “wire”, name “Load, output Image to Blur, input Image”, selected state. The spoken hint, as React Flow’s: “Delete to disconnect, Enter to move its input end”. Selecting, disconnecting and reconnecting a wire are announced in the live region, as connecting is today.
- Focus visible. The focused wire is drawn with the focus ring’s colour along its path, not only the selection’s.
- Agents. Nothing new is needed to edit:
graph.editalready takesdisconnectandconnectwithreplaces. To add:Request::Selectextended with edges (graph.selectwithedges: [{from, to}]),graph.readreporting the selected wires and, for each wire, its route points (already there for orthogonal routes), and the new edits of items 3 to 5 asgraph.insert,graph.reconnectsteps with the same veto and redirect as the others. - Undo. One gesture, one edit, one step: a multi-wire delete, a reconnect, an insert and a heal are each one edit, never a disconnect followed by a connect.
What Helios needs
Helios shows the workspace’s image-processing network (sources, darktable
and vkdt modules, composites, mask networks) through egui-pop’s editor, and
turns each edit into a network.* command, one undo step that agents also
see (helios-gui/src/graph.rs).
- Disconnect and reconnect (item 1) map straight onto
network.disconnectandnetwork.connectwithreplaces: no Helios change beyond what it does today. - Insert on a wire (item 3) is the gesture image pipelines lean on most
(a module added between two others). Helios’s design asks for explicit
actions (“insert before”, “insert after”) rather than precise gestures; the
wire menu’s “Insert node…” and the drop-on-wire gesture both serve it, and
Edit::Insertwould become one Helios command (a newnetwork.insert, ornetwork.addfollowed by connects in one step). - Delete and heal (item 5) matches Helios’s rule that taking a member out
rewires the network;
network.removetoday drops the wires, so heal would be a Helios change too. - Fan-out: a module output feeds several consumers (masks, blends); picking up one of them by its handle (item 1) is the missing piece.
- Mute: Helios bypasses nodes (
node.bypass, one undo step), so wire muting is not needed. - Reroutes: not needed; Helios’s layout is layered and the orthogonal wires avoid nodes.
Knob interaction: a study
How should a knob on a screen be driven? This study reads egui-pop’s knob as it is today, compares it with the audio, photo and video software people already know and with the web’s knob libraries, and ends with a recommendation for the knob’s API: a drag mode the application chooses, a travel in points independent of the knob’s size, one fine modifier, the wheel, reset, typing, and an endless knob.
Read on 2026-11-11, against egui-pop’s main (crates/egui-pop-core/src/knob.rs
and slider.rs).
Summary
- Linear drag wins. Nearly every audio application and plug-in
maker drives knobs by a straight drag, up for more (Ableton Live,
Bitwig, Logic, Reason, Native Instruments, FabFilter, u-he, Cubase’s
“Linear” mode, Arturia’s “linear” mode). Circular drag survives as an
option (Cubase, Arturia, VCV Rack, JUCE, MultitrackStudio, the VST 3
host knob mode) and as the default of general-purpose toolkits (Qt’s
Dial, Nexus UI), never as the only way. - Hybrids confuse. The places that pick the mode from where the press lands (FabFilter: the arrow turns, the centre drags; some synths: straying from vertical engages circular) draw steady complaints about falling into the wrong mode by accident. egui-pop’s knob is such a hybrid today.
- The mode is often the host’s or the person’s choice. VST 3 has a call for the host to tell a plug-in its knob mode; Cubase, VCV Rack, MultitrackStudio and some Arturia instruments have a preference; JUCE lets the application, or the person through an optional menu, pick among circular, horizontal, vertical, and both.
- Travel is fixed in pixels, not proportional to the knob: JUCE’s default is 250 pixels for the full range, egui-pop’s 200 points; others make it a per-control speed (VCV Rack, u-he) or a preference (Reason).
- Shift is the fine modifier in almost every audio application (Live, Bitwig, Logic, Reason, Kontakt, FabFilter, u-he, webaudio-controls); Ctrl in FL Studio and JUCE’s velocity toggle; darktable uses Ctrl for finer and Shift for coarser.
- The wheel is expected on hover in plug-ins (FabFilter, JUCE by default), but in a scrolling panel it hijacks the scroll: the web’s long fight with number inputs, and VCV Rack’s wheel control being a menu option.
- Double click means reset in Live, Bitwig, darktable and egui-pop, but typing in FabFilter; Ctrl/Cmd-click or Alt/Option-click resets in Logic, Reason, Kontakt, FabFilter and FL Studio.
egui-pop’s knob today
Knob (egui_pop_core::knob) shares the slider’s terms (soft and hard
range, step, unit, default, hook) and its history contract. How it is
driven:
| Gesture | Today |
|---|---|
| Drag | Both axes by default (2026-11-15): right and up both add, Knob::travel points (200 by default) for the soft range, whatever the knob’s size; some people drag a knob upward, others sideways, and neither is ignored. A knob or the pointer profile can ask for vertical (the audio convention), horizontal or circular (around the centre, relative to the press). Where the press lands never changes the mode. |
| Fine | Shift, or the profile’s fine modifier (Ctrl by default): ten times finer, from where it is. Coarse is never applied to a drag. |
| Wheel | The slider’s rule: by default (the “guarded” profiles) the wheel scrolls the panel and steps the knob only when it has the focus or Alt is held over it; the darktable profile steps the knob under the pointer. One step per frame with wheel input, whatever the delta. |
| Keys | When focused: arrows step, Page Up/Down ten steps, Home/End the soft ends, Enter opens the typed entry. |
| Double click | Back to the default. |
| Typing | Enter on a focused knob; no pointer gesture opens it. |
| Cursor | A drag cursor; the pointer is neither hidden nor held. |
| Accessibility | An AccessKit slider, with value text, range, step, increment, decrement and set-value actions. |
What makes it hard to control:
- The rim turns. The value’s arc and the pointer line are drawn from a quarter to nine tenths of the radius, so a person aiming at the pointer, or at the arc, presses in the outer 40 % and gets the circular mode. On a 48-point dial that ring is about 9 points wide; one press lands in it, the next one not, and the same motion does two different things.
- Circular is hard near the centre. In the circular mode, the angle swept per point of motion grows as the pointer nears the centre, so a drag that passes close to it jumps.
- Shift means two things. Shift makes a drag finer, but with the default profile Shift makes the wheel and the arrows coarser (the slider’s rule: Ctrl finer, Shift coarser).
- The wheel does nothing by default. Over an unfocused knob the guarded profiles scroll the panel; a person who expects the wheel to turn a knob, as in every plug-in, sees nothing happen.
- Up only. A person who drags sideways, as on a horizontal slider, gets nothing.
What others do
A dash: the sources read do not say.
| Software | Drag | Full range | Fine | Wheel | Reset | Typing |
|---|---|---|---|---|---|---|
| Ableton Live | vertical | — | Shift | — | double click, Delete | type digits on a selected control |
| Bitwig Studio | vertical (up/down) | — | Shift (also pressed mid-drag) | — | double click | Ctrl/Cmd-click |
| Logic Pro | vertical | — | Shift (before the drag) | after selecting the control, wheel or trackpad | Option-click | — |
| Cubase / Nuendo | preference: Circular, Relative Circular, Linear | — | Shift (linear mode) | — | — | — |
| Reason | vertical (up = clockwise) | preference “Mouse Knob Range” | Shift | — | Ctrl/Cmd-click | — |
| FL Studio | — | — | Ctrl, or both buttons | — | Alt-click | right-click menu, “Type in value” |
| FabFilter | vertical from the centre; rotational from the arrow | slow motion finer | Shift (drag and wheel) | hover | Ctrl/Cmd-click | double click |
| Native Instruments (Kontakt, Massive) | vertical | — | Shift | — | Ctrl/Cmd-click | — |
| u-he | vertical | per-control setting (normedMouseTravel) | Shift | — | — | — |
| Arturia (V instruments) | circular by default, linear as an option (some via the host) | — | right-click or Alt/Shift-click (x4 finer) | — | — | — |
JUCE Slider | application’s style: Rotary (circular, absolute), RotaryHorizontalDrag, RotaryVerticalDrag, RotaryHorizontalVerticalDrag (right plus up) | 250 px by default (setMouseDragSensitivity) | velocity mode, toggled by Ctrl/Alt/Cmd | on by default, 15 % of the range per unit, at least one interval | double click to a set value (setDoubleClickReturnValue) | text box |
| VST 3 host knob mode | the host says: kCircularMode (jump), kRelativCircularMode, kLinearMode (vertical) | the plug-in’s | the plug-in’s | the plug-in’s | the plug-in’s | the plug-in’s |
| VCV Rack 2 | preference: linear, scaled linear (each with a locked cursor or not), absolute rotary, relative rotary; a module may make a knob horizontal | speed per knob | — | a View menu option | — | — |
| MultitrackStudio | preference: Rotary or Vertical/Horizontal; touch: Horizontal/Rotating or Vertical | — | — | — | — | — |
| darktable (bauhaus sliders) | the slider follows the drag; right-click pop-up for fine control, finer the farther the pointer is from the marker | the slider’s width | Ctrl finer, Shift coarser (x10, preference) | hover | double click | right-click, then type |
| Lightroom Classic (sliders) | horizontal | the slider’s width | Shift (reported, conflicting) | reported on hover, varies by system | double click on the label | — |
| DaVinci Resolve (wheels and rings) | drag the ring or the puck | — | — | — | double click in the ring, reset button | value fields under the wheel |
Qt Quick Dial | inputMode: Circular (default, absolute), Horizontal, Vertical (relative) | — | none | — | none | none |
Nexus UI Dial | interaction: radial (default), vertical, horizontal; mode relative (default) or absolute | — | none | — | none | none |
| webaudio-controls | up or right is more | sensitivity | Shift (drag and wheel, by step) | yes | Ctrl/Cmd-click | — |
| jQuery Knob | absolute: the value follows the pointer’s angle | the dial | none | yes | none | none |
Findings
Circular versus linear. Circular drag maps the screen to a physical gesture the mouse does not have: the hand moves the wrist in a straight line, and turning in a circle around a small target is slow and imprecise, worst near the centre, where the angle per point of motion explodes. Developers report that newcomers drag knobs up and down and that “radial is confusing”, and several moved to linear for that reason (linux-audio-dev). The DAW manuals read here (Live, Bitwig, Logic, Reason, Kontakt) document a vertical drag as the knob’s gesture. Circular keeps one strength: the travel can be set by moving farther from the knob (a longer lever, finer control), which Arturia’s old instruments and darktable’s pop-up use for fine adjustment.
Hybrids. FabFilter switches to rotation when the press lands on the knob’s arrow; users ask to turn it off, report falling into it by accident, and FabFilter’s own designer says he hardly uses it since the vertical drag gained its slow-down. Plug-ins that switch to circular when the drag strays from vertical draw the same complaint. A mode chosen from where the press lands is invisible: the person cannot tell which one they will get.
Vertical, horizontal or both. Vertical is the audio convention: a
knob sits in a column of knobs on a channel strip and up reads as more.
Horizontal suits rows of knobs and matches the horizontal sliders next
to them (Lightroom, darktable). JUCE’s RotaryHorizontalVerticalDrag
and webaudio-controls add both components (right plus up), so either
gesture works and a diagonal one is faster; the cost is that a sloppy
vertical drag picks up its horizontal wander (one synth’s knobs were
reported to jump from exactly that).
Distance. The toolkits read here fix the travel in pixels (JUCE
250, egui-pop 200 points) or as a per-knob speed (VCV Rack, u-he’s
normedMouseTravel); none ties it to the knob’s size, which would make
a small knob too fast for the same motion. A fixed travel gives the same feel to every knob, small or
large; 200 to 300 points is the common range, and some ranges need
their own (u-he exposes it per control because one cutoff knob felt too
fast).
Fine. Shift dominates the audio world; Ctrl is FL Studio’s and JUCE’s. darktable’s photo convention is the reverse pair (Ctrl finer, Shift coarser), and egui-pop’s default profile follows it for sliders. What matters most is that the modifier means the same thing for drag, wheel and arrows on one control, and that pressing it mid-drag works without a jump (Bitwig, egui-pop).
Wheel. Plug-in users expect the wheel to turn the knob under the
pointer (FabFilter, JUCE on by default). In a scrolling panel that
steals the scroll: the web’s number inputs are the long-running
example, with users changing values by accident while scrolling and
browsers backing the behaviour out. Hover-to-adjust is safe in a fixed
layout (a plug-in window, a HUD over an image) and unsafe in a
scrolling form. JUCE’s step is a fraction of the range per wheel unit,
never less than one interval; webaudio-controls steps by step, and so
does egui-pop. A touchpad sends a stream of small deltas: stepping once
per frame regardless of size makes a fast swipe and a slow one equal.
Reset and typing. Double click to reset is the most common binding (Live, Bitwig, darktable, JUCE); Ctrl/Cmd-click (Reason, Kontakt, FabFilter, webaudio-controls) and Alt/Option-click (Logic, FL Studio) are the alternatives. Typing is reached by double click (FabFilter), Ctrl/Cmd-click (Bitwig), right-click (FL Studio, darktable) or a focused control and digits (Live).
Cursor. JUCE hides the pointer and lets it move without bound in its velocity mode, VCV Rack offers a “locked cursor” mode, and the browser’s Pointer Lock API exists for the same reason: a long vertical drag otherwise stops at the screen’s edge, and a knob near the top of the screen has little room above it.
Endless knobs. A value that wraps (an angle, a hue) or has no bounds
has no arc ends to show; it is driven by relative motion, and the
hardware analogue (an encoder, the Surface Dial’s rotation delta) sends
increments, not positions. JUCE’s stopAtEnd(false) and Qt’s
wrapping make a dial wrap.
Touch and pen. Touch prefers a single axis that does not fight the panel’s scroll: MultitrackStudio’s touch mode notes that a vertical knob stops vertical scrolling of the mixer, and offers horizontal or rotating instead. A pen behaves as a mouse but cannot be hidden and warped back on every platform.
Keyboard and screen readers. The WAI-ARIA slider pattern applies to a knob as is: role slider, value, minimum, maximum, value text; arrows step, Page Up/Down take a larger step, Home/End go to the ends. egui-pop already does this.
Recommendation
The owner’s view, that a knob is driven by the wheel or by a vertical or a horizontal drag at the application’s choice, is what the evidence supports, with two additions: offer both axes at once as an option, and keep circular as an option rather than as a zone of the knob.
/// How a drag turns a knob.
pub enum KnobDrag {
/// Up is more (the audio convention). The default.
Vertical,
/// Right is more.
Horizontal,
/// Right and up both add (JUCE's horizontal-vertical drag).
Both,
/// Around the centre, relative to the press: never a jump.
Circular,
}
- One drag mode per knob, never chosen by where the press lands.
Knob::drag(KnobDrag)sets it for one knob; the pointer profile gives the default for all (options.knob_drag,verticalin every built-in profile), so an application, or the person in its settings, sets it once. The hybrid centre/rim zones go. - Travel in points, not a fraction of the size. Keep
Knob::travel(points)for the soft range, 200 by default; the same travel for every axis,Bothincluded. A per-profile multiplier (a “knob speed” setting) scales it for all knobs. - One fine modifier, the same for drag, wheel and arrows: the
profile’s
gesture.value.fine. The knob drops its hard-coded Shift. Audio-minded profiles bind Shift; the default and darktable profiles keep Ctrl finer and Shift coarser. Pressed mid-drag, it takes effect from where the value is, as today. - Wheel. Keep the profile’s rule (guarded or on values), and add a
per-knob
Knob::wheel(KnobWheel::Hover)for knobs in places that do not scroll (a HUD over an image, a fixed plug-in strip), where hover is safe and expected. The step stays the knob’s step, scaled by the modifiers; a touchpad’s stream accumulates its delta into steps instead of one step per frame. - Double click resets to the default, as today; Ctrl/Cmd-click as an optional reset binding in the profiles that copy applications using it.
- Typing: keep Enter on a focused knob, and add a pointer way in: a right-click menu entry “Type a value”, or the profile’s binding.
- Long drags: hide the pointer during a drag and put it back where
the drag started at its end, where the platform allows it (egui’s
ViewportCommand::CursorGrabandCursorVisible), so the travel never meets the screen’s edge. Opt-in at first. - Endless knob: a face with no arc ends (ticks that turn with the
value), driven by the same
KnobDrag, reporting relative nudges (Changedeltas) rather than positions; a wrapping value wraps instead of clamping. - Touch:
Horizontalis the better default under a finger in a vertically scrolling panel; the profile for touch says so. - Keys and accessibility: unchanged.
Where the evidence differs from the owner’s view: toolkits that serve
everyone (Qt, Nexus UI, jQuery Knob) default to circular, and some
plug-ins keep it for its lever effect (farther is finer). The
recommendation keeps Circular as a choice, relative to the press so it
never jumps, and does not make it the default. The audio world also
expects the wheel on hover, which egui-pop’s guarded profiles refuse
over scrolling panels: the per-knob hover wheel answers it where it is
safe.
Sources
DAWs and plug-ins:
- Ableton Live keyboard shortcuts: https://www.ableton.com/en/manual/live-keyboard-shortcuts
- Bitwig Studio, user interfacing: https://www.bitwig.com/userguide/latest/user_interfacing
- Logic Pro 9, adjusting plug-in parameters: https://help.apple.com/logicpro/mac/9.1.6/en/logicpro/usermanual/chapter_10_section_5.html
- Cubase / Nuendo, Editing - Controls preferences: https://steinberg.help/cubase_pro_artist/v9/en/cubase_nuendo/topics/preferences/preferences_editing_controls_r.html
- Steinberg forum, changing a plug-in’s knob mode: https://forums.steinberg.net/t/changing-3rd-party-plugin-knob-mode/631332
- Reason, common operations: https://docs.propellerheads.se/reason9/CommonOperationsAndConcepts.02.4.html
- FL Studio basics: https://www.image-line.com/fl-studio-learning/fl-studio-online-manual/html/basics_interface.htm
- FabFilter Pro-Q 4, knobs: https://www.fabfilter.com/help/pro-q/using/knobs
- FabFilter forum, rotation mode: https://prod.fabfilter.com/forum/add-comment?id=601, https://prod.fabfilter.com/forum/add-comment?id=2627
- Kontakt Player, user interface elements: https://www.native-instruments.com/ni-tech-manuals/kontakt-player-manual/en/user-interface-elements
- KVR, u-he fine control and
normedMouseTravel: https://www.kvraudio.com/forum/viewtopic.php?p=9099521 - Arturia Jupiter-8V 2 manual (knob modes): https://www.manualsdir.com/manuals/47449/arturia-jupiter-8v-2.html?page=52
- Arturia Moog Modular V 2.6 manual: https://www.manualsdir.com/manuals/39764/arturia-moog-modular-26.html?page=141
- MultitrackStudio preferences (Knob Style): https://multitrackstudio.com/preference.php
- KVR, circular knobs in a synth: https://www.kvraudio.com/forum/viewtopic.php?p=6309446
Frameworks:
- JUCE
Slider: https://docs.juce.com/master/classSlider.html and its source,juce_Slider.cpp(250-pixel default, wheel step, rotary menu): https://github.com/juce-framework/JUCE/blob/master/modules/juce_gui_basics/widgets/juce_Slider.cpp - JUCE forum, rotary knob sensitivity: https://forum.juce.com/t/rotary-knob-movement-sensitivity/48280
- VST 3
IEditController2::setKnobMode: https://steinbergmedia.github.io/vst3_dev_portal/pages/Technical+Documentation/Change+History/3.1.0/IEditController2.html - Ardour, VST 3 knob mode: https://discourse.ardour.org/t/vst3-knob-mode/112544
- VCV Rack
Knob: https://vcvrack.com/docs-v2/Knob_8hpp_source.html; knob modes commit: https://git.kx.studio/VCVRack/Rack/commit/b93e889c75906fe2df566838bd1fab2d39553c88 - VCV community, dragging behaviour: https://community.vcvrack.com/t/idea-for-better-dragging-behaviour/2838
- Qt Quick
Dial: https://doc.qt.io/qt-6/qml-qtquick-controls-dial.html
Photo and video:
- darktable, module controls: https://docs.darktable.org/usermanual/development/en/darkroom/processing-modules/module-controls/
- Lightroom Classic, sliders and the wheel (community): https://community.adobe.com/t5/lightroom-classic-discussions/slider-scrolling-with-mouse-wheel/m-p/14244667
- DaVinci Resolve 18.6 manual, colour wheels: https://www.steakunderwater.com/VFXPedia/__man/Resolve18-6/DaVinciResolve18_Manual_files/part2715.htm
Web libraries:
- webaudio-controls: https://g200kg.github.io/webaudio-controls/docs/index.html
- Nexus UI
Dial: https://github.com/nexus-js/ui/blob/master/lib/interfaces/dial.js - precision-inputs: https://github.com/jhnsnc/precision-inputs
- jQuery Knob: https://github.com/aterrien/jQuery-Knob
Usability, accessibility and the platform:
- linux-audio-dev, knobs and widget design: https://lists.linuxaudio.org/archives/linux-audio-dev/2004-June/008370.html
- WAI-ARIA Authoring Practices, slider pattern: https://www.w3.org/WAI/ARIA/apg/patterns/slider/
- MDN, Pointer Lock API: https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API
- Firefox, the wheel changing number inputs: https://bugzilla.mozilla.org/show_bug.cgi?id=1741469
API stability
What a release promises, crate by crate and item by item. egui-pop follows Semantic Versioning with one egui-pop minor per egui minor; before 1.0 a minor may break the API, and does when the result is cleaner (the changelog says how to move). Within a minor, patch releases only add or fix. How long a deprecated item keeps working, and what counts as breaking for an extension (tokens, steps, commands, strings, the host contract), is in GOVERNANCE.md. What each component family owns and refuses, with the tier this page gives it, is in ADR 0027.
Versions of the crates
Each crate has its own version, and a release publishes only the
crates that changed: a fix in egui-pop-views is a new
egui-pop-views patch, and nothing else is published.
- The facade (
egui-pop) takes one minor per egui minor; it is the version applications and extensions name. - A sub-crate moves when its own code or its public dependencies
do: a patch for a fix or an addition, a minor for a break. A sub-crate
that does not depend on egui (
egui-pop-tokens,egui-pop-model, the platform layers) may stay on its version across egui minors. - A dependency names what the crate needs. The requirement in
[workspace.dependencies]is the lowest version every user of it works with; a crate that starts using something newer raises it in the same change. - A break travels up. A sub-crate’s new minor changes the types the crates above re-export, so each of them takes a new minor too, up to the facade.
The versions are raised mechanically, from the changeset each pull
request adds, and checked by cargo semver-checks against crates.io
(Changesets and releases).
Three tiers:
- Stable: kept within a minor; breaking it waits for the next minor and is announced in the changelog with the way to move.
- Supported: kept as far as possible within a minor; it may still change in a patch release when a defect forces it, said in the changelog.
- Experimental: may change in any release. Use it, tell us how it went, and expect to adapt.
Stable
egui-pop-tokens: the DTCG file format, the resolver, the built-in themes’ token names.egui-pop-model: typed ids and their syntax,whenclauses, commands (CommandSpec), the keymap (layers, resolution, the keymap document), menus, the value store (descriptors,Set, gestures, undo), versioned documents and their migrations.egui-pop-core: the theme (ThemeSpec,Tokens), focus scopes and the focus chain, the key dispatcher, overlays, persistence, value binding (the three modes).egui-pop-api:Plugin,Ctx,AppBuilder,App,AppHandle, zones and blocks, hooks, services,DefaultPluginsandMinimalPlugins; steps (steps, ADR 0011):Ctx::step,before,replace,after,AppHandle::step, and the names of the steps egui-pop declares.egui-pop: the facade’s paths and itsprelude.
Supported
- The components: the command palette, dialogs, toasts, the settings window and shortcuts editor, the window’s place, menus, the slider and the parameter widget, icons. Their behaviour and commands are kept; their drawing follows the theme and may be refined.
- The test kit (
egui-pop-test): harnesses and checks, the helpers at several scales, the shared GPU device, thecriticalattribute (fromegui-pop-test-macros). - Translations (
egui-pop-i18n): catalogues and their fallback chains, the rule that a plugin’s catalogue carries its id, the language setting, locale formatting, thei18n.resolvestep, the key extractor and checks. - The window’s own frame (
egui_pop_core::frame,egui_pop_api::frame) and its published hit regions (HitRegions,HitTable): the shape of the regions is what a platform layer reads. - Scale (
egui_pop_core::scale) and the interface zoom (egui_pop_api::zoom). - The keymap at run time:
AppHandle::declare,undeclare,load_keymap,export_keymap,KeymapDiff. - The debug bridge: collector names and snapshot shapes (agents read them).
- Placement of a floating element next to its anchor
(
egui_pop_core::placement): the geometry every popover, menu and tooltip uses since 0.1. - Header bands (
egui_pop_core::band), the handle movable dialogs and palettes are dragged by: their behaviour is kept, their drawing follows the kit. - Fault boundaries around panels (
egui_pop_core::fault, ADR 0003): a panel that panics is replaced by its fallback, the rest of the window goes on. - Accessibility helpers (
egui_pop_core::a11y): names for custom widgets and the announcer. - The mount contract (
egui_pop_model::mount, ADR 0013): what a component needs and a host offers, themountsdeclarations of each crate and their check; the host behind it stays experimental. - Placeholders (
egui_pop_core::placeholder: skeletons and empty states), released since 0.8: their states and names are kept, their drawing follows the kit. - F6 regions (
egui_pop_core::regions,egui_pop_core::focus::region), released since 0.8: the order and where a hop lands are kept; the commands binding F6 follow the workbench’s tier. - The icon set (
egui_pop_core::icon_set), with the icons: the names, theirowner:prefix and the refusals are kept, as declarations and kits store them. - The scroll-bar setting (
egui_pop_api::scroll_bars): theappearance.scroll_barskey and its values (auto,always,hover), which users’ settings files store. - Busy state on command-bound controls (
egui_pop_api::busy,CommandButton): greyed, a delayed spinner, the width and name kept; the host’s later replies behind it stay experimental. - The configuration folder (
egui_pop_api::dirs): where users’ settings are kept, per platform.
Experimental
- The host contract (
egui_pop_api::host): the split between declaring and running commands is decided; the trait’s methods may still move while the first application with its own kernel adopts it. - The focus mode and its system readers.
- The slider’s gestures as data (
slider::Gestures): profiles of input are not designed yet. - The workbench (
egui_pop_api::workbench): areas over egui_stack, placement rules, auxiliary windows; arrangements (egui_pop_api::arrangements); strips and indicators (egui_pop_api::strips); devtools (egui_pop_api::devtools). Their steps are kept; their API may move while the first applications adopt them. - The shell’s hooks for applications:
AppBuilder::wrap,main_edge_to_edge,frameless,layout,on_exit,run_native_with, theTOP_BAR_ENDzone. - Visual kits (
egui_pop_core::kit, kit folders,AppBuilder::kit): a kit’s boxes per state and tone, its handlers and its package format may still move; the tokens a kit reads follow the tokens’ tier. - The other components: the context stack, undo histories and the history panel, the clipboard, links, choosing files, jobs and progress, toolbars, the status bar, collapsible sections, micro-indicators, inputs and field states, tips, About, the theme editor. Their steps and commands are kept; their API may move while the first applications adopt them.
- The image viewport (
egui-pop-viewport): its view model, mapping, signals and hooks may still move while the first application adopts it; so may the image tools on it (the histogram, curves, colour wheels, the zoom control and navigator, their steps inegui-pop-imaging), the node graph (egui_pop::viewport::graph) and its wire router (ortho-router). - The slot layout engine (
egui-pop-fit,egui_pop::fit): it joined the workspace from the separateegui_fitwith its API unchanged; it may move while egui-pop’s slot regions are built over it. - The hook kernel (
egui-pop-hooks): new; its API may move while the first applications move their extension points onto it. - The data views (
egui-pop-views): the tree, the list, the data table, the in-app viewer and the photo library. - The text and code editors and the terminal (
egui-pop-editors). - The platform services (
egui-pop-platform): their steps are kept; their backends, services and the system scope’s registration state (egui_pop_api::system_keys) may move while the first applications ship them. - Compact controls for dense rows (
egui_pop_core::compact,Slider::scrub): new, not yet released. - Values worked out late (
egui_pop_core::late, new, not yet released) and slow loads where the latest asked wins (egui_pop_core::latest): no application has adopted them yet. - Layer ranks (
egui_pop_core::layers, ADR 0026): the order between kinds of foreground layers may still gain ranks. - Pointer gestures and the canvas (
egui_pop_model::pointer,egui_pop_core::pointer,egui_pop_core::canvas,egui_pop_api::pointer): profiles of input are not designed yet, as for the slider’s gestures. - Application windows (
egui_pop_api::windows) and the native runner (egui_pop_api::runner, thecreate-nativefeature, not yet released): the run loop they share may still move. - The read kernel (
egui_pop_api::reads) and waiting on the application (egui_pop_api::wait): their states are kept, their API may move while the first applications adopt them. - The main window’s paint guard (
egui_pop_api::paint_guard): new, not yet released. - Admin forms (
egui_pop_model::admin,egui_pop_api::admin). - Tooltips (
egui_pop_core::tooltip) and hover cards (egui_pop_core::hover_card): their timing and contents are still being refined. - The knob (
egui_pop_core::knob), changed since 0.11 (both axes); rating stars (egui_pop_core::rating), with the photo library; the number field (egui_pop_core::number), new in 0.11. - Thumbnails and their grid (
egui_pop_core::thumbnail, re-exported byegui_pop_viewport::thumbnail), with the photo library. - Anything marked “experimental” in its documentation (see below).
How experimental is marked
In the code, not only on this page. An experimental crate, module or item carries a warning block in its documentation, which rustdoc draws at the top of its page or beside the item:
//! <div class="warning">Experimental: may change in any release
//! (docs/stability.md).</div>
The block in a crate’s lib.rs covers the whole crate; in a public
module’s file, the module and every file under it; on an item (a type,
a function, a method, a field, a variant), that item, and a type’s
methods with it. cargo xtask experimental --list prints what is
marked.
cargo xtask experimental --check, run by pr-lint, keeps the
boundary:
- a module of a family whose tier is wholly Experimental in ADR 0027 carries the block, and a module of a family with no experimental part does not;
- no public item outside the tier names an experimental type in its
signature (arguments, return type, bounds, public fields, variants, a
trait’s items). A stable type’s method that takes a workbench or host
type is itself marked:
AppHandle::arrange,App::run(it answers ahost::Reply), the value store’s history methods. The few exposures kept on purpose are listed with their reason inxtask/experimental.allow(the kit’s tones and box states, which the stableuimodule and the header bands name).
The check reads the source with syn and resolves names through each
file’s use lines and the crate roots’ re-exports, not through the
compiler: a type reached by a glob import escapes it.
Why a marker and not an unstable Cargo feature (decided 2026-11-15):
the experimental items are public in every release so far, and
applications use them (Helios, the gallery, the templates use the
workbench, the host, the views). Gating them behind a feature is a
break for every one of those users; a feature on by default would not
break, but it would mark nothing either, as long as it stays on, and
it would double the builds to check (with and without it). The marker
breaks no one, shows in the API documentation where users read it, and
the check gives it teeth. If a 1.0 needs a hard boundary, an opt-in
feature can follow, announced a minor ahead, with the marker’s list as
its content.
Not covered
- Pixel output: snapshots are refreshed when the drawing improves.
- The gallery and the application template: examples, not APIs.
- The operating system layers (
egui-pop-win32,egui-pop-wayland,egui-pop-winit): they serve the window frame and the viewport, which carry the promise. - Undocumented items and the
pub(crate)internals.
Outside review, checked against 0.11 (November 2026)
An outside review of egui-pop, written against 0.3.0, rated the architecture well (a model independent of egui, commands as one contract for menus, keys, the palette and agents, DTCG tokens, hooks that observe, veto, replace and extend, an application agents can drive, the discipline of upstream workarounds) and named five concerns: scope, layering for adoption, the API surface, the agent bridge’s security, and the checks to run before adopting it.
This page checks each concern against egui-pop 0.11 as it stands, with the evidence, and names the follow-up for what is still open. Status: done (decided and tested), partly (decided or built, with a gap named), open (not addressed yet).
1. Scope
The review: windows, docking, focus, undo, clipboard, the context stack, selection, editors, the terminal, the viewer, the node graph and jobs are a lot to maintain, and their interactions are where bugs live.
| Question | Status | Evidence | Follow-up |
|---|---|---|---|
| Scope and its maintenance cost | partly | Each family is its own crate in a strict layering, checked by a test (ADR 0001, crates/egui-pop/tests/layering.rs); the interactions are decided in ADRs (context stack 0012, mount contract 0013, undo 0014, clipboard 0015, application windows 0025); most families are marked experimental (stability). Nothing says which components egui-pop commits to keep, or when one would leave the repository. | A scope and support policy per component family (an ADR). |
| Undo: owned by an editor or the global store? | done | ADR 0014: a History owner behind Host::history(), scopes picked by focus, innermost first (a text field’s own undo, then a component’s local scope, then the owner’s active scopes). Tests: ctrl_z_goes_to_the_focused_local_scope_else_the_application, a_text_field_keeps_its_own_undo_inside_a_local_scope (crates/egui-pop-api/tests/it/history.rs), the_settings_keep_their_own_undo_apart_from_the_host_s (tests/it/undo.rs). | None. |
| Focus when a panel is detached | done | Workbench, the focused panel: egui keeps a focus per window; a widget taking the focus, a press, or the window getting the system focus back moves focusedPanel; <panel>.focus raises the panel’s window. The per-window focus workaround is in upstream.md (focus::focused_in_window). Tests: crates/egui-pop-core/tests/focus_windows.rs, crates/egui-pop-api/tests/it/auxiliary.rs. | Real windows: see 5.6. |
| A shortcut claimed by several plugins | done | ADR 0007: the winner is the greatest (depth, layer, specificity, declaration order), every resolution can be traced; Keymap::conflicts and conflicts_by_scope (crates/egui-pop-model/src/keymap.rs) list the pairs, AppHandle::key_conflicts publishes them and the shortcuts editor shows them. | None. |
| A plugin removed while a command still refers to it | partly | ADR 0004: everything a plugin registers is removed with it (remove_owner on every registry); a menu item naming an unknown command is greyed and reported (unknown-command); running an undeclared command fails loudly (ADR 0003). Tests: everything_a_plugin_registers_goes_away_with_it, disconnecting_a_plugin_disconnects_those_requiring_it_first (crates/egui-pop-api/tests/it/api.rs). Not decided: what happens to work in flight when a plugin goes (commands queued with run_as, an open dialog bound to its command, its steps in a history, its jobs, user key bindings naming its commands). | An ADR on in-flight work of a removed plugin, with tests. |
2. Layering for adoption
The review: three tiers (foundation: model, commands, events, themes,
focus; application framework: plugins, windows, docking, persistence;
kits: components, editors, views), and components usable without
adopting App.
| Question | Status | Evidence | Follow-up |
|---|---|---|---|
| Clear tiers | done | ADR 0001 stacks the crates L0 to L6: tokens and the hook kernel without egui (L0), the model without egui (L1), core with theme, focus, keys and persistence (L2), the application API (L3), components and plugins (L4), the facade (L5). The layering test refuses back-edges. | None. |
Components without App | partly | Using parts without App lists every part usable alone with its entry point; its examples are compiled and run (cargo test -p consumer-smoke --doc). Gaps: egui-pop-views and egui-pop-editors depend on egui-pop-api even when used without App; the facade always pulls egui-pop-api (only the component crates are optional features); no CI job builds a crate with --no-default-features or checks that taking only tokens or core stays light. | Move the standalone parts of views and editors off egui-pop-api (or behind a feature), and a CI check of the light dependency sets. |
3. API surface
| Question | Status | Evidence | Follow-up |
|---|---|---|---|
| Stability tiers exist | done | API stability: stable, supported, experimental, item by item; the README’s table repeats them; releases are checked by cargo semver-checks (releasing). | None. |
| Applications kept off experimental parts | open | The tiers are documentation only: nothing in the code marks an experimental item (no feature gate, no attribute, no rustdoc badge), and no check fails when a stable item exposes an experimental type. The workbench, the views, the editors and the platform services are all reachable from the default facade. | Mark experimental items in code (an opt-in feature or a rustdoc marker) and a check that stable items do not expose them. |
4. Agent bridge security
The review: “The agent is an actor, not an implicit admin”: permissions per command, parameter validation, the origin of each action, an operation journal, confirmation for destructive actions, undo.
| Question | Status | Evidence | Follow-up |
|---|---|---|---|
| Permissions per command | partly | CommandSpec::agent and .no_agent(), collector actions’ ActionSpec::agent (ADR 0018); the flag holds for every run, chained ones included (ADR 0021); bridge modes On, ReadOnly, Off with CommandSpec::read_only (ADR 0024); value writers per path (ADR 0016, 0019). Tests: crates/egui-pop-api/tests/it/bridge_modes.rs, agent_actions.rs, origins.rs. Gap: one yes or no for all agents; no grants per agent or per session. | Agent bridge security design. |
| Origin of each action | partly | Origin (user, agent, script, remote) travels with every command, write, dialog answer, file choice and history step (ADRs 0019, 0020, 0021); the history panel names it. Gap: every client of the socket is the same Origin::Agent("agent-socket") (agent socket), so two agents cannot be told apart. | Agent bridge security design. |
| Parameter validation | open | CommandSpec::args is a description (“free JSON, a schema or an example”, crates/egui-pop-model/src/commands.rs); nothing checks a call’s arguments against it before the handler runs. | Agent bridge security design. |
| Operation journal | done | Every call is a debug.call step and is journaled; refusals are debug.call.refused, command.refused, dialog.answer.refused; reads are journaled only when they fail or are vetoed (ADRs 0018, 0024). | None. |
| Confirmation for destructive actions | partly | Possible by hand: a dialog answered by the user only, or a veto on dialog.answer unless the origin is the user, as the links plugin does (agents, “Keeping an action off the agent surface”). Gap: no destructive flag on CommandSpec, so nothing asks the user before an agent’s destructive command runs unless each application wires it. | Agent bridge security design. |
| Undo | done | Agent steps go into the same histories, named by origin; undo and redo are held to the walker’s writer (ADR 0023); history.undo with if_rev and dry_run for agents (the_store_owner_answers_dry_runs_and_stale_requests, tests/it/history.rs). | None. |
| Transport | partly | Unix socket mode 0600 in the runtime directory. On Windows the named pipe keeps the system’s default access and is compile-checked only (agent socket, “Known gaps”). | Agent bridge security design. |
5. Checks before adoption
| Check | Status | Evidence | Follow-up |
|---|---|---|---|
5.1 Cost of DefaultPlugins and default features; compile time; optional dependencies leaking | open | MinimalPlugins exists beside DefaultPlugins (plugins); every optional dependency sits behind a facade feature (crates/egui-pop/Cargo.toml). Nothing measures the build time, dependency count, binary size or start-up time per feature set, and no CI job builds with --no-default-features. | A box job measuring them per feature set, with a budget. |
| 5.2 Virtualised views with large collections | partly | 100 000 nodes in the tree (a_hundred_thousand_nodes_build_a_screenful, crates/egui-pop-views/tests/views.rs), images in the library (a_hundred_thousand_images_build_a_screenful, tests/library.rs) and lines in the log (a_hundred_thousand_lines_build_a_screenful, tests/text_log.rs), each under 100 ms a pass. Not covered: the data table at that size, rows updated asynchronously while it scrolls, and the selection changing under load. | A box job: a 100 000-row data table with async updates and selection changes. |
| 5.3 Undo transactions, concurrent edits, changes from outside the UI | partly | Groups and merges (ADR 0014); stale requests refused by revision (the_store_owner_answers_dry_runs_and_stale_requests); histories kept apart (a_store_write_entered_in_a_history_is_undone_there_alone). Not tested: an undo that would cross a change made outside the interface (another process, a write that is not a step), which the analysis says is refused (ADR 0014 analysis, section 7). | Tests for undo across outside changes. |
| 5.4 Persistence migrations across versions | partly | Versioned documents and migrations (ADR 0008); unit tests of the mechanism (documents_migrate_and_refuse_what_they_cannot_read in egui-pop-model/src/doc.rs, documents_are_written_atomically_with_a_backup_and_migrated_on_load in egui-pop-core/tests/core.rs, an_old_keymap_document_with_the_placeholder_key_migrates, an_older_item_is_migrated_before_it_is_pasted). Not covered: documents written by earlier released versions (layout, keymap, settings, arrangements) loaded by today’s code. | Golden fixtures from each release, loaded by a test. |
| 5.5 Accessibility with a real screen reader | open | The test kit checks that every interactive node has a name and dumps the AccessKit tree (egui-pop-test); no pass with Orca, NVDA or VoiceOver is recorded. | A screen reader pass: Orca through AT-SPI on the box, NVDA on Windows. |
| 5.6 Secondary windows, focus, resize and scaling on Linux and Windows | partly | tools/window-smoke.py opens the gallery in a real window on Windows and macOS, detaches a panel into a second window and resizes (testing, “Other platforms”); in-process tests cover detached panels (crates/egui-pop-api/tests/it/auxiliary.rs, app_windows.rs). Not covered in real windows: focus moving between windows, keys reaching the detached window, scale factors (mixed DPI), and the same run on Linux. | Extend the window smoke run (focus, keys, scale) and run it on Linux in the box. |
Follow-ups
Each open or partly item above with a follow-up is tracked as an issue in the project’s tracker; this page is updated when they close.
Changesets and releases
How a change reaches the changelog and a version number, and how a release is made. Versions and changelog entries are mechanical: each pull request says what it changes in a changeset, and knope turns the pending changesets into versions at release time. What a version promises is in API stability.
Changesets
A change users of the crates notice comes with a changeset: a Markdown
file in .changeset/, named after the change (toast-corner.md). Its
front matter names each crate the change touches and the bump it takes;
the text below is the changelog entry, written for users.
---
egui-pop-core: major
egui-pop-api: major
egui-pop: major
---
The debug bridge has a mode: `AppBuilder::debug_bridge` takes a
`BridgeMode` (`On`, the default as before, `ReadOnly` or `Off`). To move:
replace `debug_bridge(true)` with `debug_bridge(BridgeMode::On)`.
knope document-change asks for the crates, the bumps and a summary
and writes the file; writing it by hand is as good. The names are the
crates’ package names; the gallery, the template and the tools are not
published and take no changeset.
Which bump
| Bump | For | Before 1.0 | From 1.0 |
|---|---|---|---|
patch | a fix | 0.2.3 to 0.2.4 | 1.2.3 to 1.2.4 |
minor | an addition, or a change that breaks nothing | 0.2.3 to 0.2.4 | 1.2.3 to 1.3.0 |
major | a breaking change | 0.2.3 to 0.3.0 | 1.2.3 to 2.0.0 |
Before 1.0, a breaking change takes a new minor version (0.2 to
0.3), and additions and fixes share the patch number. A changeset still
says major for a break: knope applies it to the middle number while
the version starts with 0, and the changelog lists it under “Breaking
changes”. Declare what the change is, not the number you expect.
What breaks is the Rust API (cargo semver-checks tells), and also the
extension contract: tokens, steps, commands, strings and ids, the debug
bridge (GOVERNANCE.md).
A break travels up. The crates above a broken one re-export its
types, so each published crate depending on a crate that takes a
major takes a major too, up to the facade. The check below names the
missing ones.
One changeset per change; a pull request doing one thing has one. A changeset may name several crates with different bumps; its entry goes under its highest bump and names every crate it lists.
When none is needed
Tests, examples, benchmarks, the documentation, the gallery, CI and the
tools change no published crate. A change inside a crate that users do
not notice (a refactoring, a comment, an internal rename) needs none
either: label the pull request internal.
The check
CI’s Changesets job (cargo xtask changeset-check) fails when:
- a changeset names a crate that is not published, or a bump other
than
patch,minorormajor; - a crate takes a
majorand a published crate depending on it does not; - a pull request changes the shipped files of a published crate (its
src/, its manifest, its README; nottests/,examples/orbenches/) and adds no changeset, unless it is labelledinternal. Adding the label runs CI again.
A release pull request, which deletes changesets and adds none, passes. Locally:
cargo xtask changeset-check --base origin/main
Commit subjects
Commit subjects, and pull request titles (a squash merge makes the title the commit’s subject), follow Conventional Commits:
<type>(<scope>)!: <what changed>
- type:
feat(an addition),fix,perf,refactor,docs,test,build,ci,chore(chore(release)for a release),styleorrevert; - scope, optional: the crate without its
egui-pop-prefix (core,api,views), or the area (gallery,xtask,ci,deps); !marks a breaking change, asmajordoes in its changeset.
feat(views): the list sorts by any column
fix(core)!: a focus scope restores the focus it took
docs: how a release is made
knope reads the changesets only, not the commits
(ignore_conventional_commits in knope.toml): a change described by
both would be counted twice. The subject format keeps the history
readable and says at a glance what a commit is. CI’s Pull request
title workflow checks the title, and runs again when it is edited.
Releasing
Publishing is the owner’s call, and stays a manual step.
-
Prepare, on a branch from an up-to-date
main:knope release --dry-run # what would change knope releaseknope raises each crate’s version from the pending changesets (its manifest, its requirement in
[workspace.dependencies],Cargo.lock) and deletes them; thencargo xtask release-noteswrites the release intoCHANGELOG.md, sets the egui-pop version both templates’cargo-generate.tomlpropose to the facade’sMAJOR.MINOR(cargo xtask templates; pr-lint’scargo xtask templates --checkfails a release that leaves it behind), and commits everything, signed off, aschore(release): <the facade's version>(or the crates and their versions when the facade does not move). The section lists the crates it publishes and groups the entries under “Breaking changes”, “Features” and “Fixes”, each entry naming its crates.Then write the release’s fixtures, on the same branch:
cargo xtask fixtures <the facade's version> # e.g. 0.22.0 git add fixtures/ && git commit -s -m "test: fixtures of <version>"The gallery runs headless through a fixed scenario (a setting changed, a key rebound, a panel moved, an arrangement saved, a place’s value kept, a theme saved from the editor) and
fixtures/<version>/keeps every document it wrote, the theme file andexpected.json, the values the scenario set. The gallery’srelease_fixturestest loads every folder with today’s code: no error, every value back, each migration reported (ADR 0008). A released folder is never rewritten; a format change that cannot read one is a break.Then run the real windows check on Linux, which CI does not run: the bench box’s
egui-pop-window-smokejob (Helios’stools/bench/Benchfile,egui_pop=<the release branch>) runs the window smoke run (tools/window-smoke.py, testing, “Other platforms”) in a headless labwc, under Wayland and under X11: a detached window focused, keys typed into it, each window’s scale. Everycheckline of both sessions must sayPASS; Windows and macOS get the same checks from the platforms workflow onnext.Next to it, the screen reader pass (testing, “Screen readers”): the bench box’s
egui-pop-screen-readerjob (egui_pop=<the release branch>) walks five gallery pages with Orca and compares what it says withtools/wbox/screen_reader.json; every step must sayPASS. Then walk the same pages with NVDA on Windows, by hand, with that section’s checklist. -
Review: push the branch, open a pull request titled like the commit, read the changelog and the versions. Merge it: on
next, CI’s semver job checks the new versions against crates.io (the release raises the crates’ manifests and deletes the changesets, both of which select it). -
Publish, from the merged commit on
main, by hand:cargo xtask publish --dry-run # the plan, and crates changed but not raised cargo xtask publishIt publishes the crates whose version is not on crates.io yet, in the order of their dependencies. First it runs
cargo semver-checks check-releaseon those that have an earlier release (it needscargo install cargo-semver-checks --locked, and GStreamer’s and WebKitGTK’s development packages for the video and web view features); a failure publishes nothing.--skip-semverleaves the checks out, for a run resumed after they passed. -
Tag a minor of the facade,
vX.Y.0, on the commit it was published from; patches and sub-crates are not tagged:cargo xtask tag # refuses until crates.io has the version git push origin v0.3.0
knope is a development tool, not a dependency:
cargo install knope --locked (CI pins its version, see
.github/workflows/semver.yml).
Semver checks
CI’s Semver checks job blocks main’s promotion. It runs when a
published crate’s build input or a changeset changed since main, every
night on next, and by hand (.github/workflows/semver.yml;
CI jobs); cargo xtask publish runs the checks
again before uploading. It first runs
knope pending-versions, which writes in its checkout the versions the
pending changesets lead to, then
cargo semver-checks check-release --workspace, which compares every
published crate with its latest release on crates.io (the baseline is
what users have). A breaking change passes when its changeset makes
the crate’s version a new minor (before 1.0) and fails otherwise,
naming what broke.
The baseline is built from crates.io in a fresh resolution, which takes
the newest version of each dependency unless told otherwise; one that
needs a newer Rust than the pinned toolchain fails the build (kstring
2.0.5, through gstreamer, needs Rust 1.96 for egui-pop 0.18.0’s
publish). .cargo/config.toml sets
resolver.incompatible-rust-versions = "fallback", so the checks, run
from the checkout, pick versions the toolchain builds. A run from
elsewhere sets CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=fallback;
never skip the checks for it.
The switch to changesets
Changesets started after 0.2.0. The changes merged before them are in
CHANGELOG.md’s Unreleased section, written by hand; one changeset
without text, .changeset/since-0.2.0.md, declares their bumps. The
0.3.0 release moves that section under its heading: release-notes
puts any Unreleased section it finds into the release it writes.
From then on, entries are written as changesets only.
How quality is held
egui-pop is developed with AI assistance: most of its code, tests and
documentation are written by AI coding agents, working to the plan and
the design decisions of the maintainer. That is why it moves fast. This
page says what every change must pass before it reaches main, and,
as plainly, what those checks do not cover.
Who writes, who decides
- The maintainer decides what is built and how: the credo, the architecture decisions (written before the code they shape), what each release promises (API stability) and governance.
- Agents work under written rules: AGENTS.md and CONTRIBUTING.md. One purpose per commit, every commit building and passing its tests, signed off, with a Conventional Commits subject and a changeset for what users notice; a component comes with interaction tests, a gallery page and snapshots; an existing crate is surveyed before writing our own.
- Changes reach
mainthrough pull requests, and a pull request merges only when the required check passes. There is no second human reviewer today: a pull request is merged by the maintainer, or by an agent acting for them, once its checks are green. The checks below are what stands between a change andmain, and they are meant to be strict.
The gate on every commit
Every commit passes, locally, before it is pushed:
cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
What CI runs on a pull request
The workflow is .github/workflows/ci.yml.
Every build there treats warnings as errors (RUSTFLAGS and
RUSTDOCFLAGS set to -D warnings), as do the Windows and macOS builds
(platforms.yml) and the web site’s (pages.yml); a lint kept off at
one place says why (#[allow(lint, reason = "...")], which the
workspace’s allow_attributes_without_reason asks for), and every job but the semver
checks uses the locked dependencies and the minimum supported Rust
version. One check, CI, is required by the
branch protection of main: it fails when any job below failed. A
separate workflow, Pull request title, checks that the title follows
Conventional Commits; it runs again when the title is edited.
| Job | What it checks | Blocks a merge |
|---|---|---|
| Format | cargo fmt --all --check | yes |
| Clippy | cargo clippy --workspace --all-targets -- -D warnings, then cargo doc of the workspace | yes |
| Guides’ documentation | the README and the guides compiled as documentation (consumer-smoke), when only they changed | yes |
| Docs site | the mdBook builds, docs/SUMMARY.md lists every page of the index, no link is broken | yes |
| Tests (lavapipe 1/3 to 3/3) | unit and integration tests with cargo-nextest, split in three shards run side by side, and doctests (below) | yes |
| Viewer’s video | the one build with GStreamer: clippy, docs, and the tests of the video widget and the viewer’s video page | yes |
| Viewer’s web view | the one build with WebKitGTK: clippy, docs and the YouTube page’s tests | yes |
| Licences and advisories | cargo deny check: every dependency’s licence accepted by deny.toml, security advisories, banned crates, sources | yes |
| Gallery for the web | the gallery built for wasm32-unknown-unknown with Trunk, then started in headless Chrome: it fails on a panic or without the start line | yes |
| Packaging | cargo publish --workspace --dry-run: every published crate packages with its metadata | yes |
| Changesets | cargo xtask changeset-check: a pull request changing a published crate adds a changeset (or is labelled internal); changesets name published crates and known bumps; a break travels up to the dependents | yes |
| Semver checks | cargo semver-checks on every published crate against its latest release on crates.io, with the versions the pending changesets lead to: a break needs a major changeset (Changesets and releases); only when a published crate or a changeset changed, and nightly on next (semver.yml) | yes |
The tests job runs, among others:
- UI tests with egui_kittest, finding widgets by role and name, never by position, keyboard included; keyboard walks that press only keys and check where the focus goes (Testing).
- Snapshots: the gallery’s pages rendered with wgpu on Mesa’s software Vulkan driver, per theme and density, compared with the images in the repository.
- Accessibility: every interactive node has a name; contrast pairs pass in every built-in theme and density.
- The layering test: no crate depends on a crate of a higher layer (ADR 0001).
- Translations: the English catalogue is generated from the code, every locale translates every key and nothing else.
- Saved data: old documents and layouts still load, migrated.
- Doctests of the crates, of the README and of the guides; the application template matches the minimal example; the extension template builds as a workspace member; README links are absolute, so they work on crates.io.
unsafe is forbidden in the whole workspace by its lints, except in
the three crates that call the operating system
(Unsafe code).
Selection, and what main runs
A pull request runs the jobs and the tests its change can affect,
chosen by cargo xtask affected, plus the critical tests that guard
rules any change can break (Testing). Selection
can miss a dependency it cannot see, so every push to main runs every
job and every test, and a pull request labelled ci:full does too. A
miss is then caught on main, after the merge, not before.
After a merge, the Pages workflow builds the docs site, the API documentation with every feature, and the web gallery with its smoke test again, then publishes them.
What a build costs
What egui-pop costs an application is measured on a bench box, not in
CI (CI is for compatibility): the egui-pop-cost job runs
tools/cost/cost.py on the cost_probe
example (one plugin with one panel, which builds with any set of
features) for each feature set of the egui-pop crate: without the
default features, with them, and each default or heavy optional
feature alone. It counts the dependencies (cargo tree -e normal),
times release builds with the compile cache off (clean for the first
two sets, then what each set adds on top of the bare build, then an
incremental build after the application’s code changed), weighs the
stripped binary, and times the headless start to the first frame drawn
and tessellated, over MinimalPlugins and over DefaultPlugins. The
figures are judged against
tools/cost/budget.json: one over its
budget (each figure’s tolerance is in the file) is reported, never a
failure. To move the budget, commit the budget.json a run returns.
The first run (2026-11-18, Rust 1.95, five threads of a box running other jobs at the same time):
| Set | Dependencies | Build | Binary |
|---|---|---|---|
--no-default-features | 115 | 286 s clean | 20.0 MiB |
| default features | 289 | 371 s clean | 35.6 MiB |
eframe alone | 283 | +339 s | 33.8 MiB |
phosphor alone | 116 | +101 s | 20.8 MiB |
bundled-fonts alone | 115 | +106 s | 20.6 MiB |
theme-zip alone | 124 | +177 s | 20.0 MiB |
image-previews alone | 129 | +116 s | 20.5 MiB |
What it says:
- eframe is the cost of the defaults: 168 of the 174 dependencies
the defaults add (winit, wgpu, glow and the windowing stack), most of
their build time and 13.8 MiB of the 15.6 MiB they add to the binary.
create-native, also a default, only changes how eframe starts. A host running its own event loop leaveseframeout. - The other default features are cheap: the Phosphor icon font and
the bundled fonts add their font files (0.8 and 0.6 MiB) and one or
no dependency;
theme-zipadds the zip crate (9 dependencies) and no size;image-previewsaddsimage’s PNG and JPEG decoders, which eframe brings anyway. The+times include about 100 s of egui-pop’s own crates rebuilt with another feature set: a feature’s own share is what is left. - A feature an application does not call costs build time, not
binary size: the linker drops what the probe never reaches, so the
heavy optional features (
viewport,views-markdown,platform,graph-png…) leave the binary at 20 MiB. They cost dependencies (platform93 more,graph-png77) and build time (platform+340 s);tools/cost/budget.jsonlists each. DefaultPluginscosts nothing to build (its plugins are inegui-pop-apiwhatever the features) and nothing measurable at start: with the default features the first frame comes 40 ms after the process starts over either plugin group. Almost all of it is the application’s build (App::build); drawing and tessellating the frame takes 2 to 3 ms. Start-up times moved between 40 and 110 ms from one set to the next with the box’s load, so differences under about 30 ms are noise.- An incremental build, after the application’s code changed, takes 4 s without eframe and 8 s with it, mostly the link.
What is not covered
- Linux only. CI runs on Ubuntu. Windows and macOS are neither
built nor tested there; the Windows layer of the window frame
(
egui-pop-win32) compiles only its stubs in CI. - No real window. Rendering tests draw offscreen through wgpu on a
software renderer. A real compositor, a real GPU, the other wgpu
backends (Metal, Direct3D, OpenGL) and display scaling as a desktop
applies it are not exercised in CI. The screenshots are the gallery’s
real window in a nested compositor, but they are taken by hand
(
cargo xtask screenshots), not in CI. - Platform services (single instance, notifications, tray icon, global shortcuts, crash reports, the Wayland colour-managed subsurface) are tested through their logic, not against a running desktop session.
- Accessibility is checked on the accessibility tree egui builds; no screen reader is run.
- The web build is checked to start; its interactions are not tested in a browser.
- Snapshots catch a change in the drawing, within thresholds per
operating system (
kittest.toml); when they are regenerated, only the person or agent looking at the diff judges whether the new images are right. - API compatibility is checked on Rust signatures only:
cargo semver-checksdoes not see the extension contract’s other parts (tokens, steps, commands, strings), which the changeset’s author judges (GOVERNANCE.md). - No performance or memory gate, no fuzzing.
Upstream workarounds
The register of what egui-pop compensates for in its dependencies. Each
entry says what is compensated, where it is tracked upstream, how
egui-pop works around it (the code site carries an // upstream:
comment pointing here) and when the workaround can go.
Reviewed at every egui bump: remove what upstream fixed, update the rest.
How a limit is handled
- Work around it in egui-pop, at the narrowest place, with an
// upstream:comment at the code site. An application or an extension never has to carry the workaround itself. - Search upstream (egui’s issues and pull requests, or the dependency’s) for the same limit. If none exists, file a focused issue with a minimal reproduction, written against upstream’s code alone; a fix, when it is small and clear, goes with it as a pull request.
- Record it here: what is compensated, where it is tracked upstream (“not filed yet” says it must be), the workaround, and when it can go.
- At every egui bump, review the register: remove the workarounds upstream fixed (and their entries), update the rest.
An extension author who meets a limit egui-pop could compensate for everyone opens an issue here, or a pull request adding the entry and its workaround. Workarounds are not part of the extension contract (GOVERNANCE.md): they go when upstream fixes the limit.
egui: a link with selectable labels is announced as a label
- Compensated:
egui::Link(andHyperlink) sets its AccessKit role toLink, then draws its text through the label text selection whenselectable_labelsis on (egui’s default), whose AccessKit update (update_accesskit_for_text_widget, withRole::Label) overwrites the role: screen readers, and tests looking for a link by its role, see a plain label. On egui 0.36.2,ui.linkandui.hyperlink_toreportLabelwith selectable labels on andLinkwith them off. A link scrolled out of view keepsLink, as its text is not drawn. Links drawn by egui_commonmark in the viewer’s pages keep the limit too. - Upstream: fixed by https://github.com/emilk/egui/pull/8574, released in egui 0.37.0; nothing to file.
- Workaround:
egui_pop::api::links::Linksets the role back toLinkon the node after drawing it (crates/egui-pop-api/src/links.rs). egui’s ownHyperlinkon the built-in widgets page keeps the limit. - Remove when: now, egui-pop being on egui 0.37 (check that the text selection keeps the role the widget gave); a follow-up of the move (issue #24).
egui_kittest: no double click from queued events
- Compensated: a double click made of queued events never registers,
because each queued event advances the clock by
step_dt(0.25 s), beyond egui’s 0.3 s double-click delay. - Upstream: https://github.com/emilk/egui/issues/8697
- Workaround:
egui_pop_test::double_click(harness, label)(anddouble_click_at) put the four button events in one frame, so egui sees both clicks within its delay instead ofstep_dtapart. - Remove when: kittest ships a
double_clickhelper or a per-step time.
egui: a scroll area cannot keep the wheel at its end
- What is compensated: a
ScrollAreaat the end of its range leaves the wheel’s delta in the input, so the next scroll area out moves instead, with no option to keep it (the web’soverscroll-behavior: contain). And it clamps its offset after drawing and asks for no repaint, so a body that grew, or lost rows, shows blank room under its last row until something else repaints. - Tracked upstream: not filed yet.
- Workaround:
core::ui::contain_wheel, used by sections, the views andUiPop::scroll_area_contained: after a scroll area, the pointer over it, it clears the delta of the ways it can go from the input, asScrollAreaitself does when it takes a wheel;core::sections::scrolledasks for a repaint when the offset changed since the last pass. - When it can go: when
ScrollAreahas such an option and repaints after clamping.
egui: a scroll area reads no key
- What is compensated: a
ScrollAreareads no key, says neither which ways it may scroll nor whether it has something to scroll on them, and egui’s widgets read keys without taking them from the input (Slider’s arrows, aTextEdit’s Home and End), so nothing after them can tell a key was used. - Tracked upstream: not filed yet.
- Workaround:
core::scroll_keys, behindUiPop::scroll_area: after the content, it reads which ways there are from the bars’ widgets and writes the offset to the area’sState, for the next pass. A focused widget keeps the keys if it is a text input, senses drags or says so (focus::takes_keys). - When it can go: when
ScrollAreahas keys of its own, and a widget’s use of a key can be seen.
egui: a scroll area’s offset cannot be set from outside
- Compensated: egui 0.37 made the offset of a scroll area’s
Stateprivate, with getters (clamped_offset,unclamped_offset) and no setter.ScrollArea::scroll_offsetsets it only for whoever builds the area, andUi::scroll_with_deltaor a scroll target reach only the innermost area being drawn. egui-pop moves areas it did not build: the focus brought into view through every area around it (core::reveal), and the keys of a scroll area (core::scroll_keys). - Upstream: not filed yet (a
State::set_offset, or a public field again). - Workaround:
egui_pop_core::ui::set_scroll_offsetround-trips the state through its serde form (egui’sserdefeature, turned on by egui-pop-core) with the new offset (// upstream:); kinetic scrolling in progress stops there. - Remove when: egui’s scroll state can be given an offset.
egui: input in the pass of an AccessKit focus is lost
- Compensated: an AccessKit
Focusaction on a text field (from a screen reader, an agent, or a test) is only noted when egui reads the pass’s input (Focus::begin_pass); the focus is handed over when the field registers its interest in it, as it is allocated. ATextEditreads its events earlier, while its text is laid out, so the keys and text that arrive in the same pass as the action are dropped: the field gets the keyboard, not what was typed with it. Later passes are fine, which is why a kittest test (one queued event per step) does not see it; a platform batching the action with the keys does. - Upstream: fixed in egui 0.37.0:
Focus::begin_passfocuses the widget the action names at once, looked up among the focusable widgets of the previous pass (memory/mod.rs), before anything reads the input. No issue to file. - Workaround: the focus plugin (
egui_pop_core::focus::install, which anAppinstalls) holds back the keyboard input that follows an AccessKitFocusaction in the same pass and replays it, in order, at the start of the next pass, when the field has the focus (focus::hold_after_accesskit_focus,// upstream:). It covers every text field in the context, egui-pop’s and an application’s own. - Remove when: now, egui-pop being on egui 0.37 (check that text typed in the pass of an AccessKit focus reaches the field without the plugin); a follow-up of the move (issue #24).
egui: a plugin’s input hook runs in another window
- Compensated:
Context::begin_passcallsPlugin::input_hookbefore the pass begins: the viewport stack andMemory::viewport_idare only set after it. For an immediate viewport’s pass they are still the parent’s, and for a deferred viewport’s pass the context says the root and the memory says the last window that ran. SoMemory::focused()andsurrender_focusin a hook act on another window’s focus, and no public method reads a given window’s: onlyRawInput::viewport_idtells which window the input is for. In a real second window, Escape made the main window’s text field let go and lost the press, and a field of that window never got step 1 of the Escape order. - Upstream: not filed. egui’s main branch has the same order (2026-10-30).
- Workaround: the focus plugin notes at the end of each window’s pass what
has the focus, the hook reads that for
RawInput::viewport_id, and the focus is let go inon_begin_pass, where the memory is that window’s (focus::escape,// upstream:). A host running passes withContext::begin_passandend_passby hand has noon_end_pass, so no step 1 of the Escape order, and a terminal gets no keys. - Also compensated: the terminal’s key routing, which had the same cause.
In real windows, keys typed in a detached window went to a terminal focused
in the main window, past that window’s own text field, and a terminal in a
detached window got none of its keys. It reads the same note
(
focus::focused_in_window) and lets go on Shift+Escape inon_begin_pass(terminal::keys,// upstream:). - Remove when: egui runs the hook with the window’s memory, or offers a window’s focus by id.
egui: popups built from the context’s style, not the opening Ui’s
- Compensated: egui builds the
Uiof everyAreafrom the context’s style (Ui::newfalls back toctx.global_style();Areahas no style of its own), and every popup is anArea: a combo box’s list, a tooltip (on_hover_text,on_hover_ui), a context menu, a menu (menu_button,MenuBar), egui’sPopupandModal, windows. A style set on oneUi(a theme drawn in one part of a window, egui-pop’sScopedTheme) does not reach the popups opened inside it. The hooks that exist (Popup::style,ComboBox::popup_style,MenuConfig::style, all aStyleModifierapplied over the context’s style) only help at call sites one owns:Response::on_hover_textandResponse::context_menutake none, and a widget of another crate opening a popup cannot be reached. The same in egui 0.37.0 (ui.rs,containers/popup.rs); its experimental style providers see a popup’sUiStack, which does not lead back to theUithat opened it. - Upstream: https://github.com/emilk/egui/issues/4692 (tooltips
should inherit the parent’s style, open;
ComboBox::popup_style, https://github.com/emilk/egui/pull/7360, covers combo boxes at the call site only). A comment widening it to every popup, with a proposed API, is not posted yet (draft: upstream-drafts/egui-popups-inherit-ui-style.md). - Workaround: while a
ScopedThemedraws, egui’s context styles (dark and light) are the scoped theme’s, made from the installed style and kept per scope, and the installed ones are put back when the scope ends, even after a panic (ScopedTheme::within,// upstream:intheme.rs). egui 0.36 draws its popups while the widget that opens them is drawn, so they follow the scope. A popup egui-pop draws later, out of the scope (menus::popup_at, drawn by the shell), records the scope it was opened in and is drawn within it. Limits: egui’s light or dark mode (ctx.theme()) stays the installed one, and a change to the context’s style made while a scope draws is undone when it ends (themes are installed between frames). - Remove when: egui’s popups take the style of the
Uithey are opened from;ScopedTheme::withinthen only sets egui-pop’s tokens and kit (still needed for a popup drawn after its scope).
egui: scroll bar colours come from the widget visuals
- Compensated: egui’s
ScrollStylecarries a scroll bar’s sizes and opacities but no colour. egui 0.36 draws the thumb in the colours of the widget states (visuals.widgets.inactive,hovered,active): theirfg_strokecolour withforeground_color, else theirbg_fill, and theircorner_radius; these are the button’s colours and corners. It draws the track inextreme_bg_color, which text fields, canvases and progress bars also use. A theme cannot give the scroll bars colours of their own without changing every button and field. egui 0.37.0 is the same: itsScrollStylehas no colour either (style.rs,containers/scroll_area.rs). - Upstream: not filed yet (draft: upstream-drafts/egui-scroll-style-colours.md).
- Workaround: the kit’s
scroll-bargoes intoScrollStylewith the theme for what it can carry (width, margin, placement, visibility, no track), in every scroll area. Its colours come from aScrollBarscope:UiPop::scroll_areashows the area in aUiwhose widget states’ foreground colours and corners are the thumb’s, and whoseextreme_bg_coloris the track’s, and gives the content the style from outside the scope again (// upstream:inui.rs). Anegui::ScrollAreashown directly keeps the button’s colours, and the kit reports it in its problems. - Remove when: egui’s
ScrollStyle(or its visuals) has its own colours for the thumb in each state and for the track, and its own corner radius; the kit then writes them with the theme,Stock::ScrollBarand the problem go, andUiPop::scroll_areabecomes a plainScrollArea::show.
egui: AccessKit bounds ignore layer transforms
- Compensated: a widget in a transformed layer (egui’s
Scene) reports its rectangle to AccessKit in the layer’s coordinates, before the transform: screen readers (and kittest, which clicks at a node’s bounds) place it where it is not. - Upstream: not filed yet (draft: upstream-drafts/egui-accesskit-bounds-layer-transform.md).
- Workaround: the node graph editor sets the bounds of its nodes,
ports, chevrons, groups, stacks and sliders to their rectangles on
screen (
graph::Cx::bounds,// upstream:). - Remove when: egui applies the layer’s transform to the bounds it reports.
AccessKit: no expanded state on Linux
- Not compensated: AccessKit’s AT-SPI adapter (
accesskit_atspi_common0.21) maps no expanded or expandable state: a tree’s folder says whether it is open on Windows and macOS, never to Orca, and Right or Left on a folder is silent there. - Upstream: not filed yet.
- Workaround: none in egui-pop: the tree view sets the state
(
set_expanded) for the platforms that read it, and the screen reader pass’s walk marks those two steps silent (tools/wbox/screen_reader.py). - Remove when: the AT-SPI adapter maps the state; then the two steps say “expanded” and “collapsed”, recorded again.
egui: the focus cannot be given back as a modal closes
- Compensated: a widget drawn under the top modal layer gives up the
focus as it is drawn (
create_widget,allows_interaction), and that layer is the previous pass’s (top_modal_layer). Sorequest_focuson the widget behind a modal is undone in the pass the modal closes, and in the next when the modal was still drawn in that pass: on egui 0.36.2, the focus ends on nothing. - Upstream: not filed yet.
- Workaround: the overlay stack keeps the place and asks for the focus
once
allows_interactionsays the widget’s layer can hold it (// upstream:atgive_focus_back,crates/egui-pop-core/src/overlay.rs). - Remove when: egui takes a modal layer off in the pass it stops being drawn, or keeps a focus requested for a widget below it.
egui: a scroll target stops at the innermost scroll area
- Compensated:
Response::scroll_to_meandUi::scroll_to_rectset a target that the innermostScrollAreatakes whole, on both axes, even when it cannot move on that axis or does not overflow, so the areas around it never see it (Prepared::end). Reproduced on egui 0.36.2 with plain egui, a button in an area nested in a scrolled area:scroll_to_meleaves it out of view (egui_scroll_target_stops_at_the_innermost_area,crates/egui-pop-test/tests/focus_into_view.rs). And nothing says which areas hold a widget, or lets a central hook set a target for them:Action::ScrollIntoView, which a hook could inject, stops at the same place and always centres. - Upstream: not filed yet. The nearest is #985, from 2023, asking for a way to name the area: it saw every area scroll, the opposite of 0.36.2.
- Workaround: the focus plugin writes the offsets of the areas itself, from
the previous pass (
// upstream:incrates/egui-pop-core/src/reveal.rs): the ids inPassState::used_idsholding ascroll_area::Stateare the areas; the widgetsid.with(axis)are their bars, giving their reach; the widgets between the area’s contentUiand its bars are what it holds. These are egui’s internals read through public items: the test file above fails if a bump changes them. An area with hidden bars is not found. - Remove when: a scroll target bubbles to the outer areas as far as it needs to, or a widget’s enclosing areas can be read.
egui: a focus dropped leaves no place
- Compensated: when egui drops the focus (Escape, a widget no longer drawn) it
keeps no trace of it: Tab starts at the window’s first stop, Shift+Tab at its
last, and a widget removed has no successor. Reproduced on egui 0.36.2 with the
plugin off (
crates/egui-pop-test/tests/focus_place.rsfails). - Upstream: not filed yet.
- Workaround: the focus plugin remembers the place
(
// upstream:incrates/egui-pop-core/src/place.rs), holds back a Tab pressed with nothing focused for the pass, so that a key binding can take it, then gives the widget the focus back at the start of the next pass and tells egui to move on from it, and hands a removed widget’s focus on before egui’s own end of pass. - Remove when: egui’s focus has a notion of the last place, or a successor.
egui: a popup’s frame is a Tab stop
- Compensated:
PopupsensesSense::click()by default, so the frame of every popup (MenuButton,SubMenu,Popup::menu, a context menu, a combo box’s list) is a focusable widget with no role and no name, showing nothing: Tab goes from a menu’s button to its frame, then to its first item. Only aPopupbuilt by hand can set another sense;MenuButton,ComboBoxandResponse::context_menuhave nowhere to say it. Reproduced on egui 0.36.2 with the plugin off (crates/egui-pop-test/tests/focus_place.rsfails). - Upstream: fixed in egui 0.37.0, whose
PopupsensesSense::CLICK. - Workaround: when the focus lands on a popup’s frame, the focus plugin
moves it on in the next pass, the way Tab was going
(
// upstream:incrates/egui-pop-core/src/place.rs). - Remove when: now, egui-pop being on egui 0.37; a follow-up of the move (issue #24).
egui: a focused widget shows no focus of its own
- Compensated: egui’s widgets draw no focus ring: a focused button takes
the pressed button’s look (
Widgets::stylegivesactivefor a press and for the focus alike), and a focused label or custom widget shows nothing. Itsshow_focused_widgetis a debug outline, shown for any focus, a click’s included. - Upstream: not filed yet.
- Workaround: the focus plugin rings the focused widget at the end of the
pass while the focus is visible (the web’s
:focus-visible: on after a navigation key, off at a press of the pointer), unless the widget says it shows its own (crates/egui-pop-core/src/ring.rs,focus::own_ring); a widget drawing its own ring follows the same flag (focus::shows_ring). - Remove when: egui draws a focus indicator of its own, for the keyboard’s focus only.
egui: a panel’s resize line takes no key
- Compensated: since 0.37 a resizable
Panel’s line is a focusableSplitternamed “Resize panel”, answering AccessKit’s increment, decrement and set value, but no key: Tab reaches it and the arrows go on to the next widget. Its name does not say which panel, and its id is not given out. - Upstream: not filed yet.
- Workaround: the workbench gives its areas’ lines the keys (an arrow
across it, Shift, Enter) as an AccessKit set value, so that egui’s clamping
and storing apply, and names each after its area; it rebuilds the line’s id
the way egui does (
// upstream:incrates/egui-pop-api/src/workbench.rs,sash_id), which the keyboard walk’s tests check. - Remove when: egui’s resize line reads the arrows and Enter, and takes a name.
egui: Enter and Space click whatever the modifiers
- Compensated: a focused widget sensing clicks is clicked by any press of
Enter or Space (
Context::create_widget,key_pressed), with Ctrl, Alt or Shift held, and at every repeat of a key held down: Ctrl+Enter clicks a focused button, and a held Space clicks it many times. A native button clicks on a press alone, once. - Upstream: not filed yet.
- Workaround: the key dispatcher, once the keymap has taken what it binds,
takes such presses out of the input when the focused widget senses clicks
and not drags (
// upstream:incrates/egui-pop-core/src/keys.rs,quiet_plain_clicks). - Remove when: egui clicks on a plain, first press only.
egui: arrows move the focus anywhere
- Compensated: a plain arrow on a focused widget that does not lock it moves the focus to the best widget in a cone that way, across any container: from a side list’s last row to the line beside it, then into the page; from a menu’s button to a row behind the menu. Only a modal layer bounds it.
- Upstream: not filed yet.
- Workaround: the focus plugin undoes a move made by a plain arrow that
leaves the F6 region holding the focus (
// upstream:incrates/egui-pop-core/src/stay.rs). - Remove when: egui bounds its arrow moves to a container (a focus scope).
egui: no roving Tab stop
- Compensated: a widget is in Tab’s order if and only if it senses
FOCUSABLE, and that order is the order of drawing: nothing keeps a toolbar’s buttons out of it while they stay focusable by arrow or click, nor says where Tab lands in a container. A toolbar of twenty tools was twenty stops. - Upstream: not filed yet.
- Workaround:
tab::roving(// upstream:incrates/egui-pop-core/src/roving.rs): Tab from a widget of the group goes on from the group’s end, and Tab landing on another of its widgets than the one focused there last is moved to it before the next pass draws. - Remove when: egui has a focus scope with a single Tab stop (the web’s
roving
tabindex), or lets a widget leave Tab’s order and stay focusable.
egui: Tab wraps only in a modal layer
- Compensated: Tab goes by drawing order through the whole window and wraps
only inside
Memory::set_modal_layer, which also blocks the pointer below, so a popover closed by a click outside cannot use it. A focused widget’sEventFiltersays whether it takes Tab, but neither the filter nor the direction egui read from the key can be asked, so whether a press will move the focus is unknown before the pass. Read in egui 0.36.2 (Focus::begin_pass,interested_in_focus). - Upstream: no issue filed yet.
- Workaround:
focus::keep_tab. egui moves the focus by its own rule, so a widget taking Tab keeps it, and the focus plugin corrects where it landed: a hidden stop ends the popover’s order, for Tab from the last stop to land on, and the next pass moves the focus from there, or from a widget behind, to the popover’s first or last stop (// upstream:incrates/egui-pop-core/src/place.rs). - Remove when: egui can wrap Tab in a layer without blocking the pointer, or says where a press of Tab is going.
egui: no side-effect free read of a widget’s response
- Compensated:
Context::read_responseruns the “clicked elsewhere” rule (get_response): on a frame with a click that did not land on the widget, a focused widget loses the focus. Read every pass for the focused widget, to find its layer or place, it drops the focus a widget took when the click landed on one of its children (a tree focused through its clicked row). The pass’s widget lists, which hold the layer and rectangles, are not public. - Upstream: not filed yet.
- Workaround:
focus::peek_responsereads the response withsurrender_focus_onset toNeverfor the call (// upstream:infocus.rs); the focus chain, hover mode, F6 and the palettes’ Escape check use it. - Remove when: egui offers a read of a widget’s rectangle and layer (or a response) without interaction side effects.
egui: text blurs in a Scene zoomed past 100 %
- Compensated: egui draws text at its size and scales the layer, so
a
Scenezoomed in shows blurred glyphs. - Upstream: https://github.com/emilk/egui/issues/4813
- Workaround: the node graph editor stops at 150 % by default
(
GraphEditor::zoom_range), and its overview draws titles at a few larger sizes rather than scaling small ones. - Remove when: egui lays text out at the layer’s scale.
eframe: no custom cursor on the web or in immediate viewports
- Compensated:
Context::set_cursor_imagereaches winit only where egui-winit has the event loop (eframe’s root and deferred viewports); immediate viewports and the web drop the bitmap. - Upstream: web: https://github.com/emilk/egui/issues/3848 (custom
pointer icons, open; the web integration carries a TODO for CSS
url(...)cursors). Immediate viewports: a known limitation of https://github.com/emilk/egui/pull/8155, not filed yet (draft: upstream-drafts/egui-cursor-image-immediate-viewports.md). - Workaround: every bitmap cursor is shown with a system cursor as
its fallback (
cursor::apply,// upstream:): the tool cursor’s nearest system cursor, or a registered image’s own fallback. - Remove when: the bitmap reaches the system everywhere.
winit: no system cursor size
- Compensated: winit does not say how large the system’s cursors are, so tool cursors could not match them.
- Upstream: https://github.com/rust-windowing/winit/issues/3788 (open); a comment with this use case is not posted yet (draft: upstream-drafts/winit-cursor-size-comment.md).
- Workaround:
cursor::system_sizereadsXCURSOR_SIZE(X11 and Wayland desktops), else 24 points;CursorSettings::sizeoverrides it. - Remove when: winit reports the cursor size (Windows’
SM_CXCURSOR, the desktop’s cursor theme size).
winit: no release after a compositor move on Wayland
- Compensated: on Wayland, a window moved or resized by the
compositor (
ViewportCommand::StartDrag,BeginResize, winit’sdrag_windowanddrag_resize_window) does not get the release of the press that started it (seen in labwc, reported on GNOME’s mutter): egui then holds the primary button down, nothing hovers, and the next clicks (a window button, a section’s title) are taken as the rest of that press, until a new press and release or the pointer leaving the window.tools/wbox/titlebar.pyshows it in a headless labwc. - Upstream: not filed yet; to check against winit’s Wayland backend and mutter before filing.
- Workaround:
frame::compositor_grab, called by the title bar and the resize edges after they hand the window to the compositor: the window’s next pass starts with the primary button released, when egui still holds it and no release came. A real release coming later finds the button up. - Remove when: winit delivers the release (or a pointer leave and enter) after a compositor move or resize on Wayland.
winit and egui: no owner window for a viewport
- Not built: a palette or toolbox as a native utility window (U3 in hosts.md). Without an owner, such a window floats above every application instead of only above its own, and is listed in the taskbar and the window switcher.
- Upstream: winit has an owner only on Windows
(
WindowAttributesExtWindows::with_owner_window). The cross-platform request is https://github.com/rust-windowing/winit/issues/4256 (open; it names X11’sXSetTransientForHint, macOS child windows and, in a comment, Wayland’sxdg_toplevel.set_parent). A comment with this use case is not posted yet (draft: upstream-drafts/winit-owner-window-comment.md). egui’sViewportBuilderhas no owner either; an issue is drafted for when winit has one (upstream-drafts/egui-viewport-owner-issue.md). - Workaround: palettes stay inside the main window; a detached panel is an ordinary top-level window, not a utility window.
- Remove when: winit gives an owner on every desktop platform and
egui’s
ViewportBuilderpasses it through.
eframe: no window handle for a viewport other than the main window
- Compensated: the system’s file chooser asked from an application
window cannot be attached to it: eframe gives the native window
(
CreationContext::winit_window,Frame::winit_window) of the main window only, never of a deferred or immediate viewport. Such a chooser is attached to no window, rather than to the main window, where it would block the wrong window. - Upstream: not filed yet; the same need as a viewport’s owner above (a viewport’s native window, or its raw handles, from eframe).
- Workaround:
files::set_parent_windowtakes a window’s handles from an application that has them;AppBuilder::run_nativerecords the main window’s, and with thecreate-nativefeature (default) every other window’s too: egui-pop owns the event loop and reads a window’s handles from its winit id (egui-pop-winit, an implementation detail of winit 0.30 checked by a test per system and, at run time, against the main window’s handles), immediate viewports’ included. A host running its own loop callsrunner::host’s hooks (featurehost-loop) for the same. See eframe-comparison.md. - Remove when: eframe gives each viewport’s window or raw handles; egui-pop then records them as each window opens.
egui_table: unnamed resize handles, rows drawn per region
- Compensated: the column resize handles are interactive widgets
without an accessible name;
TableDelegate::row_uiandheader_cell_uiare called once per region (sticky and scrolled columns), also for the sticky region when there are no sticky columns;TableDelegate::preparegets a reversedvisible_rowswhen the table is clipped away, scrolled out of a scroll area around it. - Upstream: egui_table lives in rerun-io/egui_crates now. Not filed
yet (drafts:
upstream-drafts/egui_crates-table-resize-handle-name.md
and
upstream-drafts/egui_crates-table-row-ui-empty-sticky-region.md).
On egui_table’s main the header is drawn once, so only
row_uiis still called for the empty region. - Workaround:
egui-pop-views’ data table names each handle after its column once the table is drawn, and skips the rows and header cells of an empty region (table.rs,// upstream:). - Remove when: egui_table names its handles and skips empty regions.
egui_commonmark: a code block is an unnamed text field
- Compensated:
egui_commonmark_backend::elements::code_blockdraws a code block as a read-onlyegui::TextEdit::multilinewith no hint and no label, so AccessKit reports aMultilineTextInputwithout a name; it returns nothing, and the field’s id comes fromui.next_auto_id(), so a caller cannot name it. Seen on 0.25.0 (egui 0.36, the version in use); 0.26.0 (egui 0.37, the current release) and themasterbranch still draw it the same way. The block’s copy button is named by its glyph (🗐, then✔). - Reproduction:
CommonMarkViewer::new().show(ui, &mut cache, "```text\na\n```")in anegui_kittestharness: the tree holds a node of roleMultilineTextInputwith no label. - Upstream: not filed yet.
- Workaround:
egui-pop-views’ viewer names the unnamed multi-line fields among the widgets a page just drew, on their AccessKit nodes (viewer/view.rs,// upstream:). The copy button keeps its glyph. - Remove when: egui_commonmark names its code blocks, or takes a name for them.
egui_commonmark: a code block’s copy button is a symbol
- Compensated: egui_commonmark 0.26 draws a code block’s copy button
as the text
🗐(and✔once copied). egui 0.37’s bundled fonts have no🗐: the viewer shows a box there, and egui_kittest 0.37, which panics on a missing glyph by default, fails a test drawing a code block. - Upstream: not filed yet (draw the button as an icon, or let the application hide it).
- Workaround: the tests drawing the viewer’s code blocks allow
missing glyphs (
HarnessBuilder::allow_missing_glyphs,// upstream:). The button still shows a box. - Remove when: egui_commonmark draws its copy button without a symbol the fonts may lack.
egui_kittest: no way to move a window to a screen of another scale
- Compensated:
Harness::set_pixels_per_pointchanges egui’s zoom factor, not the window’s native scale, so a test cannot simulate a window moved to a screen of another scale (winit’s scale change). - Upstream: not filed yet (draft:
upstream-drafts/egui-kittest-native-pixels-per-point.md,
proposing
Harness::set_native_pixels_per_point). - Workaround:
egui_pop_test::set_native_scalewrites the root viewport’snative_pixels_per_pointin the harness’s input before the next step, as egui-winit does on a scale change. - Remove when: kittest has such a setter.
egui: keyboard zoom on by default
- Compensated:
Options::zoom_with_keyboardis on by default: Ctrl and+,-,0change the zoom factor of every window, the keys an application’s content zoom (an image viewer’s) uses too. - Upstream: a default, not a defect; nothing to file.
- Workaround: egui-pop’s application turns it off and owns the
interface zoom (
egui_pop_api::zoom): a setting in fixed steps, and commands bound by default toCtrl+Alt+=,Ctrl+Alt+-andCtrl+Alt+0, rebindable like any command. - Remove when: never; this is egui-pop’s design.
egui: symbols missing from the default fonts
- Compensated: symbols such as ✓ ▸ ◆ ● render as missing glyphs with egui’s default fonts.
- Upstream: https://github.com/emilk/egui/pull/8491 (“Render any
glyph on native”, in egui 0.37.0) draws a glyph the fonts lack from the
system’s fonts, through an opt-in font provider (eframe’s
system_fontsfeature, off in egui-pop). egui’s bundled fonts still lack these symbols, and neither the web nor kittest has a provider. - Workaround: icons are named by role (
egui_pop_core::icon::Icon) and drawn from the Phosphor icon font (phosphorfeature), installed in a family of its own, or painted with lines and fills; widgets never put symbols in text. egui’sSubMenuButtonarrow (⏵) is replaced by a painted chevron in egui-pop’s menus. - Remove when: every backend egui-pop runs on (native, web, kittest) draws these symbols; until then icons stay named by role.
eframe: no list of screens when a window is placed
- Compensated: a window’s place is restored before the window exists, when eframe gives no list of the screens (only the current monitor’s size afterwards, with no origin), so a place on a screen that is gone cannot be told from one on a second screen.
- Upstream: related to https://github.com/emilk/egui/issues/4073
(choose the monitor at launch); a request for the screens’ rectangles
in
ViewportInfois not filed yet. - Workaround:
egui_pop_api::window::WindowState::repairtakes the screens when they are known (tested with sample layouts). With thecreate-nativefeature (default), egui-pop owns the event loop, reads the monitors before eframe creates the main window, and repairs its place against them in thewindow_builderhook; without it, only the size is bounded and a position far away is dropped. Sizes are kept under 8192 points per side, past which the surface cannot be configured (https://github.com/emilk/egui/issues/8361). - Remove when: eframe tells the screens before the window is placed.
winit: no hit-test hook for a custom title bar on Windows
- Compensated: Windows 11 shows its Snap Layouts flyout only when the
maximize button’s area answers
HTMAXBUTTONtoWM_NCHITTEST; winit has no hook to answer it, so a title bar drawn by the application loses Snap Layouts. - Upstream: https://github.com/rust-windowing/winit/issues/3884
(open since 2024), https://github.com/rust-windowing/winit/issues/2413
(a
HitTestevent) and its pull request https://github.com/rust-windowing/winit/pull/3207, not updated since 2024. Maintainers point to subclassing the window outside winit; a 2026 comment on the issue notes that subclassing does not help when a child window covers the client area. - Workaround: egui-pop’s frame (
egui_pop_core::frame) publishes each window’s hit regions every frame, in physical client pixels (HitTable,HitRegions::hitmapping a point to caption, minimize, maximize, close or a resize edge). On Windows,FramePlugin(when the application draws the frame) subclasses the main window throughegui-pop-win32(SetWindowSubclass,unsafein one module, with no egui dependency) and answersWM_NCHITTESTfrom them:HTCAPTION(Windows moves the window, with Aero Snap),HTMINBUTTON,HTMAXBUTTON(Snap Layouts) andHTCLOSE, the resize codes, elseHTCLIENT. The buttons’ non-client clicks never reach winit, so the layer swallows them and hands them back with hover, as are a double click and a right click on the caption: theframe.*steps still run. The layer is installed and removed through theframe.hit_teststep. Limits: only the main window (its handle comes from eframe’s creation context; auxiliary windows keep egui’s own hit handling), and a child window covering the client area would take the hit tests first (the 2026 comment above). - Remove when: winit can answer a hit test for a point of the window.
egui-wgpu: no surface format or colour space to choose
- Compensated: wgpu 30 configures surfaces in any colour space the
platform offers (
SurfaceConfiguration::color_space: extended sRGB, scRGB, Display P3, BT.2100 PQ and HLG) and reports them per format (SurfaceCapabilities::color_spaces) with the display’s headroom (Surface::display_hdr_info). eframe 0.36 does not let an application use any of it: egui-wgpu picks the format itself (preferred_framebuffer_format:Rgba8UnormorBgra8Unorm), and configures the surface with wgpu’s default colour space (configure_surfacebuilds onget_default_config);WgpuConfigurationhas no field for either. Its renderer also writes sRGB-encoded values to every format that is not*Srgb(fs_main_gamma_framebuffer), so the interface is right only on sRGB and extended sRGB surfaces. - Upstream: not filed yet. What would plug in: a preferred format
and colour space in
egui_wgpu::WgpuConfiguration(used byRenderState::createandconfigure_surface), and the renderer’s fragment entry chosen by the colour space’s transfer (linear for scRGB, an encoding pass for PQ and HLG) rather than byis_srgb(). - Workaround: none possible inside eframe for the window’s own
surface. The viewport’s display stage implements every transfer and
the P3 and BT.2020 primaries (CPU and shader); it reports truthfully
what an eframe window draws (sRGB, with the reason,
display::Resolution); a host with its own surface configures it withegui_pop_viewport::gpu::choose_surfaceand declares it (gpu::install_for_surface,display::set_target); on Wayland the image gets a surface of its own (next entry). The issue text is drafted below, under the Wayland entry. - Remove when: egui-wgpu takes a surface format and colour space;
then
gpu::installreads them from the render state.
egui-winit: copy, cut and paste arrive as events, their keys swallowed
- Compensated: egui-winit turns the platform’s copy, cut and paste
chords (Command or Ctrl with C, X, V; Ctrl+Insert, Shift+Insert,
Shift+Delete on Windows) into
Event::Copy,Event::CutandEvent::Paste(text)and sends no key event: a command bound to them in the keymap never runs. A paste is read synchronously, as text only, and nothing reads the primary selection. When the system clipboard holds no text (a file manager’s copy of files, a browser’s “Copy image”), the paste chord makes no event at all: its press is dropped, only its release reaches egui as a key event. - Upstream: egui 0.37 answers most of it:
NativeOptions::clipboard_shortcuts(egui-winit’sState::set_clipboard_shortcuts), when off, sends the chords as plain key events, andEvent::PasteImage(emilk/egui#8472) carries an image when the clipboard holds no text. A clipboard holding only files still makes no event with the shortcuts on (emilk/egui#1167 asks for file paste events). - Workaround: while a clipboard endpoint has the focus (and no text
field does), the clipboard plugin takes the three events and runs
edit.copy,edit.cut,edit.paste(Shift held: paste special) with the pasted text (clipboard::pass,// upstream:); the keymap binds the same keys for every other backend (kittest, the web). The paste chord with no text is recognised by its release: a release of the paste key whose press egui never saw, with no paste event since and the command modifier held meanwhile, runsedit.pastewithno_text, and the system backend reads what the clipboard holds (files, an image, HTML); with the default backend, which reads nothing, that paste is refused when the owner’s text is no longer there. It fires on the release, not the press, and a key repeat pastes once. - Partly removed: with a backend that reads the system clipboard
(
SystemClipboardPlugin),run_nativeturnsclipboard_shortcutsoff; the keymap runs the chords and gives text fields their copy, cut and paste events, the text read through the backend (clipboard::set_keymap_shortcuts), so the key is seen on its press whatever the clipboard holds. - Remove when: the default backend reads the system clipboard too (then the shortcuts go off everywhere natively); on the web, the browser’s clipboard events stay the only way to read it.
Wayland: no colour management through winit
- Compensated: on Wayland, colour management is the
wp_color_management_v1protocol (staging, in wayland-protocols since 1.41): a surface gets an image description (primaries, transfer, luminances), and the compositor gives each surface’s preferred one. winit 0.30 binds none of it (no colour-management object, no event for the preferred description), eframe configures every window 8-bit sRGB (above), and wgpu’s Vulkan path relies on the driver: Mesa’s Wayland window system integration (25.1 and later) maps someVkColorSpaceKHRto the protocol, none of them BT.2020 with a 2.2 power, and holds the colour-management object of every swapchain’s surface when the compositor announces thesrgbtransfer to it (research: wayland-colour.md). - Upstream: winit’s https://github.com/rust-windowing/winit/issues/4131 (colour management getters and events, open); the wgpu, egui-wgpu and Mesa requests below are not filed yet.
- Workaround: the image gets a surface of its own
(
egui_pop_viewport::image_surface,// upstream:inimage_surface.rs):egui-pop-waylandjoins winit’s connection from the window’s raw handles, makes a subsurface below the window, tags it through the protocol (or lets the driver declare a colour space where it holds the surface), and reads the preferred description throughget_surface_feedback; the viewport renders into it with wgpu and punches a hole in the interface. It needs a transparent window, and serves each window whose handles are known, its own surface per window (egui-wgpu keeps one format for every window’s interface). - Remove when: egui-wgpu takes a surface colour space and wgpu offers one for the wanted encoding (or a pass-through one an application can tag), and winit exposes the preferred description; then the window’s own surface carries the image, and the interface is encoded for it.
Drafted requests (not filed)
egui-wgpu / eframe: a present mode per window.
Title: Let each viewport’s surface have its own present mode
WgpuConfiguration::surfaceandFrame::set_wgpu_surface_configset oneSurfaceConfigfor every surface (egui-wgpu/src/winit.rsreconfigures them all). An application with several windows on Wayland must pickAutoNoVsyncfor all of them: a FIFO present on a window the compositor does not show (minimised, on another workspace) waits for a frame callback that never comes, and with one UI thread every other window waits behind it. With a mode per surface, the windows shown could keep a FIFO present and only the hidden ones (or the secondary ones) skip it.Proposal: an optional
present_modeonViewportBuilder(or aFrame::set_viewport_surface_config(ViewportId, SurfaceConfig)), applied by egui-wgpu’s painter to that viewport’s surface only, falling back to the global configuration.
PR idea: a per-viewport override map in egui_wgpu::winit::Painter,
read in configure_surface, and the field on ViewportBuilder, passed
through egui-winit’s viewport creation like the other window options.
wgpu: a pass-through surface colour space, and BT.2020 linear.
Title:
SurfaceColorSpace::PassThroughandBt2020Linearon Vulkanwgpu 30 configures a surface’s colour space (
SurfaceConfiguration::color_space, #9658), mappingSRGB_NONLINEAR,EXTENDED_SRGB_LINEAR,EXTENDED_SRGB_NONLINEAR,DISPLAY_P3_NONLINEAR,HDR10_ST2084andHDR10_HLG(wgpu-hal/src/vulkan/conv.rs); the others a driver reports are dropped (unknown_color_spaces_are_dropped). Two of them matter on Wayland:
VK_COLOR_SPACE_PASS_THROUGH_EXT: Mesa’s Wayland WSI then leaves the surface’swp_color_management_surface_v1alone. With any other colour space, Mesa creates that object (one is allowed perwl_surface) on compositors announcing thesrgbtransfer, even for plain sRGB, so an application that describes its surface itself through the protocol (an ICC profile, BT.2020 with a 2.2 power, custom primaries) cannot use a wgpu swapchain there: tagging it is a fatalsurface_existserror.VK_COLOR_SPACE_BT2020_LINEAR_EXT: Mesa maps it tobt2020+ext_linearwherever the compositor announces both (GNOME and sway included, which offer no scRGB), a wide SDR encoding.Proposal:
SurfaceColorSpace::PassThrough(documented as “the presentation engine applies no colour management; the application describes the surface by other means”) andBt2020Linear, with theirSurfaceColorSpacesflags, mapped on Vulkan only and reported fromvkGetPhysicalDeviceSurfaceFormatsKHRas the others are.
PR idea: two variants in wgpu-types/src/surface.rs and their flags,
the two arms in wgpu-hal/src/vulkan/conv.rs both ways, a line in the
03_hdr_surface example’s list.
egui-wgpu / eframe: a surface colour space (see also the entry above).
Title: Let
WgpuConfigurationchoose the surface format and colour spaceegui-wgpu picks the surface format (
preferred_framebuffer_format) and configures wgpu’s default colour space (configure_surfacebuilds onget_default_config); an application cannot ask for a wide-gamut or HDR surface, which wgpu 30 supports (SurfaceConfiguration::color_space,SurfaceCapabilities::format_capabilities). The renderer also picks its output encoding fromformat.is_srgb()(fs_main_linear_framebufferorfs_main_gamma_framebuffer), so on a linear half-float surface (scRGB) the interface would be written gamma-encoded.Proposal:
WgpuConfiguration::surface_formatandsurface_color_spaceas callbacks over the surface’s capabilities (Fn(&SurfaceCapabilities) -> Option<(TextureFormat, SurfaceColorSpace)>, default: today’s choice), used byRenderState::createandconfigure_surface; the chosen colour space exposed inRenderState; the renderer’s output transfer chosen from it (linear for scRGB and the linear spaces, sRGB-encoded otherwise), with a hook for a matrix and transfer (Display P3, PQ) later.
PR idea: the two fields and their default in egui-wgpu/src/lib.rs,
their use in winit.rs (configure_surface) and RenderState::create,
and a Renderer option for the output transfer replacing the
is_srgb() test; eframe passes them through NativeOptions::wgpu_options.
winit: the preferred image description (a comment on rust-windowing/winit#4131 rather than a new issue).
On Wayland,
wp_color_manager_v1.get_surface_feedbackgives a window’s preferred image description (primaries, transfer, luminances, the display’s target volume) andpreferred_changedits changes, which is what an application needs to choose an encoding and an HDR headroom per window. AWindow::preferred_color_description()(a plain struct of those values) and aWindowEvent::ColorDescriptionChangedwould cover it; binding the manager in winit’s Wayland backend and one feedback object per window is enough. Today an application binds it on winit’s connection through the raw handles (as egui-pop does).
Mesa (Wayland WSI): leave sRGB surfaces untouched (for the record; Mesa’s call).
needs_color_surface()creates awp_color_management_surface_v1forVK_COLOR_SPACE_SRGB_NONLINEAR_KHRwhen the compositor announces thesrgbprimaries and transfer, butwsi_wl_swapchain_update_colorspacenever sets a description for it. The object only takes the surface’s single slot, so a client describing the surface itself (a subsurface with an ICC profile, for one) cannot. Creating it lazily, when a description is set, would leave sRGB swapchains untouched. Separately,SRGB_NONLINEARandDISPLAY_P3_NONLINEARmap to thesrgbtransfer, deprecated in version 2 and not announced by KWin, wlroots or Weston, so Display P3 is offered only on GNOME and Hyprland;gamma22(orcompound_power_2_4on version 2) would offer it everywhere.
eframe and egui-pop
egui-pop runs its applications through eframe,
egui’s official application framework, behind the eframe feature. This
page compares the two: what eframe gives, what egui-pop adds on top, where
egui-pop works around eframe or duplicates it, and how egui-pop should
grow alongside it.
The direction: egui-pop does not replace eframe; it extends it. It builds on eframe’s extension points, stops duplicating what eframe does, and treats what only eframe (or egui-winit, egui-wgpu, winit) can fill as upstream proposals, with a workaround in egui-pop meanwhile that a future upstream fix can replace without breaking egui-pop’s API.
Versions read: eframe, egui, egui-winit and egui-wgpu 0.37.0 (the
versions in Cargo.lock), winit 0.30. Paths to eframe’s sources are
given inside its crate (eframe-0.37.0/src/...), as published on
crates.io; paths to egui-pop’s are from this repository’s root. Line
numbers are those of the versions read.
What eframe provides
| Area | What eframe 0.37 gives | Where |
|---|---|---|
| Native runner | run_native (winit event loop, one window per viewport), run_ui_native (a closure, no state), create_native returning an EframeWinitApplication to run on an event loop the application owns, with other windows it manages itself, or pumped (pump_eframe_app) | lib.rs:288, lib.rs:478, lib.rs:376, native/run.rs:540, native/run.rs:610 |
| Renderers | wgpu (default) or glow (OpenGL), chosen by NativeOptions::renderer; the wgpu render state is handed to the application for custom painting | epi.rs:331, epi.rs:943 |
| Web | WebRunner on a canvas, WebOptions (renderer, wgpu options, dithering), a text agent for IME and mobile keyboards, web storage | web/web_runner.rs, epi.rs:514, web/text_agent.rs, web/storage.rs |
Lifecycle (App) | logic (also ticks while the window is hidden), ui, save and auto_save_interval, on_exit, clear_color, persist_egui_memory, raw_input_hook | epi.rs:152 to epi.rs:282 |
| Creation | CreationContext: the egui context, storage, the GL context or wgpu render state, the root window (winit_window) and its raw handles | epi.rs:53, epi.rs:101, epi.rs:144 |
| Persistence | the Storage trait (strings), a file store in the platform’s data directory (storage_dir), egui’s memory, the root window’s place restored and clamped to the monitors seen by the event loop (persist_window) | epi.rs:1086, native/file_storage.rs:17, epi.rs:382, native/epi_integration.rs:32 |
| Viewports | egui’s immediate and deferred viewports become winit windows; viewport commands (title, size, decorations, focus, attention, fullscreen, drag, resize) applied by egui-winit | native/wgpu_integration.rs:640, native/wgpu_integration.rs:1203 |
| Window options | NativeOptions::viewport (an egui::ViewportBuilder: title, icon, app id, decorations, transparency, min/max size, position), window_builder (a last edit of the root’s builder), event_loop_builder (platform tweaks to the event loop), centered | epi.rs:299 to epi.rs:370, native/epi_integration.rs:83 |
| Icon, title, IME, cursor | icon and title through the viewport builder (macOS app icon in native/app_icon.rs); IME and cursors through egui-winit’s platform output | native/app_icon.rs |
| Accessibility | AccessKit per window through accesskit_winit on native; a screen reader path on the web | native/wgpu_integration.rs:319, web/screen_reader.rs |
| Clipboard and links | the system clipboard (clipboard_shortcuts decides whether the chords become Copy/Cut/Paste events or plain keys); OpenUrl opened in the browser (links feature) | epi.rs:423 |
| Frame pacing | repaint on demand (request_repaint, deferred viewports repainting on their own), the wgpu present mode and frame latency (WgpuConfiguration, Frame::set_wgpu_surface_config), a hidden or minimized window sleeping | epi.rs:378, epi.rs:965, native/wgpu_integration.rs:715 |
| Activation | an activation token requested from the windowing system, to hand to another process (Wayland’s xdg-activation) | epi.rs:881 |
| macOS chrome | traffic lights placed in a custom title bar | epi.rs:839 |
Its limits that matter to egui-pop
- One window handle.
CreationContext::winit_windowandFrame::winit_windowgive the root window. A deferred viewport’s callback gets only anegui::Ui, never aFrame(native/epi_integration.rs:347to:361), so no viewport but the root hands out its winit window or raw handles. - No owner or parent window.
ViewportBuilderhas no owner, and egui-winit’screate_winit_window_attributes(egui-winitlib.rs:2238) sets none; winit 0.30 has one on Windows only. A tool window floats above every application; a native dialog cannot be attached to a secondary window. - The window builder hook reaches the root only, once
(
WindowBuilderHookis aFnOnceover the root’sViewportBuilder,epi.rs:42,native/epi_integration.rs:83), and sees no monitors. - No monitors for the application. eframe clamps its own saved
window place to the monitors (
native/epi_integration.rs:42), but an application restoring a place of its own gets no list of screens. - No surface format or colour space. egui-wgpu picks the format
(
preferred_framebuffer_format, egui-wgpulib.rs:421) and wgpu’s default colour space (configure_surface, egui-wgpuwinit.rs:110);SurfaceConfigcarries the present mode and frame latency only (egui-wgpulib.rs:69). - Nothing native beyond the window: no menu bar, no tray, no native dialogs, no notifications, no single instance. eframe leaves them to other crates (muda, tray-icon, rfd, notify-rust).
- Multi-window: deferred viewports must be
Send + Syncthough they run on the main thread; one UI thread presents every window, so a FIFO present waiting on one compositor surface can stall the others (seen on a headless mutter, ADR 0025); winit cannot hide a window on Wayland; deferred viewports’ rects stay empty on Wayland. - Testing: eframe has no harness of its own; egui_kittest drives an
eframe::Appor a bare context, without real windows (no native scale change, no second OS window).
What egui-pop adds on top
egui-pop’s runtime is a layer over an egui::Context, not over eframe:
App::logic and App::show_wrapped run in any pass, and the eframe
glue is one impl eframe::App (crates/egui-pop-api/src/app.rs:6891)
plus AppBuilder::run_native and run_native_with
(crates/egui-pop-api/src/app.rs:3984 to :4057). The same
application runs under eframe on native and on the web
(crates/egui-pop-gallery/src/main.rs:77), headless in kittest, and in
a test’s bare context. What it adds:
- The application model: plugins that own what they register,
commands, keymaps and
whenclauses, menus, panels and docking, zones and blocks, steps and hooks (ADR 0011), dialogs, the palette, toasts, undo, value binding and settings, admin forms. - Application windows (ADR 0025,
crates/egui-pop-api/src/windows.rs): deferred viewports with anRcshim (a thread-local registry keyed by viewport, lines 12 to 17), titles from the content, the main window taking the content of the last window worked in when it is closed, geometry kept per window id (lines 32 to 36), a shell per window group, per-window keys and modals. - Its own window frame (
crates/egui-pop-api/src/frame.rs): a title bar drawn by the kit, with Windows’ hit test answered throughegui-pop-win32(Snap Layouts, lines 64 to 77) and window corners. - Platform services (
crates/egui-pop-platform): a single instance and deep links, notifications, a tray (tray-icon over ksni on Linux), global shortcuts, logs and crash reports, the system’s text scale, focus mode and wheel lines, raising the main window. - Files: an in-app file picker, and the system’s chooser behind a
feature, attached to the window it was asked from when its handles
are known (
crates/egui-pop-api/src/files.rs:739,:782). - Wide gamut: the image viewport’s own Wayland subsurface tagged
through
wp_color_management_v1(crates/egui-pop-wayland,crates/egui-pop-viewport/src/image_surface.rs:417). - Persistence of its own (
egui_pop_core::persist): versioned, migrated JSON documents per concern (settings, layouts, windows). - Agents and tests: the debug bridge over a socket
(
egui-pop-agent), the test kit (egui-pop-test).
Where egui-pop works around eframe
Each is an entry of upstream.md, with an // upstream:
comment at the code site.
| Limit | egui-pop’s workaround | Entry |
|---|---|---|
| No window handle for a viewport other than the root | the runner reads each window’s handles from its winit id and records them per viewport (files::set_parent_window, frame::set_native_window); the root’s still come from the creation context (frame::record_native_window). Their consumers still serve the main window only: the Windows hit test and the Wayland image surface | upstream.md:499 |
| No owner window (winit and egui) | palettes stay inside the main window; detached panels are ordinary top-level windows (U3 in hosts.md) | upstream.md:478 |
| No screens before the window is placed | the runner reads the monitors before eframe creates the main window, and the root’s window_builder hook repairs the restored place against them (WindowState::repair); without the runner, the size is bounded and a far position dropped (crates/egui-pop-api/src/window.rs:147) | upstream.md:612 |
| No surface format or colour space | the viewport reports sRGB truthfully; on Wayland the image gets its own surface | upstream.md:660, upstream.md:729 |
| No hit-test hook on Windows (winit) | egui-pop-win32 subclasses the root window | upstream.md:628 |
| Custom cursors dropped on the web and in immediate viewports | a system cursor fallback per bitmap cursor | upstream.md:430 |
| Clipboard chords arrive as events | with a reading backend (SystemClipboardPlugin), run_native turns clipboard_shortcuts off and the keymap runs the chords, text fields included; elsewhere (the web, the default backend) the clipboard plugin maps the events to commands | upstream.md:691 |
| No release after a compositor move on Wayland (winit) | frame::compositor_grab (crates/egui-pop-core/src/frame.rs:395) | upstream.md:458 |
| A FIFO present stalls every window on Wayland | windows::present_mode picks AutoNoVsync there (crates/egui-pop-api/src/windows.rs:450) | ADR 0025 |
Deferred viewports must be Send + Sync | the Rc shim and its thread-local registry | ADR 0025 |
| Raising a window on Wayland needs an activation token | platform::window::raise asks for attention instead (crates/egui-pop-platform/src/window.rs:11) | - |
Overlaps and conflicts
- The root window’s place is restored twice. egui-pop restores it
from its settings into
NativeOptions::viewport(crates/egui-pop-api/src/window.rs:163). With eframe’spersistencefeature on (the gallery enables it,persist_windowis on by default), eframe also restores its own saved place and applies it over the builder (native/epi_integration.rs:32to:45), so eframe’s wins. eframe’s copy is better on one point: it clamps the position to the real monitors, which egui-pop’s cannot (it sees none). Resolved (2026-11-18):window::restoreturnspersist_windowoff, so a run egui-pop starts has one owner, egui-pop, and the runner’s screens give it the clamping eframe had. A host on eframe’s own runner chooses: it callswindow::restore(egui-pop’s place), or leaves the root to eframe (the gallery, which keeps its documents in eframe’s storage, does that). A detached window’s closed place has one owner too: egui-pop’s (closed_windows, naming its screen); the copy egui_stack keeps when it closes a float is dropped at each pass. - Two persistence systems. egui-pop never implements
eframe::App::saveand never readsStorage; it keeps its documents in its own directory. eframe’s store, when the feature is on, keeps egui’s memory and the root window beside it. Neither is wrong, but an application sees two directories and two sources of truth. Decided (2026-11-18): egui-pop keeps its own writer. eframe callsApp::saveonly with itspersistencefeature and a storage, everyauto_save_interval(30 s) and at exit (native/epi_integration.rs:458to:502). egui-pop’s writer saves a second after a change, with no feature, so a crash loses at most that second; driving it fromApp::savewould lose up to thirty and force eframe’s feature on. eframe’s storage stays the application’s choice, for egui’s memory. - The present mode is chosen before start-up, for every window.
windows::present_moderewriteswgpu_optionsglobally; eframe 0.37 lets the application change it per frame throughFrame::set_wgpu_surface_config(epi.rs:965). Decided (2026-11-18): it stays chosen at start-up. The per-frame setter reconfigures every surface at once, so it cannot give one window a mode of its own, and going back to a FIFO present when only one window is open would bring the Wayland stall back for a hidden or minimised main window, which the main window’s wake (main_wake::paint_safe) relies on not having. The per-window mode is asked upstream instead (upstream.md, drafted requests). - Window handles taken once, from the creation context, then kept
in egui-pop’s statics (
frame::set_native_window,files::set_parent_window): correct for the root, and the only option for the others, which eframe does not expose. - The
Rcshim works around theSend + Syncbound of deferred viewports rather than eframe’s model; it holds as long as eframe runs deferred callbacks on the main thread, which egui-pop asserts. - Things eframe has that egui-pop replaces on purpose: keyboard
zoom (egui-pop owns the interface zoom, upstream.md:583), clipboard
events (
clipboard_shortcutsoff where a backend reads), the window frame (drawn by the kit). These are design choices, not conflicts.
Options
A. Keep eframe as the runner, extend it (chosen)
Cost: low; the glue is already thin and runner-agnostic. Risk: the limits above stay until upstream moves, so their workarounds stay.
A variant inside A, adopted (2026-11-15): create_native runs
eframe on an event loop egui-pop owns (lib.rs:376, native/run.rs:540).
eframe still creates, paints and runs every window, on the desktop and
on the web, so there stays one runner for both targets; owning the loop
reaches several native hooks eframe does not expose. See
The runner below.
B. An own runner on winit and egui-wgpu (rejected)
It would give every window’s handle, owners where winit has them, the surface format, and the event loop. It would cost the web runner, the AccessKit, IME, clipboard and frame pacing integration eframe maintains, a fork to keep in step at every egui release, and the users who run egui-pop parts in a plain eframe application (standalone.md). Several of the gains are blocked in winit anyway (owners, colour management). Rejected: it fights the ecosystem rather than extending it.
C. Contribute the missing pieces upstream
egui’s CONTRIBUTING, “Agents & LLM policy”: a human is responsible for
the quality of code, issues and pull request descriptions, a human
reviews the code before a pull request leaves draft, descriptions stay
short, and pull requests that put an undue burden on the maintainers
(“massive PRs, LLM slop”) may be closed. So: focused issues with a
minimal reproduction, small pull requests a maintainer asked for, filed
by the owner. winit’s CONTRIBUTING has no AI policy and asks for larger
API proposals as an issue first. Nothing is opened from here; drafts go
in docs/upstream-drafts/.
Recommendation
Keep eframe (A), and organise egui-pop’s work around it in three parts.
1. Build on eframe’s extension points
- The
Apptrait: keep egui-pop’s application aneframe::App(logicfor hidden-window ticks,ui,on_exit).saveis not used: eframe calls it only with itspersistencefeature, every 30 s, and egui-pop’s writer saves a second after a change (overlap 2). NativeOptionsandWebOptions: keep taking the application’s options and adding to them (window::restore,present_mode), never building them behind the application’s back; document which fields egui-pop sets.- Viewports: application windows and detached panels stay egui
viewports with
ViewportBuilderandViewportCommand, so they keep working on the web and in kittest (embedded asegui::Window). - Raw window handles: take them where eframe gives them (the creation
context,
Frame), throughraw-window-handletypes, asfilesandframealready do; for the windows eframe does not expose, from the event loop egui-pop owns (the runner), behind the same per-viewport functions. - Frame pacing: the present mode stays chosen at start-up
(
windows::present_mode);Frame::set_wgpu_surface_configchanges every surface at once and would bring back the Wayland stall (overlap 3). - Platform services stay separate crates (tray-icon, notifications,
a single instance) waking egui through
request_repaint, which is how eframe expects them.
2. Stop fighting or duplicating eframe
- The root window’s place: one owner, egui-pop:
window::restoreturnspersist_windowoff, and the runner’s screens clamp the place (done, overlap 1). - Storage: document that egui-pop’s persistence is the application’s
store and eframe’s
persistencefeature is not needed; when an application turns it on, egui-pop says so in itsaboutinformation rather than silently keeping two. - Clipboard: turn
clipboard_shortcutsoff and bind the chords in the keymap, as the upstream.md entry already plans, but only where a system backend reads the clipboard (egui-pop-platform’s arboard backend): with the shortcuts off,TextEditno longer copies or pastes on its own, and egui-pop must push the events and read the text itself, which the default backend cannot do natively. The event mapping stays for the web and the default backend (done:clipboard::set_keymap_shortcuts, clipboard.md).
3. Gaps only eframe (or below) can fill
Each with a workaround in egui-pop shaped like the future fix, so the fix replaces the inside of an egui-pop function and not its API.
| Gap | Proposal | Layer | Workaround meanwhile, compatible with the fix |
|---|---|---|---|
| A viewport’s window handle | expose each viewport’s raw handles (on ViewportInfo, or a Context query on native) | eframe | the runner reads them from winit’s window ids and records them through files::set_parent_window and frame::set_native_window; when eframe gives handles, they replace the ids behind the same functions |
| An owner window | ViewportBuilder::with_parent(ViewportId), mapped to winit’s owner where it exists | winit first (issue 4256), then egui-winit | palettes inside the main window; the U3 cell in hosts.md flips when it lands |
| Screens before placement | the monitors (rects and scales) given to the window_builder hook or in ViewportInfo | eframe | reached by the runner (runner::screens), which hands them to WindowState::repair; the ask stays for applications on eframe’s own runner |
| Surface format and colour space | WgpuConfiguration choosing them, the renderer’s output transfer from the colour space | egui-wgpu | the display stage reports sRGB with its reason; gpu::install reads the format from the render state, so it follows automatically |
| Custom cursors in immediate viewports and on the web | pass the bitmap through | egui-winit, eframe web | a system cursor fallback per bitmap |
| A Windows hit test | a hit-test callback | winit (PR 3207) | the subclass layer in egui-pop-win32, removed by a step |
| Activation token for raising | pass a token to ViewportCommand::Focus | egui, egui-winit | asking for attention on Wayland |
Drafts already exist for several of them in
docs/upstream-drafts/; the others are listed as “not
filed yet” in upstream.md, which stays the register: a
workaround and its entry go when the fix ships in a release egui-pop
moves to.
Fallback triggers
egui-pop stays on eframe (option A, through create_native) until one of
these holds; then it runs its own winit loop with eframe’s pieces
(create_native already owns the loop) or, last, option B:
- A hook only eframe’s painter holds becomes a must: the main interface’s surface in a wide-gamut or HDR colour space, or a present mode per window, with no answer to the drafted egui-wgpu requests (upstream.md) within two egui releases of filing them.
- An owner window egui-pop must set at creation, on a system where setting it after creation does not work, with winit’s cross-platform owner (rust-windowing/winit#4256) still not released two winit releases after it is filed for.
- eframe stops painting inside
RedrawRequested, or winit’sWindowIdstops being the native window, and the release that changes it gives no per-viewport handle instead: the runner’s guards (runner::ids_verified,egui-pop-winit’swindow_idtest) say so first. - eframe drops
create_native, or a hook egui-pop relies on, with no replacement.
Each trigger is checked at an egui release bump. Until one holds, the cost (about 2,900 lines natively and 4,500 on the web, re-synced at each release) is not worth paying.
The runner: eframe through create_native
Decided 2026-11-15, after a time-boxed spike (one file of about 270
lines, run in wbox on Wayland and X11): egui-pop keeps eframe as its one
runner for native and web, and on the desktop runs it on an event loop of
its own. AppBuilder::run_native and run_native_with build the winit
event loop, hand eframe to it with eframe::create_native, and run it
with a handler (crates/egui-pop-api/src/runner/native.rs) that sees
every winit callback before eframe; behind the create-native feature,
on by default. Without the feature, on the web, on iOS and Android,
eframe runs as before (eframe::run_native, WebRunner). kittest never
goes through run_native.
What owning the loop reaches:
| Hook | Reached? | How | Workaround it removes |
|---|---|---|---|
| Each viewport’s raw window handle | Yes on Windows, X11, Wayland; not on macOS (winit’s id is the NSWindow, the handle wants its NSView) | eframe paints a window synchronously in its RedrawRequested (native/run.rs:420); the handler notes which, a Context::on_begin_pass hook pairs it with ctx.viewport_id(). winit 0.30’s WindowId is the native window (the HWND, the X11 id, the wl_surface proxy): egui-pop-winit turns it into raw handles, the only crate with the unsafe | the per-viewport consumers move to it next: the chooser’s parent from a secondary window, the Windows hit test, the Wayland image surface on any window |
| Monitors before placement | Yes | the handler reads available_monitors in resumed, before eframe’s own creates the main window; the root’s window_builder hook, called inside it, repairs the restored place | WindowState::repair(&[]) gets real screens |
| Owner / parent window | Not at creation (eframe builds the windows). After creation, from the handle: Windows (GWLP_HWNDPARENT), X11 (WM_TRANSIENT_FOR); not Wayland | not coded | palettes inside the main window, on Windows and X11 only |
| Events before eframe | Yes (filter or add WindowEvents) | not coded | candidate: frame::compositor_grab |
| Surface format / colour space | No: egui-wgpu’s painter is private to eframe | - | none |
| Present mode per window | No, and unrelated to the loop: Frame::set_wgpu_surface_config is per frame but for every surface | - | none beyond realignment step 3 |
| Activation token | Already in eframe 0.37 for the root; the handler sees ActivationTokenDone for every window | - | none |
Guards on the assumptions it rests on:
WindowIdis the native window, an implementation detail of winit 0.30, not its API.egui-pop-winit‘swindow_idtest creates a hidden window on each system and compares; and at run time the runner compares the main window’s id, read as a handle, with the handle eframe gives for it: other windows’ handles are used only when both agree (runner::ids_verified).- eframe paints inside
RedrawRequested, true in 0.37: the first pass that begins there is that window’s viewport. An immediate viewport (a detached panel’s window) is painted in a pass nested in its parent’s, and its own window’sRedrawRequestedruns no pass (eframe repaints the parent instead): the two are paired in the order seen, a guess a later pass of the window’s own corrects. A host running the loop itself gets the same throughrunner::host(featurehost-loop). - eframe’s own result:
create_nativekeeps the run’s error inside its handler, so the runner keeps the application creator’s error itself (run_native_with’sError::AppCreation), and reports a run that stopped before the application was made as an error too. - One event loop per process (winit): it is kept for a second run, as eframe does.
An own runner for native and web (sketched, not built)
Built on egui-winit, egui-wgpu and egui’s web pieces, it would
re-implement what eframe 0.37 keeps in about 2,900 lines natively for
wgpu (native/run.rs, winit_integration.rs, wgpu_integration.rs,
epi_integration.rs, without glow) and 4,500 lines on the web (web/:
the runner, events, text agent, screen reader, painter, storage),
re-synced at each egui release. On top of what create_native reaches,
it would gain the surface format and colour space per window, the
present mode per window, owners set at creation (winit has them on
Windows only), and lose the users who mix egui-pop parts into a plain
eframe application. It stays the fallback if wide gamut in the main egui
surface, or another hook only the painter holds, becomes a must.
egui_stack: directions for egui-pop
Status: analysis, 2026-11-03. Nothing here is decided; the sections and
toolbars direction is accepted in ADR 0022.
Since then egui-pop has moved to egui 0.37 and draws its docks with
egui_stack, which has the first changes listed at the end of this page;
the workarounds those changes allow egui-pop to drop are removed one by
one. Since 2026-11-07 the workbench’s areas are the docks of one
egui_stack DockSpace (2.1, direction D): the drag between areas, the
private drag id and the drop hint drawn by egui-pop are gone.
egui_stack continues egui_dock (MIT, its full history kept): it starts as egui_dock 0.21.1’s API moved to egui 0.37, and it is meant to grow into more of an application’s panel management (stackable sections, toolbars). egui-pop draws its workbench over egui_dock 0.21 on egui 0.36 today. This page reads both codebases and says which directions would make egui_stack fit egui-pop best, before egui-pop moves onto it and before sections and toolbars move into it.
Two rules hold throughout:
- egui_stack never depends on egui-pop. It stays a plain egui crate, useful to any egui application; egui-pop wraps it. Whatever egui-pop needs from it is a hook, a trait or a value, never an egui-pop type.
- Ideas, not code, from GPL projects; egui_tiles (MIT OR Apache-2.0) may lend ideas and code, with credit.
References: egui-pop paths are from the repository’s root; egui_stack paths are from its own root and marked “egui_stack”. egui_stack had no functional change from egui_dock 0.21.1 when this was written (its changelog lists the rename and egui 0.37 only), so what is said of one holds for the other.
Where egui-pop touches egui_dock
| Where | What |
|---|---|
crates/egui-pop-api/src/workbench.rs:127 | The one import: DockArea, DockState, NodeIndex, Split, TabViewer. |
workbench.rs:1528-1600 | to_dock, fill, from_dock, read: egui-pop’s own layout tree converted to a DockState and read back. |
workbench.rs:798-830 | layout, read_back, project: the layout document is the truth, the docks a projection of it, rebuilt when it changed outside them. |
workbench.rs:1230-1243 | take_dock, put_dock: one DockState per area, taken out while drawn (since 2026-11-07, one DockSpace for every area). |
workbench.rs:1258-1274 | dragged_tab: rebuilds egui_dock’s private drag id (show/leaf.rs) to know which tab egui is dragging (gone 2026-11-07: DockArea::dragged_tab). |
workbench.rs:2571-2614 | draw_dock: one DockArea per area with close, add, close-all and collapse buttons off, then the kit paints over it. |
workbench.rs:2668-2694 | dock_style: egui_dock’s tab painting made transparent. |
workbench.rs:2785-2850 | paint_tabs: the kit paints the bars and tabs over what egui_dock laid out. |
workbench.rs:2852-2970 | TabViewer for panels: id, title, ui, on_tab_button, tab_style_override, context_menu, allowed_in_windows. |
workbench.rs:2972-3093 | follow_drag, drop_hint: drops between areas, the veto, the hint and the ghost tab, done by egui-pop (gone 2026-11-07: the space’s drag, dock_drop_allowed). |
crates/egui-pop-api/tests/it/theme_pairs.rs:183, crates/egui-pop-gallery/tests/it/gallery.rs:1766 | Tests that lean on egui_dock’s drag timing. |
egui-pop builds egui_dock without features (Cargo.toml:87): it never
serializes a DockState.
1. Theming
Today
The kit paints the workbench tabs, egui_dock only lays them out and takes their input (kit):
- A style made invisible.
dock_style(workbench.rs:2668) starts fromegui_dock::Style::from_eguiand sets to transparenttab_bar.bg_fill,tab_bar.hline_color, andbg_fill,outline_color,text_colorof all sevenTabInteractionStyles (active,inactive,focused,hoveredand the three*_with_kb_focus); it setstab_bar.heightfrom the kit’stab-barandtabheights. Nothing else is touched: separators (SeparatorStyle: width, colours idle, hovered, dragged), the drop overlay inside an area (OverlayStyle: selection colour, leaf highlight, the icon buttons),TabBodyStyleand the buttons keep egui’s colours, not the theme’s tokens. - Not copied every frame. The style is kept per area in a
TabCache(workbench.rs:2714-2783), rebuilt when egui’sStyleArc changes, and the prepared tabs (title translated, label laid out, width measured) when the kit, the scale or the strings provider change. The first kit version did it every frame and cost 56% more frame time (kit, cost). - Widths through an override.
tab_style_override(workbench.rs:2890) gives each tab the kit’s measured width asminimum_width; egui_dock still adds 8 points either side of the label, so a kit can make tabs wider, never narrower, nor overlap them (kit, known limits). - Painting after the fact.
on_tab_button(workbench.rs:2871) records each tab’s rect, layer and state (SeenTab); aftershow_inside,paint_tabspaints the bars (kit.tab_bar) and tabs (kit.tab), clipping to the bar and following a dragged tab onto its floating layer. egui_dock lays the title out a second time for its own (invisible) text. - Hints drawn twice over. Between areas, the kit’s
dock-previewandtab-previeware egui-pop’s (drop_hint,workbench.rs:3004). Inside one area, egui_dock’s own overlay still shows, in egui’s colours.
In egui_stack, every part is painted from Style fields with no hook:
the tab in tab_title (egui_stack src/widgets/dock_area/show/leaf.rs:1079-1211),
the bar (leaf.rs:225-234), separators (show/mod.rs:446-550), the
drop overlay (drag_and_drop.rs:78-143). The only levers are
tab_style_override, title and on_tab_button, which gets a
Response but no painter.
What egui_stack could expose
| Option | For | Against |
|---|---|---|
More Style fields | No new concept | Every kit shape (box, underline, Chrome-like) needs fields; a kit’s handlers, states and per-part data do not map onto colours |
Per-part callbacks on DockArea (`.paint_tab( | p, part | ..)`) |
A painting trait (DockPainter), one method per part, defaults painting from Style | One object a kit implements once; defaults keep today’s look; measure and paint in one place | A public trait to keep stable |
Painting in TabViewer (egui_tiles’ Behavior style) | One trait for everything | Mixes “what a tab is” with “how the theme looks”: egui-pop’s viewer is per panel set, the kit per theme |
Direction T: a DockPainter trait passed to DockArea::painter,
its default the current painting from Style:
tab_width(&self, title: &Galley, tab: TabFlags) -> f32: the measure, so a kit decides the width, padding included;tab(&self, painter, TabPaint { rect, title, state, closeable, close_hovered });tab_bar(&self, painter, rect, scrolled);separator(&self, painter, rect, axis, state);drop_preview(&self, painter, DropPaint { rect, destination, refusal });- the state as flags (
selected,hovered,pressed,focused,dragged), the same four egui-pop’s kitStatealready reads.
What it removes from egui-pop: dock_style, SeenTab and its
recording, paint_tabs’s second pass, the transparent text laid out
twice, the 8-point floor, egui’s colours on separators and in-area hints.
The kit implements the trait in egui-pop-core (L2) with Kit, as it
bridges egui’s widgets today (kit).
- Benefit: high. Every visible part of the workbench follows the theme; tabs narrower or overlapping become possible; less code.
- Cost: medium. Painting is spread across
leaf.rsanddrag_and_drop.rs; each site is replaced by a call. - Risk: low to medium. Defaults keep egui_dock’s look; the trait is
public API, so its argument structs are
#[non_exhaustive].
Done (2026-11-04). egui_stack’s DockPainter, set with
DockArea::painter; egui-pop’s Kit implements it
(crates/egui-pop-core/src/kit/dock.rs). Amended from the above where the
code said otherwise:
- Each method takes the painter and one
#[non_exhaustive]struct, which also carries egui_stack’sStyle(faded while a window surface is hovered) and, for tabs, the tab’sTabStyle: the default painting needs them. Every method has a default (theStylePainter), so a painter overrides only some parts. tab_widthtakes aTabMeasure(title, flags known before layout, close button width, styles). A bar filling its width can still widen a tab.tab_barpaints under the tabs;tab_bar_tailpaints the bar right of the last tab, after them, where egui_dock drew its line. The line under each tab is part oftab.scrolledis how far the tabs are scrolled, in points.tabgets the close button asclose: Option<TabClose { rect, state }>rather thancloseableandclose_hovered; egui_stack keeps the button’s place and input.- The drop overlay takes three methods:
drop_target(the node under the pointer),drop_button(the overlay’s buttons) anddrop_preview(rect,destination,refusalwith its laid out reason and the pointer, andfrom_buttons). - The flags are
PartState, shared by every part:SELECTED,HOVERED,PRESSED,FOCUSED,DRAGGED, andLEAF_FOCUSED(the dock’s focused leaf, which egui_dock’s look distinguishes). - The tab bar buttons, the hidden tab bar’s handle and the bar’s scroll
bar are still painted from
Style. Since 0.25 a body’s border is the painter’s too (tab_body, with the body’s state: hovered, focused leaf).
egui-pop no longer has SeenTab, paint_tabs, the transparent style or
the tab_style_override width (a tab is as wide as the kit measures it,
no 8-point floor); its egui_stack style only sets the bar’s height.
Separators are the kit’s dock-separator, the bodies’ borders its
dock-body, the drop overlay inside an area the kit’s dock-preview and
button.
Since egui_stack 0.23 the drop overlay is drawn on the target
(OverlayType::Zones: the region the tab would take, bordered and
tinted, no buttons), and egui-pop sets it with its zone colours from the
kit’s dock-preview; the cross of buttons (OverlayType::Widgets) is
no longer used. Since 0.24 the tree is n-ary, with rows, columns and
grids (Node::Linear, Node::Grid), which the workbench saves in its
layout document and arranges by command (workbench.arrange).
2. Behaviour egui-pop works around
2.1 The drop veto, by tab and destination
Today. egui_stack’s only veto is allowed_in_windows(tab) (egui_stack
src/widgets/tab_viewer.rs:93, read at show/mod.rs:222-230 and
leaf.rs:1414-1423) and the global AllowedSplits
(an entry of upstream until 2026-11-07).
egui-pop panels declare the areas they may live in, so each area is a
dock of its own, windows are refused (workbench.rs:2965), and a drag
leaving an area is followed by egui-pop: it guesses the dragged tab by
rebuilding egui_dock’s private id (workbench.rs:1258-1274), finds the
area under the pointer (area_at, workbench.rs:1277), moves the panel
through the workbench.move step on release (follow_drag,
workbench.rs:2977), and draws its own hint (drop_hint). Since
egui_dock follows a drag only inside its own DockArea, the ghost tab
always lands at the end of the first tab bar: no insertion index
between tabs, no split from another area (workbench).
A small API.
TabViewer::drop_allowed(&self, tab: &Tab, to: &TabDestination) -> DropVerdict, withDropVerdict::{Allow, Refuse(Option<WidgetText>)}, defaultAllow; consulted whereallowed_splitsandallowed_in_windoware computed; a refused target draws the preview as refused (throughDockPainter::drop_preview) with its reason.- Public drag state:
DockArea::dragged_tab(ctx, id) -> Option<(TabPath, Pos2)>, instead of an id scheme callers must copy. - Later, one dock for the whole workbench: with (1), egui-pop’s
areas could be the main surface’s top splits, and every drop between
areas would get egui_stack’s insertion index and splits. That needs
“fixed” nodes (an area that never collapses or merges away) and
egui-pop’s step model still deciding the move: a
TabViewer::on_move(from, to) -> MoveResponse::{Apply, Cancel}hook lets theworkbench.movestep veto or redirect.
Removes: dragged_tab, follow_drag’s guesswork, the ghost at the end,
the workaround entry in docs/upstream.md. (1) and (2) are small; (3)
is a redesign of the workbench’s drawing and is worth it only after (1)
has proved itself.
Done (2026-11-07), (3) in another shape. egui_stack 0.25.1’s
DockSpace: several named docks, each a surface of one DockState,
each drawn by its own DockArea::dock(&mut space, name) call wherever
the application lays it out, sharing one drag (the first call of a pass
resolves it for every dock). No fixed nodes were needed: an area is a
dock, not a split of one tree, so egui-pop keeps laying the areas out
(widths, folds, flyouts, an area lying over the centre) and draws each
dock in its area. What changed in egui-pop:
- each area is a dock named after it, with
DockRules(any split, no floating window, kept when empty); a panel’s area rules areTabViewer::dock_drop_allowed, a refusal shown on the zone with its reason; - a closed area is an empty dock drawn along the areas’ edge while a tab drags, an area drawn bare (a zone alone) a second, empty dock over it whose drops join the area’s tabs;
- the move between areas is still the
workbench.movestep, run after egui_stack’s drop: a veto puts the areas back as they were (theon_movehook above stays a possible egui_stack addition); - gone:
dragged_taband its private id (DockArea::dragged_tabon the space’s id),area_at, the cross-area move and the hint and ghost drawn by egui-pop; the drop hint is now what egui_stack resolved (DropHint::zone,index), its rect where the kit painted the zone; - the layout document is unchanged: each area’s tree becomes its dock
through
DockSpace::from_states.
2.2 Tab context menus and commands
Today. context_menu (workbench.rs:2902-2963) draws plain egui
buttons: Move to each area (greyed with the refusal as tooltip), Float,
Detach, Close. They call change_workbench directly; they are not
command-backed menu items, so they show no keys, are not in the command
palette, and break “declare once” (credo 1). egui_stack adds its own
Eject and Close items after the viewer’s (leaf.rs:512-525); egui-pop
avoids them by refusing windows and turning close buttons off. The Close
item calls on_close twice (leaf.rs:518, then the removal loop at
show/mod.rs:104), a bug egui-pop never hits because it hides the
item.
A small API.
DockArea::show_builtin_tab_menu(bool): the caller’s menu alone.TabViewer::context_menualready gets theNodePath; add the tab’sTabPathso a caller can name the tab in a command’s arguments.- Public
DockStateoperations for every built-in action (close, eject, focus, move to aTabDestination), so a command does what a built-in button does, from a palette or a key. - Fix the double
on_close.
On egui-pop’s side, the tab menu becomes a menu id (as toolbars are,
toolbars) whose items are commands with args.panel:
keys, palette entries and agent surfaces follow.
2.3 Close confirmation
Today. egui-pop hides close buttons (workbench.rs:2600) and closes
through the tab menu’s Close, the workbench.hide step, which a plugin
may veto (workbench.rs:256, :1007). A detached window’s close is the
workbench.close_window step (workbench.rs:1456-1462). egui_stack has
on_close -> OnCloseResponse::{Close, Focus, Ignore}, is_closeable
and force_close (tab_viewer.rs:35-59), enough for a synchronous
answer; a confirmation dialog answers later.
A small API. Nothing new is needed for an asynchronous confirmation
once the double call is fixed: Ignore now, then a public
DockState::remove_tab(path) when the dialog answers. Documenting that
pattern, and showing the close button as the kit’s (through
DockPainter::tab, close hovered or not), lets egui-pop show close
buttons again, as the indicators design asks (the modified dot that
turns into a close button, indicators). Removes: the
“no close button” stance and its keyboard-survey note.
2.4 Focus and the keyboard
Today. Each area is wrapped in a focus region for F6
(draw_area, workbench.rs:2564-2569); the focused panel follows the
widget focus (workbench). The keyboard
survey found: every tab is a Tab stop; Enter or Space activates it
(egui_stack leaf.rs:579-585); separators take the focus and move 16
points with Ctrl or Shift and an arrow (show/mod.rs:481-508), a plain
arrow leaves them, nothing announces them; no key goes to the next tab
of an area (keyboard survey, items 3 and 9).
A small API.
- One Tab stop per tab bar (roving focus): the active tab takes Tab,
Left and Right move along the bar, Home and End, as WAI-ARIA’s tab
list; a
DockArea::tab_focus(TabFocus::Each | TabFocus::Roving)option keeps today’s behaviour available. - Ctrl+Tab cycling between an area’s tabs, as egui_tiles’
Behavior::cycle_tabs_with_keyboard; off by default so a host’s keymap may own the key (egui-pop’s would bind a command instead). - Separators as splitters: a plain arrow moves them once focused (a
separator has no other use for arrows), Shift for a larger step,
Enter resets (today a double click resets to 0.5,
show/mod.rs:546), as egui-pop’s sections do. - Escape while dragging a tab cancels the drag (today only the release ends it).
DockArea::focus_tab(path): the focus to a tab button, for egui-pop’s<panel>.focuswhen the panel has nothing focusable.
F6 regions stay egui-pop’s: they span the whole window (menu, strips, status bar), not a dock.
2.5 Accessibility names and roles
Today. egui_stack sets no WidgetInfo anywhere (no widget_info
nor accesskit call in src/): tabs, close, add, close-all, collapse
buttons and separators have no role or name. egui-pop names tabs after
the fact in on_tab_button as plain buttons (workbench.rs:2871-2880),
and separators stay role Unknown with no name.
A small API, built in, no hook needed:
- a tab: role
Tab, its title as name,selectedwhen active, inside aTabListnode per bar (egui_tiles’ defaulttab_uisetsWidgetInfo::selected(Button, …),behavior.rs:155-276); - the close, add, close-all, collapse and minimise buttons: role
Button, names from aDockArea::labels(Labels { close, add, … })struct with English defaults, so a translated application passes its strings; - a separator: role
Splitter, its fraction as value, increment and decrement actions, named from aTabViewer::separator_name(path)or the labels’ format.
Removes: the naming in on_tab_button, an accessibility gap in every
egui_stack application.
2.6 Drag and drop between windows
Today. egui-pop refuses egui_stack’s floating windows
(allowed_in_windows false, workbench.rs:2965); a panel leaves the
main window only through Detach, one panel per OS window, and comes
back through the close step or Attach. A tab cannot be dragged into or
out of a detached window. egui_stack’s drag state lives in the
Context’s temporary data keyed by the dock’s id (egui_stack
state.rs:16-28), in one viewport’s coordinates.
Direction. This waits on egui and eframe: dragging between
viewports needs a pointer known across windows, which eframe does not
give (egui_dock issue 202’s last word: blocked). What egui_stack can do
first is cheap: hit-test drops in global coordinates (each viewport’s
inner_rect known), and accept a drop released over another viewport’s
DockArea sharing the same DockState. Not before section 3’s work.
3. Detached windows
Since egui_stack 0.28.4 (EP2), done this way. egui_stack grew the
host hook this section asks for (ViewportHost) and native floats in
the space (FloatsArea, one drag across viewports,
DockSpace::dragging). egui-pop’s detached windows are those floats:
each window’s tabs are a dock of the workbench’s space
(window:<panel>), drawn through egui-pop’s host (its viewport ids,
frame, keys, overlays and close step), painted by the kit
(FloatsArea::painter, configure, decorate for the Dock back
button). egui-pop keeps its own window lifecycle: the floats’ close
policy is Keep (the workbench.close_window step closes), the screens
are repaired by egui-pop (the host tells egui_stack none), and a drop
into or out of a detached window is put back and run as
workbench.join_window or workbench.move. The text below is the
analysis as it stood before.
What egui-pop adds on top of egui_dock’s windows. egui_stack’s
windows are egui::Windows inside the same viewport, bounded by the
dock’s window_bounds (egui_stack src/dock_state/window_state.rs:121-140,
show/window_surface.rs:13-120); WindowState::screen_rect and
dragged are never written. egui-pop uses none of them: its detached
panels are OS windows (windows, workbench.rs:1371-1478, through
show_viewport_immediate at :1409), each:
- titled “Panel — Application”, with the application’s own frame when it
draws one (title bar, resize edges, full screen), its own scale and a
scale.changedevent; - a window of the application in full: the key dispatcher runs in its
pass, the
windowcontext key holds the panel, dialogs and the palette come up over the window in use and block the others, each window has its own overlay stack andWINDOW_OVERLAYSzone; - closed through the
workbench.close_windowstep, vetoable (CancelClose); - kept in the layout (
Auxiliary { panel, screen, rect },crates/egui-pop-model/src/layout.rs:109), repaired against the screens before it opens (crates/egui-pop-api/src/window.rs:95); - one panel each: no tabs, no splits in a detached window.
On top, egui-pop has its own floating palettes (palettes.rs):
groups, stacks, tabs one level deep, anchoring, magnetism, docking into
an area; none of it is egui_dock’s.
Pull request 203 (egui_dock, branch multi-viewport, open since
2023-11, last commit 2024-01, 4 files, +113 -52, against egui_dock 0.11
on egui 0.24): behind a viewports feature, WindowState::create_window
returns a ViewportBuilder (no decorations, resizable, position and size
from the state) and show_window_surface runs the window body inside
show_viewport_immediate. Its own checklist leaves open deferred
viewports, docking a second tab into an existing window, dropping a
window outside the main viewport, minimise and maximise, tiling window
managers; closing the OS window does not remove the surface.
Verdict: take the idea, not the branch. The diff targets code that
no longer exists (create_window returned (Window, bool), leaves
were struct variants, egui moved 13 minors), so it is a rewrite. And
for egui-pop a viewport per surface is not enough: everything listed
above (frame, keys, overlays, dialogs, the close step, screen repair)
happens around the window body. If egui_stack grows OS windows, the
shape that fits egui-pop is a host hook: TabViewer::window(&mut self, surface, builder, body: &mut dyn FnMut(&mut Ui)) (or a SurfaceHost
trait) where the caller opens the viewport, wraps the body with its
frame and dispatcher, and reports close requests; egui_stack keeps the
surface’s tree, its tabs and its drops. That lets egui-pop put several
tabs in a detached window, the step model untouched.
- Benefit: medium, later: tabbed detached windows.
- Cost: high (cross-viewport drag waits on eframe).
- Risk: medium: two window systems (egui_stack’s in-viewport ones and OS ones) to keep apart.
4. State: save, restore and migration
Today. egui-pop never serializes egui_dock’s state. Its layout
document (crates/egui-pop-model/src/layout.rs:666) is JSON through the
persisted documents’ schema (ADR 0008),
version 2 with one migration (areas renamed, layout.rs:696-722). It
holds per area a binary Node (Tabs { panels, active } or
Split { vertical, ratio, a, b }, layout.rs:18), plus what no dock
knows: detached windows with their screen, hidden panels, folded
areas, areas lying over the centre, flyout widths, floating palette
groups and docked groups. Layout::repair (layout.rs:1071) fixes it
against the declared panels and screens; named arrangements are layouts
in the host’s store (workbench).
Sections keep their own Layout (fold and heights set by hand, by key)
in egui’s persisted memory, readable whole for an application
(egui_stack’s sections::Layout since 2026-11-04, under its key
egui_stack.sections; egui-pop’s Layout converts to it).
egui_stack’s serde (feature serde) covers DockState, Surface,
WindowState, Tree, Node, LeafNode with runtime rects, indices
and all styles; no version field. Its binary heap stores Empty nodes
and positions (2n+1, 2n+2), so a saved tree is tied to its storage.
Direction S: a small, plain, versioned layout value in egui_stack, not a migration framework.
egui_stack::LayoutTree<T>:Tabs { tabs: Vec<T>, active },Split { axis, fraction, children }(n-ary once section 6’s direction lands), withDockState::to_layout()andDockState::from_layout(), serde behind the feature, aversion: u32field and a documented rule: a field added gets a default, a change of meaning bumps the version, and egui_stack reads the versions it wrote (its own small upgrade, inside the crate).- The application owns its document: what goes with the tree (egui-pop’s areas, hidden, folded, palettes) and the migrations of its own meaning stay egui-pop’s, in ADR 0008’s schema.
Removes to_dock, fill, read, leading_tabs (workbench.rs:1528-1600)
and the 0.05-0.95 clamping guess; egui-pop’s Node becomes egui_stack’s
LayoutTree<PanelId> inside its own document (a migration, version 3,
if the field names change).
- Benefit: medium: one tree shape, any egui_stack user gets a stable format instead of serializing runtime state.
- Cost: low to medium.
- Risk: low; owning a full versioned model (with app migrations) in egui_stack would be the risk: it would duplicate ADR 0008.
5. Sections and toolbars
Sections: done (2026-11-04). egui_stack 0.22.2 has the
sections module, ported from egui-pop; egui_pop::core::sections wraps
it (the kit’s DockPainter::section_band and section_boundary, the
strings behind Labels::resize_section, pull_when from the gesture
map, overflow_scroll and band_height from the kit, the debug slot and
the move of the old layouts), and egui-pop’s tests run against the
wrapper. egui_pop::model::sections is a deprecated copy for one
release: the model stays free of egui, so it cannot re-export
egui_stack’s sections::plan, which egui_pop::core::sections::plan
does. The toolbar row has not moved.
What existed in egui-pop before:
- Sections: the arithmetic in
crates/egui-pop-model/src/sections.rs(1041 lines, no egui:fitat:302,plan_dragat:108,keep_title,pin_plan,rows_least); the widget incrates/egui-pop-core/src/sections.rs(1425 lines). The widget reaches into egui-pop in few places: the kit (section-band,section-disclosure,section-count, focus rings,:641-1060), the theme’s tokens and text roles, the strings provider for the boundary’s name (SECTION_RESIZE,:745), the pointer gestures map for the pull’s keys (gesture.sections.pull), the indicator pill for the count, andSlotstate. Accessibility is its own: buttons named with their count andexpanded(:1062-1063), splitters with value and increment and decrement actions (:1163,:1318).laid_out(:304) feeds the debug bridge’sstatecollector. - Toolbars:
crates/egui-pop-api/src/toolbars.rs(901 lines), a menu id drawn as buttons. Most of it is egui-pop’s command world (menus,whenclauses, keys, arguments, list providers, busy runs, the icon registry, thetoolbarscollector); the plain part is the layout: orientation, labels mode, the overflow into More tools (fit,:870), separators that never end a row.
Direction P: a plain-egui core in egui_stack, egui-pop wraps it (accepted in ADR 0022):
| In egui_stack | Stays in egui-pop |
|---|---|
sections::plan: the arithmetic, as is (no egui types) | The kit’s painter for bands, marks, counts and rings |
Sections, Section, Stack with the three body kinds, fold, resize, pull, titles that drag or stay, empty room, windowed rows, the wheel contained | The strings (Fluent) behind the labels struct |
The persisted sections::Layout (by key), laid_out | The pull’s keys from the gesture map, rebindable |
| Roles, names (from a labels struct with English defaults), keyboard on bands and boundaries | The debug collector, the value store, agent actions |
A SectionsPainter trait, defaults from egui’s Visuals | Saving the layout with the workbench’s |
ToolRow: items (id, icon as an egui::Image or a paint closure, label, tooltip, enabled, checked, busy, separator, submenu), orientation, labels mode, overflow into a More button, roles and names | Toolbars declared as menus, commands, when, keys in tooltips, arguments, list providers, the icon registry, the busy spinner, the toolbars collector |
What a caller gets from egui_stack, sketched:
let out = egui_stack::sections::Sections::new("sessions")
.painter(&my_painter) // default: egui's visuals
.labels(&my_labels) // default: English
.pull_modifiers(Modifiers::COMMAND)
.show(ui, |stack| {
stack.section(Section::new("live", "Live").count(3), |ui| { /* … */ });
});
let tools = egui_stack::toolbar::ToolRow::new("format")
.orientation(Orientation::Horizontal)
.show(ui, &[Tool::new("bold", "Bold").icon(bold_image).checked(true), Tool::separator()]);
if let Some(id) = tools.clicked { /* the caller runs its command */ }
- Benefit: high for egui_stack’s purpose (its stated growth), medium for egui-pop: the widget gets other users and testers, egui-pop keeps less code; sections can later become a container kind of the dock (section 6).
- Cost: medium: a painter trait and a labels struct to cut, the arithmetic moved (egui-pop-model loses a module; layering, ADR 0001), the gallery’s snapshots must not move.
- Risk: medium: two repositories to change in step while sections still evolve (five versions in a week). Mitigation: move only when the behaviour has settled, and keep egui-pop’s tests as the reference (they run against the wrapper unchanged).
6. egui_tiles
egui_tiles
0.18 (MIT OR Apache-2.0, now in the egui_crates workspace) models a
layout as Tiles in a map by TileId, each a pane or a container:
Tabs { children, active }, Linear { children, dir, shares } with
relative weights (n-ary), Grid { children (holes allowed), layout: Auto | Columns(n), col_shares, row_shares }. SimplificationOptions
prune empty and single-child containers, join nested linears, flatten
tabs in tabs. One Behavior trait holds the pane’s UI, titles,
closing (is_tab_closable, on_tab_close -> bool), the whole tab
(tab_ui), tab bar slots (left, trailing, top right), colours and
strokes per part, paint_drag_preview, paint_on_top_of_tile,
resize_stroke, retain_pane, cycle_tabs_with_keyboard, on_edit.
It has no drop veto, no floating windows and no viewports.
Where its model fits egui-pop better than a binary tree:
- n-ary splits with shares. A side area holding three panels one
above the other is two nested binary splits today, whose fractions
interact (moving one sash rescales the other); egui-pop’s sections
already chose VS Code’s model, a sash between neighbours that gives
way in turn. A
Linearwith shares is the natural tree for it, and egui-pop’sNode::Split { ratio, a, b }would becomeSplit { axis, shares, children }. - Sections as a container kind. A
Linearvertical container whose children show title bands and fold is exactly a stack of sections: VS Code lets a view move from a side bar’s stack to the panel’s tabs. With an n-ary tree, egui_stack could offerStack(sections) besideTabsandLinear, and a panel dragged onto a section stack would become a section (sections lists “moved out of the stack” as not done). - Grids fit image work (compare views, a 2×2 of viewports) better than nested halves; useful later, not today.
- Simplification as explicit, named options replaces egui_dock’s
implicit collapse rules, and is what egui-pop’s
readdoes by hand ((Some(n), None) => Some(n),workbench.rs:1597). - Stable ids (
TileId) instead of heap positions make paths stable across edits, so a drag, a focus or a hint can name a node from one frame to the next.
Where egui_dock’s model fits better: windows (surfaces), built-in scroll areas, close and add buttons, the drop overlay’s split preview, and a history of users who know it.
Direction N: borrow the model, keep the API. Grow egui_stack’s tree
toward n-ary Linear nodes with shares and stable node ids, behind the
existing DockState/TabViewer surface, and add a sections container
kind; take SimplificationOptions as named options; credit egui_tiles
in NOTICE and the changelog for each idea or piece of code taken. Do
not adopt a single Behavior trait: keep TabViewer (what a tab is)
apart from DockPainter (how it looks), because egui-pop’s kit and its
panels change for different reasons.
- Benefit: high, long term: sections, areas and docks in one tree.
- Cost: high: the binary heap (
NodeIndexarithmetic,Tree::splitmoving subtrees level by level) runs through the whole crate. - Risk: high: the largest divergence from egui_dock, and its serialized states change (direction S’s versioned value absorbs that).
Directions, ranked
Ranked by benefit for cost, risk last.
| # | Direction | Benefit | Cost | Risk |
|---|---|---|---|---|
| 1 | A Accessibility built in: roles, names, labels struct (2.5) | High: every egui_stack user; removes egui-pop’s after-the-fact naming | Low | Low |
| 2 | V Drop veto by tab and destination, public drag state (2.1, items 1 and 2) | High: removes a documented workaround and the private-id guess | Low | Low |
| 3 | K Keyboard: roving tab focus, plain-arrow splitters, Escape cancels a drag, optional Ctrl+Tab (2.4) | Medium to high: closes keyboard survey items | Low to medium | Low (options keep today’s behaviour) |
| 4 | M Tab menu and close: built-in items optional, public operations, the double on_close fixed (2.2, 2.3) | Medium: lets egui-pop’s tab menu become commands and show close buttons | Low | Low |
| 5 | T DockPainter trait for tabs, bars, separators, drop previews (1) | High: the kit drives every part, less code, narrower and overlapping tabs | Medium | Low to medium |
| 6 | S A versioned plain LayoutTree<T> (4) | Medium | Low to medium | Low |
| 7 | P Sections and a toolbar row as plain-egui cores (5, ADR 0022) | High for egui_stack, medium for egui-pop | Medium | Medium |
| 8 | N n-ary linear nodes with shares, stable ids, a sections container kind (6) | High, long term | High | High |
| 9 | D One dock for the whole workbench, moves through a hook (2.1, item 3); done 2026-11-07 as a DockSpace | Medium: insertion and splits across areas | High | Medium |
| 10 | W OS windows through a host hook, then drops between windows (2.6, 3) | Medium, later | High, partly blocked upstream | Medium |
Recommended order
- In egui_stack, the small changes below (A, V, K, M): each lands alone, with its test, and is offered upstream to egui_dock where it applies.
- egui-pop moves to egui 0.37 (also expected for the default fonts, upstream), then from egui_dock to egui_stack: a rename, then dropping the workarounds A and V remove.
- T, the painter trait; egui-pop’s kit implements it and
paint_tabsgoes (done). - P, sections first (their arithmetic is egui-free and tested; done 2026-11-04, egui_stack 0.22.2), then the toolbar row, once sections’ behaviour has settled.
- S, the layout value, folded into egui-pop’s
layoutdocument version 3. - N, then D, as one redesign of the tree, decided by its own ADR (D
done first, 2026-11-07, as egui_stack’s
DockSpace: no tree redesign needed). - W when eframe can drag between viewports.
First egui_stack changes, issue-sized
Each is one pull request with a test and a changelog entry.
- Context menu Close calls
on_closetwice.leaf.rs:518asks the viewer, then the removal loop asks again (show/mod.rs:104). Push a forced removal once the viewer saidClose. - Tabs have no accessible role or name. Role
Tabwith the title,selectedwhen active, aTabListper bar. - Buttons and separators have no accessible role or name. Close,
add, close-all, collapse, minimise named from a
Labelsstruct with English defaults; separators asSplitterwith value, increment and decrement. TabViewer::drop_allowed(tab, destination) -> DropVerdict, defaultAllow, the refusal’s reason given to the overlay.- Public drag state:
DockArea::dragged_tab(path and pointer), so no caller copies the tab button’s id scheme (leaf.rs:403-407). - Escape cancels a tab drag.
- Plain arrows move a focused separator; Shift a larger step; Enter resets to the default fraction.
DockArea::show_builtin_tab_menu(false): the viewer’s menu alone, without Eject and Close.TabViewer::context_menugets theTabPath, and the built-in actions are publicDockStatemethods (close, eject, focus, move).DockArea::tab_focus(TabFocus::Roving): one Tab stop per bar, arrows, Home and End along it.WindowState::rect()anddragged()are never written (screen_rect,dragged): write them, or remove them.- The width a tab gets: a
DockPainter::tab_widthmeasure (or, before the trait, aTabStyle::paddingfield) so a tab can be narrower than its label plus 16 points (done: both).
Advanced widgets: a survey, and what egui-pop should have
Status: survey (2026-10-12, crates refreshed 2026-11-03). It answers which advanced widgets egui-pop should have, progress bars and spinners first, and whether each one is egui’s built-in, a crate to adopt or wrap, or our own. Each crate’s latest version, its date, the egui version it requires and its licence were read from crates.io on 2026-11-03. egui-pop is on egui 0.36; egui 0.37.0 was released on 2026-10-15, and what it brings and what holds the move back are in sections 2.3 and 2.4.
The first application is a photo editor: a darkroom (image viewport, parameter sliders, curves, scopes), a lighttable (tens of thousands of thumbnails, ratings, labels, tags, filters), a graph of modules, and long background jobs (renders, exports, imports, GPU work).
What decides, as for the rest of egui-pop:
- Values live outside the widget. A widget reads a value from the store or the host and writes through a command (ADR 0009, ADR 0010). Crates that keep their own model (a string queue, their own graph, their own tree) are, at most, drawing helpers.
- Progress comes from the host as events. egui-pop never polls a job. The host publishes events, egui-pop builds a model from them and draws it (ADR 0010).
- Everything can be inspected and driven. Each widget is named for AccessKit, shows up in the debug bridge, and gives the same result in a headless test on every run.
- Theme tokens only. Colours, sizes and motion come from tokens;
reduced motion is a theme setting already (
motion.durationis 0). - No silent no-op (ADR 0003): a widget that cannot show what it was given says so.
1. Catalogues of other libraries
Each line lists only what matters here. The names are the libraries’ own.
| Library | Progress and waiting | Other advanced widgets worth noting |
|---|---|---|
| shadcn/ui (on Radix primitives) | Progress, Spinner, Skeleton, Sonner (toasts with a promise state: loading, then success or error) | Command (palette), Empty, Kbd, Item, ButtonGroup, InputGroup, Resizable, Toggle Group, Hover Card, Data Table (TanStack), Sidebar, Field |
| MUI (Material UI, MUI X) | LinearProgress (determinate, indeterminate, buffer, query), CircularProgress, Skeleton, Backdrop, the loading prop of Button, Snackbar | Rating, Chip, Badge, Stepper, ToggleButtonGroup, Slider (range, marks, vertical), Transfer List; MUI X has DataGrid, TreeView, date pickers and charts |
| Mantine | Progress (sections, striped, animated), RingProgress, SemiCircleProgress, Loader, LoadingOverlay, Skeleton, loading prop on Button, notifications that update from loading to done | SegmentedControl, Switch, Chip, Badge, Pill, TagsInput, Rating, ColorPicker, AngleSlider, RangeSlider, Tree, Stepper, Timeline, Indicator, Spoiler, Kbd |
| Ant Design | Progress (line, circle, dashboard, steps, a success segment), Spin with a delay (shows only after a delay, so there is no flicker), Skeleton, Button loading, message.loading | Segmented, Rate, Tag, Badge, Empty, Result, Steps, Statistic (countdown), Splitter, Tree, TreeSelect, Cascader, Transfer, Tour, Descriptions, Upload (per-file progress) |
| Blueprint (data-dense, desktop-like) | ProgressBar (intent, stripes), Spinner (also determinate, with a value), progress inside a Toast (the documented upload example) | NonIdealState (empty or error state), EditableText, TagInput, Breadcrumbs (collapse into an overflow menu), OverflowList, Tree, Table (virtualized, frozen columns), Omnibar, HotkeysDialog, SegmentedControl, MultiSlider, NumericInput, PanelStack2, MultistepDialog, EntityTitle |
| Fluent UI v9 | ProgressBar (indeterminate when it has no value, thickness, validation state), Spinner (label and its position), Skeleton, MessageBar, Toast | Tag, TagPicker, InteractionTag, Badge, CounterBadge, Rating, SwatchPicker, Tree, FlatTree, DataGrid, Toolbar, SearchBox, InfoLabel, TeachingPopover, Drawer, Nav, Field |
| Carbon (IBM) | ProgressBar (status: active, finished, error; helper text), InlineLoading (inactive, active, finished, error, with a description: for buttons and rows), Loading (overlay or small), SkeletonText, SkeletonPlaceholder; a written loading pattern | ProgressIndicator (a stepper), ContentSwitcher (segmented), Toggle, Tag (dismissible, operational), Notification (inline, toast, actionable), DataTable (batch actions, expandable rows, toolbar search), TreeView, FileUploader |
| libadwaita / GTK4 | GtkProgressBar (fraction, or pulse() for indeterminate), GtkLevelBar (a meter with offsets), AdwSpinner (libadwaita 1.6), AdwToast with a button, AdwBanner | AdwStatusPage (empty state), AdwToggleGroup (segmented, 1.7), AdwSplitButton, rows (AdwSwitchRow, AdwSpinRow, AdwEntryRow, AdwExpanderRow), AdwPreferencesDialog with search, AdwNavigationSplitView, AdwTabView, AdwTabOverview, AdwBottomSheet, AdwWrapBox, AdwShortcutsDialog; GTK’s GtkListView, GtkGridView and GtkColumnView recycle row widgets (virtualized), and GtkScale has marks and a fill level |
| Qt Widgets / QML | QProgressBar (busy when min = max = 0), QProgressDialog (only shows when the operation will last longer than minimumDuration, 4 s by default), QML BusyIndicator, ProgressBar (indeterminate), DelayButton (fills while held); KDE’s KJob and its job tracker gather the jobs of every application in one notification area | QSplitter, QDockWidget, model/view QTreeView and QTableView (virtualized), QDial, QKeySequenceEdit, QUndoView, QCompleter, QColorDialog; QML RangeSlider, Switch, Tumbler, SplitView, TreeView, TableView |
| Dear ImGui | ProgressBar (a negative fraction animates it as indeterminate, since 1.90), no spinner built in; imspinner has dozens | Extensions: ImPlot, ImGuizmo (gizmo, ImSequencer, ImCurveEdit, GraphEditor), imnodes, thedmd’s imgui-node-editor, imgui-knobs, imgui_toggle, ImGuiFileDialog, ImGuiColorTextEdit, imgui_markdown, the curve and gradient editor gists; Tracy’s timeline as the reference for dense timelines |
| JetBrains IDEs | Background tasks in the status bar: a small progress bar and a counter; a click opens the list of tasks, each with cancel (and pause for indexing). A modal task has a “Background” button that moves it to the status bar. A thin indeterminate line under a tool window’s title | Tool windows (dock, float, split), Search Everywhere, the Notifications tool window (history), breadcrumbs, inline hints |
| VS Code | window.withProgress locations: Notification (a toast with a bar and Cancel), Window (a status bar spinner), SourceControl, and a view’s progress (a thin moving line under the view title, and a badge on its activity bar icon); the notification centre keeps a history | The status bar, the quick pick and palette, breadcrumbs, the minimap, peek views, tree views with inline actions, the activity bar with badges |
| Photo applications (the domain’s own references) | Lightroom Classic: an activity area at the top left stacks one bar per running task, each with a cancel cross. Capture One: an Activities window lists the process queue with its history. darktable: a “background jobs” module, one bar per job with cancel (its dt_control_progress API) | Filmstrip, navigator, histogram, curves, colour wheels, star ratings and colour labels on thumbnails, darktable’s bauhaus sliders |
Patterns that come back across libraries:
- Three ways to wait: a spinner (indeterminate), a bar (determinate), a skeleton (the content’s shape). Carbon and Fluent write the rule down: indeterminate when the length is unknown, determinate as soon as it is known.
- Flicker control: Ant’s
Spin delay, Qt’sQProgressDialog::minimumDuration, VS Code’s internal progressdelay, and the web’s “spin delay” idea (a delay before showing, then a minimum time on screen). The thresholds come from Nielsen Norman Group: nothing under about 1 s, a looped indicator from 2 to 10 s, a percent-done bar beyond that. - Busy controls: the button or row that started the work shows it
(MUI, Mantine and Ant
loading, CarbonInlineLoading). A modal can be sent to the background (JetBrains). - Jobs gathered in one place: JetBrains background tasks, KDE’s job tracker, Lightroom’s activity area, Capture One’s Activities, darktable’s background jobs, and the VS Code and Fluent notification centres for the history.
- Data-dense desktop libraries (Blueprint, Qt, GTK, JetBrains) matter more for us than marketing-site kits: tag input, editable text, non-ideal state, virtualized trees and tables, multi-handle sliders, overflow lists.
2. The egui ecosystem
2.1 What egui 0.36 has
egui-pop uses egui 0.36.2 (2026-09-08). The latest release is egui 0.37.0, with eframe, egui_extras and egui_kittest 0.37.0 (2026-10-15); section 2.3 says what it changes for the gaps below.
| Built in | What it does | Gaps for us |
|---|---|---|
ProgressBar | A fraction, text or percentage, fill colour, corner radius. animate(true) pulses the fill and draws a spinning arc at its end. AccessKit role ProgressIndicator, with the percentage as its numeric value | No indeterminate mode: animate decorates a determinate bar. No tone (success, warning, error), no buffer or sections, no reduced motion. It asks for a repaint every frame while animated, and it reads input.time, so a snapshot depends on the clock |
Spinner | An arc spinning on input.time, size and colour, role ProgressIndicator | No label (so an unnamed node in our accessibility check), no delay, no reduced motion. It repaints every frame while visible |
Slider, DragValue | Logarithmic scale, clamping modes, step, trailing fill, a value shown with its prefix and suffix | No soft and hard range, no fine adjustment, no reset, no gradient track, no range (two handles). Own (2026-10-13): egui-pop’s slider family covers them all (see “Sliders” below) |
color_picker, color_edit_button_* | HSV picker, alpha | Not colour-managed; no wheels |
Modal, Popup, tooltips, menus, ComboBox | Already the base of egui-pop’s overlays | (egui-pop’s overlay stack) |
ScrollArea::show_rows, show_viewport | Virtualized scrolling | A grid and its selection are ours |
Scene | A container you can pan and zoom | A starting point for the graph view and the minimap |
Image | Shows a spinner while its loader works | A spinner per thumbnail is noise; we want a placeholder |
selectable_value, toggle_value, Checkbox | The building blocks of a segmented control | A toggle switch exists only as a demo (egui_demo_lib, toggle_switch.rs) |
| egui_extras 0.36.2 | TableBuilder, StripBuilder, DatePickerButton (feature), image loaders, syntax highlighting |
2.2 Crates
Version and date: the latest release on crates.io; egui: the version it requires. A verdict changed on 2026-11-03 says why.
| Crate | Version (date) | egui | Licence | What | Verdict |
|---|---|---|---|---|---|
| egui_plot | 0.38.0 (2026-10-19) | 0.37 | MIT OR Apache-2.0 | Lines, points, bars, boxes, heatmaps; legend, axes, linked axes and cursors, pan, zoom, box zoom | Wrapped for charts (decided 2026-11-05): egui-pop-views’ plot adds the kit’s look, the categorical palette, an accessible summary (egui_plot has none), the hovered point, a time cursor and a collector (plot.md). Not for the scopes, which are images fed by the engine |
| egui_dock | 0.21.1 (2026-08-06) | 0.36 | MIT | Docking, tabs, splits | Adopted, then replaced by egui_stack, its continuation on egui 0.37 (changed 2026-11-03: egui_dock has no release for 0.37; #145). egui-pop’s areas are still docks of their own (see upstream.md) |
| egui_tiles | 0.18.0 (2026-10-19) | 0.37 | MIT OR Apache-2.0 | Rerun’s tiling, now in the rerun-io/egui_crates repository | Not needed next to egui_stack; a source of ideas and code for it, with credit (directions) |
| egui-notify | 0.24.0 (2026-10-30) | 0.37 | MIT | Toasts | Ideas only, now taken: the slide, the corners and the toast’s states are in egui-pop’s toasts, with credit (crates/egui-pop-api/src/toasts.rs, NOTICE). Not a dependency: it keeps a string queue, with no commands and no state to inspect, and 0.24 pulls egui-phosphor from git |
| egui-toast | 0.22.0 (2026-08-08) | 0.36 | MIT | Toasts | Same as egui-notify (ideas only) |
| egui-snarl | 0.12.0 (2026-08-26) | 0.36 | MIT OR Apache-2.0 | Node graph that owns Snarl<T> | Reference for wire and pin interaction; the graph view is our own |
| egui_node_editor | 0.11.0 (2026-08-21) | 0.36 | MIT | Node editor | Too young (few downloads); reference at most |
| egui_graph_edit | 0.9.1 (2026-07-13) | 0.35 | MIT | Node graphs | Same |
| egui_graphs | 0.32.0 (2026-08-31) | 0.36 | MIT | A petgraph viewer | Not an editor |
| egui_ltreeview | 0.10.0 (2026-10-25) | 0.37 | MIT | Tree view: multi-select, keyboard, drag and drop, context menu; the caller keeps the data | Own (decided 2026-10-13, see “Data views” below); the drop zones (before, inside, after) follow its idea |
| egui_table | 0.11.0 (2026-10-19) | 0.37 | MIT OR Apache-2.0 | Rerun’s virtualized table (sticky header, resizable columns), now in rerun-io/egui_crates | Wrapped (decided 2026-10-13): egui-pop-views’ data table |
egui_extras TableBuilder | 0.37.0 (2026-10-15) | 0.37 | MIT OR Apache-2.0 | egui’s own table: rows in view, resizable columns, striped | Skip (2026-10-13): widths only in egui’s memory, no sticky columns |
| egui_virtual_list | 0.13.0 (2026-10-19) | 0.37 | MIT | Virtual list with rows of varying height, measured and cached | Own the thumbnail grid (decided 2026-10-13, see docs/library.md): cells of one size need no measuring, and End must reach the last of 100 000 images at once. Kept as the candidate for lists of rows of varying height (history, logs) |
| egui_infinite_scroll | 0.13.0 (2026-10-19) | 0.37 | MIT | Pages loaded on scroll | Ideas only: our fetches are windowed by the host |
| egui_dnd | 0.18.0 (2026-10-19) | 0.37 | MIT | Reorder by drag and drop, animated | Adopt for reorderable lists (export targets, module order in a stack); the order is written back through a command. Not a dependency yet |
| egui-modal | 0.6.0 (2024-12-21) | 0.30 | MIT | Modals | Dead: egui’s Modal replaces it |
| catppuccin-egui | 5.7.0 (2025-11-15) | 0.26 to 0.33 | MIT | Themes | Stale; our tokens replace it |
| egui_double_slider | 4.0.0 (2026-08-19) | 0.36 | Apache-2.0 only | A range slider | Skip (2026-10-13): ideas only for the range slider (see “Sliders” below) |
| egui_fader | 0.1.2 (2025-06-12) | 0.31 | MIT | An audio fader | Skip (2026-10-13): no soft range or typed entry; the slider turns vertical itself (Slider::vertical, 2026-11-10) |
| egui_knob | 0.6.3 (2026-09-01) | 0.36 | MIT | Knob | Ideas only (2026-11-10): egui-pop’s own knob::Knob shares the slider’s terms, gestures and history, which egui_knob lacks |
| egui_colors | 0.14.0 (2026-10-16) | 0.37 | MIT | 12-step palettes | Theme work only |
| egui_colorgradient | 0.2.3 (2025-07-25) | 0.32 | MIT | Gradient editor | Reference only |
| egui-keyframe | 0.1.0 (2026-02-13) | 0.33 | MIT OR Apache-2.0 | Keyframes and curve editing | Reference for curve handles; too young |
| egui_timeline | 0.5.0 (2026-10-26) | 0.36 | MIT OR Apache-2.0 | Timeline for media (nannou) | Reference only |
| egui_chip | 0.3.1 (2025-11-16) | 0.33 | MIT OR Apache-2.0 | Chips | Too small to depend on; ideas only |
| egui-dropdown / egui_autocomplete | 0.16.0 (2026-09-04) / 15.0.0 (2026-09-06) | 0.36 | MIT | Autocomplete text fields | Ideas for the tag input; our palette’s fuzzy matcher is enough |
| egui-multiselect | 0.8.0 (2026-04-01) | 0.34 (through eframe) | MIT | Multiselect | Skip |
| egui_suspense | 0.14.0 (2026-10-19) | 0.37 | MIT | Loading and error UIs for async data | Ideas only (the loading, error and retry triad); progress comes from the host |
| egui_inbox | 0.14.0 (2026-10-19) | 0.37 | MIT | A channel that wakes egui | The host’s Waker already does this |
| egui-async | 0.8.0 (2026-10-19) | 0.37 | MIT OR Apache-2.0 | Async helpers | Skip: the host owns execution |
| egui_animation | 0.14.0 (2026-10-19) | 0.37 | MIT | Easing and transitions | Optional; motion must follow tokens and reduced motion |
| egui_flex, egui_taffy | 0.9.0 (2026-10-19), 0.16.0 (2026-10-22) | 0.37 | MIT | Flex or CSS layout | Skip for now (wrapping tag lists may want flex) |
| egui-file-dialog | 0.15.0 (2026-08-08) | 0.36 | MIT | File dialog drawn in egui | Skip (changed 2026-11-03: it was to be wrapped as the fallback behind rfd; that fallback is egui-pop’s own in-app picker, Choosing files) |
| egui_json_tree | 0.17.0 (2026-08-15) | 0.36 | MIT OR Apache-2.0 | JSON tree with search | Adopt for the debug bridge and the journal viewer. Not a dependency yet |
| egui_commonmark | 0.26.0 (2026-10-15) | 0.37 | MIT OR Apache-2.0 | Markdown | Adopted (changed 2026-11-03: it was “later”; the viewer’s markdown feature in egui-pop-views uses 0.25, links) |
| egui_logger, egui_tracing | 0.13.0 (2026-10-16), 0.3.0 (2026-04-10) | 0.37, 0.34 | MIT, Unlicense | Log views | Later; the journal viewer is ours |
| egui-phosphor | 0.14.0 (2026-09-10) | 0.36 | MIT OR Apache-2.0 | Icons | Adopted; on egui 0.37 through the egui-pop-phosphor fork until its pull request for 0.37 is released (#146, section 2.4) |
| egui_circular_progress_bar | 2.0.0 (2026-08-19) | 0.36 | GPL-3.0 | Ring progress | Skip: GPL-3.0 cannot go into an MIT library. A ring is a few lines of painting anyway |
| egui-data-table | 0.11.0 (2026-08-01) | 0.35 | non-standard | Editable data table | Skip: non-standard licence, little use |
| re_ui | 0.41.0 (2026-10-28) | 0.37 | MIT OR Apache-2.0 (fonts OFL-1.1, Bitstream Vera) | Rerun’s UI kit: list items, design tokens | Ideas only (too coupled to Rerun) |
What we learn: egui has the primitives (painting, Popup, Modal,
virtual scrolling, Scene, AccessKit) and no advanced widgets that are
maintained. The crates that are maintained and have no model of their
own are egui_dock (now continued as egui_stack), egui_table,
egui_ltreeview, egui_dnd, egui_json_tree and egui-file-dialog. Many
crates followed egui 0.37 within two weeks (egui_table, egui_ltreeview,
egui_dnd); egui_dock, egui-phosphor, egui_json_tree and
egui-file-dialog had not on 2026-11-03. Everything about progress is ours, and is built
(Jobs and progress).
2.3 egui 0.37: what it brings us
Read from egui’s and egui_kittest’s 0.37.0 changelogs (2026-11-03).
Fonts, colour emoji and the fixes egui-pop works around have their own
pages: Fonts, Upstream (each entry says
whether 0.37 removes it), and Scrolling. Two
changes are work the bump itself must do, not options: WidgetType is
replaced by egui::Role (accesskit’s Role), and Id::new is
deprecated (with Id::unique, IdSaltSet and IdSaltMap as the new
ways), while the workspace denies warnings.
| In 0.37 | What it could replace or improve in egui-pop | Follow-up |
|---|---|---|
egui::Role replacing WidgetType | a11y::name (crates/egui-pop-core/src/a11y.rs) takes a WidgetType; about 180 uses across the crates and tests. With the role itself, custom widgets can say Tab, Splitter, Status or Dialog, which WidgetType could not, and the accesskit_node_builder calls that set a role by hand (overlay.rs, the splitter handle) become ordinary | Part of the bump (required) |
Response::accessible_name, Ui::label_inputs_by / Ui::name_inputs | egui-pop-test’s unnamed_interactive and assert_all_named (crates/egui-pop-test/src/lib.rs) read the label or labelled_by from the tree; the gallery pairs labels and values with labelled_by by hand (crates/egui-pop-gallery/src/shell.rs, pages/builtins.rs). label_inputs_by would name a form’s inputs from their row label in one call. egui_kittest 0.37 also fails a test when an input has no name, which overlaps our check (ours covers every interactive role, buttons included, so it stays) | Yes, small: use label_inputs_by in forms and the settings pages; fix what kittest’s new check finds during the bump |
Area::role, named Ui, Area, Popup and Tooltip, better popup, menu, modal and panel trees | Dialogs are an Area of kind Modal (crates/egui-pop-core/src/overlay.rs, the modal area) with no Dialog role; popovers and hover cards (overlay.rs, hover_card.rs) and the toast area (crates/egui-pop-api/src/toasts.rs) neither. A screen reader would announce a dialog with its title | Yes: Dialog with the title for dialogs, Group or Tooltip for popovers, after the bump |
StyleProvider (feature experimental): per-widget styles chosen by class | The kits (crates/egui-pop-core/src/kit/, kit.md) paint egui-pop’s own widgets from tokens, while egui’s built-in widgets only get the global Visuals from theme::visuals_with (crates/egui-pop-core/src/theme.rs). A provider could give Button, Checkbox, TextEdit and DragValue their kit parts by class | Watch: experimental, behind a feature, its API may change; read it again at 0.38 |
RangeSlider | egui-pop owns its range slider (crates/egui-pop-core/src/slider/range.rs): soft and hard ranges, typed entry, fine adjustment, steps and hooks, none of which egui’s has | No: keep ours; compare its AccessKit output for ideas |
CompletionPopup (completion under a TextEdit) | The tag input’s completion (crates/egui-pop-views/src/library/tags.rs) and the palette (crates/egui-pop-api/src/palette.rs) use egui-pop’s fuzzy matcher and overlay stack; the code editors’ assist (crates/egui-pop-editors/src/assist.rs) does not use TextEdit | No for now: ours is placed, inspected and driven like every overlay. Ideas only |
kittest videos (feature video, KITTEST_RECORD=1, ffmpeg) | Interaction tests are read from their code and snapshots (testing); a video of a failing keyboard walk (crates/egui-pop-gallery/tests/it/keyboard_walk.rs) or of a drag would say more | Yes, small: document it in testing.md; never on in CI by default |
Kinetic scrolling with a rubber band (KineticScrollStyle) | Already planned at the bump: off under reduced motion, no bounce on panels of sliders (Scrolling, item 14); theme.rs already turns egui’s scroll animation off for reduced motion | Part of the bump (planned) |
InputState::scroll_source (MouseWheelSource: wheel, trackpad, momentum) | pointer::wheel_pointer (crates/egui-pop-core/src/pointer.rs) guesses a mouse from a scroll in lines and a trackpad from one in points, with a WheelDevice setting to override. egui knows the source only on macOS (and winit’s pan gestures); elsewhere it says Unknown, so the guess stays. Sliders and the viewport could ignore Momentum, so a flick does not keep changing a value after the fingers lift | Yes, small: use the source when known, ignore momentum on value widgets |
Id::unique, IdSaltSet, IdSaltMap; Id::new deprecated | About 200 Id::new calls in 85 files, most for state slots and areas. Id::unique makes an id that cannot collide, which suits the overlay stack and the debug bridge’s handles | Part of the bump (required) |
| Galley cache shared across viewports | Panels floated into OS windows (crates/egui-pop-api/src/workbench.rs, show_viewport_immediate) no longer evict each other’s laid-out text | Nothing to do: free with the bump |
Also of note: Event::PasteImage for the clipboard (clipboard),
KeyboardShortcut::conflicts_with_text_editing next to the focus rules of
the key dispatcher, Context::set_repaint_observer, which could tell the debug
bridge who asked for a frame, and HarnessBuilder::with_context_setup for the test
kit’s themed harness.
2.4 What blocks the move to egui 0.37
Tracked in #24.
- egui_dock 0.21.1 requires egui 0.36 and has no release for 0.37. egui-pop moves to egui_stack instead: egui_dock’s continuation (MIT, its history kept), on egui 0.37, released on crates.io as 0.22 (directions).
- egui-phosphor 0.14.0 requires egui 0.36. Its upstream pull request
(amPerl/egui-phosphor#49)
moves it to 0.37; until it is released, egui-pop depends on
egui-pop-phosphor0.15, a fork carrying that pull request, published on crates.io under its own name with its library still namedegui_phosphor, so no code changes (#146). It goes back to egui-phosphor once upstream releases. - Nothing else in the tree holds it back: egui_table 0.11 and egui_commonmark 0.26 already require egui 0.37, so both move with the bump.
Data views: what was checked (2026-10-13)
The tree, the list and the table were checked against what egui-pop’s views must do: branches loaded on demand and asynchronously, edits from the application at any time, keyboard navigation with type-ahead, drag and drop gated by a step, rename in place, AccessKit names, 100 000 rows, and every moment a step.
- egui_ltreeview 0.9 (own). Its builder is fed every open node on every pass (fast, but the caller walks the whole open tree each frame), it has no loading state, no rename, no Home/End or type-ahead, reads its arrow keys directly from the input, and gives its rows no AccessKit names. Wrapping it would leave most of the work outside it; the tree is egui-pop’s own, a cache flattened once per change and drawn from a scroll area that builds only the rows in view.
- egui_table 0.10 (wrap). Rows in view only, a sticky header, resizable columns, horizontal scrolling and prefetch hints; it leaves selection, sorting and keys to its delegate, and keeps the widths in egui’s memory, where the wrapper writes the store’s widths and reads back the result of a resize. Two things are compensated: the resize handles get names, and a row is drawn twice when a sticky region is empty (the empty one is skipped).
- egui_extras
TableBuilder(skip). Virtualised and resizable, but its widths can only be reset, not set, and it has no sticky columns: egui_table does more for the same weight.
Sliders: what was checked (2026-10-13)
The slider family was checked against darktable’s bauhaus slider, the reference: the label and the value inside one compact row, a soft range for dragging and a hard range for typed values, a typed value or expression, fine and coarse modifiers, a double click back to the default, a quad button (a colour picker or a toggle), a wheel that scrolls the panel unless the slider has the focus, and a gradient track for hue and temperature; plus a range (two thumbs) and a logarithmic bar, AccessKit roles and values, and every finished change a step.
- egui
SliderandDragValue(own).Sliderhas a logarithmic scale, steps, clamping and AccessKit (role, range, step, increment and decrement);DragValuehas typed entry and drag. Neither has a soft and a hard range, a label inside the bar, fine adjustment by modifier, a reset, a quad button, a gradient, two thumbs, a wheel that leaves the panel alone, or a hook to veto or redirect a change. Wrapping them would mean replacing their input handling and their painting: egui-pop’s slider is its own, and keeps egui’s AccessKit properties (range, step, increment, decrement, set value). - egui_double_slider 4.0 (skip). A range slider with two handles and a filled span, Apache-2.0 only, with no soft range, typed entry or hook. The span drawn between the thumbs is the idea kept; none of its code is used.
- egui_fader 0.1 (skip). A vertical audio fader.
- Expression evaluators (own). A typed value takes
+ - * / ^, parentheses andx(the current value), in either decimal separator. evalexpr is AGPL-3.0 in its current releases and does far more; meval (0.2, 2017) is unmaintained. A small parser of about 150 lines is egui-pop’s own.
Inputs and forms: what was checked (2026-10-14)
The inputs were checked against what desktop and web toolkits put
around a field (shadcn/ui’s InputGroup and Field, Fluent’s
SearchBox and Field, Blueprint’s InputGroup and NumericInput,
Carbon’s text input states, GTK’s entry icons, Qt’s QLineEdit clear
button): a placeholder; leading and trailing icons, prefix, suffix and
unit; a clear button; attached buttons, a dropdown and a split button;
one state model for every field (modified, required, invalid with a
message, disabled with a reason, read-only, pending) drawn from tokens
with an icon per state, given to AccessKit and to agents; Tab order by
reading order, explicit indices and groups, scopes cycling in a modal,
F6 between panels. Licences are MIT or Apache-2.0 unless said; the
versions, their dates and the egui each requires were refreshed on
2026-11-03, and no decision changed.
| Crate | Version (date), licence, egui | What it has | Decision |
|---|---|---|---|
egui’s TextEdit | 0.36 (0.37.0 released 2026-10-15), MIT OR Apache-2.0 | The field: editing, selection, undo, IME, a hint text (AccessKit placeholder), its own prefix and suffix, a frame it can drop | Wrap: it is the field inside the decorated input, without its frame; the slots, buttons and states are drawn around it |
| egui’s focus | 0.36 | Tab in drawing order; a modal layer keeps the focus inside it; scroll_to_me for a widget to call, reaching the innermost scroll area only | Own the order on top: reading order, indices and groups per scope, F6; egui’s order stays for widgets outside a scope. Own the focus coming into view and keeping its place, in the focus plugin (Tab order) |
| egui_form | 0.11.0 (2026-10-19), MIT, egui 0.37 | Validation through garde or validator: a field wrapper turning red with its message after it loses the focus, and the focus sent to the first invalid field on submit | Ideas for the formal form layout (errors after leaving a field, focus to the first error); its validation reports stay the application’s, and it has no required or disabled state, no tokens, no Tab order |
| egui-dropdown | 0.16.0 (2026-09-04), MIT, egui 0.36 | A text box with a list of matches under it | Skip: the dropdown chevron opens the input’s choices; matching as one types is the tag input’s and the palette’s (the fuzzy matcher) |
| egui_autocomplete | 15.0.0 (2026-09-06), MIT, egui 0.36 | Completion under a text box | Skip, for the same reason |
| egui-typed-input | 0.1.3 (2026-03-11), MIT OR Apache-2.0, egui 0.32 to 0.33 | Parsed text inputs that refuse what does not parse | Ideas only (an older egui); a number field reads what a slider’s typed entry reads |
| egui-probe, egui_struct, egui_field_editor | 0.13.0 (2026-08-26), MIT OR Apache-2.0, egui 0.36; 0.4.2 (2024-07-09), MIT, egui 0.21; 0.7.0 (2026-10-20), MIT, egui 0.37 | Forms derived from structs | Skip: forms come from value descriptors (as the Form dialog) |
| kylig-ui, functora-egui, egui-antd | 0.9.0 (2026-11-03), 0.2.0 (2026-10-19), 0.1.2 (2026-05-05); MIT; egui 0.36, 0.36, 0.34 | Kits with inputs, selects and buttons in their own style | Skip: young, styled outside the tokens, without field states or AccessKit for them |
| egui-modal | 0.6.0 (2024-12-21), MIT, egui 0.30 | Modals | Dead (as in section 2.2): egui’s Modal keeps the focus in its layer |
| egui_path_picker | 0.2.0 (2025-09-02), GPL-3.0-only, egui 0.32 | A path field with a browse button | Skip: GPL cannot go into an MIT library; the path input with an attached Browse button covers it |
Decision: own the decorated input, the field states and the Tab
order, around egui’s TextEdit; no dependency is added. No code was
taken from any of them.
Image tools: what was checked (2026-10-13)
The image tools were checked against what photo editors have: a histogram drawn from the application’s bins with clipping markers and a drag handed back (darktable drags the exposure on it); a curve editor whose spline is the application’s, with points added, moved and deleted, keys, and the targeted adjustment (a value picked in the image); lift, gamma and gain wheels and a hue and saturation picker with a luminance slider; a zoom control and a navigator on the viewport’s own state; AccessKit roles and values, and every finished change a step. Versions, dates and egui requirements refreshed on 2026-11-03; no decision changed.
| Crate | Version (date), licence, egui | What it has | Decision |
|---|---|---|---|
| egui_plot | 0.38.0 (2026-10-19), MIT OR Apache-2.0, egui 0.37 | Plots: lines, bar charts, its own axes, grid, legend, pan and zoom, box zoom | Own the histogram: a plot widget brings axes and its own pan and zoom, while the histogram is a compact strip whose drag belongs to the application; filling the bins takes a mesh of a few dozen lines (kept from the first histogram) |
| egui’s colour picker | egui 0.36, MIT OR Apache-2.0 | A saturation and value square with a hue bar (color_picker_hsva_2d), colour buttons | Own the wheels: no wheel, no relative drag around a neutral centre, no hook; the swatch button stays egui’s |
| egui_oklch_color_picker | 0.1.0 (2026-07-28), MIT, egui 0.33 | An OKLCH picker | Skip: one release, an older egui, no grading wheels |
| egui-keyframe | 0.1.0 (2026-02-13), MIT OR Apache-2.0, egui 0.33 | Keyframes and animation curves on a timeline | Skip: curves of time, not tone curves; no application spline, no pick |
| egui-colorgradient | 0.2.3 (2025-07-25), MIT, egui 0.32 | A gradient editor (stops along a bar) | Skip: the slider’s gradient track covers what is needed |
| egui_minimap | 0.4.0 (2026-07-25), MIT OR Apache-2.0, egui 0.35 | A scrolling minimap of rows (text, hex bytes) | Skip: not an image navigator; the navigator draws the application’s proxy and shares the viewport’s state |
| rsplot | 0.6.1 (2026-10-17), MIT OR Apache-2.0, egui 0.36 | Scientific plots on wgpu | Skip: far more than a histogram (it has caught up with egui 0.36, so its egui is no longer a reason) |
No code was taken from any of them. The curve’s default spline, a monotone cubic, follows Fritsch and Carlson’s published method.
3. Progress and waiting: design notes
3.1 Where progress comes from
egui-pop does not run jobs. The host publishes events on its journal
(ADR 0010), and an L1 model with no egui (egui-pop-model::jobs) folds
them into job states. Proposed events, which a host may map from its
own bus:
| Event | Data |
|---|---|
job.started | id, title, kind (icon role), source, parent (for a batch), total (optional: no total means indeterminate), cancellable, pausable, cause (the command that started it) |
job.progress | id, done (and a new total if it changed), item (the current item’s name), phase (decode, process, encode, write), buffered (optional, MUI’s buffer) |
job.item_failed | id, item, error (the job goes on; it counts the failures) |
job.paused, job.resumed, job.cancelling | id |
job.finished | id, outcome (done, failed, cancelled), error, actions (commands such as “Show in folder”, “Open in lighttable”) |
- The model, not the widget, holds the state. Each widget is a view
of a
JobId. The model coalesces progress per frame: a thousandjob.progressevents in a frame are one repaint. It readsHost::since(seq)after eachWakercall and never polls the host on a timer. - Cancel, pause and retry are commands (
job.cancel {id},job.pause,job.retry) sent to the host. A command that waits for its result greys out like any other, and the job shows “cancelling” until the host confirms. - ETA and rate are computed in the model with an exponential moving
average over the
donetimestamps. They are not shown before about 3 s, and not while the rate is unstable (“about 2 min”, not “1 min 57 s”). The clock is injected, so tests can fix it. - “Wait until idle” (a Helios rule): the model answers “are there
running jobs, which ones”, and the debug bridge gets a
jobscollector, so an agent can wait on it and see what is running. - A job with no events for a long time (a timeout the host declares) is shown as “not responding”, never as frozen at 40%.
3.2 Determinate and indeterminate
- Indeterminate while
totalis unknown; determinate as soon as it is known, and never back to indeterminate (Carbon’s rule). If the total grows (the import found more files), the bar may go back, and the text says why (“312 of 1,204, still scanning”). - A real indeterminate bar: a segment travelling along the track (MUI,
Fluent, GTK
pulse), not egui’s pulsing fill. - Tones: running (accent), paused (muted), done (success, then fades out), failed (danger, stays), done with failures (warning: “340 exported, 3 failed”).
- Sizes: a thin line (2 px, under a panel title or at the top of the viewport, as JetBrains and VS Code do), a standard bar, a bar with a label and text (title, n of m, ETA).
3.3 Where progress shows
- In the control that started it (Carbon
InlineLoading, MUIloading). A button bound to a command shows the command’s running state: after the delay, a small spinner replaces its icon, its width does not change, and the label stays readable (a screen reader keeps the name). The failure shows on the button, as menus do already. - In a row (the queue panel, export targets, a thumbnail): a small ring or a thin bar inside the row, with the state as text.
- In the status bar: one summary for all jobs (“3 jobs, 42%”, with a thin bar for the overall progress). A click opens the jobs centre as a popover, as JetBrains does.
- In a toast: a job started by the user that takes longer than a few seconds can become a toast with a bar and Cancel (VS Code’s Notification location). It is still the same job in the model, and closing the toast does not cancel it.
- On the viewport: a delayed “working” overlay that never blocks
(darktable’s “working…” in the centre, Mantine’s
LoadingOverlay), or better a thin line along the top while the image recomputes. The old image stays visible until the new one arrives. - Later, outside the window: taskbar or dock progress (Windows
ITaskbarList3, the macOS dock, Unity’sLauncherEntryon Linux docks) and a system notification when a long job ends while the window is not focused. winit offers neither, so this is platform code.
3.4 The jobs centre
A panel (dockable, like any other) and the same content in the status bar’s popover:
- Running: title, icon by kind, a bar (stacked for a batch), “n of m”, the current item, the phase, the ETA, buttons for pause, cancel and “show details”. A batch’s children fold under it.
- Queued: with the position in the queue, and reordering if the host allows it.
- History: finished jobs with their outcome, their duration and their result actions (commands); errors stay until dismissed; “clear finished”. It is kept for the session, and the host may keep more.
- Errors per item: “3 failed” opens the list (item, error, retry this one).
- Filters: by kind (export, import, render, GPU) and by source (the user, an agent, a schedule). An agent’s job carries its origin like any other write.
- References: JetBrains’ background tasks, KDE’s job tracker, Lightroom’s activity area, Capture One’s Activities, darktable’s background jobs module.
3.5 Batches: stacked progress
- One bar for the batch (n of m) with sections for done, failed and
skipped (Mantine
Progresssections, Ant’s success segment). An optional second, thinner bar shows the current item when items are long (a 100 MP render). The text gives the current item’s name. - Phases (decode, process, encode, write) are text, not more bars. Nested bars beyond two levels confuse users.
- Concurrency: with 4 items at once, “n of m” counts finished items, and the details list the items in progress.
3.6 Delayed spinner, minimum duration
- Show nothing before 300 ms (configurable token,
motion.progress.delay). Most commands return before that, and a flash of spinner reads as a glitch. - Once shown, keep it at least 500 ms (
motion.progress.min), so it does not flash off. - A determinate bar after about 1 s if a total is known; a modal operation offers “Run in background” after about 2 s (JetBrains).
- The delay starts from the job’s or command’s start time in the model, not from when the widget was first drawn, so a panel opened midway shows the right state at once.
- The delay needs no timer thread: the widget asks for
request_repaint_after(remaining)once, then draws on the next frame.
3.7 Skeletons and placeholders
- Skeleton (grey shapes in the content’s layout) for panels that fill progressively: metadata, the queue panel’s rows, a module’s parameters while its manifest loads. This follows pitfall 20 (a panel opens in one frame and fills progressively).
- Not for thumbnails: use what is already known (the raw’s embedded preview, a thumbhash, the last cached thumbnail, or a flat tile in the image’s average colour), then the real thumbnail. A grid of shimmering tiles is noise.
- Skeletons do not shimmer when motion is reduced, and they do not shimmer in tests.
3.8 Accessibility
- Role
ProgressIndicator, with a numeric value and a range (0 tototal, or 0 to 100) for a determinate bar, and no value for an indeterminate one. egui’sProgressBarsets the percentage but no range; our widget sets both. - A name: “Exporting 340 images”. The value text gives “12 of 340, about 2 minutes left”.
- The region being refreshed gets AccessKit’s busy flag while a skeleton or overlay stands in for it.
- Announcements, sparingly, through egui-pop’s announcer (polite live region): when a job starts after the delay, when it finishes or fails, and never for each percent. At most one progress announcement every 10 s, and only on request.
- Cancel buttons are named with the job (“Cancel export of 340 images”). The jobs centre is a list with keyboard navigation.
- Colour is never the only signal: the state is in the text too (“failed”, “paused”).
3.9 Reduced motion and repaint cost
- Reduced motion (
motion.durationis 0): spinners become a static “busy” icon (Phosphorhourglassorcircle-notch) or a slow 2 Hz step, indeterminate bars become a striped static track, skeletons do not shimmer, and toasts do not slide. - An animated widget repaints the whole frame. Limit it: an animation
runs only while the indicator is visible and the window is focused;
otherwise
request_repaint_after(250 ms). An event-driven bar repaints only when the host wakes the interface.
3.10 Deterministic headless tests
- Animations read an egui-pop motion clock (a service), not
input.timedirectly. Tests freeze it, step it, or set “no motion”, so snapshots are the same on every run. In a kittest harness,input.timemoves withstep_dt, which is deterministic but couples snapshots to the number of frames. - The delay and minimum duration use the same clock, so a test can say “advance 299 ms: no spinner; 301 ms: spinner”.
- A fake host (
egui-pop-test) publishes scriptedjob.*events: a test drives a job from start to failure without threads. - The
jobsdebug collector lets a test or an agent assert on the model, not on pixels.
4. Prioritized list
Must = Helios needs it soon (the shell, the lighttable, the first darkroom, jobs). Useful = next, when the surface that needs it comes. Later = a real need, but not soon. Skip = not worth it.
“Own” = written in egui-pop on egui primitives; “wrap” = a crate behind an egui-pop widget bound to values and commands; “adopt” = used as it is; “built-in” = egui as it is, styled by tokens.
Must
| Widget | What it is | Others | egui status | Helios use | Notes |
|---|---|---|---|---|---|
| Progress bar | Determinate, indeterminate (a moving segment), tones, sizes (line, bar, labelled), sections for done, failed and skipped | MUI LinearProgress, Mantine Progress, Ant Progress, Blueprint ProgressBar, Fluent ProgressBar, Carbon ProgressBar, GtkProgressBar, QProgressBar | Built-in lacks indeterminate, tones, sections, a range for AccessKit and reduced motion: own (about 200 lines) | Exports, imports, renders, the status bar, rows | Reads a JobId or a plain fraction; motion clock; tokens progress.* |
| Spinner / busy indicator | Indeterminate, small, with a label, a delay and a minimum duration | shadcn Spinner, MUI CircularProgress, Mantine Loader, Ant Spin delay, Fluent Spinner, AdwSpinner, QML BusyIndicator, imspinner | Built-in has no label, no delay, no reduced motion: own, painting like egui’s | Buttons, rows, the viewport, panels | 300 ms delay, 500 ms minimum (tokens); static under reduced motion |
| Jobs model and jobs centre | Jobs folded from host events; a status bar summary, a popover, a panel and the history | JetBrains background tasks, VS Code notifications and progress, KDE job tracker, Lightroom activity area, Capture One Activities, darktable background jobs | None: own (model in L1, views in L3, a jobs debug collector) | Every background job is named, cancellable and visible (Helios rule); “wait until idle” | The centre of this survey; section 3 |
| Busy state of a command-bound control | A button or row showing that its command runs, then its outcome | Carbon InlineLoading, MUI/Mantine/Ant loading, QML DelayButton | Own, on the command running state egui-pop already tracks | “Export”, “Import”, “Apply style” buttons | Width stable, name kept, failure on hover |
| Toast with progress and actions | The existing toast with a bar, Cancel and result actions | VS Code notifications with progress, Sonner promise toasts, Blueprint toast progress, AdwToast | Own (toasts exist in Helios; move them to egui-pop) | “Export finished: Show in folder” | A view of a job; closing it does not cancel the job |
| Status bar items | Declared items (text, icon, progress, a command on click) placed left or right | VS Code status bar, JetBrains widgets | Own (a zone with declared items) | Job summary, profile, zoom, selection count | Needed by the jobs centre |
| Empty state | An icon, a sentence, an action (a command) | Blueprint NonIdealState, AdwStatusPage, Ant Empty and Result, shadcn Empty | Own (small) | Empty queue panel, empty collection, no module selected | Also covers error with Retry (the fault boundary card already exists) |
| Slider family | darktable-style slider (label in the bar, soft and hard range, fine adjustment, reset, typed entry, gradient track), range slider (two handles), logarithmic | darktable bauhaus, Blueprint MultiSlider, MUI and Mantine range Slider, GtkScale marks, egui_double_slider | egui Slider has logarithmic only: own (decided 2026-10-13: egui_pop_core::slider) | All module parameters; range filters (ISO, date, focal length) | Wheel only when focused or with a modifier (pitfall 7); a gradient track for hue and temperature |
| Virtualized thumbnail grid | A grid of tens of thousands of cells, selection (click, Shift, Ctrl, rubber band), keyboard, placeholders, cell overlays | GtkGridView, Qt QListView icon mode, MUI X DataGrid virtualization | Own (done: egui-pop-views library, docs/library.md) | The lighttable, the filmstrip | Placeholders, not spinners; the host fetches windows |
| Rating stars and colour labels | 0 to 5 stars, reject; five colour labels, toggled | MUI and Mantine Rating, Ant Rate, Fluent Rating; Lightroom and darktable thumbnails | Own (done: docs/library.md) | The lighttable, the darkroom | Keys 0 to 5 and F1 to F5 come from the keymap; labels need a shape or text besides colour |
| Tag chip and tag input | Chips (dismissible, selectable) and a field that adds tags with completion | Blueprint TagInput, Mantine TagsInput and Pill, Fluent TagPicker, Carbon Tag, Ant Tag | Own (done: docs/library.md); the completion uses egui-pop’s fuzzy matcher | Keywords, filters, collections | Wraps onto several lines; hierarchical tags (`place |
| Search field with filters | A text field with chips for active filters, a clear button and a menu of filters | VS Code search and filter boxes, Fluent SearchBox, Carbon table toolbar search | Own (done: docs/library.md), on TextEdit | Lighttable filters, the panel and setting search | Its keys go through the focus rules (no shortcut fired while typing) |
| Segmented control and toggle switch | Mutually exclusive options in one row; an on/off switch | Mantine SegmentedControl, Ant Segmented, Blueprint SegmentedControl, AdwToggleGroup, Carbon ContentSwitcher; MUI and Mantine Switch, AdwSwitchRow | Own (done: widgets::Segmented and widgets::Switch, docs/kit.md) | View modes, module blend modes, settings | Role radio group for the segmented control, switch for the toggle |
| Tree view | Expand and collapse, multi-select, keyboard, drag and drop, context menu, lazy children | Blueprint Tree, Fluent Tree, Carbon TreeView, MUI X TreeView, QTreeView | Own (done: egui-pop-views, docs/tree.md) | Folders, collections, tag hierarchy, the graph’s outline | Lazy children come from the host |
| Data table | Virtualized, sortable, resizable columns, sticky header | Blueprint Table, MUI X DataGrid, Carbon DataTable, Fluent DataGrid | Wrap egui_table (done: egui-pop-views, docs/table.md) | Metadata, the queue panel, the history of jobs | Sorting and widths are values; selection by key |
| Dock, split panes and tabs | Dockable panels, splits, editor tabs | JetBrains tool windows, VS Code, QDockWidget, AdwTabView, shadcn Resizable, Ant Splitter | Adopt egui_dock (decided), then its continuation egui_stack with egui 0.37 (#145) | The whole shell | Drop veto worked around (see upstream.md) |
| Histogram | Draws supplied bins (per channel, log or linear), clipping markers | Lightroom, darktable, Capture One | Own, done (viewport::histogram, clipping and drag 2026-10-13) | The darkroom, the import preview | Data from the host; egui-pop only draws |
| Node graph editor | Nodes with headers, pins, wires, semantic zoom, stacks | imgui-node-editor, imnodes, egui-snarl | Own (decided), snarl as reference | The graph view | A large item; the header shows the job state of each node (states and badges above) |
Useful
| Widget | What it is | Others | egui status | Helios use | Notes |
|---|---|---|---|---|---|
| Skeleton | Grey shapes standing in for content | MUI, Mantine, Ant, Fluent Skeleton; Carbon SkeletonText | Own (small) | Metadata and queue panels, module parameters while loading | Not for thumbnails (section 3.7); no shimmer in tests |
| Badge and counter | A small count or dot on an icon, tab or node | MUI and Mantine Badge, Mantine Indicator, Fluent CounterBadge, the VS Code activity bar | Own (small) | A stack’s +3, queue counts, the jobs count on the status bar | Never colour only |
| Ring progress | A small circular determinate progress | MUI CircularProgress, Mantine RingProgress, Ant Progress circle, Blueprint determinate Spinner | Own (do not use the GPL crate) | Per-thumbnail export or render state, node headers | 12 to 16 px |
| Meter / level bar | A value against thresholds (not progress) | GtkLevelBar, Mantine Progress sections | Own, sharing the bar’s painting | Disk space, GPU memory, cache use | Role meter, not progress |
| Viewport busy overlay | A delayed, non-blocking “working” mark over a surface | Mantine LoadingOverlay, Carbon Loading, darktable’s “working…” | Own | The darkroom while the pipeline recomputes | Old image stays; a thin line rather than a veil |
| Popover, hover card, rich tooltip | Anchored floating content, with or without interaction | Radix Popover and HoverCard, Blueprint Popover, Fluent TeachingPopover | Built-in Popup and tooltips; own layer on egui-pop’s overlay stack (exists) | Pixel readout, node details, a job’s details | Delay and placement tokens |
| Inline editable label | Text that becomes a field on double click or F2 | Blueprint EditableText | Own (small) | Rename presets, nodes, tabs, collections | Enter commits, Escape cancels, through a command |
| Breadcrumbs | A path with an overflow menu | Blueprint Breadcrumbs, Ant Breadcrumb, VS Code breadcrumbs | Own | Folder paths, macro nesting in the graph | Collapse in the middle when too long (Blueprint OverflowList) |
| Zoom control | Fit, fill, 100%, steps, a typed percentage | Every image and graph editor | Own | Viewport, graph | “100%” is one image pixel per physical pixel (pitfall 10) |
| Navigator / minimap | A small view of the whole with the visible rectangle | Lightroom navigator, darktable navigation, VS Code minimap, node editor minimaps | Own, done for images (viewport::navigator, 2026-10-13); the graph’s later | Darkroom, graph | |
| Filmstrip | A one-row strip of thumbnails | Lightroom, darktable, Capture One | Own (done: the thumbnail grid with one row, docs/library.md) | Darkroom | Shares selection with the lighttable |
| Curve editor | Control points, spline, per channel, a histogram behind | darktable tone curve and rgb curve, ImGuizmo ImCurveEdit | Own, done (viewport::curve, 2026-10-13) | Tone and RGB curves | Each point is a value; one drag is one undo step |
| Colour wheels and picker | Hue-chroma wheels with a lightness slider; a swatch picker | darktable colour balance rgb, Lightroom colour grading, Fluent SwatchPicker, Mantine ColorPicker | Built-in picker for swatches; own wheels, done (viewport::wheel, 2026-10-13) | Colour grading; labels and theme work | Colour-managed display through the host’s display transform |
| Reorderable list | Drag to reorder with keyboard alternatives | Mantine and Ant sortable lists, egui_dnd | Adopt egui_dnd | Export targets, a module stack, presets | The new order goes out as a command; Alt+Up and Alt+Down as keys |
| Split button | A main action and a menu of variants | AdwSplitButton, Fluent and Ant dropdown buttons | Own on egui menus | “Export” with its presets | Entries are commands |
| Key display | Keys drawn as caps | shadcn and Mantine Kbd, Blueprint HotkeysDialog | Own (small; menus and the palette show keys already) | Menus, the palette, tips, a shortcuts sheet | Text from the keymap, never typed by hand |
| JSON tree | A collapsible view of structured data | egui_json_tree | Adopt egui_json_tree | The debug bridge, the event journal, inspect output | |
| Virtual list (variable rows) | A long list whose rows differ in height | GtkListView, egui_virtual_list | Adopt egui_virtual_list, or our own if it gets in the way | History stack, log, journal |
Later
| Widget | What it is | Others | egui status | Helios use |
|---|---|---|---|---|
| Stepper / wizard | Numbered steps of a long form | MUI Stepper, Ant Steps, Carbon ProgressIndicator, Blueprint MultistepDialog | Own, on the normalized Form dialog | Import with options, first run, export setup |
| Date picker and range | Calendar, range of dates | MUI X date pickers, egui_extras DatePickerButton | Wrap egui_extras | Date filters |
| Timeline | Images or events over time, zoomable | darktable lighttable timeline, Tracy, egui_timeline | Own | Browse by capture date; job history over time |
| Gradient editor | Stops on a track | ImGui gradient gists, egui_colorgradient | Own | Gradient masks, theme work |
| Guided tour, teaching popover | Steps that point at parts of the interface | Ant Tour, Fluent TeachingPopover | Own on overlays | Tips (a Helios surface) |
| Markdown view | Rich text for help | egui_commonmark | Adopted (the viewer’s markdown feature, links) | Help, tips, release notes |
| Log view | Filterable log lines | egui_logger, egui_tracing | Own on the virtual list | Diagnostics |
| Taskbar and dock progress, system notifications | Outside the window | Windows ITaskbarList3, the macOS dock, Unity LauncherEntry | Platform code (winit has none) | Long exports while the window is hidden |
| Shortcut editor | Captures a key chord | QKeySequenceEdit, VS Code keybindings editor | Own, on the keymap model | Keymap settings |
| Transform gizmo, handles | Handles on image overlays | ImGuizmo | Own, with the viewport’s overlays (decided) | Crop, masks |
Skip
| Widget | Why |
|---|---|
| Carousel, speed dial, floating action button, watermark, QR code, transfer list, cascader, statistic and countdown | Web and mobile patterns with no use here |
| Pull to refresh, infinite scroll by pages | The host windows the data; there is no “refresh” gesture on desktop |
| egui_circular_progress_bar | GPL-3.0, not usable in an MIT library |
| egui-modal, catppuccin-egui, egui-aesthetix | Dead or stuck on old egui |
| Third-party toast crates as dependencies | String queues with no commands or inspectable state (ideas only) |
| A generic form-from-struct crate (egui-probe, egui_struct) | Forms come from value descriptors |
5. Suggested order for progress work
egui-pop-model::jobs: the job events, the fold, ETA with an injected clock, a fake host inegui-pop-test. No egui.- The motion clock service and the tokens
motion.progress.delayandmotion.progress.min. - Progress bar, spinner (delayed), ring and meter, sharing one painting module; gallery page “Progress” with every state, every theme and reduced motion.
- Busy state on command-bound buttons; status bar items with the job summary.
- The jobs centre (popover and panel) and the toast with progress.
- Skeleton and empty state, used by the queue panel.
Each step: AccessKit names and ranges checked by egui-pop-test, a
jobs debug collector, snapshots per theme with motion frozen.
Done (2026-10-13), as described in Jobs and progress:
the tokens are named motion.spinner.delay and motion.spinner.min;
every job carries an estimated overall percentage (steps and child jobs
rolled up, refined by the jobs.estimate step); each job of the jobs
centre opens a log console, a pseudo-terminal when egui-pop-editors
provides it. Not yet: queued jobs, “not responding”, taskbar progress,
the viewport’s busy overlay, announcements of a job’s start and end.
6. Dialogs
Decided on 2026-10-13, built in egui_pop::api::dialogs.
The default: no header band and no ✕. A dialog is its title, its
content and its footer. The way out is the Cancel button and Escape;
an acknowledgement (Info) has its own Close button.
Why.
- The desktop convention. Desktop dialogs that ask something end
with their buttons: in the classic Mac OS guidelines, modal dialog
boxes have no close box (even movable ones), the user answers
through the buttons, and Cancel revokes what was done; WinUI’s
ContentDialogdismisses through itsCloseButtonTextbutton (and Escape), not a title-bar ✕. The ✕ in a header is the web’s convention (the ARIA practices’ modal dialog example has one). - No duplicate controls. A ✕ next to Cancel is two controls for one action: one more thing to read, to reach by Tab, and to name for a screen reader.
- One consistent rule. Every dialog gets out the same way, so the user learns it once. Asked on the WCAG working group’s list whether a modal should have a ✕, Cancel or both, the answer pointed to SC 3.2.4 (consistent identification): choose one approach and use it consistently throughout the application; Escape acts as Cancel.
The option: DialogSpec::new(dialog).closable(true), or the
dialogs.closable setting for every dialog. It puts a ✕ at the right
end of the title row, still with no band behind it. The ✕ is Escape and
nothing else: the same cancel, through the same dialog.answer step and
hooks, refused exactly when Escape is (a hook vetoing the cancel keeps
the dialog open either way). It is named “Close” (translated), is a
target of at least 24 points (WCAG 2.5.8) and is never focused when the
dialog opens: the focus goes where it would without it. Use it for a
notice of the application’s own that has no Cancel button, or in an
application that follows the web’s convention throughout (then turn
the setting on, rather than mixing dialogs with and without it).
Movable dialogs: DialogSpec::new(dialog).movable(true), or the
dialogs.movable setting for every dialog. A dialog that hides what it
acts on (levels over an image, a find dialog over a text) can be moved
out of the way.
- The header band. Only a movable dialog has one: its title row on
the kit’s
header-band(the title indialog-header.rest.text), a line below it, the move cursor over it. It carries the ✕ when the dialog is closable. A dialog that is not movable keeps its plain title row: no band means “this does not move”. - Dragging. Dragging the band moves the dialog, kept inside the window, and kept inside again when the window is resized. The title is not selectable there, so a press on it drags too. A double click on the band centres the dialog again.
- The keyboard. The
dialogs.movecommand (Alt+F7, the move key of several desktops, rebindable, live while a modal is open) starts a move: the arrow keys move the dialog byspace.m, Shift+arrow by eight times that, Enter keeps the place, Escape puts it back where the move started (and only then, a second Escape cancels the dialog as usual). The band itself is not in the Tab order. - Where it comes up. Centred, every time, unless it was opened with
.remember_position(key): then where it was last left, kept per key in the host’s store (ui/dialogs/<key>, an offset from the window’s centre, written without an undo step) and clamped to the window it opens in. - Hooks (ADR 0011). Each finished move (a drop, an arrow key, a
return to the centre) runs the
dialog.movestep with{id, title, key, how, from, to}: a before-hook may veto it (the dialog goes back) or redirect it (its ownto); a run-hook may place it its own way. The journal then saysdialog.moved. The positions in between, while the pointer drags, are not steps: the dialog follows the pointer, and the drop decides.
The backdrop: DialogSpec::backdrop(Backdrop::Dim | Backdrop::Clear).
A dialog is modal either way: the interface behind it takes no input,
and a click on the backdrop never closes the dialog (an answer comes
from its buttons, Enter or Escape; a stray click must not lose what
was typed).
Dim, the default, darkens the interface by thebackdrop.opacitytoken (an alias of the systemopacity.scrim, a number from 0 to 1). While a movable dialog is dragged the dim fades to about a third, so the user sees where to put it; it comes back on the drop.Clearleaves the interface untouched, for a dialog previewing its effect (a curve applied to the image behind it).
A body of its own: Dialog::Custom (decided 2026-10-14, ADR 0013),
opened with Dialogs::open_custom(app, spec, body). The four kinds are
drawn from data; a custom dialog draws a closure (a viewport, a curve,
a preview), kept on the application’s side so the queue stays Clone
and Send. It keeps every rule above: a primary button that says what
it does (or a Close button only), Cancel, steps, the debug bridge
(its body says what agents see with CustomPass::describe, and its
values are merged into the command’s arguments), movable, closable, a
kept place, the backdrop. Its body has a size of the dialog’s own (a
share of the window by default), a dialog focus scope and a fault
boundary, and is drawn every frame.
- Keys the body claims (
Custom::claims, or its component’sMountablethroughCustom::needs) go to it first. A body claiming Enter keeps it, and Ctrl+Enter accepts; a body claiming Escape gets it while it has something to cancel (CustomPass::claim_escape, a drag of a viewport), and the next Escape cancels the dialog. - What it holds is checked. A body declaring its needs is checked against the custom dialog’s offer when it opens (a body requiring wide gamut is refused: sRGB first), and recorded as a mount while the dialog is open.
- One dialog at a time still: a body draws a second choice inline.
egui_pop::imaging::preview is the first use: an export preview, an
image viewport over a Clear backdrop, movable and kept in place; the
interface behind, its own viewport included, keeps drawing while the
dialog is modal.
Sources:
- WAI-ARIA Authoring Practices, modal dialog example: https://w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/dialog
- WinUI
ContentDialog.CloseButtonText: https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.contentdialog.closebuttontext - WCAG working group’s list, ✕ or Cancel in a modal (SC 3.2.4): https://lists.w3.org/Archives/Public/w3c-wai-gl/2017OctDec/0897.html
- Inside Macintosh, Macintosh Toolbox Essentials, kinds of dialog boxes (movable modal dialog boxes have a title bar to drag them by): https://developer.apple.com/library/archive/documentation/mac/Toolbox/Toolbox-373.html
Sources
- shadcn/ui: https://ui.shadcn.com/docs/components; Radix: https://www.radix-ui.com/primitives
- MUI: https://mui.com/material-ui/, MUI X: https://mui.com/x/
- Mantine: https://mantine.dev/
- Ant Design: https://ant.design/components/overview,
Spindelay: https://ant.design/components/spin - Blueprint: https://blueprintjs.com/docs/
- Fluent UI v9: https://react.fluentui.dev/
- Carbon: https://carbondesignsystem.com/components/overview/, loading pattern: https://carbondesignsystem.com/patterns/loading-pattern/
- libadwaita: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/; GTK4: https://docs.gtk.org/gtk4/
- Qt:
QProgressDialoghttps://doc.qt.io/qt-6/qprogressdialog.html, Qt Quick Controls https://doc.qt.io/qt-6/qtquickcontrols-index.html; KDE KJob: https://api.kde.org/frameworks/kcoreaddons/html/classKJob.html - Dear ImGui: https://github.com/ocornut/imgui, its list of extensions: https://github.com/ocornut/imgui/wiki/Useful-Extensions
- VS Code progress API: https://code.visualstudio.com/api/references/vscode-api#window.withProgress; UX guidelines: https://code.visualstudio.com/api/ux-guidelines/overview
- JetBrains UI guidelines, progress: https://plugins.jetbrains.com/docs/intellij/progress-indicators.html
- Nielsen Norman Group, progress indicators: https://www.nngroup.com/articles/progress-indicators/
- egui 0.36.2 source (
widgets/progress_bar.rs,widgets/spinner.rs): https://github.com/emilk/egui - egui 0.37.0 changelog: https://github.com/emilk/egui/blob/main/CHANGELOG.md; egui_kittest’s: https://github.com/emilk/egui/blob/main/crates/egui_kittest/CHANGELOG.md
- crates.io’s API for each crate named in section 2 (latest version, its date, licence and dependencies), read on 2026-11-03.
- darktable background jobs (
src/control/progress.c) and bauhaus sliders (src/bauhaus/bauhaus.c): https://github.com/darktable-org/darktable
Fonts in egui-pop: proportional and monospace, done properly
Status: design note, not decided (2026-10-12). Built so far
(2026-10-18): families from the tokens at four weights (a variable face through its
wght axis, set per face with FontTweak::coords), from
registered faces, the system’s (fontdb behind system-fonts, not
fontique: no per-script fallback yet) and egui’s bundled ones, in that
order (2026-10-22), reported
problems (egui_pop_core::fonts); a size scale (2026-10-18), below;
font files a user adds, kept as paths (2026-10-20), below; the text size
setting, aligned numbers, the fonts debug collector, the settings
window’s Fonts page (2026-10-21), below; the bundled pair, Inter and
JetBrains Mono NL behind the bundled-fonts feature (decided and built
2026-10-27), below. The rest is still a design.
The bundled pair: Inter and JetBrains Mono NL (decided 2026-10-27)
egui-pop bundles Inter for interface text and JetBrains Mono NL for values and code, chosen on the gallery’s Font pairs page (below):
- Why. Inter is designed for interfaces at small sizes (tall
x-height, open shapes) and is variable, so one file draws every weight
through its
wghtaxis. JetBrains Mono NL is the cut without programming ligatures (egui cannot turncaltoff), with a slashed zero and tabular digits, so columns of values line up. Noto was the alternative (tabular digits in its proportional face, the family of the CJK fallbacks), at 834 KB against 617 KB; IBM Plex cannot be subset without being renamed (Reserved Font Name). - Size. Inter subset to Latin, Greek and Cyrillic,
opszpinned at 14: 416 KB. JetBrains Mono NL regular and bold, subset the same way: 201 KB. 617 KB together, within the budget of about 1 MB. - Licence. Both are under the SIL Open Font License 1.1, which
allows bundling them with MIT or Apache-2.0 code provided the licence
ships with the fonts: each font’s
OFL.txtsits next to it incrates/egui-pop-core/fonts/, with a README giving its source, version and changes, and the crate’s package carries them. egui-pop-core’s licence reads(MIT OR Apache-2.0) AND OFL-1.1, anddeny.tomlallowsOFL-1.1for that crate alone. - The feature.
bundled-fonts, on by default in egui-pop, egui-pop-api and egui-pop-core; the workspace depends on egui-pop-core without its default features, so an application that leaves the facade’s feature out (default-features = false) leaves the files out of its binary. Without it, egui’s own pair (Ubuntu Light and Hack, from egui’sdefault_fonts) is the default, as before. - How it is the default. The built-in themes name only generic
families:
font.family.uiis["sans-serif"],font.family.mono["monospace"]. A generic name stands for the bundled fonts: with the feature,sans-serif,serifandsystem-uidraw Inter andmonospaceandui-monospaceJetBrains Mono NL, at every weight (Inter on its axis, JetBrains Mono NL’s nearest of 400 and 700, said by no problem); without it, egui’s faces behind every chain draw them. A generic name after a list that already found the same family (Interon the system, thensans-serif) adds no second copy. - Values.
font.numericstays"mono"by default and draws values in JetBrains Mono NL, whose digits are tabular;"ui"draws them in Inter, whose default digits are proportional, so in cells. - Still available. Inter and JetBrains Mono NL are bundled families
a theme may name (
["Inter", "sans-serif"]) and the Fonts page lists, as egui’sUbuntuandHackstay: a theme naming them, or a user picking them, gets egui’s pair. A name is still looked for on the system before a bundled face (the order below): a theme namingInterdraws the system’s Inter where it is installed. - The fonts are reached from code as
egui_pop_core::fonts::bundled(the bytes and the family names); the gallery’s Font pairs page draws them from there.
The size scale (built)
font.size.xs, s, m, l and xl are the theme’s text sizes, in
px (points). egui’s five text styles each alias a step, and so may any
component token:
| Text style token | egui | Step | pop-dark | high contrast |
|---|---|---|---|---|
font.text-style.small | Small | xs | 10 | 12 |
font.text-style.monospace | Monospace | s | 12.5 | 14 |
font.text-style.body | Body | m | 13 | 15 |
font.text-style.button | Button | m | 13 | 15 |
font.text-style.heading | Heading | xl | 18 | 18 |
l (15, 16 in high contrast) has no text style of its own. A theme
moves a step and every style on it follows, or re-aliases a style onto
another step. The former font.size.small, body, heading and mono
are no longer read (see the changelog’s migration table). In code, fonts::font_at(tokens, role, weight, step) is the FontId of a step (fonts::Step), next to
fonts::font_id(role, weight, size); Tokens::font.scale holds the
sizes. The user’s text size (below) multiplies the scale.
Where text sits in its row (built)
egui places a face’s glyphs in their row by the face’s own ascent and
descent; another toolkit may centre them differently (GPUI lays a text
out in a line box and centres it there), and the same text then lands a
pixel or two lower or higher. font.baseline-offset.ui and
font.baseline-offset.mono (numbers, 0 in every built-in theme) move a
family’s glyphs down by that share of the size: 0.1 at 14 px is 1.4 px
lower, a negative share moves them up. Every face of the family’s
chain, egui’s fallbacks included, gets it as egui’s
FontTweak::y_offset_factor, under a key of its own (a face both roles
share moves for one only). Only the glyphs move: the row keeps its
height and the layout its sizes, so a widget’s box does not change. At 0
the faces keep their keys, and nothing is drawn differently.
egui has no per-face line height to centre on: a row’s height comes
from the face’s metrics (TextFormat::line_height is per text, not per
family), so there is no line-height token. In code,
Tokens::font.baseline_offsets holds the shares, and
fonts::install_with_offsets installs families with them.
Text size (built)
The text size is a user setting, appearance.text_size in Settings ›
Appearance › Fonts, one of seven steps: 85 %, 100 %, 115 %, 130 %, 150 %, 175 %
and 200 % (egui_pop_tokens::TEXT_SIZES). Quantised, so the font atlas
holds few sizes.
ThemeSpec::text_size(factor)(the nearest step) multiplies each step offont.size.*when the theme resolves, rounded to half a point; the text styles and every component token aliasing a step follow. Spacing does not move: it is not the interface zoom, which scales everything (appearance.interface_zoom).size.control.heightgrows to at leastceil(body × 1.6)when the text size is not 100 %, so a larger label is not clipped in a button.- In an application,
egui_pop_api::textreads and writes the setting (text_size,set_text_size); the theme is installed again at the next frame. Changing theme keeps it: it is the user’s, not the theme’s.
Starting from the system’s text size
The desktop’s text scaling (“larger text”) is the setting’s default:
AppBuilder::system_text_scale takes it, rounded to the nearest step
(125 % starts at 130 %). It is not the display’s scale, which winit
gives as the pixels per point and egui-pop already follows; the image
viewport’s 100 % stays one image pixel per screen pixel whatever the
text size.
- A value the user chose always wins. The seeded one is a default, not a choice: it is never saved, so a later change in the desktop’s settings is followed at the next start; Reset in the settings window goes back to it. A choice equal to the seeded step cannot be told apart from it (only values that differ from their default are saved).
- egui-pop reads no system itself; without
system_text_scalethe default is 100 %.egui-pop-platformreads it in the process (featureplatform-text-scale, orplatform), with no helper program:
use egui_pop::platform::text_scale;
use egui_pop::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
App::builder()
.plugins(DefaultPlugins)
.system_text_scale(text_scale::read())
.run_native("Viewer", Default::default())?;
Ok(())
}
| Read from | |
|---|---|
| GNOME on Wayland (and desktops using its settings) | the XDG Settings portal: org.gnome.desktop.interface text-scaling-factor |
| KDE Plasma on Wayland | forceFontDPIWayland, else forceFontDPI (group General of kcmfonts, then kdeglobals), over 96 |
| Linux on X11 | nothing: GNOME and Plasma fold the text scaling into Xft.dpi, which winit reads as the display’s scale, so it is already applied |
| Windows | “Make text bigger”: TextScaleFactor under HKCU\Software\Microsoft\Accessibility (100 to 225), through the registry API |
| macOS, other desktops, the web | nothing: 100 % |
EGUI_POP_TEXT_SCALE (1.25 or 125%) stands in for the system.
text_scale::read_with takes each source as a function, so tests give
a fake answer. Agents read the result in the text_scale collector:
the size in use, the setting’s default, whether the user chose it, and
the system’s factor, step and source (text::describe); the setting’s
description says it too.
The ask: “good font management, fixed-width and variable-width”. Concretely, egui-pop should load real families for interface text (proportional) and for values, code and debug output (monospace), let a theme and a user pick them, size them from one scale tied to an accessibility setting, and make columns of numbers line up.
When this note was written (2026-10-12), the tokens font.family.ui (["Ubuntu", "sans-serif"]) and
font.family.mono (["Hack", "monospace"]) are parsed and typed
(egui_pop_core::theme::Font::family_ui / family_mono) but not applied:
the text is drawn by egui’s bundled fonts. Only font.size.{small, body, heading, mono} reach egui’s TextStyles. The icon font (Phosphor) is
already installed in a family of its own with ctx.add_font
(egui_pop_core::icon::install); that is the pattern to generalise.
A user’s font files (built)
A user adds a font file (.ttf, .otf, the first face of a .ttc)
rather than the application embedding it:
fonts::FontFile::read(path)checks the file parses (with skrifa, the font reader egui itself uses: egui panics on a file it cannot parse, so nothing unchecked reaches it) and reads its family (the typographic family, else the family name) and weight from its tables.- A
FontFileis a path, a family and a weight, serialisable: what settings keep, never the bytes.fonts::register_files(ctx, &files)reads each file again and registers its face (fonts::register); a file that cannot be read or parsed is reported, and the face it had stays. The faces are installed with the next theme install, or at once withfonts::reinstallwhen the families did not change (one slow frame: the atlas is rebuilt). fonts::installed_familiesgives the families installed last.
The theme editor’s Fonts tab (The theme editor)
edits them: each role’s families in priority order (move up, move down,
remove, add a name), the font files (added through the host’s file
chooser), a preview of the fonts edited, and one explicit “Apply the
fonts” (or “Cancel the font edits”) that registers the files, writes font.family.ui and
font.family.mono into the theme being edited as one change, and
applies it. Saving the files is the host’s: ThemeEditor::font_files
gives them, ThemeEditor::set_font_files registers them at the next
start. A theme naming the user’s font files is saved with them, as a
folder or a .zip archive holding the token file and the faces by
relative path (Design tokens), and
opening one makes its faces the user’s font files again
(ThemeEditor::set_font_dir says where an archive’s faces are kept).
Settings › Appearance › Fonts (built)
The settings window has a Fonts page under Appearance (section 3’s
“Text” page, in part), holding egui-pop’s text settings
(egui_pop_api::text, settings_window::FONTS):
- Text size, above.
- Interface font and Monospace font (
appearance.font_ui,appearance.font_mono; empty: the theme’s): a family picked amongfonts::families(egui’s, the application’s, the user’s font files, the system’s withsystem-fonts), only monospace ones for numbers and code, each drawn in its own face (as a specimen) but the system’s. The family is put first in the theme’s list (ThemeSpec::font_ui,font_mono), the theme’s families stay its fallbacks; changing theme keeps it. Each has its reset. - Preview: a heading, the theme editor’s sample line per role
(
theme_editor::font_sample, shared with its Fonts tab), and numbers right-aligned in the numeric font. Resting the pointer on a family in a picker draws the heading and the sample in it before it is picked (the preview families, below).
Not built: the weight of body text, the hinting choice, the per-script lines and the missing glyphs outlined.
Aligned numbers (built)
egui applies no OpenType feature, so tnum cannot be asked: digits
line up only in a face whose default digits are tabular. As section 3
recommends, values are drawn by font.numeric (a theme token):
"mono"(the default): in the monospace family, at the size whose x-height matches the text around (size × font.text-style.monospace / font.text-style.body), lowered to the nearest size whose advance is a whole number of physical pixels at the window’s scale: with a fractional advance, glyphs snap to pixels differently from row to row and a column drifts by a pixel."ui": in the interface family. When its regular face’s default digits are tabular (measured at install,Report::tabular_digits), as they are; otherwise each digit is laid in a cell as wide as the face’s widest digit, right-aligned in it (one layout section per digit, with itsleading_space), the workaround of section 4.
fonts::number_font(ctx, size) says which, fonts::number_job and
fonts::number_galley lay a value out. egui-pop’s slider draws its
value this way, so it no longer jitters while dragged; an application’s
readouts and tables use the same functions. Tests: a column of numbers
in the default has every digit at the same distance from the right
edge; Inter’s digits in cells take the same width whatever they are.
The fonts debug collector (built)
Among the core collectors of the debug bridge (section 3 below was its design):
- snapshot: the families the theme asks for (
requested), the faces registered (family, weight,origin: registered or file, bytes, tabular digits, monospace), each egui family with the face drawn first and its fallback chain, the specimens, whether each role’s face has tabular digits,numeric, the text size, the sizes of the scale and of egui’s text styles,pixels_per_point, the atlas’s size and fill ratio, and the install’s problems; - action
check { text, family }: the chars of a text no face of a family covers (ui,monoor a family’s name), drawn as a box.
Not built: the coverage action over the string catalogue, and the
warning when the atlas is rebuilt often.
Families by name, and the families there are (built)
fonts::specimen(ctx, name, weight)gives an egui family drawing a family by its name, outside the theme’s two roles: a picker drawing each name in its own face, a page comparing fonts. The first ask installs the fonts again (one slow frame, from the next pass) and returnsNonemeanwhile; a name found nowhere draws egui’s bundled fonts and is said in the report.fonts::families(ctx)lists the families a theme or a user may name: egui’s bundled ones (Ubuntu,Hack), the faces registered (the application’s, then the user’s files), then the system’s (featuresystem-fonts), each with itsOriginand whether it is monospace.- The install’s
Reportalso gives each egui family’s fallback chain, the specimens, and per role whether its regular face has tabular digits by default (Report::tabular_digits), read from the face’s advances with skrifa.
Previewing a face before it is applied (built)
egui’s fonts are global, and egui panics on a family it has no fonts for, so a face is previewed through families every install defines:
fonts::set_preview(ctx, role, Some(names))makes the role’s preview families (pop.preview.ui.400,.500,.600,.700, and themonoones) draw the faces found fornamesin priority order, the role’s families as installed behind them: a name found nowhere draws the role’s families, never an empty family.Nonemakes them draw the role’s families alone. The theme’s own families are untouched. A change installs the fonts again (one slow frame, from the next pass).- Every install defines the preview families, whatever it was asked for: a theme switched while a preview is shown keeps drawing it, and no frame asks for a family egui has not got.
fonts::with_preview(ui, add)drawsaddin them: its text styles draw the interface preview (the monospace style the monospace one), and inside it the text roles (UiPop::section_title, …) andfonts::shown_font_idgive the preview families too. What draws with an explicitFontIdkeeps the theme’s fonts.fonts::preview_family(ctx, role, weight)isNoneuntil egui’s fonts in use have it (before the first install’s pass), asfonts::specimenis until egui has the specimen.
The theme editor’s Fonts tab and Settings › Appearance › Fonts preview a face this way (The theme editor).
The order a name is looked up in (built)
Each name of font.family.ui and font.family.mono (and a specimen’s
name) is looked for in this order, the order a platform resolves a font
stack in (as GPUI and browsers do):
- the faces the application registered, and the user’s font files;
- the system’s fonts, by family name (below);
- the bundled faces by name: egui-pop’s (
Inter,JetBrains Mono NL, withbundled-fonts), then egui’s (Ubuntuis egui’s Ubuntu-Light,Hackits Hack).
A generic name (sans-serif, monospace, …) draws the bundled pair
(above). A bundled face is reached by its name only when the system has no
family of that name: a theme naming Ubuntu draws the system’s Ubuntu
where it is installed, egui’s Ubuntu-Light elsewhere, so a stack copied
from a platform (Helvetica, Segoe UI, Ubuntu, Adwaita Sans, ...)
draws what the platform draws. Until 2026-10-22 egui’s bundled faces
came before the system’s, and shadowed the system’s Ubuntu.
fonts::origin_of and fonts::families follow the same order: a
family both on the system and bundled is listed once, as the system’s.
The install’s report says where each name was found
(Report::resolved, Report::resolved(list, name)), at the regular
weight, in list order: its list (ui, mono or specimen), its
origin (registered, file, system, bundled, or none for a name
found nowhere) and the face drawn (egui’s key for a bundled face, the
PostScript name of a system one, else its family and weight). Shown, it
reads Ubuntu → bundled Ubuntu-Light, Adwaita Sans → system AdwaitaSans-Regular, Helvetica → missing; the fonts collector gives
the same under resolved, each with its says line.
The system’s fonts, or faces given in their place (built)
With system-fonts, the system’s fonts are fontdb’s (MIT, read once per
process). fonts::set_system_faces(ctx, Some(faces)) gives a context’s
system fonts in their place: tests that must not depend on the fonts of
the machine they run on, or an application finding fonts its own way.
None goes back to fontdb’s. The faces are listed by
fonts::families with Origin::System and found by the install as the
system’s would be.
A theme names a system face by its family name: the next names of its
list are the fallback where the face is missing.
fonts::origin_of(ctx, name) says where a name would be found, None
when it is missing on this machine (the install’s report says so too),
and fonts::is_generic names the generic families (sans-serif,
monospace, …), always found. A theme package carries a face’s file
instead when the file is one of the user’s font files.
Choosing the bundled pair: the gallery’s Font pairs page (built)
The gallery’s fonts page draws candidate pairs side by side, egui’s
own as the baseline: a heading, a paragraph, buttons and a checkbox, the
four weights, a slider with its value, a column of numbers right-aligned
in the proportional and in the monospace face, code, and a few scripts;
each pair says its licence, the size of its files and whether its digits
are tabular, measured from the glyphs. The pair bundled was chosen on
that page: decided (2026-10-27), Inter + JetBrains Mono NL (the
bundled pair, above).
| Pair | Files carried | Licence | Digits |
|---|---|---|---|
| Ubuntu Light + Hack (egui’s) | none (in egui) | Ubuntu Font Licence; MIT + Bitstream Vera | Measured on the page |
| Inter + JetBrains Mono NL (bundled, 2026-10-27) | 416 + 201 KB (617 KB), in egui-pop-core | OFL 1.1 | Inter proportional, JetBrains Mono NL tabular |
| Noto Sans + Noto Sans Mono | 453 + 381 KB (834 KB) | OFL 1.1 | Noto Sans tabular |
| IBM Plex Sans + Plex Mono | 537 + 273 KB (810 KB) | OFL 1.1, RFN “Plex” | Measured on the page |
The bundled pair’s files are in crates/egui-pop-core/fonts, the
others are gallery assets in crates/egui-pop-gallery/assets/fonts
(not published), each with its licence and source. Inter
and Noto are subset to Latin, Greek and Cyrillic with their other axes
pinned (full files: 877 KB, 2049 KB, 1708 KB); JetBrains Mono NL (no
ligatures, no variable build) is subset, regular and bold; IBM Plex is
as published, since a modified build must be renamed (subset and renamed
it would be 347 + 98 KB). The page’s test checks every monospace face
has one advance for digits, i and W, and that Noto Sans’s digits are
tabular and Inter’s are not.
1. What egui 0.36 / epaint can do
All of this was checked in the epaint 0.36.2 source (src/text/*.rs) and
the egui release notes.
Pipeline
| Stage | Crate in 0.36 | Notes |
|---|---|---|
| Font parsing, charmap, metrics, outlines, hinting | skrifa 0.44 (Google Fonts / Linebender, MIT or Apache-2.0) | Replaced ab_glyph. TrueType instructions or the auto-hinter, with HintingTarget (Mono, Smooth with light/normal, symmetric rendering, linear metrics). |
| Shaping | harfrust 0.12 (Rust port of HarfBuzz) | Since 0.35: “Use harfrust for better kerning and ligatures”. Called with ShapeOptions::new(): the font’s default features apply (kern, liga, calt, mark, …). No API to pass features. |
| Rasterisation | vello_cpu 0.1 | Outlines only (an OutlinePen). CPU, so output depends only on font bytes and options, not on the GPU. |
| Atlas | epaint TextureAtlas | An RGBA ColorImage (4 bytes per pixel). |
Families and fallback
FontDefinitions { font_data: name -> Arc<FontData>, families: FontFamily -> Vec<name> }. The first name is the primary, the others are fallbacks in order.FontFamily::{Proportional, Monospace, Name(Arc<str>)}. ANamefamily is any number of extra families (egui-pop’s icons already use one).- Fallback is per grapheme:
segment_into_runsresolves the face of each grapheme’s base char through the chain and shapes each run with its own face. A char in no face is drawn as◻(or?if no face has◻).Fonts::has_glyph(font_id, c)tells whether a family covers a char. ctx.set_fonts(defs)replaces everything,ctx.add_font(FontInsert)adds one face to families at a priority. Both take effect at the next pass. Loading at runtime is therefore fine: read a file,FontData:: from_owned(bytes), insert, done. A change ofFontDefinitionsor ofTextOptionsrebuilds the atlas and the galley cache (one slow frame).FontData { font, index, tweak }:indexpicks a face in a collection (.ttc/.otc, needed for Noto CJK).
FontTweak (per face)
scale, y_offset_factor, y_offset (visual only, layout unchanged),
hinting: Option<bool>, hinting_target, subpixel_binning: Option<bool>, coords: VariationCoords (default axis values, e.g.
wght), thin_space_width (for 1 234 567 grouping). scale and the
offsets are how a fallback face is matched to the primary’s x-height and
baseline; egui does it for its emoji fonts (scale: 0.81).
Weights, italics, variable fonts
- No
bold.FontIdis{ size, family }; a comment infonts.rsstill says “TODO: weight (bold), italics”.RichText::strong()only changes the colour. - Variable fonts work. Since 0.34 (“Add font variations API”), a
TextFormatcarriescoords: VariationCoords, andRichText::variation(b"wght", 600.0)/variations(..)set them per run.FontData::variation_axes()lists a font’s axes with their ranges. So with a variable font, real weights (andwdth,opsz) are available per run without extra files. - With static fonts, a weight is a separate face in its own
FontFamily::Name(“ui-semibold”). italics: trueis a fake slant: the glyph quad is sheared by a quarter of its height. A real italic needs its own face (or aslnt/italaxis).
OpenType features
The shaper applies only the default features. Consequences:
- No
tnum: tabular figures come only from fonts whose default digits are already tabular (many UI fonts are proportional by default: Inter is; Noto Sans and Roboto have tabular default digits; check each with a test, see section 5). - No way to turn off
calt/liga: JetBrains Mono, Fira Code and Cascadia Code ligate!=,->,>=by default. For values and debug output pick a font without programming ligatures (JetBrains Mono NL, IBM Plex Mono, Hack, Noto Sans Mono, Cascadia Mono). - No
ss01/cv**(slashed or dotted zero, single-storey a), nozero. The default glyph of the chosen mono font must be the wanted one.
Scripts
- CJK: needs a font that covers it. Sub-pixel binning is disabled for
CJK glyphs (too many unique glyphs for the atlas); CJK line-break rules
exist (
is_cjk_break_allowed). - RTL: harfrust shapes Arabic and Hebrew runs (joining forms), but layout
is left-to-right: there is no bidi reordering (
// TODO(emilk): heed bidi characters; bidi control chars are made invisible). Arabic text is shaped but drawn in the wrong visual order for mixed or RTL lines. - Emoji: outlines only. Colour emoji (COLR, bitmap) are not drawn in 0.36; egui bundles monochrome Noto Emoji and an emoji icon font.
Hinting, sub-pixel, HiDPI, memory
TextOptions { max_texture_side, font_hinting: true, subpixel_binning: true, .. }are global, overridable per face by the tweak. egui’s settings UI calls hinting “sharper text” and binning “more even kerning” (but blurrier).- There is no LCD (RGB) sub-pixel anti-aliasing: grey-scale only.
- Glyphs are rasterised at physical pixels:
pixels_per_point(native scale timeszoom_factor) is part of the glyph key. Text is crisp at any scale, but every distinct (face, size, ppp, variation location, sub-pixel bin up to 4) is a separate bitmap. - The atlas is
max_texture_sidewide (2048 default, capped at 16384; the backends raise it to the GPU limit), starts 32 rows high and grows. When it is more than 80 % full,Fonts::begin_passthrows everything away and rebuilds (one slow frame, re-rasterisation). Memory iswidth x height x 4bytes: a 4096 x 1024 atlas is 16 MiB of CPU RAM plus the GPU copy. What fills it: many sizes, many weights (eachwghtvalue is a new location), CJK (thousands of glyphs, no binning saves them a little), HiDPI (4x the pixels at ppp 2). - Rule for egui-pop: few sizes, few weights. A size scale of five or six steps and two or three weights keeps the atlas small; a continuous “text size” slider is quantised (section 3).
What is coming upstream (not in 0.36.2)
A stack of PRs merged in September 2026 (into a feature branch, then completed by #8512), expected in egui 0.37:
- #8491 “Render any glyph on
native”: a
FontProvidertrait asked once per (family, char) that no configured face covers;egui_system_fonts::SystemFontProvider, backed by fontique, asks the OS fallback (CoreText, DirectWrite, fontconfig, Androidfonts.xml) and memory-maps the file. eframe featuresystem_fonts, on by default,NativeOptions:: system_font_fallbackto turn it off, locale throughSystemFontProvider::with_locale. Closes #5233. - #8492: colour emoji
(epaint
color_fontsfeature). - #8493: bundled monochrome
emoji fonts become opt-in (
monochrome_emoji_fonts).
egui-pop’s docs/upstream.md already expects 0.37 to fix missing
symbols through #8491. The design below takes it as the system fallback
mechanism and does not build its own before 0.37.
2. Families: bundle or ask the system
Bundled candidates (all redistributable with MIT and GPLv3 software)
| Family | Licence | Kind | Notes |
|---|---|---|---|
| Inter | OFL 1.1 | variable wght, opsz | Designed for UI at small sizes; tall x-height. Default digits proportional (tnum unreachable in 0.36). Full file about 0.8 MB, much less subset to Latin, Greek, Cyrillic. |
| Noto Sans | OFL 1.1 | variable wght, wdth | Default digits tabular. Same design family as Noto Sans CJK, Arabic, Hebrew, so fallbacks match. |
| IBM Plex Sans / Mono | OFL 1.1, Reserved Font Name “Plex” | static, variable for Sans | A modified (subset) build must be renamed. Mono has no programming ligatures. |
| JetBrains Mono | OFL 1.1 | variable wght | Ligatures on by default: use the NL cut for values. |
| Noto Sans Mono | OFL 1.1 | variable wght, wdth | Wide coverage, plain, no ligatures. |
| Hack | MIT + Bitstream Vera | static Regular in egui | Already in egui’s default_fonts. |
| Ubuntu (Light, in egui) | Ubuntu Font Licence 1.0 | static | Free to redistribute, also embedded; modified versions must be renamed; Debian treats it as free. Already shipped by egui’s default_fonts, so no new obligation. Light at 13 px is thin on dark themes. |
| Fira Sans / Mono / Code | OFL 1.1, RFN “Fira” | static | Code ligates. |
| Atkinson Hyperlegible Next / Mono | OFL 1.1 | variable | Made for low vision: a natural “legibility” choice in the picker. |
| Noto Sans CJK | OFL 1.1 | .otc collections | 15 to 20 MB per weight; regional subsets (SC, TC, JP, KR) about 5 to 10 MB each. Never bundled by default. |
OFL fonts may be bundled, embedded and sold with any software; only the
fonts themselves stay under OFL, and a modified font cannot use a
Reserved Font Name. Carry each OFL.txt next to the file and list the
fonts in the crate’s licence notes (cargo deny does not see font
files). GPLv3 Helios linking MIT egui-pop that embeds OFL fonts is fine:
the OFL explicitly permits bundling.
System fonts
| Crate | Licence | Backends | Use |
|---|---|---|---|
| fontique (Linebender, part of parley) | Apache-2.0 OR MIT | fontconfig (optionally dlopen), DirectWrite, CoreText, Android | Enumeration, CSS-like matching (family, weight, width, style), fallback by script and locale. What egui 0.37 uses. Built on read-fonts/skrifa, the same stack as epaint. |
| fontdb | MIT | scans directories, parses fontconfig’s XML (no libfontconfig) | Enumeration and CSS-like queries; no per-script fallback. Used by resvg and cosmic-text. Mature. |
| font-kit (servo) | MIT OR Apache-2.0 | fontconfig + FreeType, DirectWrite, CoreText | Heavier (FreeType); maintenance slower. Not needed. |
fontconfig crates directly | MIT | Linux only | Too low level. |
fontique is the choice: same stack as epaint, used upstream, does per-script fallback, and asks the OS for “sans-serif” / “monospace” (generic families) the way the token value’s last entry already does.
Recommendation
- Ship one proportional and one monospace family, in a feature
(
bundled-fonts, on by default), budget about 1 MB:- UI: Inter (variable, roman, subset to Latin + Latin Extended + Greek + Cyrillic). Alternative if tabular digits in proportional text matter more than small-size polish: Noto Sans (tabular by default, same family as the CJK and Arabic fallbacks). A side by side page in the gallery decides: Inter, decided 2026-10-27.
- Mono: JetBrains Mono NL or Noto Sans Mono (no ligatures,
slashed or dotted zero by default, variable
wght): JetBrains Mono NL, decided 2026-10-27 (regular and bold, no variable build). - Keep egui’s Noto Emoji and Ubuntu-Light only as last fallbacks while
default_fontsstays on (it is enabled by egui-pop crates today and features are additive, so turning it off saves about 1.4 MB only if every crate in the build agrees).
- Never bundle CJK, Arabic, Devanagari by default. Take them from the
system: with egui 0.37,
SystemFontProviderwith the UI locale; before that, an opt-insystem-fontsfeature that, at install, asks fontique for a fallback per script of the active locale and adds the faces behind the bundled ones. An application that ships a locale ships or downloads its fonts (Helios: an optional CJK font pack). - A theme or a user picks families by name.
font.family.uiis a list resolved in order: a bundled family name ("Inter"), an installed system family ("Cantarell"), a font file shipped with a theme ("file:fonts/MyFace.ttf", relative to the theme file), and the generic namessans-serif,monospace,system-ui(asked from the OS). The first one found is the primary, the next ones are fallbacks, the bundled family is always appended last so text never vanishes. Every name not found is a reported problem (the theme’sproblems()), not a silent fallback. - Tests and snapshots never look at the system (section 5).
3. Tokens and settings
Tokens
Families (type fontFamily, a list):
| Token | Default | Use |
|---|---|---|
font.family.ui | ["sans-serif"] (built: the bundled Inter) | Interface text, FontFamily::Proportional. |
font.family.mono | ["monospace"] (built: the bundled JetBrains Mono NL) | Values, code, logs, the debug pages, FontFamily::Monospace. |
font.family.display (optional) | {font.family.ui} | Headings, if a theme wants a distinct face. |
Weights (type fontWeight, DTCG’s own type, 1 to 1000, or keywords):
| Token | Default | Use |
|---|---|---|
font.weight.regular | 400 | Body. |
font.weight.medium | 500 | Buttons, labels of active items. |
font.weight.strong | 600 | Headings, emphasis. |
Applied through wght when the face has the axis; with a static face
the nearest installed static weight family; otherwise ignored and
reported once (“Hack has no weight axis, strong drawn regular”).
RichText::strong() keeps egui’s colour meaning; egui-pop’s own
strong_text helper (ui.strong_text(..)) sets both the colour and
font.weight.strong.
Sizes: today four px values. Proposed scale, in rem (the DTCG
dimension reader already accepts rem at 16 px; egui-pop rem = the
body size, not 16 px, see below):
| Token | Comfortable | Use (egui TextStyle) |
|---|---|---|
font.size.caption | 0.77 (10 px) | Captions, small print (Small). |
font.size.small | 0.85 (11 px) | Secondary text, hints. |
font.size.body | 1 (13 px) | Body, buttons (Body, Button). |
font.size.mono | 0.96 (12.5 px) | Values and code (Monospace), so mono and proportional x-heights match. |
font.size.heading.3 / .2 / .1 | 1.08 / 1.23 / 1.38 | Section, panel, page headings (Heading = .2, others as TextStyle::Name). |
font.line-height | 1.3 (a number) | Row height multiple, applied as TextFormat::line_height where egui-pop lays out text. |
Keep font.size.small/body/heading/mono as aliases for compatibility.
How a size is computed:
pt = round_to_half(token_rem * base(density) * text_scale)
base(density): 13 px comfortable, 12 px compact (density overlays setfont.size.base).text_scale: the user’s text size setting (accessibility), steps 85 %, 100 %, 115 %, 130 %, 150 %, 175 %, 200 %. Quantised so the atlas holds a small set of sizes; rounding to half points keeps hinting steady.- Text size is not
zoom_factor.zoom_factor(interface scale) scales everything, spacing included, and stays a separate setting (Helios already lists “font size, interface scale” as settings outside the theme). Text size scales only text, and the control height token grows with it (size.control.height = max(token, ceil(body * 1.6))), so larger text never clips in a button.
Values and numbers:
font.numeric:"mono"(default) or"ui". Value displays (slider readouts, drag values, tables, histograms’ readouts) use the mono family unless the theme says the UI face has tabular digits.- egui-pop’s value widgets right-align numbers and pad to a fixed number of digits per parameter (from the parameter’s range and step), so the label does not jitter while dragging.
Settings page “Text”
- Interface font: a picker listing bundled families first, then system families (fontique enumeration, proportional only), each name drawn in its own face; a “theme default” entry.
- Monospace font: the same list filtered to fixed-pitch faces
(
post.isFixedPitch, or all digits andi/Wof equal advance). - Text size: a stepped slider (the steps above) with the percentage.
- Weight of body text: regular or medium (low-vision aid on dark
themes), only shown when the face has a
wghtaxis. - Hinting: auto (on below ppp 1.5, off above), on, off.
- Preview: a panel with a heading, a paragraph, a labelled slider
with its value, a column of numbers (
0.00to-1234.56), a code line (0O1lI |{}[] != ->), and a line per script of the shipped locales; missing glyphs are outlined in the warning colour. - These are user settings, not theme tokens: changing theme keeps them. The theme provides the defaults; the settings override the families and scale at install.
Debug bridge
A fonts core collector:
- snapshot: for each family (
ui,mono,display, icons), the requested list, the resolved faces (name, source: bundled, system path hashed or file, theme file; axes and the weight used), the problems (names not found),pixels_per_point,TextOptions, the atlas size andfont_atlas_fill_ratio, the computed point sizes per text style. - action
check { text, family }: the chars no face covers (has_glyphfalse) and which face draws each run. - action
coverage { locale }: runscheckover every string of the string catalogue (egui_pop_core::strings) for that locale and lists missing chars with the keys that use them. The same function backs a test. - A warning diagnostic when the atlas was rebuilt because it was full more than once in a minute (a sign of too many sizes or weights).
4. Upstream gaps (for docs/upstream.md)
Each entry follows the register’s format (compensated, upstream, workaround, remove when). Issues to open or find:
- No OpenType features per text run (
tnum,zero,caltoff,ss01). harfrust takes features inShapeOptions; epaint passes none. Upstream: addfeaturestoTextFormat, next tocoords(small, symmetric with variations; file a PR). Workarounds: pick fonts whose defaults are right (no-ligature mono, tabular digits); for numbers in a proportional face, egui-pop’stabulartext helper lays each digit in a cell as wide as the widest digit (glyph_widthof0..9), painting digits one by one; or freezetnuminto a derived font offline (fontToolspyftfeatfreeze, allowed by OFL when there is no Reserved Font Name, renamed anyway). Remove when features land. - No weight or style in
FontId,strongis colour only, italics are a shear. Workaround: variable fonts andvariation(b"wght", ..), static weights asFontFamily::Name, real italics as their own family. Remove when egui getsRichText::bold/ a weight inFontId(listed as planned in the 0.34 notes). - No bidi: RTL lines are drawn in logical order. Workaround: none
good; do not ship RTL locales until fixed (or reorder with
unicode-bidibefore layout for single-direction labels only). Track the upstream issue. - No system font fallback in 0.36. Fixed by #8491 (0.37). Until then: bundled faces, plus an opt-in fontique fallback per locale script at install.
- No colour emoji in 0.36. Fixed by #8492 (0.37). Workaround: icons by role (already done), no emoji in UI strings.
- Atlas thrown away when 80 % full. Workaround: quantised sizes and
weights, a larger
max_texture_sideon native. Possible upstream proposal: evict least-used glyphs instead of rebuilding. - No callback when a replacement glyph is drawn. Workaround: the
check/coverageactions above, run over the string catalogue.
5. Tests
- Determinism. Tests install only bundled faces: a
FontSource::BundledOnlymode inegui_pop_testthat disables the system provider (and, from egui 0.37,system_font_fallback), so a snapshot never depends on the machine’s fonts. Rasterisation is CPU (vello_cpu), so with the same bytes and options glyphs are identical; the existing wgpu/lavapipe snapshot threshold covers the compositing. Pin hinting and sub-pixel options in the test harness. - Resolution. Unit tests on the resolver (no egui): a list with an unknown name, a bundled name, a generic name; the problems reported; the bundled family always last.
- Fallback. A test font fixture without
é(or a missing-glyph string):checkreports it; a chain with a second face that has it reports nothing and the run uses the second face. - Monospace alignment. Lay out
0123456789,-1234.56,iiiiiandWWWWWin the mono family: equal advances per char, and a column of numbers right-aligned has digitxpositions equal across rows (compareGalleyglyph positions, not pixels). - Tabular digits of the UI face: all ten digits have the same advance,
or the test documents that they do not and
font.numericstays"mono". - Size scaling. For each text-size step and both densities: the
computed point sizes, monotonic, rounded to half points; the control
height grows so a
Bodybutton label is not clipped (galley height <= inner height). - Weights. A variable face at
wght400 and 600: the 600 galley is wider; a static face reports the problem once. - Coverage. For every shipped locale,
coverage(locale)over the catalogue returns nothing missing (pseudo-locale included). - Snapshots. The gallery’s new “Text” page (families, scale, weights, number column, scripts) in each theme and density.
6. Implementation plan (egui-pop commits)
- Docs: fonts design and upstream entries. This note condensed into
docs/fonts.md; entries 1, 2, 3 and 6 indocs/upstream.md. - Tokens: font scale, weights, line height.
font.size.*scale with aliases,font.size.basein density overlays,font.weight.*(fontWeighttype in the parser),font.line-height,font.numeric. Contract and docs updated. No egui change. - Bundled fonts. A
bundled-fontsfeature inegui-pop-corewith the UI and mono faces (subset, licence files, aFONTS.mdwith sources and versions), registered by name. Tests: faces parse, axes listed. - Family resolver and install.
egui_pop_core::fonts: resolvefont.family.*lists (bundled, theme file, generic) intoFontDefinitionswith the icon family kept, report unknown names as theme problems, called bytheme::install. Snapshots regenerated (the visible change of the series). - Text size setting.
text_scaleinThemeSpec(quantised steps), sizes computed in points, control height follows. Tests on the scale. - Weights and strong. Weight tokens applied through
wght; astronghelper; headings atfont.weight.strong. - Tabular values. Value widgets use
font.numeric; thetabularhelper for proportional digits; the alignment tests. - Debug collector
fonts. Snapshot,check,coverage; the coverage test over the English catalogue. - System fonts (opt-in).
system-fontsfeature: fontique enumeration for the pickers and per-script fallback for the locale. Off in tests. - Settings page “Text” and gallery page. Pickers, size, weight, hinting, preview; snapshots.
- On the egui 0.37 bump. Switch the fallback to
SystemFontProvider(with the UI locale), drop commit 9’s fallback part, remove the symbol workaround, consider colour emoji; reviewdocs/upstream.md.
What Helios then uses
- Parameter values, slider readouts, coordinates, histogram and scope
readouts (
L 52.3 a -4.1 b 12.0), the node graph’s numeric ports, the log and the agent/debug pages:font.family.monoatfont.size.mono, right-aligned, fixed digits per parameter. Columns of values in the module panel line up while dragging. - Module labels, menus, dialogs, hints:
font.family.ui; panel headings atfont.weight.strong. - The “Text” settings page as is, with the Helios defaults in the Helios
themes; font size and interface scale stay ordinary settings outside
the theme (as
docs/gui.mddecides). - Locales: ship Latin, Greek, Cyrillic in the bundle; CJK through the system (0.37) or an optional font pack; Arabic and Hebrew not shipped until bidi exists. Screenshot tests per script and density, as the platform pitfalls note asks (darktable showed per-OS font regressions, e.g. darktable#13084).
Sources
- epaint 0.36.2 source:
src/text/fonts.rs(FontDefinitions,FontTweak,HintingTarget,FontData::variation_axes, default fonts,begin_passatlas rebuild),src/text/font.rs(skrifa, vello_cpu, sub-pixel bins, CJK, invisible bidi chars),src/text/text_layout.rs(segment_into_runs,shape_textwithShapeOptions::new(), italics shear),src/text/mod.rs(TextOptions),Cargo.toml(skrifa 0.44, harfrust 0.12, vello_cpu 0.1). egui 0.36.2src/widget_text.rs(variation,strong). - harfrust 0.12
ShapeOptions(has afeaturesslice). - egui releases: https://github.com/emilk/egui/releases (0.34 font variations, 0.35 harfrust and hinting target).
- egui PRs #8491, #8492, #8493, #8512; issue #5233.
- fontique: https://crates.io/crates/fontique; fontdb: https://crates.io/crates/fontdb; font-kit: https://crates.io/crates/font-kit.
- SIL Open Font License FAQ: https://openfontlicense.org/ofl-faq/; Ubuntu Font Licence: https://ubuntu.com/legal/font-licence.
- Font projects as linked in the table. File sizes are approximate and must be measured when the subset is built.
Architecture decision records
One page per decision that shapes the code: what was known (context), what was decided, what follows (consequences). An ADR is dated and never edited after the fact except to mark it superseded by a later one.
| # | Decision | Date |
|---|---|---|
| 0001 | Crates in layers, no back-edges, checked in CI | 2026-10-11 |
| 0002 | Typed ids that serialize to strings | 2026-10-11 |
| 0003 | No silent no-op | 2026-10-11 |
| 0004 | Plugins own what they register | 2026-10-11 |
| 0005 | Zones and blocks | 2026-10-11 |
| 0006 | The theme moves to egui-pop-core, egui-pop becomes the facade | 2026-10-11 |
| 0007 | Key resolution: focus depth, layers, removal | 2026-10-11 |
| 0008 | Persisted documents: versions, migrations, atomic writes | 2026-10-11 |
| 0009 | Three ways to bind a value | 2026-10-11 |
| 0010 | egui-pop wraps the application’s kernel through a host | 2026-10-12 |
| 0011 | Every feature’s life is reachable: observe, veto, replace, extend | 2026-10-12 |
| 0012 | The context stack: owned by the kernel, projected by the interface (analysis) | 2026-10-13 |
| 0013 | The mount contract: components declare needs, hosts declare offers (analysis) | 2026-10-14 |
| 0014 | Undo: histories owned by the kernel, routed by focus, projected by the interface (analysis) | 2026-10-14 |
| 0015 | The clipboard: typed items owned by the kernel, offered in several formats, hooked at each boundary (analysis) | 2026-10-18 |
| 0016 | One writer per value: a path’s writers are declared, a write names its scope | 2026-10-20 |
| 0017 | Links and outside content: one service opens them, an egui-native viewer shows what is safe, the rest goes outside (analysis) | 2026-10-28 |
| 0018 | Collector actions say whether agents may call them, through one step | 2026-11-03 |
| 0019 | Collector actions and value writes act as their caller | 2026-11-03 |
| 0020 | Answers carry their caller, and a dialog keeps its command’s flag | 2026-11-03 |
| 0021 | The origin goes along the chain of commands; deep links are remote | 2026-11-03 |
| 0022 | Sections and a toolbar row move into egui_stack as plain-egui cores; egui-pop wraps them (accepted, analysis) | 2026-11-03 |
| 0023 | Every command goes through the host’s dispatch; history walks are held to the writers | 2026-11-03 |
| 0024 | The debug bridge has a mode; commands say when they only read | 2026-11-03 |
| 0025 | Application windows are deferred viewports with an Rc shim; the main window is always the first | 2026-11-11 |
| 0026 | Layers have ranks, pinned under base layers at the bottom of the foreground | 2026-11-11 |
| 0027 | Every public module belongs to one component family, which says what it owns and refuses; cargo xtask families --check | 2026-11-15 |
| 0028 | A removed contributor’s work in flight is closed, refused or kept dormant, and said | 2026-11-15 |
| 0029 | What is not on the bus does not exist: a module knows the bus (requests, events, named listeners in a declared order), not its neighbours; the window lifecycle first | 2026-11-15 |
| 0030 | The bus is a contract the application supplies: the external bus-contract crate holds the traits, egui-pop-hooks is the default implementation, libraries take the bus at construction | 2026-11-16 |
Template: copy any of them; keep it to half a page.
0001: Crates in layers, no back-edges, checked in CI
Date: 2026-10-11. Status: accepted.
Context
egui-pop follows egui closely (one minor per egui minor), but most of what an application framework holds (commands, keymaps, menus, layouts, a value store, plugin ordering) has nothing to do with drawing. When that logic sits next to egui code it is tested slowly, through a renderer, and every egui bump touches it. Libraries that grew without layers (one crate importing everything) end up with cycles that only a rewrite removes.
Decision
Crates are stacked; a crate depends only on crates of a lower layer:
| Layer | Crate | Depends on egui |
|---|---|---|
| L0 | egui-pop-tokens: design tokens | no |
| L0 | egui-pop-win32: the frame’s Windows hit-test layer (amended 2026-10-12) | no |
| L0 | egui-pop-wayland: the image viewport’s Wayland layer, a tagged subsurface (amended 2026-10-13) | no |
| L0 | egui-pop-winit: the runner’s winit layer, a winit window id as the window’s raw handles (amended 2026-11-15) | no |
| L0 | egui-pop-test-macros: the test kit’s attributes, a procedural macro crate without dependencies (amended 2026-10-20) | no |
| L0 | ortho-router: orthogonal connector routing around rectangles, a standalone crate without dependencies, used by the node graph (amended 2026-10-21) | no |
| L0 | egui-pop-fit: a slot layout engine over plain boxes (dense grid packing in standard slot sizes, forms, groups, growth, hysteresis), a standalone crate without egui, formerly the separate egui_fit (amended 2026-11-17) | no |
| L0 | egui-pop-hooks: a hook kernel (typed hook points, ordered listeners, alter and collect emits, a per-listener error boundary, introspection), a standalone crate whose only dependency is the external bus-contract (amended 2026-11-16, ADR 0030), usable off the interface thread (amended 2026-11-15) | no |
| L1 | egui-pop-model: commands, keymap, menus, panels, layouts, values, ids, diagnostics, documents | no |
| L2 | egui-pop-core: theme, focus, keys, overlays, placement, accessibility, strings, icons, persistence, fault boundary, binding, thumbnails and their grid (moved down from the viewport for the file picker, amended 2026-10-30), debug bridge | yes |
| L3 | egui-pop-api: plugins, the app builder, Ctx, zones and blocks, hooks, services, stories | yes |
| L3 | egui-pop-viewport: the image viewport, the histogram, thumbnails re-exported from core (a component on the egui layer alone) | yes |
| L4 | egui-pop-test: test kit (dev-dependency only) | yes |
| L4 | egui-pop-i18n: translations, a plugin (a component on the application API) | yes |
| L4 | egui-pop-platform: platform services (single instance, notifications, tray, global shortcuts, logs and crash reports, focus mode), opt-in plugins | yes |
| L4 | egui-pop-views: data views (a live tree, a list, a data table), a component on the application API | yes |
| L4 | egui-pop-editors: text and code editors, a component on the application API (amended 2026-10-13) | yes |
| L4 | egui-pop-imaging: the steps of the viewport’s image tools (histogram, curves, colour wheels, zoom and navigator), on the application API (amended 2026-10-13) | yes |
| L4 | egui-pop-agent: the debug bridge served out of the process (JSON-RPC over a private local socket), opt-in, on the application API (amended 2026-11-08) | yes |
| L5 | egui-pop: the facade users depend on, re-exporting the layers | yes |
| L6 | applications: the gallery, consumer-smoke, xtask; third-party extensions, as templates/extension (amended 2026-10-13); the application template templates/app (amended 2026-11-06) | yes |
Components sit between L3 and the facade. A component that needs only
the egui layer (egui-pop-viewport) sits at L3 beside the application
API, so the test kit (L4) can carry test doubles for it; one that needs
plugins sits above the API, at L4 (egui-pop-i18n, amended
2026-10-12; egui-pop-views, whose moments are steps, 2026-10-13), so
the facade can re-export it. A platform layer that must call the system
(egui-pop-win32, amended 2026-10-12; egui-pop-wayland, 2026-10-13;
egui-pop-winit, 2026-11-15)
knows nothing of egui: it sits at L0 as a leaf, may use unsafe (in
one module, the only crates that may), and the layer above maps its
plain types. A test
(crates/egui-pop/tests/layering.rs) reads cargo metadata and fails on
any dependency that points to the same or a higher layer, on any
workspace crate missing from the table, and on L0 or L1 depending on
egui or eframe.
Consequences
- The model is unit-tested in milliseconds, without a GPU, and survives egui bumps untouched.
egui-pop-apigets its own semver: plugins written against it should not break when core internals move.- Adding a crate means placing it in the table of the layering test.
- A feature that needs an upper layer from a lower one is redesigned (a trait in the lower layer, implemented above), never wired backwards.
0002: Typed ids that serialize to strings
Date: 2026-10-11. Status: accepted.
Context
Commands, menus, panels, zones, blocks, plugins, services and settings are
all named by strings that end up in files (keymaps, layouts, settings) and
in the agent surface. With plain Strings a command id slips into a menu
id parameter, a typo in a zone name compiles, and nothing tells the reader
which namespace a string belongs to.
Decision
Every kind of id is a newtype: CommandId, MenuId, PanelId,
ZoneId, BlockId, PluginId, OwnerId, SettingId, ServiceId.
They are generated by one macro in egui-pop-model::ids, share one
syntax (ASCII letters, digits and . _ - / :, not empty, at most 128
bytes) and:
- serialize and deserialize as plain strings (
"view.palette"), so files and JSON stay readable; deserializing checks the syntax; - build at compile time from literals,
const SIDEBAR: ZoneId = ZoneId::from_static("app.sidebar"), where an invalid literal is a compile error, and at run time withZoneId::new(text)returning aResult; - are cheap to clone (a
Cow<'static, str>: literals are never copied).
Well-known ids (the shell’s zones, its menus) are typed constants, so a typo is a compile error rather than a block that never shows.
Consequences
- APIs say what they take:
fn block(&mut self, zone: ZoneId, ...). - Converting from a user-provided string is explicit and fallible.
- The syntax keeps ids usable in file names, JSON keys and when-clauses.
0003: No silent no-op
Date: 2026-10-11. Status: accepted.
Context
Extension systems fail quietly: a block contributed to a zone nobody declared never shows, a second command with the same id is dropped, a “replace” aimed at a block that was renamed does nothing. Each costs an afternoon to find, because nothing says it happened.
Decision
A registration that would be ignored is either impossible by types, or reported. Reporting means both:
- a
log::warn!(orerror!) naming the owner, the subject and what happens instead (“blockxreplacesyin zoneapp.main, which has no such block: it is added as a new block”), and - an entry in a collected
Diagnosticslist (owner, code, subject, message), that tests assert on and the debug bridge shows.
Types come first: typed ids (ADR 0002), well-known zones as constants,
builders that cannot be half-filled. Validation runs at registration
(when-clauses parsed, ids checked for duplicates) or, for what depends on
other plugins (zones, replace targets, requires), when the app is
built, never per frame.
Refusals that change the outcome (a duplicate command id, a plugin whose requirement is missing, a dependency cycle) are typed errors, not warnings.
Consequences
- Every registry method returns a
Resultor records a diagnostic; none returns()after doing nothing. - Tests can assert that an app builds with an empty diagnostics list.
- The
logfacade is the only logging dependency; the application picks the logger.
0004: Plugins own what they register
Date: 2026-10-11. Status: accepted.
Context
An application built on egui-pop is a set of features (pages, panels, commands, settings) that come and go: optional features, features turned off in settings, test apps with one feature. When features register into shared registries by hand, removing one leaves dangling commands, menu items and key bindings behind.
Decision
A feature is a Plugin: an id, the ids it requires, a priority,
enabled(&Ctx), connect(&mut Ctx) and disconnect(&mut Ctx). The app
builder sorts plugins topologically at start-up (requirements first, then
higher priority, then id, so the order is stable), and refuses with typed
errors a missing requirement (PluginError::Missing), a cycle
(PluginError::Cycle, with the path) or a duplicate id.
Everything registered through Ctx during connect (commands, key
bindings, menu items, panels, zones, blocks, settings, services, event
handlers, hooks, stories) is tagged with the plugin as owner. Disconnecting
a plugin removes all of it (remove_owner on every registry) and rebuilds
the derived declarations; disconnect itself is only for what the plugin
holds outside the framework.
The topological sort is our own (Kahn’s algorithm with a priority queue,
about fifty lines): petgraph’s toposort neither orders ties by
priority nor reports the whole cycle, and the dependency would be the
largest in the model.
Consequences
- A plugin can be switched off and on at run time without leaks; tests check that the registries return to their previous state.
- Plugins never hold registry handles; they talk to the framework through
Ctx(at connect time) andAppHandle(at run time). - egui has its own
egui::Plugin(context hooks). egui-pop plugins are a different, higher-level concept; the docs say so where both appear.
0005: Zones and blocks
Date: 2026-10-11. Status: accepted.
Context
Plugins need to put things on screen in places other plugins own: a status bar item, a section in a settings page, a decoration around another plugin’s view. Hard-coding those places in the shell does not scale; letting plugins draw anywhere makes the result depend on call order.
Decision
A zone is a named place (ZoneId, typed constants for the shell’s:
zones::TOP_BAR, zones::SIDE_BAR, zones::MAIN, zones::INSPECTOR,
zones::STATUS_BAR); a plugin may declare its own zones and show them
anywhere it draws (zones::show(ui, handle, zone)). A block is
something drawn in a zone: an id, a weight (lighter first) and a draw
function. Four operations, resolved when the app is built (not per frame):
add: a new block;replace(id): takes the place (and weight) of an existing block;extend(Before(id) | After(id)): a new block placed next to another;wrap(id): a wrapper drawn around an existing block, receiving the inner block as a closure it calls (or not) where it likes.
Resolution order: adds (by weight, then registration order), then replaces, then extends, then wraps (by plugin order, the outermost wrap last). A zone nobody declared, a replace, extend or wrap whose target is missing, or two blocks with the same id are reported (ADR 0003) with what happens instead: the block is not shown, added at the end, or the wrap is skipped.
Consequences
- Removing a plugin restores the zones as they were (its replaces and wraps go with it).
- The zones collector of the debug bridge shows each zone’s resolved blocks with their owners and the operations applied.
- Blocks get an
AppHandleto reach services, the value store and the command runner; they keep their own state in their closure.
0006: The theme moves to egui-pop-core, egui-pop becomes the facade
Date: 2026-10-11. Status: accepted.
Context
Phase 1 put the theme (tokens into egui’s style, Tokens::of) in the
egui-pop crate, the one users depend on. With the layers of ADR 0001,
egui-pop-core needs the typed tokens (icons sized from tokens, the
fault boundary’s error card, overlays), and the facade re-exports
everything, so the theme cannot stay in the facade without a back-edge.
Decision
theme moves to egui-pop-core unchanged. egui-pop keeps its name and
becomes the facade: it re-exports egui, egui_pop_tokens as tokens,
egui_pop_core::theme as theme (so egui_pop::theme::install keeps
working), and the model, core and api crates as model, core and
api, plus a prelude.
Consequences
- User code written against phase 1 compiles unchanged.
egui-popholds almost no code; its semver follows whatever it re-exports.- The layering test lives in the facade crate, the one that sees every layer.
0007: Key resolution: focus depth, layers, removal
Date: 2026-10-11. Status: accepted.
Context
Several bindings may claim one key: a dialog’s Escape and a text field’s Escape inside it, a framework default and the user’s rebinding, a component’s suggestion. Users must be able to rebind and to unbind anything, and when a key does something unexpected, someone must be able to see why.
Decision
The context a key is resolved in is rebuilt each frame from the focus
chain: the scopes (egui_pop_core::focus::scope) containing the
focused widget, outermost first; each sets context keys at its depth
(the root is depth 0). A binding’s depth is the deepest depth among the
keys its when clause tests. Among the bindings of the pressed keys
whose when holds, the winner is the greatest
(depth, layer, specificity, declaration order): the binding closest to
the focus wins, then User > Workspace > Default > Suggestion, then the
clause testing more keys, then the last declared.
Two removals, both stored in the user’s keymap document:
"command": "-id"removes that command’s bindings from lower layers;"command": nullunbinds the keys: bindings of exactly those keys in lower layers are gone, whatever their command.
A shortcut is one or more chords (Ctrl+K Ctrl+S); a prefix of a live
binding makes the dispatcher wait for the next chord. Keys are logical
(keypad digits are digits).
Every resolution can produce a trace: each candidate binding with its verdict (won, lost to, clause false, removed by, unbound by, prefix), which the debug bridge keeps for the last keys pressed.
A binding whose command went with a disconnected plugin is dormant
(ADR 0028): kept in its
layer, it is no candidate for its keys, which go to the next binding;
the trace gives it the verdict “lost” with because dormant: its command's plugin is disconnected (Keymap::set_dormant,
Keymap::dormant).
Consequences
- A user binding meant to beat a focused component’s binding uses the
same
when(the shortcuts editor copies it), or unbinds the key. - Resolution is pure (
egui-pop-model::keymap); the egui dispatcher only turns key events into chords and consumes the keys that resolve.
Addendum (2026-10-12): scopes and Escape
A binding listens globally or on a surface (surface:<name>, a focus
scope that must be in the focus chain); a surface binding’s depth is its
scope’s. Each binding says whether a text input keeps its key (auto
leaves plain keys to it), and an open modal blocks global bindings
unless they go through it. Escape is taken in a fixed order: a focused
text input lets go first (and swallows that press), then egui’s drag,
the top overlay, the key bindings, the widgets (egui_pop_core::focus).
Addendum (2026-11-18): scopes per window
Every binding has a scope, and each window dispatches its own keys, bubbling from the focus outwards:
| Scope | In files | Fires |
|---|---|---|
| Surface | surface:<name> | while that focus scope is in the window’s focus chain |
| Panel | panel:<id> | while that panel is the focused panel of the window the key is pressed in |
| Window | window:<id> | only in that application window (main: the main window and its detached panels) |
| Global | global (or none) | in every window |
| System | system | as global, and from the system while the application is not focused |
focusedPanel belongs to each window: the main window and its detached
panels share the workbench’s, an application window keeps the panel
focused last in it (empty while none was), so a panel’s keys never fire
from another window. Among the bindings of the pressed keys that may
fire, the winner is the greatest (depth, scope, layer, specificity, order): nearer the focus first, then the narrower scope (surface, panel,
window, global), then as before. A modal open in a window blocks every
binding there but a surface’s, unless it goes through modals.
A binding declared without a scope (or global) whose clause requires a
panel (focusedPanel == '<id>', alone or in a conjunction) is that
panel’s: keymaps written before scopes load unchanged, and are saved
without the inferred scope. when keeps the other conditions. The
focused widget before the keymap is a later step.
0008: Persisted documents: versions, migrations, atomic writes
Date: 2026-10-11. Status: accepted.
Context
Layouts, keymaps and settings are written to disk and read back by later versions of the application and of egui-pop. A crash during a write must not lose them, and a format change must not reset them.
Decision
Every persisted document is a JSON object with a "version" integer
(missing means 0). Each kind (layout, keymap, settings, or an
application’s own) has a Schema: its current version and one migration
per older version, each a function from the JSON of version n to that of
n + 1. Loading applies the migrations in order, then deserializes; a
document newer than the schema is refused, not guessed at. Schemas and
migrations live in egui-pop-model::doc (no I/O).
The persistence driver (egui-pop-core::persist) writes atomically: the
new text to name.json.tmp, flushed and synced, the previous file renamed
to name.json.bak (one backup), then the temporary file renamed into
place. Loading falls back to the backup when the main file is missing or
unreadable, and says so.
No crate is added: tempfile and atomicwrites do the rename but not the
backup or the migrations, which are the substance here.
Consequences
- Each format change ships with its migration and a test loading the previous version.
- On the web (no file system) the driver reports an error; storage there is a later concern.
0009: Three ways to bind a value
Date: 2026-10-11. Status: accepted.
Context
egui widgets edit a &mut T, which is simple and stays the default. An
application with a value store (settings, parameters an agent may also
change, undo) needs widgets that read and write the store with an origin,
group a drag into one undo step and notify listeners. Some views only
show a value that something else changes.
Decision
egui_pop_core::binding::Binding<'a, T> has three modes:
Binding::plain(&mut value): exactly egui’s model, nothing else;Binding::bound(&store, path): reads the store, writes throughStore::setwithOrigin::User, opens a gesture when a drag starts and ends it when the drag stops (one undo step, the path held against other writers meanwhile); listeners registered on the store are told of each change;Binding::watch(&store, path): reads the store, never writes; the widget is drawn disabled.
binding::edit(ui, binding, |ui, &mut T| ui.add(...)) adapts any egui
widget to the three modes. There is no implicit data context: the store
is always passed explicitly.
Consequences
- Components take a
Bindingand work the same in all three modes. - A refused write (a gesture of another origin holds the path, a value out of range) is reported on the response’s hover text and in the diagnostics, never dropped.
0010: egui-pop wraps the application’s kernel through a host
Date: 2026-10-12. Status: accepted.
Context
Until now egui-pop ran commands itself: handlers were closures run on the interface thread, settings lived in its own store. An application with a kernel of its own cannot work that way: its engine may run in another process, a command may be long, asynchronous or remote, and its bus already orders events (sequence, source, cause) in a journal its tests read. egui-pop exists to help build such applications and keep their code clean, so it must wrap the kernel, not be it.
Decision
egui-pop keeps the interface’s part: command declarations (name, keys,
when, menus, arguments) feeding the menus, the palette, the keymap and
the traces; focus, overlays, layout, theme; interface settings.
The application’s part goes through egui_pop_api::host::Host, which
the application implements and gives to AppBuilder::host:
dispatch(Dispatch) -> Reply: the result now (Done) or later (Later(Pending), given from any thread through itsResolver). A frame never waits; the command shows as running (its menu items greyed) until its result arrives, then its failure is shown;- an event journal:
publish(source, cause, name, data) -> Seqandsince(seq). egui-pop publishescommand.dispatched, thencommand.doneorcommand.failedcaused by it; the debug bridge’sjournalcollector reads it; store(): the value store holding settings and values;set_waker(Waker): the host wakes the interface from any thread.
LocalHost is the default and keeps the earlier behaviour: commands
declared with an in-process handler (Ctx::command) run on the
interface thread, the journal is in memory. Commands the host runs are
declared without a handler (Ctx::declare). A host may run in-process
handlers too (Dispatch::run_local).
Consequences
App::runreturns aReply;Reply::now()gives a result that is already there.- Simple applications, the gallery and the template write nothing more.
- An application with its own kernel adapts its bus and its command
runner to
Host; egui-pop’s command and settings API must not assume egui-pop executes commands. - Not settled yet: settings persistence still goes through egui-pop’s
Persistdocuments; a host storing settings elsewhere supplies a store and saves it itself.
0011: Every feature’s life is reachable: observe, veto, replace, extend
Date: 2026-10-12. Status: accepted.
Context
egui-pop does the plumbing of an application: shortcuts, commands, the layout, windows, the frame. An application built on it must still be able to take part in that plumbing at the moment it happens: refuse to close while work is unsaved, keep a panel from being detached, save an arrangement elsewhere, log every rebinding, react when the scale changes. Without a common way, each feature grows its own callbacks, or none, and the application forks egui-pop’s code to get in.
Decision
A feature names the moments of its life as steps (StepId,
frame.close, workbench.detach, keys.rebind), declared through
Ctx::step and run through AppHandle::step(step, args, default). At
each step a plugin may, each optional:
- observe: the step publishes a signal on the host’s journal (ADR
0010), named after it, with its arguments and result
(
<step>.vetoedwhen stopped); - veto or redirect: a before-hook (
Ctx::before) returnsGo,Veto(reason)orRedirect(args); - replace: a run-hook (
Ctx::replace) does the step instead of egui-pop’s default (the last plugin to replace a step wins; two are reported, ADR 0003); - extend: an after-hook (
Ctx::after) gets the arguments and the result.
Hooks are owned (ADR 0004). Every run is traced: who redirected,
vetoed, ran and followed; the debug bridge’s steps collector lists
the declared steps, their hooks and the last runs. A hook on a step
nobody declares is reported.
Every feature egui-pop adds from now on exposes its steps, with a default doing the sensible thing, and documents them.
Consequences
- Applications reach egui-pop’s lifecycle without forking it, and an agent sees in one place why something did or did not happen.
- A feature’s default is a closure given at the call site, so the plumbing stays readable; hooks never hold a registry borrowed and may run other steps.
- Steps are interface moments, not commands: a command (ADR 0010) is what the user asks for, a step is how the interface carries it out. A command’s handler usually runs one step.
0012: The context stack: owned by the kernel, projected by the interface
Date: 2026-10-13. Status: accepted.
The analysis behind it (three architectures compared, the main flows step by step) is in the appendix.
Context
Applications need a global notion of where the user is and how the
application behaves right now: places (drill-downs: a group, a
composite, a mask sub-tree, a sub-workspace; leaving one restores the
parent’s projection exactly) and modes (global states: an
orientation, compare, read-only, “an agent is driving”). Together they
are a small global state machine, and the session state to restore on
reopen. egui-pop had pieces (WhenContext keys set by hand, flat
arrangements, the host contract, steps), none stacked. The stack is
held by the application’s kernel, reachable by contract from the
interface, and close to the bus.
Decision
A typed contract, implemented by an owner that publishes. The owner
implements Contexts (in egui-pop-api, reached through
Host::contexts()): the frames, the state, request, hold,
release. egui-pop’s default owner is LocalContexts. The machine is
pure and shared: egui-pop-model::context has the frames (FrameSpec:
place or mode, a mode’s exclusivity group, pushed or set, transient,
guards), the state (place path, modes, rev), apply(state, frames, holds, envelope) -> Result<Transition, Refusal> and restore(saved, frames, valid) -> (State, dropped), and the context and view
documents. The bus is not the truth (an event-sourced fold has no place
for guards or refusals, and the journal is a ring in memory): the
owner’s events (context.changed carrying the whole new state and its
revision, context.left, context.entered, context.refused,
context.restored, context.held, context.released) are a typed
sub-protocol of the bus, and every reader is a trivial fold of them.
The interface reads and asks, never writes. A transition is the
step context.request (ADR 0011): before-hooks hold the interface’s
own guards (veto or redirect), the default asks the owner. The
projection changes only when the owner’s revision moves: nothing is
applied optimistically, so a refusal changes nothing on screen.
The projection keeps, per projection key (the place path and the
active modes), the workbench’s layout, the focused panel and the values
components keep (scroll offsets), and sets the context keys place,
placeDepth, modePushed, mode.<group> and the frames’ own keys.
A frame’s key bindings use its when clause (Ctx::frame_keybinding).
The breadcrumb, the mode chips, the commands nav.back, nav.up,
nav.enter and context.* (for agents), and a contexts collector
come with ContextsPlugin.
Saving never waits for the exit. The owner writes the stack inside
each transition, before it answers or publishes. A debounced writer in
egui-pop-core::persist (about a second) writes the view state, the
layout, the settings and the keymap; app.exit only writes what is
still waiting, and a vetoed exit writes nothing more.
The owner’s answers to the open questions:
- An undo of a change made out of sight undoes it and says where, in a toast with “Go there”. Transitions are not undo steps.
- A layout change made in a mode belongs to the mode and is reverted when it is left.
- Modes are global to the stack, not scoped to a place.
- Pushed modes come back after a restart, unless declared transient.
- A held request is refused with the hold’s reason (not queued).
- All windows show the same stack; another place means another workspace.
- Each frame has its own keymap layer, through
WhenContext.
Survey. statig (MIT, hierarchical, states known at compile time), rust-fsm (MIT, a DSL for flat machines), sm (MIT, typestate checked at compile time) and finny all build machines whose states are types fixed at compile time; frames here are declared by plugins at run time, persisted, guarded and held, and the machine is a few hundred lines. For egui, egui_router (MIT) routes pages with a history but has no modes, guards or persistence, and no breadcrumb crate exists. Own both the machine and the widgets.
Consequences
- An application gets drill-downs, modes and session restore from one
mechanism; a simple one writes nothing of its own (
LocalContexts). - Agents reach the stack through the same request path as the user,
with typed refusals,
if_revanddry_run. - A remote owner costs a round trip per transition (
Answer::Later). - Plugins must not set the stack’s context keys by hand; they declare frames and read the keys.
- A crash loses at most the last second of view state; the stack loses nothing.
0012, appendix: the analysis behind the context stack
The analysis that led to ADR 0012, kept for the reasons it gives. Where it differs from the ADR, the ADR wins.
Three architectures
A. A state service on the kernel, transitions published as events
The kernel holds a context service, the owner. Requests are commands to
it, answered at once or later. After each transition it publishes facts
(context.changed, context.refused) on the bus. Readers keep their
own copy by applying the events, or query the service.
B. An event-sourced fold of bus messages, with snapshots
The state is fold(log): transitions are written to the bus as events,
and every reader (the kernel included) computes the stack by folding
them from the last snapshot. Persistence is the log plus snapshots;
replay rebuilds any past state.
C. A kernel state machine behind a typed host contract, the bus as transport
The kernel implements a typed contract (Contexts): read the state,
request a transition, get a typed answer. The machine itself (frames,
groups, guards, the pure transition function) is a shared library. The
bus only transports the contract’s notifications to remote readers; in
process, the contract is called directly.
Comparison
| Criterion | A: service + events | B: fold of the log | C: typed contract, bus as transport |
|---|---|---|---|
| Ownership | One owner, clear. Fits “commands go to the owner”. | Nobody owns it: whoever publishes a transition event changes the state. Guards have no natural home: an event is a fact, it cannot be refused after it is published. A “request” event plus an “accepted” event brings back an owner, that is A. | One owner behind a trait, clear. |
| Consistency across windows | All windows of a process read the same events, same order. A window may lag one event behind. | Same, as long as every reader folds the same log. | Same as A in process; windows read the owner directly. |
| Consistency across nodes | Events relay between nodes like job.*; a mirror needs snapshot then subscribe from its seq. | Needs a total, durable, shared log across nodes: the bus offers one order per process, not across them. | Same as A: the contract’s notifications are relayed; a remote mirror reads a snapshot then follows. |
| Persistence | The owner writes the state (small) on each transition. | The log must become durable and unbounded, or snapshotted carefully. The bus journal is a ring in memory: making it the truth changes what the bus is. | Same as A; the shared library defines the document and its schema. |
| Replay | Not needed: the state is small and written whole. A trace of transitions is in the journal for debugging. | Native, and its real strength: “how did we get here”. But the stack’s history has little value beyond the last state. | Same as A. |
| Undo | The owner decides what is undoable (see flows). | A tempting “undo = fold without the last event”, but the log mixes transitions with everything else; undo needs its own model anyway. | Same as A. |
Survival after kill -9 | Write before publishing, in the transition: the last applied transition survives. | Requires the log write to be synchronous and durable before any reader acts; a ring in memory loses everything. | Same as A. |
| Threading | The owner is Send (a lock or its own thread); the interface receives events through its journal and the waker. | Every reader folds; the interface folds on its thread. Cheap but duplicated. | The interface calls the contract on its thread; a remote owner answers Later. |
| UI latency | In process: the answer and the event arrive in the same frame. Remote: one round trip, the interface shows “switching”. | Same as A once the event is in; a local publish is immediate, but the guard problem makes local publishing unsafe. | Same as A. |
| Headless testability | Good: the owner is plain code with no window. | Good: a fold is a pure function. | Best: the pure transition function is unit-tested without an owner, the owner without a window, the projection with a fake contract. |
| Agents and MCP | Agents send requests to the owner (the same path as a key press), read the state, wait for context.changed. | Agents would publish events directly: no guard, no answer, no refusal. | Same as A, with typed requests, dry_run and if_rev. |
| Complexity | Low. | High: durable log, snapshots, compaction, schema of every past event forever. | Low to moderate: one trait, one library, one event family. |
What “close to the bus” should mean
B is rejected as the source of truth. It contradicts the bus’s own rules (events are facts published by an owner, the bus carries no commands, the journal is not durable), it has no place for guards or refusals, and the property it buys (replaying the past) has little value for a state this small. Its two good ideas are kept:
- state-carrying events: every
context.changedcarries the whole new state and itsrev, not only the delta. A reader that missed events folds nothing: the last event is the state. A late reader takes a snapshot (describe) and subscribes from itsseq, as the jobs view already does; - the journal as a trace: the sequence of
context.*events with theircauseis how an agent or a test sees why the stack moved.
A and C are not rivals: C is the contract, A is how an owner implements
it. The recommendation is C, implemented as A: an owner-held state
machine, reached through a typed contract, whose notifications are a
typed sub-protocol of the bus (context.*). So, answering the question
asked:
- the context stack is a peer service (an owner), not a fold of the bus;
- its events form a typed sub-protocol of the bus;
- every reader (the projection, a window, a relay, an agent’s mirror) is a fold of that sub-protocol, and the fold is trivial because each event carries the state.
Flows
Notation: UI is the interface thread (egui-pop), K the owner
(the application kernel, or LocalContexts), J the journal.
Entering a sub-place
user: double-click a group, or `nav.enter`
UI : step context.request {enter, frame: sub, payload: id, if_rev: 7}
UI : before-hooks: no unsaved input → Go
UI : host.contexts().request(...) → Reply::Done or Later
K : can_enter(sub, id)? yes; no hold on places
K : write stack rev 8
K : publish context.changed {rev 8, state, entered:[sub], left:[], cause}
UI : (same pass if Done, next pass if Later) projection:
UI : save view state of "root"; switch arrangement to sub's layout;
UI : keys place=sub, placeDepth=1; restore sub's view state; crumb
nav.back is the same with leave; the parent’s view state is restored
from what step 1 of the projection saved.
An agent switches the orientation while the user drags
user: starts dragging a slider (a gesture in the value store)
UI : step context.request is not involved; the drag places a hold:
UI : host.contexts().hold {token: drag-3, groups: [*], reason: "drag"}
agent: context.set_mode {group: orientation, mode: review, origin: agent}
K : hold drag-3 covers orientation → Refused {by: "user drag", reason}
K : publish context.refused {request, reason, hold: drag-3}
agent: waits for context.released, then retries with if_rev
user: releases the slider → UI: release {token: drag-3}
K : publish context.released {token: drag-3}
agent: retries → Applied {rev 9} → context.changed → projection
The user’s drag is never interrupted and the agent gets a reason it can act on. The owner refuses rather than queues (decided). An application whose kernel already knows the gesture (Helios’s value store is kernel-side) does not need the interface to place this hold; a tab drag, which only egui knows, does.
Two windows
main window and a detached "Histogram" window, same process, same stack
user (in the detached window): Alt+Left → context.request {leave}
K : applied, context.changed rev 10
UI : one projection pass; both viewports read the same WhenContext;
UI : the parent's arrangement has no detached Histogram → its window
UI : closes, its geometry saved in the sub-place's view state
user: re-enters the sub-place → the detached window reopens where it was
A headless run in “review”
script or agent, no window: context.set_mode {orientation: review}
K : applied, written, context.changed on the bus
K : the batch starts and places hold {token: batch-12, groups: [orientation]}
agent: context.set_mode {orientation: culling} → Refused {by: batch-12}
K : the batch ends → release → context.released
The machine works without egui; nothing in this flow needs a projection.
kill -9 and reopen
user: enters sub (rev 8), sets culling (rev 9), pushes compare (rev 10)
K : each transition wrote the stack before publishing
UI : view state written one second after each change
kill -9
start: K loads the stack rev 10; registry check: all valid; no transients
K : publish context.restored {rev 10, dropped: []}
UI : projection applies rev 10, then the saved view state of sub
→ same places, same modes, same panels, same zoom
If the sub-place was deleted meanwhile, the stack is cut at the root, the modes survive, and a toast says what was dropped.
Undo across a transition
Transitions are not undo steps: navigation has its own inverse
(nav.back, the crumbs, the chips), and mixing them would make Ctrl+Z
walk the user around instead of undoing their work. But an undo step
made in another frame must not apply out of sight:
user: in sub, changes a parameter (undo step 41, stamped with frame path root›sub)
user: leaves to root (rev 11)
user: Ctrl+Z
host: step 41 was made in root›sub, the current path is root
→ undo it, and show a toast "Undone in Sub" with "Go there"
Undo stamps the frame path on each step; the host answers undo as
today (ADR 0010).
0013: The mount contract: components declare needs, hosts declare offers
Date: 2026-10-14. Status: accepted.
The analysis behind it (what egui-pop has, the contract in detail, the survey, the free-content dialog, the steps, the risks and the open questions) is in the appendix. Today’s matrix, written by hand from the code, is hosts.md.
Context
Whether a component can be put in a place is answered nowhere. A dialog
cannot hold a viewport (its four kinds take no free content), although
its Clear backdrop was made for a dialog previewing its effect on the
image. A panel detached into an auxiliary window loses the keymap
without saying so. A palette cannot be resized, so a viewport in it has
no size to fill. Each answer is buried in one module, and the only
declaration that says where something may go, PanelSpec (areas,
min_size, detachable, floatable, palette, refuses(area)),
covers panels in areas and nothing else.
What is missing is a low-level connector shared by every place and every component, like the studs of building bricks: a small, common vocabulary in which a component says what it needs and a place says what it offers, so that “can this go there, and if not, why not” is computed, tested and documented from one source.
Decision
Components declare needs (Mountable, in egui-pop-model, no
egui): keyboard (none, while hovered, when focused, or exclusive) and
the keys it claims (Enter, Escape, Space, Tab); pointer (drags inside,
drag out, wheel, bitmap cursors); workers (a producer the application
runs, drained when drawn) and whether they must keep running while
another surface is modal; surface (egui textures, a GPU paint callback,
the image’s own surface) and colour (sRGB, wide gamut wanted, wide
gamut required); size (minimum, preferred, maximum, fills or not,
aspect); instances (single, through a service, or several, through the
caller’s state); a view-state key; its commands and keymap surface; an
accessibility role; whether it needs an AppHandle; whether it
asks a question (must be answered before going on); whether it
holds a session (an edit, a running program) that must not end by
accident; and a non-interactive preview mode.
Hosts declare offers (HostOffer): size (fills a rect, bounded
width with content height, one row, none), resizable by the user; focus
policy (shared, click-into, modal-exclusive, none) and the keys the host
owns (Enter, Escape, a click outside); lifetime (persistent or
transient); window (main, auxiliary, follows its panel); whether the
keymap reaches it; participation in the context stack’s projection
(ADR 0012); what it keeps (place, view state); whether it gives a Ui
and an AppHandle.
Mounting is matching, a pure function in egui-pop-model:
check(needs, offer) -> Verdict, one of fits, fits under
conditions (each condition named and explained), or does not fit
with a reason of one kind: by design (a named rule and what to do
instead), an egui-pop limit (with its gap), or an upstream
limit (with its entry in docs/upstream.md). “Not tried” is not a
verdict: a component or host without declarations shows as a gap. The
rules are named and few (size, keyboard and claimed keys, lifetime and
sessions, questions, display, instances, application handle, view
state); each rule’s text is the reason shown.
The matrix is generated. docs/hosts.md is produced from the
declarations (an xtask writes it; a test fails when the committed page
is stale), so the “why” in each cell is the unmet need, never a
sentence written apart from the code.
Each component has one mount test against mock hosts built from
each host’s offer (egui-pop-test): it mounts the component’s
fixture in every host its verdict accepts, checks the conditions that
can be checked headless (size kept, every interactive node named, a
global binding refused under a modal with the trace’s verdict), and
checks that a refused mount is reported with its rule (ADR 0003). A new
host or a new component is covered by the same loop.
The free-content dialog is a host. A Custom dialog kind takes a
body and keeps every dialog rule (a primary button that says what it
does, Enter and Escape, steps, agents through the collector, movable,
closable, a remembered position, the backdrop); its offer is modal,
transient, bounded, keyboard exclusive with claims. Its first use is a
preview dialog with an image viewport and the Clear backdrop.
Existing declarations become offers and needs. PanelSpec’s
only_in, min_size, detachable and floatable stay, and gain the
content’s Mountable; refuses(area) generalises to refuses(host).
Zones, the workbench’s areas, palettes, auxiliary windows, the overlay
stack’s modals and popovers, the status bar and the gallery’s stories
each declare an offer.
Consequences
- “Where can this go?” has one answer for people (the generated page),
for code (
check), for agents (amountscollector and anAppHandlequery), and for tests. - A refused mount (detaching a panel whose content requires the main window, putting an edit session in a popover) is reported with its rule instead of failing silently.
- Every component crate carries one declaration per component and one
mount test; a plain widget declares
Mountable::plain()and changes nothing else. - The gaps found while writing the first matrix (no free-content dialog, palettes not resizable, no keymap in auxiliary windows, overlays in the main window only, no custom settings page) become tickets, each a rule whose verdict changes from “egui-pop limit” to “fits”.
- Declarations can lie; the mount tests are what keeps them honest.
Answers to the open questions (2026-10-14)
The owner accepted the proposed defaults of the analysis (section 6):
- The free-content dialog is a new kind,
Dialog::Custom; the other four kinds keep taking no free content. - Claims of Enter and Escape in a dialog: a focused component may take them when its declaration claims them. When the content claims Enter, Ctrl+Enter accepts; Escape still cancels the dialog unless the content claims it and has something to cancel.
- Auxiliary windows get the keymap and overlays of their own (E3, E4): a detached viewport is meant to be a real window. Each is its own piece of work, not part of this decision’s first steps.
- Palettes become resizable (E2), their size remembered; also its own piece of work.
- Several instances of a panel become possible, opt-in per panel.
- No edit session in a popover (D3) is confirmed, by design.
- The preview dialog is sRGB first; two overlapping wide-gamut image surfaces come later, once tried.
- The generated page is committed, and a test fails when it is stale.
- Dialogs stay outside the context stack’s projection (ADR 0012): a modal tool that must come back after a restart is a transient frame of the stack instead.
- A heads-up host over the viewport comes later, as its own piece of work, when a component needs it.
0013, appendix: the analysis behind the mount contract
The analysis that led to ADR 0013, kept for the reasons it gives. Where it differs from the ADR, the ADR wins; the open questions of section 6 are answered there. The matrix it starts from, written by hand from the code, is hosts.md; the codes used below (c1, D1, E1, U1…) are that page’s.
1. What egui-pop already has
Several studs exist already, each covering one host or one concern:
| Piece | What it declares | What it misses for a general contract |
|---|---|---|
PanelSpec (egui-pop-model::panels) | Areas allowed (only_in), min_size, default_size, detachable, floatable, palette, bare, open; refuses(area) returns a reason (“X stays out of the bottom panel”), shown by the drop hint and reported (ADR 0003). | Only areas; nothing about keyboard, size bounds of other hosts, windows, display, instances. It describes the panel, not the component inside it. |
| The panel registry | AppHandle::panels() on the main branch; AppHandle::declared_panels() with each panel’s owner on the entry-icons branch (not merged). | A list of panels, not of components or hosts. |
| Zones and blocks (ADR 0005) | Named places, blocks added, replaced, extended, wrapped, resolved at build time with reported failures. | A zone says nothing about what fits in it (the status bar and the main zone look alike to a block). |
The overlay stack (egui-pop-core::overlay) | Modal, popover, menu; Escape closes the top one; a click outside closes popovers, never a modal; focus restored on close. | Not exposed as a host: the settings window, the command palette and the file picker use it directly. |
| Focus scopes and key resolution (ADR 0007) | Surfaces (surface:<name>), through_modal, the Escape order, traces with verdicts (BlockedByModal, SurfaceNotFocused). | Already the right vocabulary for the keyboard part of the contract; nothing ties a component’s surface to the hosts it may be in. |
| Steps (ADR 0011) | workbench.detach, palette.float, dialog.show, each with veto and redirect. | Hooks can refuse a move for a plugin’s own reasons; the contract gives the structural reasons before any hook runs. |
| Fault boundary | Panels, blocks and stories draw inside one. | Dialog bodies and raw modals do not. |
| The context stack’s projection (ADR 0012, on its branch) | Per projection key: the layout (docked, floating and detached panels), the focused panel, named view values (set_view_value, scroll_area). | Dialogs, popovers and zones are outside it; a component’s view state is kept only if it uses those names. |
| Stories | A component in its states, reused by tests as fixtures. | The fixture a mount test needs already exists for most components. |
| Threading (docs/threading.md) | Every producer posts to a queue and wakes the interface; the queue is drained when the component draws. | Whether a component’s work must go on while another surface is modal, or while it is hidden, is nowhere declared. |
Hosts, in the contract’s vocabulary
| Host | Size | Resizable | Focus policy, keys it owns | Lifetime | Window | Keymap | Projection | Keeps | Ui, AppHandle |
|---|---|---|---|---|---|---|---|---|---|
| Docked panel | fills its area rect, min_size across | yes | shared (scope panel:<id>); none | persistent | main, or auxiliary when detached | yes | yes (branch) | place; view values (branch) | yes, yes |
| Floating palette | width min_size..default_size, content height | no (E2) | click-into; Escape gives the keyboard back | persistent | main | yes | yes (branch) | place, rolled, pinned | yes, yes |
| Auxiliary window | fills a window | yes | the OS window’s; none | persistent | auxiliary | no (E3) | yes (branch) | window rect | yes, yes |
| Dialog (four kinds) | dialog.width, content height | no | modal-exclusive; Enter, Escape | transient, one at a time | main | through modal only | no | position (opt-in) | no (E1) |
| Raw modal | optional width, content height | no | modal-exclusive; Escape | transient | main | through modal only | no | nothing | yes, yes (from a block) |
| Popover | content | no | transient; Escape, a click outside | transient | main | yes | no | nothing | yes, yes |
| Line zone, status bar | one row | no | shared (zone scope); none | persistent | main | yes | no | nothing | yes, yes |
| Viewport overlay | the image | n/a | none | per frame | follows the viewport | n/a | no | the application’s data | no (D2) |
| Gallery story | the gallery’s main zone | yes | shared; none | persistent | main | yes | no | nothing | yes, yes |
Components, in the contract’s vocabulary
| Component | Keyboard, claims | Pointer | Workers | Surface, colour | Size (min, fill) | Instances | View state | Session | Needs AppHandle |
|---|---|---|---|---|---|---|---|---|---|
| Image viewport | hover (Space, loupe, compare) and focus (zoom, arrows); claims Escape during a drag | drag, wheel, bitmap cursors | tiles, drained when drawn | paint callback or textures; wide gamut wanted | none, fills | several | zoom, centre (caller) | no | no (steps optional) |
| Navigator | focus | drag, wheel | no | textures | 120..320, 3:2 | several | shares the viewport’s | no | no |
| Node graph | focus; claims Escape, Delete; Space read globally (c9) | drag, wheel | no | egui Scene | fills | several (id_salt) | view rect, selection (caller) | yes (wiring) | for agent commands |
| Curves, wheels, histogram | focus | drag | no | painter | 120..320 square; 48+; 120..600 | several | caller | no | no |
| Thumbnail | none | click | no | texture | 96 by 72 | several | none | no | no |
| Library grid, filmstrip | focus (culling keys) | rubber band, wheel | thumbnails | textures | fills; filmstrip 120 high | several | selection, size, scroll (caller) | no | for commands |
| Compare view | none | drag, wheel | thumbnails | textures | at least 80 high, fills | several | pan, zoom (caller) | no | no |
| Text, code editor | focus; surface editor; claims Enter, Tab, Escape (popups) | drag-select | assist providers | text | fills | several | model, scroll | yes (unsaved text) | for steps and keymap |
| Terminal | exclusive while focused (except Shift+Escape); surface terminal; claims Enter, Tab, Escape | drag-select, Ctrl+click | PTY threads, started on first drawing | text | at least 4 cells, fills | several | scrollback | yes (a process) | for steps |
| Tree, table, list | focus; claims Enter, Space, F2 (tree) | drag inside (tree), resize columns | sources (tree) | text | fills | several | expansion, selection (caller); widths in the store (table) | no | no |
| Sliders, forms | focus; claims Enter (typed entry), Escape (drag) | drag | no | painter | at least 120 wide | several | value | no | no |
| Progress | none | none | no | painter | fills width | several | none | no | no |
| Jobs centre | focus | click | the host’s jobs, folded from the journal | text | fills | single (service) | expanded jobs (service) | no | yes |
| Theme editor | focus | colour picker popups | no | text, swatches | about 520 wide | single (service) | the draft (service) | yes (a draft) | yes |
| Tips | focus | click | no | text | a card, or one line for a hint | several (one service) | dismissed tips (settings) | no | yes |
| Breadcrumb, chips (branch) | focus | click | no | text | one row | several | the stack (owner) | no | yes |
2. The contract
Needs
| Need | Values | Why it matters |
|---|---|---|
keyboard | None, Hover, Focus, Exclusive | Line hosts give no lasting focus; a modal owns Escape and Enter; an exclusive component (a terminal) conflicts with any host owning a key. |
claims | a set of keys: Enter, Escape, Space, Tab, arrows | A dialog’s Enter accepts and Escape cancels; a component that uses them must be asked first (section 5). |
surface | a keymap surface name, and whether its commands are bound there | Surface bindings fire through a modal but not in an auxiliary window today (c2, c4). |
pointer | Click, Drag, DragOut, Wheel, CursorImages | Drag out of a transient host closes it; bitmap cursors fall back in an auxiliary window (U1). No component drags out today. |
workers | None, DrainedWhenDrawn, plus keep_under_modal | Workers are the application’s threads and keep running whatever the host; what matters is whether the queue grows while the component is hidden. |
display | Srgb, WideWanted, WideRequired; PaintCallback, ImageSurface | Wide gamut exists only in the main window (U2): wanted degrades, required refuses. |
size | min, preferred, max, fills, aspect | A content-sized host gives a filling component nothing to fill (c1); a line host gives one row (D1). |
instances | Several (caller’s state), Single (a service) | Two mounts of a single component show one state (c7). |
view_state | a key, or none | Kept only by hosts in the projection, or by the store. |
app | whether it needs an AppHandle, and which services | A host without one (the viewport overlay) cannot take it. |
role | an AccessKit role and name | Checked by the test kit (“every interactive node has a name”); the host adds its own (a dialog is named by its title). |
asks | whether the component is a question that must be answered | Only a modal host takes it (D4). |
session | whether ending it by accident loses work | A transient host closed by a click outside refuses it (D3). |
preview | whether it can be drawn non-interactive | A thumbnail-sized, read-only mount (a story’s index, a template’s preview) fits more hosts. |
A plain widget declares Mountable::plain() (focus keyboard, no
claims, several instances, no workers, sRGB, any size); most of today’s
yes* cells are exactly that.
Offers
| Offer | Values |
|---|---|
size | Fill(rect), Bounded { width, height: content }, Row, NoUi |
resizable | by the user or not |
focus | Shared, ClickInto, ModalExclusive, None |
owns_keys | the keys the host takes before the content (Enter, Escape, Tab) |
dismissed_by | Answer, Escape, OutsideClick |
lifetime | Persistent, Transient |
window | Main, Auxiliary, FollowsPanel |
keymap | whether the key dispatcher reaches it |
projection | whether it is part of the context stack’s projection |
keeps | place, size, view values |
gives | a Ui, an AppHandle, a focus scope, a fault boundary |
display | Srgb, Wide (main window with an image surface) |
Offers compose: a panel detached into an auxiliary window offers the panel’s focus scope and the window’s display and keymap reach.
Matching rules
Each rule looks at one need against one offer and gives a verdict and, when it does not fit, the kind of reason. The worst verdict wins; all conditions are kept.
| Rule | Need, offer | Verdict |
|---|---|---|
| R1 size | fills against Bounded | fits under condition: an explicit size (c1) |
min larger than a Row | no, by design: D1 | |
fills and resizable wanted, palette not resizable | fits under condition (E2 named as the gap) | |
| R2 keyboard | Focus or Exclusive against a Row host | no, by design: D1 |
| a claimed key the host owns (Escape in a modal) | fits under condition: the host takes it first (c4), until the free-content dialog lets a focused component claim it | |
| a keymap surface where the keymap does not reach (auxiliary window) | fits under condition: c2 (E3 named) | |
| R3 session | session against dismissed_by: OutsideClick | no, by design: D3 |
| R4 question | asks against a non-modal host | no, by design: D4 |
| R5 display | WideWanted against Srgb | fits under condition: sRGB with the reason (c3, U2) |
WideRequired against Srgb | no, upstream: U2 | |
CursorImages in an auxiliary window | fits under condition: system cursors (U1) | |
| R6 instances | Single mounted twice | fits under condition: one shared state (c7) |
| R7 application | app against a host that gives none | no, by design: D2 (data-only host) |
R8 Ui | any component against NoUi | no, by design: D2 |
| R9 workers | DrainedWhenDrawn in a host that can hide its content | fits under condition: the queue grows while hidden |
| R10 view state | a key against a host outside the projection | fits under condition: not kept across places and restarts |
| R11 dialog content | any component against the four-kind dialog | no, egui-pop limit: E1 (until section 5) |
A rule refers to a reason by code; the code’s text (the rule, what to do instead, the gap and its cost, the upstream entry) lives once, with the rule, and is what the generated page and the reported refusal show.
Worked examples
- Image viewport in a dialog: today R11 refuses (E1). With the free-content dialog: R1 gives c1 (an explicit size), R2 gives “Escape claimed during a drag” (handled, section 5), R9 nothing (the dialog draws it every frame): fits under conditions.
- Terminal in a popover: R3 refuses, by design (D3): a running program would end on a click outside. Instead: a panel, or a dialog that asks before closing.
- Viewport in an auxiliary window: R2 gives c2 (its keymap commands, if any, do not fire), R5 gives c3 (sRGB, system cursors): fits under conditions.
- A mastering view requiring wide gamut, detached: R5 refuses, upstream (U2).
3. Generating the matrix and testing it
- Declarations live with the code. Each component crate exports
its
Mountables (a function per component, next to the widget); each host’s offer is declared where the host is built (egui-pop-apifor panels, palettes, windows, dialogs, overlays, zones and stories;egui-pop-viewportfor its overlays). The types andchecklive inegui-pop-model(no egui), so every layer can use them (ADR 0001). - The page. An xtask (
cargo xtask hosts) collects every declaration through a registry the facade fills, runscheckfor every pair and writesdocs/hosts.md: the hosts and their offers, the components and their needs, the matrix, the conditions and the reasons, and the counts. A test compares the committed page with a fresh generation (asgallery_doc.rsdoes for snapshots), so it cannot drift. - What stays hand-written: the evidence (which test or page exercises a cell) comes from the mount tests themselves, which tag the cells they draw; “not tried” is any accepted cell no test tags.
- Mock hosts (
egui-pop-test::hosts): one per offer, each a harness that reproduces the host’s constraints: aFillrect, a content-sized area of bounded width, a modal overlay (with the dispatcher, somodalOpenand Escape behave), a row, an immediate viewport for the auxiliary window (with kittest’s limit noted). - One mount test per component: for each host its verdict
accepts, mount the component’s fixture (its story, interactive and
in preview), check that it stays within the host’s size, that every
interactive node is named, and the checkable conditions (a global
binding refused under the modal with
BlockedByModal; the component’s own keys still received). For each refused host, check thatAppHandle::mountreports the refusal with its rule and does nothing else (ADR 0003). - At run time:
AppHandle::where_can(component)lists the hosts and verdicts, and amountscollector on the debug bridge shows every mounted component with its host and conditions, so an agent can ask “where can this go?” before moving anything.
4. Survey
| System | What a part declares | What the container declares | Take |
|---|---|---|---|
| egui_dock (MIT) | A TabViewer per tab type: title, ui, is_closeable, allowed_in_windows, clear_background, scroll_bars, on_close, context_menu. | The dock style; AllowedSplits globally. | Already used; the per-tab flags are the right granularity, but there is no per-destination refusal (its issue 351, our upstream entry). Take: capabilities per content, answered per destination by egui-pop. |
| egui_tiles (MIT OR Apache-2.0) | A Behavior: pane_ui, tab_title_for_pane, is_tab_closable, simplification options. | Container kinds (tabs, linear, grid). | Same shape as egui_dock; nothing about keyboard or windows. Nothing new to take. |
egui Modal, Window, Popup (MIT OR Apache-2.0) | Free content in each. | Modal per viewport; popups closed by a click outside (PopupCloseBehavior). | The free-content dialog builds on Modal as dialogs already do; PopupCloseBehavior is the popover’s dismissed_by. |
| VS Code views and contribution points | contributes.views: id, name, type (tree or webview), when, initialSize, visibility; viewsContainers per location (activity bar, panel); custom editors with a selector and priority; webviews with retainContextWhenHidden; supportsMultipleEditorsPerDocument. | Locations (side bar, panel, secondary side bar, editor area); views movable between view containers. | Declarative manifests read before any code runs; when clauses on placement; retainContextWhenHidden is exactly our workers/hidden question, made explicit and costly on purpose; multi-instance as a declared capability. Take all four. |
| Qt docks and widgets | QWidget::sizePolicy, sizeHint, minimumSizeHint; focusPolicy (NoFocus, TabFocus, ClickFocus, StrongFocus, WheelFocus); QShortcut context (WidgetShortcut, WidgetWithChildrenShortcut, WindowShortcut, ApplicationShortcut); QAccessible roles; objectName as the key saveState uses. | QDockWidget::setAllowedAreas, DockWidgetFeatures (closable, movable, floatable); Qt::WindowModality; QMainWindow::saveState. | The size triple and the focus policy enum map directly to our size and keyboard; the shortcut contexts are our global and surface scopes (and say “window” explicitly, which is what c2 is missing); objectName as the persistence key is our view_state key. Take the vocabulary. |
| Blender areas and editors | Panels declare bl_space_type, bl_region_type, bl_context and a poll() that decides at run time; operators have poll() too; keymaps per space and region (“Window”, “Screen”, “Image”); popups and invoke_props_dialog draw any layout in a dialog. | Any area can become any editor (space); regions (header, tool bar, side bar, window, HUD) are fixed per space. | The extreme case: every editor fits every area, which works because each editor fills its area and owns its keymap layer; placement rules sit in regions, not areas. poll() is a dynamic need; our needs stay static, and dynamic refusals stay in step hooks (ADR 0011). Free-content dialogs are ordinary there, with the operator keeping the confirm button. Take: keymap per host kind, the HUD as a region over the editor (our missing heads-up host over the viewport, D2’s “do instead”). |
| Other egui crates | egui-modal (MIT) gives free-content modals with buttons; egui_extras has no placement model. | Nothing to adopt: egui-pop’s dialog already does more. |
Adopt, wrap or own: own. No crate declares placement needs and
offers across hosts; the vocabulary is taken from Qt (size, focus,
shortcut context), VS Code (declarative contributions, hidden-state
retention, multi-instance) and Blender (keymaps per host kind, a HUD
region). The matching is a pure function of a few hundred lines in
egui-pop-model.
5. The free-content dialog as a host
A new kind, Dialog::Custom, with a title, a primary verb and command
(or none, for a dialog that only closes), and a body: a draw function
returning the values the command gets (as a form’s values are merged
in) and whether the primary action is possible now.
What it offers: modal and transient; bounded size, given by the
spec (size(width, height), a fraction of the window by default for a
preview) rather than the content, so a filling component has something
to fill; optionally resizable by its corner (kept with the remembered
position); keyboard exclusive, global bindings blocked unless
through_modal, surface bindings of the body’s components firing; a
focus scope dialog and a fault boundary around the body; main window
only; not in the projection (a modal tool that should come back after a
restart is a transient frame of the context stack instead, as ADR 0012
suggests).
What it keeps from the dialog rules:
- A primary button that says what it does (“Export 3 images”), a danger style, Cancel; never “OK”.
- Enter accepts, Escape cancels, with claims: when the focus is in a component that claims Enter (an editor, a tree’s rename) the key goes to it, and Ctrl+Enter accepts from anywhere; Escape goes first to a focused component that claims it and has something to cancel (a drag, a selection, a popup), then cancels the dialog. This needs one small API on the focus side: a component says, during its pass, that it will take the next Escape (as text inputs already do).
- Steps
dialog.show,dialog.answer,dialog.moveunchanged; the body’s values are in the answer’s arguments. - Agents: the
dialogscollector describes a custom dialog by its title, verb and the body’sdescribe(a JSON value the body gives, such as the preview’s view and settings), and answers it withaccept(values merged) orcancel, as for a form. - Movable, closable, remembered position, backdrop as today; the
Clearbackdrop is the default for a preview. - One dialog at a time (D5): a body never opens a second dialog; a choice inside it is drawn inline.
Implementation notes: the queue clones the shown dialog every frame
and lives in a Send service; a body capturing the application’s state
is neither Clone nor Send, so bodies are kept on the AppHandle
side, by dialog id, and the queue holds only the id. The dialog draws
the body every frame, so the components’ queues are drained while it is
open.
First use: a preview dialog with an image viewport. An export or
crop preview: Custom with a 70 % window size, Clear backdrop,
movable, remembered under export.preview, primary verb “Export”. The
viewport draws from its own tile source; the main viewport behind keeps
receiving and drawing tiles (egui still draws the interface behind a
modal). Its mount test: tiles delivered from another thread appear in
both viewports while the dialog is open; a global binding is refused
with BlockedByModal; the viewport’s zoom keys work when focused;
Escape during a handle drag cancels the drag and not the dialog; Enter
exports. Not tried and to check first: two Wayland image surfaces in
the main window (the main viewport’s and the dialog’s) overlapping;
until then the dialog’s viewport may ask for sRGB.
6. Steps, risks and open questions
Steps
- Accept this ADR (or amend it with the answers below).
egui-pop-model::mount: needs, offers, rules, verdicts, reason codes; unit tests per rule. No egui.- Offers for today’s hosts in
egui-pop-apiandegui-pop-viewport;PanelSpecgains its content’sMountable,refuses(area)becomesrefuses(host); refusals reported (ADR 0003) when a detach, a float or a mount is refused. - Needs for today’s components (
Mountable::plain()for most). - The generator and its staleness test;
docs/hosts.mdregenerated, this hand-written version retired. - Mock hosts and one mount test per component; refusal tests.
- The free-content dialog and the preview dialog in the gallery.
where_canand themountscollector.- A ticket per egui-pop limit: E1 (closed by step 7), E2 palettes resizable, E3 keymap in auxiliary windows, E4 overlays per window, E5 custom settings pages; and the upstream entry for U3 and for kittest’s embedded viewports.
Risks
- Declarations that lie. A component declared
Focusthat reads Space globally (the node graph today) shows “fits” where it does not. The mount tests are the guard; they must probe keys, not only draw. - Too fine a vocabulary. Every need added is a column of declarations to keep. The list above stops at what today’s matrix needed; anything else waits for a cell that needs it.
- Dynamic needs. A viewport with or without wide gamut, a graph
read-only or editable: needs depend on options. Declarations take the
options (
Mountablebuilt from the widget’s settings), and preview and interactive are two declarations. - Multi-window cannot be tested headless. kittest embeds immediate viewports in the main one; W cells stay “read from the code” until a wbox run covers them.
- egui changes under the rules. egui’s modal is per viewport today; a change there moves E4. The rules name the egui behaviour they rely on, checked at each egui bump with the upstream register.
- Cost for third-party components. One declaration and one test each; the extension template gets them, so the cost is visible from the start.
Open questions for the owner
- The free-content dialog’s shape: a new kind (
Dialog::Custom, proposed) or a body that any kind may carry? - Claims of Enter and Escape inside a dialog: may a focused component take them (proposed: yes, when declared, with Ctrl+Enter always accepting), or does the dialog always win?
- Auxiliary windows: fix the keymap and the overlays per window (E3, E4), or declare by design that an auxiliary window shows content and the commands stay in the main window?
- Palettes: resizable (E2), or content-sized by design, refusing filling components?
- Several instances of a panel (two viewports or two graphs as
tabs): add a declared instance count to
PanelSpec, or keep one panel per id and let the application declare several ids? - Popovers holding a session (D3): confirm as by design, or allow a popover that asks before closing?
- Wide gamut in the preview dialog: required for its first use, or sRGB first and two image surfaces later?
- The generated page: committed and checked for staleness (proposed), or generated only at documentation build?
- Dialogs and the projection: stay outside (proposed), with transient frames for modal tools that must come back?
- A heads-up host over the viewport (D2’s “do instead”): wanted now, or wait for a component that needs it?
0015: The clipboard: typed items owned by the kernel, offered in several formats, hooked at each boundary
Date: 2026-10-18. Status: accepted (2026-10-21).
The analysis behind it (what exists today, how egui and eframe reach the system clipboard, a survey of crates and of seven applications, the questions answered, the flows) is in the appendix. Where they differ, this page wins.
Context
egui-pop copies text and nothing else. The code editor and the terminal
handle egui’s Event::Copy, Event::Cut and Event::Paste themselves;
text fields keep egui’s own handling; the node graph, colours, theme
tokens and table rows cannot be copied at all. There is no clipboard
command, no Edit menu entry, no step to observe or veto a copy or a
paste, and no way for an application to strip what must not leave it
or to adapt what comes in. egui-winit turns Ctrl+C, Ctrl+X and Ctrl+V
into those three events and swallows the keys, so the keymap cannot
bind them; it reads a paste synchronously, as text only, and knows no
primary selection.
An application with a kernel (Helios) copies typed, rich content (module parameters, mask shapes, sub-networks, colours in a colour space, library images, workspace parts) that holds ids and paths only its kernel understands, between windows and between processes, and lets agents copy and paste through the same commands as the user. Like the context stack (ADR 0012) and undo (ADR 0014), the clipboard’s content belongs to the kernel; the interface routes the keys to it and shows it.
Decision
A typed contract, implemented by the kernel, with a local default.
The owner implements Clipboard (in egui-pop-api, reached through
Host::clipboard(), like Host::contexts() and Host::history()):
slots holding one item each, put, get, offers, a revision.
egui-pop’s default owner, LocalClipboard, keeps the items in memory,
shared by the application’s windows. The pure parts (FormatId,
ClipItem, the boundary rules, negotiate) live in
egui-pop-model::clipboard.
An item is typed; the system clipboard gets its fallbacks. A copy
makes a ClipItem: a private type (application/x-<app>.<type>+json)
with its version, a structured payload, and its source (origin, window,
place in the context stack, owner). The owner keeps the item (the
internal clipboard) and writes its readable fallbacks to the
system clipboard: text always, HTML or an image when the type
renders one, and the private type itself where the platform backend
allows it. A paste uses the internal item when the system clipboard
still holds what the owner last wrote there (a change counter, else a
hash of the fallback); otherwise the content is external and is pasted
from its own formats.
The target picks the richest format it accepts. A target declares
the formats it accepts, richest first; negotiate takes the first one
the offer has, or one a declared transform makes from what the offer
has (one transform, no chains). Nothing fits: the paste is refused
with the reason (ADR 0003). Paste special lists every format and
transform that fits, the item’s parts when its type has parts (a
parameter set’s modules), and the target’s preview.
Hooks at each boundary. Copy and paste are steps (ADR 0011):
clipboard.copy: before-hooks veto (a secret field) or redirect (another selection); sanitisers run per representation on the boundary it crosses. Inside the owner nothing is removed; towards the system clipboard local paths, secrets and owner-local ids are removed from the fallbacks and from the private payload, and the item records what went (stripped), shown in the toast.clipboard.paste: before-hooks veto or redirect (another target, another format); external content is sanitised first (HTML reduced, control characters removed from text bound for a terminal); then transforms adapt the representation to the target (a version upgrade, a size, a colour space, a unique name). A lossy transform says what it lost.
Plugins declare types and transforms in their registry and own them (ADR 0004): a type has an id, a version, a schema, the fallbacks it renders and a migration from its older versions; a transform has a source and a target format, a condition, and whether it is lossy.
A paste is one undo step; a copy is none. The paste runs under a history group (ADR 0014) labelled by the type (“Paste 3 nodes”); a cut is the copy and the delete in one step, and copies only once the delete is accepted.
Sources and targets are the focused component’s. A component
registers a ClipSource (what a copy takes, what a cut deletes) and a
ClipTarget (the formats it accepts, how it applies a paste), as it
registers a local undo scope. The commands edit.cut, edit.copy,
edit.paste and edit.pasteSpecial sit in the Edit menu (group
1_clipboard) with the keys canCopy, canCut, canPaste, and
when !textInputFocus: text inputs keep egui’s own copy and paste.
Ctrl+C, Ctrl+X and Ctrl+V are dispatched from egui’s three events (the
modifiers held then give Ctrl+Shift+V), every other binding from the
keymap.
Across windows and processes. One owner, one internal clipboard, for all its windows. Two processes share an item when they share an owner (the kernel stores it; the system clipboard carries a marker), or through the private type on the system clipboard where the backend supports it. Other applications see only the fallbacks.
Agents use the same steps: clipboard.copy, clipboard.paste
(with format, transform, parts, if_rev, dry_run; a dry run
answers the format chosen, the transforms, what would be stripped and
the changes, without making them), clipboard.offers, clipboard.read,
clipboard.write, and a clipboard collector on the debug bridge. An
agent’s session has its own slot: it neither reads nor overwrites the
user’s unless the host allows it.
Survey. egui and eframe carry text both ways and images out, no formats, no primary selection, and a paste pushed as text on the key: keep them for text inputs, wrap the rest. arboard (MIT or Apache-2.0, already in the tree through egui-winit: text, HTML, images, file lists, X11’s primary selection, no private types) and smithay-clipboard (MIT, already in the tree: Wayland text and primary selection) are adopted behind egui-pop’s system backend. wl-clipboard-rs (any type, but only with the data-control protocol) waits; copypasta (text only) is rejected. No crate has the model (typed items, negotiation, transforms, boundaries): own it, and own a small private-type backend later.
Consequences
- Copy and paste of rich content (nodes, colours, tokens, rows, and an application’s own types) with one rule for every component; text fields unchanged.
- What leaves the owner is stripped by rules the application declares, and the user is told what was left out.
- A host adapts pasted content to its target in one place (transforms) instead of in every widget.
- Agents copy and paste with the user’s refusals and a dry run, without touching the user’s clipboard.
- The keymap cannot rebind Ctrl+C, Ctrl+X, Ctrl+V while egui-winit
swallows them; that limit goes to
docs/upstream.md. - Private types across processes without a shared owner wait for a backend per platform; until then such a paste falls back to text.
Answers to the open questions (2026-10-21)
The owner accepted the proposed defaults (the analysis gives the reasons):
- System clipboard on every copy: yes, the fallbacks are written on every copy; a type may declare itself internal only.
- Private type or marker: a marker first (a change counter, else a hash of the fallback); the private type later, where the platform allows it.
- Clipboard history: none; one item per slot.
- Agents reading the user’s clipboard: refused, unless the host allows it per agent.
- External HTML on paste: reduced to text, unless the target accepts HTML; then sanitised.
- Primary selection: opt-in, for text inputs and the code editor only.
- Lossy transforms: applied, with a toast naming the loss; paste special shows it beforehand.
- Paste with no target that accepts it: refused with the reason, the command greyed out; no guessed target.
Done ahead of the steps
The fixes of step 1 found while reading the code: a cut in the code
editor copies only once its delete is accepted; the terminal removes
the bracket’s markers from a bracketed paste; Ctrl+Shift+C in the
terminal never interrupts; docs/editors.md says Shift+Insert pastes
on Windows only. The Clipboard contract itself is step 2.
Built (2026-10-21)
Steps 2 and 3: the model in egui-pop-model::clipboard, the
Clipboard contract with LocalClipboard behind Host::clipboard,
history groups (Host::begin_group, Host::end_group), endpoints
(ClipSource, ClipTarget), plugin-declared types, transforms and
sanitisers, the clipboard.copy and clipboard.paste steps, the four
Edit commands (dispatched from egui’s events too), the agents’
clipboard.* with a dry run, and the clipboard collector; a gallery
page. The guide is docs/clipboard.md. Left: the
first types and their sanitisers (step 4), and the system backend for
rich formats, private types and the primary selection (step 5).
Follow-up: gaps found by an application (2026-10-28)
An application building its own clip types (parameters, graph nodes, mask shapes) and its own system clipboard on the contract found gaps (issue #73). Built, each in the guide (docs/clipboard.md):
- Elements and areas. In a graph or a tree the focus sits on each
node or row:
bind_elementbinds each element’s widget with its key,bind_areaany focused widget whose centre lies in an area; the source and the target receive the key (ClipSource::copy_element,Cut::element,Paste::element) and agents name one (element). The focused widget’s rectangle comes from egui’s lists of widgets:Context::read_responsewould surrender the focus of a widget not hovered during a press. - Deferred pastes. A target whose edit goes through the
application’s loop answers
Pasted::LaterfromClipTarget::apply; the history group stays open until the result arrives (one undo step still), and the result is published asclipboard.pasted. - Transforms that see the target.
Transform::for_targetreceives the target’s name, element andClipTarget::context, so an adaptation to the target is a transform whose loss is shown, not a hidden step ofClipTarget::paste. - Translatable titles. A type’s title is a declaration
(
clip-<format>.title); an item carries its title as a catalogue message (ClipItem::title_key); the undo step’s labels are strings. AppHandle::localis public, for a host’s own state.- The system backend (step 5).
SystemBackendwrites one copy’s representations at once and reads every format the system clipboard holds as one external item with several representations (ClipItem::external); the default,EguiText, keeps text through egui, so nothing changes for an application that does not opt in. A host gives its own (Clipboard::system), an application installs one (set_backend);egui-pop-platformhas one over arboard (SystemClipboardPlugin), which states its Wayland path (XWayland, or the data-control protocol withclipboard-wayland) and reads and writes the primary selection. - The paste key with no text. egui-winit makes no event when the
system clipboard holds no text; the chord is recognised by its
release (its press never reaches egui) and pasted with
no_text, read through the backend. egui 0.37’sNativeOptions::clipboard_shortcutsreplaces this at the bump (docs/upstream.md).
Left: egui-pop’s text inputs and code editor using the primary selection (the backend reads and writes it; the widgets do not yet); private types across processes without a shared owner (arboard writes only standard formats: a host’s backend may); several rich formats in one copy through arboard (it writes one per copy: files, else an image, else HTML with its text, else text); the web (no backend reads there); the first types of step 4.
0015, appendix: the analysis behind the clipboard
The analysis that led to ADR 0015, kept for the
reasons it gives. Where it differs from the ADR, the ADR wins. Helios,
the application egui-pop is built for, has its own note on the kernel
side (its docs/design/clipboard.md); this appendix summarises what it
needs.
What exists today
Read from the code on main (2026-10-18), egui, eframe and egui-winit
0.36.2.
In egui-pop
Two widgets touch the clipboard themselves, the code editor and the
terminal; both handle plain text only, both through egui
(ctx.copy_text out, Event::Copy, Event::Cut, Event::Paste in).
There is no clipboard command, no Edit menu entry for it, no clipboard
step, no Host part and no internal buffer. Nothing uses arboard
directly.
| Site | Copies or pastes | Format | How | Step | Gaps |
|---|---|---|---|---|---|
Code editor, copy (egui-pop-editors/src/view.rs:1065, copy_text at :1115) | the selection, or the cursor’s line and a newline when nothing is selected | plain text | ctx.copy_text | none | no step, no signal, nothing can see or veto it |
Code editor, cut (view.rs:1069, cut_span at :1129) | copies as above, then deletes through edit(.., EditKind::Cut) | plain text | copy_text, then the edit.change step | the delete is edit.change {kind: cut}, undoable | bug: the clipboard is written before the step runs, so a vetoed edit.change, a refused edit or a read-only editor (edit() returns false at :994) still copies, and the user sees a cut that deleted nothing |
Code editor, paste (view.rs:1082) | replaces the selection, \r\n becomes \n | plain text | Event::Paste → edit(.., EditKind::Paste) | edit.change {kind: paste}, vetoable, redirectable, undoable | fine; but a multi-character Event::Text is also classed as a paste (view.rs:1035), so some input methods are labelled “paste” |
Terminal, paste (terminal/view.rs:294) | the text, newlines as \r | plain text | Event::Paste → terminal.input {kind: paste} | vetoable, rewritable | bug: write_default (terminal/state.rs:679) wraps a paste in ESC[200~ … ESC[201~ when the program asked for bracketed paste, but does not remove an ESC[201~ (or any escape) inside the text: pasted text can end the bracket early and type commands |
Terminal, copy (terminal/view.rs:298, copy() at :430) | the selection; with none, sends ^C | plain text | ctx.copy_text, TerminalSignal::Copied | copy: none; ^C: terminal.input | bug: Ctrl+Shift+C is meant to copy only (view.rs:309), but under winit it arrives as Event::Copy (see below), so with no selection it interrupts the program; only kittest, which sends key events, reaches the Key::C branch (tests/terminal.rs:137) |
Terminal, cut (terminal/view.rs:302) | sends ^X | n/a | terminal.input | yes | intended |
Terminal, terminal.copy command (terminal/steps.rs:44, :321) | the selection | plain text | AppHandle::egui().copy_text | a command, no key, no menu | the only clipboard verb an agent has; there is no paste command |
Terminal docs (docs/editors.md:447) | “Ctrl+V, Shift+Insert” paste | doc bug: egui-winit maps Shift+Insert to paste on Windows only | |||
Node graph (egui-pop-viewport/src/graph/mod.rs:1950) | no copy or paste; Duplicate (Ctrl+D) emits graph.add with copy_of (egui-pop-imaging/src/graph.rs:11) | n/a | graph.add | nodes cannot be copied to another graph, window or application | |
Theme editor (egui-pop-api/src/theme_editor.rs:453) | import from text pasted into a text field, then theme.import / theme.load | JSON text | egui’s text field | import is a step | no “copy token”, no “copy colour” |
Colour picker, swatches, wheels (egui-pop-core/src/param.rs, egui-pop-viewport/src/wheel.rs) | nothing | no copy of a colour, no paste of one | |||
Table, list, tree (egui-pop-views) | nothing; the library binds X to Reject (views/src/library/marks.rs:231) | no copy of rows or cells | |||
egui text fields (about 25 TextEdit uses: palette, files, dialogs, settings, find bar, tags, filters…) | egui’s own copy, cut, paste | plain text | egui | none | fine as they are: text inputs keep their own, as for undo |
Edit menu (egui-pop-api/src/app.rs:2232) | edit.undo, edit.redo only, group 0_undo | no edit.cut, edit.copy, edit.paste | |||
| Debug bridge, collectors | nothing | an agent cannot see what is on the clipboard | |||
tools/wbox/config.yaml:10 | clipboard_bridge: false | scripted runs in the nested compositor cannot test the real clipboard | |||
Icon::Copy (egui-pop-core/src/icon.rs:178) | exists | used by no command |
How the keys reach egui-pop
egui-winit (src/lib.rs:1016 in 0.36.2) turns a chord into
Event::Cut, Event::Copy or Event::Paste(text) and returns
without sending the key: copy is the Copy key, Command+C (whatever
Shift does) or Ctrl+Insert on Windows; paste is the Paste key,
Command+V or Shift+Insert on Windows; cut is the Cut key, Command+X or
Shift+Delete on Windows. Three consequences:
- A command bound to Ctrl+C, Ctrl+X or Ctrl+V (or Ctrl+Shift+V) in egui-pop’s keymap never fires under winit: no key event arrives. The clipboard commands must be dispatched from the three events, with the modifiers held at that moment.
- A paste reads the system clipboard synchronously, as text only, inside egui-winit, before any application code: a plugin cannot choose a richer format, and a slow clipboard owner (another application on Wayland) stalls the frame.
- Copy and cut carry no payload: the focused widget decides what to copy, and nothing else can.
What eframe brings
eframe 0.36 always enables egui-winit’s clipboard feature off the
web: arboard 3.6.1 (with image-data; X11 through x11rb, Windows,
macOS) and smithay-clipboard 0.7.3 on Wayland (egui-winit src/clipboard.rs). On Wayland, text goes through smithay-clipboard
with the window’s display; an image (ctx.copy_image) goes through
arboard, which without its wayland-data-control feature (off) talks
to XWayland, so it works only when XWayland runs. When neither backend
starts, a string inside the process stands in. Nothing reads an image,
HTML or a file list on paste, and nothing reads or writes the primary
selection (middle-click paste). deny.toml:37 already accepts
clipboard-win (BSL-1.0), arboard’s Windows backend.
In Helios (summary)
From its docs/design/clipboard.md:
- Helios copies two strings today (a parameter’s path and its value as JSON, from the parameter’s context menu) and pastes nothing. What a user would copy is typed and rich: a module’s parameters (all or some), mask shapes and groups, a sub-network, a colour, library images (as references or as files), styles and presets, workspace parts.
- darktable, its engine, has a history copy and a selective paste (append or overwrite), styles, and a path that upgrades old module parameters; Helios will reuse that path as a paste transform.
- Its workspace parts import is already a copy with a review (decided 2026-10-13: importing is copying, with no provenance), and its “Save as template” already strips absolute paths, secrets and embedded data: the same rules a copy leaving the vault needs.
- Its agents and its headless node edit through the same commands as the user and need copy and paste without a desktop clipboard.
What the inventory says
- The only rich content egui-pop could put on a clipboard (nodes, colours, tokens, rows) has no copy at all; what is copied is text.
- The key path is egui-winit’s, not the keymap’s: Ctrl+C, Ctrl+X and Ctrl+V cannot be commands as Ctrl+Z is, without dispatching from egui’s events.
- Nothing between the widget and the system clipboard can inspect, strip, transform, veto or log a copy or a paste.
- Three small bugs (the editor’s cut before its veto, the terminal’s unsanitised bracketed paste, Ctrl+Shift+C interrupting) and one doc error.
Survey
egui and eframe
- Text both ways, through
ctx.copy_textandEvent::Paste; images out only (ctx.copy_image, egui 0.30 and later), through arboard, which on Wayland needs XWayland in eframe’s configuration. - No formats: no HTML, no file list, no custom type, no way to offer several representations of one copy.
- No primary selection on X11 or Wayland (selecting text does not set it, middle-click does not paste it).
- Paste is pushed, not pulled: egui-winit reads text on the key, synchronously; a widget cannot ask for another format.
- Verdict: keep for text inputs (they keep their own copy and
paste, as they keep their own undo), wrap for the rest: egui-pop
dispatches its commands from the three events and reads and writes
the richer formats itself. The missing pieces (rich paste, a pull
model, primary selection) go to
docs/upstream.md, with issues filed upstream after a search for existing ones.
Crates
| Crate | Licence | Does | Lacks | Verdict |
|---|---|---|---|---|
| arboard 3.6 (already in the tree through egui-winit) | MIT or Apache-2.0 | text, HTML with a text alternative, RGBA images, file lists (read and write); X11 primary and secondary selections; exclude_from_history for clipboard managers; Windows, macOS, X11; Wayland with wayland-data-control | arbitrary (private) types; Wayland without the data-control protocol, which not every compositor offers; on Linux the data dies with the process unless a clipboard manager keeps it | adopt, behind egui-pop’s system backend, for every standard format |
| smithay-clipboard 0.7 (already in the tree) | MIT | Wayland clipboard and primary selection through the window’s own connection (no extra protocol) | text only (text/plain;charset=utf-8, UTF8_STRING, text/plain) | adopt for text and the primary selection on Wayland, as egui-winit does |
| wl-clipboard-rs | MIT or Apache-2.0 | any MIME type on Wayland, reading and serving | needs the data-control protocol (the same gap as arboard’s feature), runs outside the window | not now; the custom-type backend may use it where the protocol exists |
| copypasta (Alacritty’s) | MIT or Apache-2.0 | text, X11 and Wayland, primary selection | text only; nothing over arboard and smithay-clipboard | reject |
x11rb, the Wayland data-device protocol, Windows RegisterClipboardFormat, macOS NSPasteboard | permissive | private types per platform | a backend to write per platform | own, later and small, only for private types across processes (step 5) |
No crate offers the model itself (an internal typed clipboard, several representations, negotiation, transforms, hooks); own it, as the context stack and undo are owned.
Prior art
VS Code. A copy in the editor puts plain text, HTML (the text with
its colours) and a private vscode-editor-data entry (the language,
whether it was a whole line, the multi-cursor split) on the clipboard;
a paste into VS Code reads the private entry and restores what text
lost (a whole-line copy pastes above the line; three cursors receive
one line each). Extensions register paste providers per MIME type:
pasting an image into Markdown can write the file and insert a link,
pasting a URL can make a link; after a paste a small widget offers the
other ways (“Paste as…”), and a preference picks the default per kind.
Providers also run on copy to stash metadata for the paste.
Browsers. A copy is a ClipboardItem carrying several types
(text/plain, text/html, image/png, and “web custom formats” for
private types, which the browser keeps apart from the system’s own
names); a paste reads the item and picks the type it can use. Pasted
HTML is sanitised (scripts, event handlers and foreign styles removed)
before a page sees it. Reading the clipboard without a user gesture
asks for permission. Copy and paste are events a page can intercept
and rewrite.
GIMP. Copy, Copy Visible, Cut; Paste (a floating selection to anchor), Paste In Place, Paste Into Selection, Paste as New Layer, as New Image; named buffers keep several copies at once. It exchanges images with other applications as PNG and other types; a paste is one undo group (“Paste”).
Krita. Copies layers in its own format besides a flat image; on a paste whose clipboard holds both Krita’s own data and an image from elsewhere, a preference (ask, the web image, the local data) decides. Paste at cursor, Paste into active layer, Paste as new layer; Copy Merged; layer styles copy and paste separately.
Blender. Ctrl+C and Ctrl+V over any field copy and paste its value as text (a colour as a list, a vector), and paste can fill a whole array; Ctrl+Alt+C copies a whole vector or colour. Objects copy through a file in the temporary directory, so a paste works in another Blender process; node selections copy inside the session. Pose copy has Paste X-Flipped: a paste that transforms the content for its target. Alt over a field edits it on every selected object.
Lightroom Classic. Copy Settings opens a dialog of checkboxes (white balance, exposure, crop, masks, each group) whose last choice is remembered; Paste Settings applies it; Paste from Previous takes the previous photo’s; Sync applies the chosen settings to every selected photo, as one undo step. Masks synced to other photos are recomputed there (a subject mask finds that photo’s subject); a crop synced keeps its aspect ratio; white balance “as shot” stays relative. These are transforms on paste in all but name.
darktable. In the darkroom and the lighttable: copy the history stack (Ctrl+C), copy parts of it (Ctrl+Shift+C, a dialog of modules, some unticked by default because they belong to one image), paste (Ctrl+V) or paste parts (Ctrl+Shift+V), in append or overwrite mode (a preference, also in the dialog); one source, many targets. Masks travel with their modules in normalised coordinates. Styles are saved partial histories applied the same way. A module’s old parameters are upgraded to its current version when read. Copy and paste reach the history stack only, never the library fields or the GUI.
What carries over
- One copy, several representations, the target picks (VS Code, browsers, Krita): a rich private one, readable fallbacks for everyone else.
- Paste special is a choice of representation or of parts (VS Code’s “Paste as”, GIMP’s paste variants, darktable and Lightroom’s selective paste).
- Transforms on paste exist everywhere under other names (Lightroom’s recomputed masks, Blender’s X-flip, darktable’s parameter upgrade, VS Code’s paste providers).
- Sanitising is a boundary rule (browsers on paste, Helios’s “Save as template” on export): content crossing out of a trust zone is stripped.
- A paste is one undo step (GIMP’s “Paste” group, Lightroom’s sync).
- Cross-process works by a shared store (Blender’s file in the temporary directory) or by private types on the system clipboard (VS Code, browsers, Krita).
- Several buffers (GIMP’s named buffers) are rare and expert; a short history of recent copies is what most users meet (clipboard managers).
The questions, answered
1. Internal and system clipboards
Recommendation: two layers. The internal clipboard holds the
last copy as a typed item (its type id, its version, the payload as
structured data, its source: origin, window, place, and the kernel
it came from), owned by the Clipboard owner and shared by every
window of that owner. The system clipboard receives, on each copy,
the item’s readable fallbacks (text, and HTML or an image when the
type renders one) and, where the platform allows it, the item itself
under a private type. A paste first asks whether the system clipboard
still holds what the last internal copy put there (a change counter
where the platform has one, else a hash of the fallback text written):
if so the internal item is pasted, otherwise the system’s content is
external and pasted by its own formats.
Why not internal only (Blender’s node copy): a colour or a parameter set copied should land in a chat or a text file as readable text. Why not system only: private types are not portable today (smithay-clipboard is text only, arboard has none), and rich items carry ids that must never leave the kernel.
2. Formats and negotiation
- A format is a MIME-like id: private types are
application/x-<app>.<type>+json(egui-pop’s own areapplication/x-egui-pop.<type>+json), with a version inside the payload; standard ones aretext/plain,text/html,image/png,text/uri-list. - A copy produces an offer: the type, then its fallbacks in order, each rendered lazily (an image is made only if asked).
- A target declares the formats it accepts, richest first. A paste takes the first format of the target’s list that the offer has, or that a declared transform can make from one it has (one transform by default; chains are not searched). Nothing found: the paste is refused with the reason (“A colour cannot be pasted here”), never a silent no-op (ADR 0003).
- Paste special lists every format and transform that would work, with a preview where the target gives one, and the parts when the type has parts (a parameter set’s modules).
3. Hooks
- On copy, the
clipboard.copystep: its before-hooks may veto (“this field is a secret”) or redirect (copy another selection), and sanitisers run on each representation by the boundary it crosses: inside the same owner, nothing is removed; to the system clipboard, local paths, secrets and owner-local ids are removed from the fallbacks and from the private payload. A sanitiser says what it removed; the toast says it (“Copied; 2 local paths left out”). - On paste, the
clipboard.pastestep: before-hooks may veto or redirect (another target, another format); transforms adapt the chosen representation to the target (a parameter set to the target’s module version, a shape to the target’s size, a colour to the target’s space, a name made unique); external content is sanitised first (HTML stripped to its text or allowed tags, control characters out of text pasted into a terminal). - Plugins declare types (id, version, schema, the fallbacks they render, a migration from older versions) and transforms (from, to, when they apply, lossy or not) in their registry, and own them (ADR 0004).
- A paste is one undo step, made under a history group (ADR 0014) labelled by the type (“Paste 3 nodes”); a cut is the copy plus a delete, one step, and copies only when the delete is accepted. A copy is never an undo step: it changes no document.
4. Commands and keys
edit.cut,edit.copy,edit.paste,edit.pasteSpecialin the Edit menu (group1_clipboard, under undo), withwhen!textInputFocusso text inputs keep their own; they are dispatched from egui’sEvent::Cut,Event::Copy,Event::Paste(Ctrl+Shift+V read from the modifiers held then), and from the keymap for every other binding.- The focused component answers what a copy takes and where a
paste goes (a
ClipSourceand aClipTargetit registers, as a local undo scope is registered); with nothing focused that answers, the commands are disabled (canCopy,canPastekeys, ascanUndo).
5. Across windows and processes
- Windows of one application share one owner, so one internal clipboard.
- Two processes of one application share it when their owner is shared (a kernel serving both: the item is stored by the kernel, the system clipboard carries its id as a private type or as a marker beside the fallback). Without a shared owner, the private type on the system clipboard is the only way, when the platform backend supports it.
- Another application only ever sees the fallbacks.
6. Agents
- The same steps with the same refusals:
clipboard.copy {source, selection?, dry_run},clipboard.paste {target, format?, transform?, parts?, if_rev, dry_run},clipboard.offers,clipboard.read,clipboard.write. dry_runanswers the plan: the format chosen, the transforms that would run, what a sanitiser would remove, and the changes the paste would make, without making them.- An agent’s session has its own slot in the internal clipboard by
default: it never reads what the user copied (which may be a
password from another application) and never overwrites it, unless
the host lets it (
clipboard.read {slot: "user"}refused by default, with the reason).
7. Primary selection
X11 and Wayland users expect select-to-copy and middle-click paste in text. egui has neither. Recommended: opt in, text inputs and the code editor only, through the system backend (arboard’s primary kind on X11, smithay-clipboard’s on Wayland), and an upstream issue for egui to carry it.
The contract
Sketch (names to settle when built):
// egui-pop-model::clipboard (pure, no egui)
pub struct FormatId(String); // "application/x-egui-pop.color+json", "text/plain"
pub struct ClipItem {
pub kind: FormatId, // the private type
pub version: u32,
pub payload: serde_json::Value,
pub source: ClipSourceInfo, // origin, window, place (ADR 0012), owner id
pub stripped: Vec<Stripped>, // what sanitisers removed, and why
}
pub enum Boundary { Owner, System } // where a representation goes
pub struct TransformSpec { pub from: FormatId, pub to: FormatId, pub lossy: bool }
pub fn negotiate(offer: &[FormatId], accepts: &[FormatId], transforms: &[TransformSpec])
-> Result<Plan, Refusal>; // the format, the transform, or why not
// egui-pop-api::clipboard
pub trait Clipboard {
fn put(&mut self, slot: &Slot, item: ClipItem, origin: &Origin) -> Answer;
fn get(&self, slot: &Slot) -> Option<ClipItem>;
fn offers(&self, slot: &Slot) -> Vec<FormatId>; // internal, or what the system holds
fn rev(&self) -> u64;
}
pub trait ClipSource { fn copy(&mut self, ctx: &CopyCtx) -> Option<ClipItem>; fn cut(&mut self) -> Option<Delete>; }
pub trait ClipTarget { fn accepts(&self) -> Vec<FormatId>; fn paste(&mut self, item: Pasted, plan: &Plan) -> Answer; }
// Host (ADR 0010)
fn clipboard(&mut self) -> Option<&mut dyn Clipboard> { None } // None: LocalClipboard
LocalClipboard keeps one item per slot in memory and writes the
fallbacks through the system backend. Answer is the same as the
context stack’s and history’s: done, refused with a reason, or later.
The owner publishes clipboard.changed {slot, kind, rev} on the
journal (never the payload).
Flows
O is the owner, UI egui-pop’s projection.
A colour copied to a chat, and back
user : focus on a colour swatch, Ctrl+C (Event::Copy)
UI : edit.copy → clipboard.copy step → the swatch's ClipSource
O : item color {srgb, space, value}; system: "#d9a441" as text
user : pastes in a chat → "#d9a441"
user : copies "rgb(12, 40, 200)" from a web page, focus on a swatch, Ctrl+V
UI : the system holds text not written by O → external
O : the swatch accepts [color, text/plain]; transform text→color parses
it; one undo step "Paste colour"
Nodes copied from one window to another
user : selects three nodes in window A, Ctrl+C
O : item graph.nodes {nodes, edges between them, values}; system:
a readable summary as text ("3 nodes: blur, mask, mix")
user : window B, Ctrl+V on its graph
O : the system still holds O's text → the internal item
UI : clipboard.paste step; transform "rename on clash"; one step
"Paste 3 nodes"; Ctrl+Z removes them together
A cut that is vetoed
user : selects a read-only node, Ctrl+X
UI : edit.cut → the graph's delete is vetoed ("locked")
O : nothing copied, nothing deleted; toast with the reason
Paste special
user : Ctrl+Shift+V on a parameter panel holding a parameter-set item
UI : the dialog lists the parts (modules) and the formats; the
target's preview on the viewport
user : unticks two modules, confirms → clipboard.paste {parts}; one step
An agent pasting with a dry run
agent: clipboard.copy {source: "graph", selection: [n1, n2]} → its slot
agent: clipboard.paste {target: "graph@B", dry_run: true}
O : plan: format graph.nodes, transform rename (n1 → n1_2), 2 adds
agent: clipboard.paste {target: "graph@B", if_rev: 41} → one step,
origin agent
Open questions, with the defaults proposed
- System clipboard on every copy, or on demand? Default: every copy writes the fallbacks; a type may say “internal only” (a secret, a huge item).
- Private type on the system clipboard (step 5 needs a backend of our own), or a marker only? Default: a marker (change counter or hash) first; the private type later, where the platform allows.
- Clipboard history (several recent items, GIMP’s buffers)? Default: no; one item per slot. A history panel can come later.
- Agents reading the user’s clipboard: default refused; the host may allow it per agent.
- External HTML on paste: default reduced to text unless the
target accepts
text/html, and then sanitised. - Primary selection: default opt-in, text only.
- Transforms that lose information (a colour out of gamut, a parameter dropped by a newer module): default applied with a toast naming the loss; paste special shows it before.
- Paste with nothing focused that accepts it: default refused with a reason, the command greyed out; no guess at a target.
Steps
- Fixes first: the editor’s cut copies after its delete is accepted;
the terminal strips escapes from a bracketed paste; Ctrl+Shift+C in
the terminal never interrupts;
docs/editors.mdsays Shift+Insert is Windows only. An entry indocs/upstream.mdfor egui-winit swallowing the keys. egui-pop-model::clipboard(formats, items, negotiation, boundary rules) and theClipboardcontract withLocalClipboard;Host::clipboard().edit.cut,edit.copy,edit.paste,edit.pasteSpecial, theclipboard.*steps, dispatch from egui’s events,ClipSourceandClipTarget, the undo group per paste.- First types: colour, graph nodes, theme tokens, table rows; the
sanitisers; agent commands and a
clipboardcollector on the debug bridge. - The system backend for rich formats (images, HTML, files) and, where possible, private types; primary selection; wbox’s clipboard bridge for tests.
0016: One writer per value
Date: 2026-10-20. Status: accepted.
Context
The value store knows each path’s owner (Store::declare refuses a
second one), but writes were checked against the descriptor alone: any
plugin could write any path, and when two plugins wrote the same value,
nothing said which one should. egui_mobius’s composition language
checks a one-writer rule before the application runs; the idea is
borrowed here, not the language.
Decision
- A path has writers: its owner, the ones its descriptor names
(
Descriptor::writers), or anyone (Descriptor::any_writer). - A write names its scope:
Set::by, or the scope entered on the thread (values::enter_scope). The application enters the plugin’s scope while it connects, while its command handlers run (in the interface or throughDispatch::run_local) and in its lifecycle hooks;Ctx::writergives a writer that names the plugin from anywhere else. - The framework writes any path, for a person: the settings form,
bound widgets, the
value.*commands, the debug bridge and egui-pop’s own helpers write asOwnerId::FRAMEWORK. A setting therefore stays writable by the settings form without being opened to every plugin, whichanywould do: the person edits it, other plugins do not. - A write from someone else is refused, as a value out of its
descriptor is (
Refused::NotWriter), with anot-a-writerdiagnostic once per path and scope.WriterCheck::Warn(AppBuilder::writer_check) applies it with a warning instead, to migrate plugins written before the check. - Not checked: a write naming no scope (the application’s own code, a host, a test), and the store’s own replays: undo, redo, a gesture cancelled, saved values restored. They write what was already allowed, or what the person saved.
- Seen: each entry keeps its last writer (
Entry::writer); thestorecollector (devtools and the debug bridge) lists each path’s owner, writers and last writer, and the writes refused or warned about;egui_pop_test::assert_writes_declaredfails a test on any.
Consequences
- A plugin that wrote another plugin’s value must be named its writer by the owner, or go through the owner’s command or step.
- The context stack is not part of it: it does not go through the
value store. Its owner, the kernel, is already its one writer; the
interface asks through the
context.requeststep and never writes. - Readers are not declared: a value nobody reads is cheap, and the check would have little to say.
0017: Links and outside content: one service opens them, an egui-native viewer shows what is safe, the rest goes outside
Date: 2026-10-28. Status: accepted (2026-10-28), revised on 2026-11-01 for local video (below), amended on 2026-11-03 by a YouTube trial behind a feature (below).
The analysis behind it (what exists today, what egui and eframe do with a link, a survey of openers, markdown and HTML renderers, webviews and five applications, the questions answered, the flows, the sources) is in the appendix. Where they differ, this page wins.
Context
Links are about to appear everywhere: an About dialog with the repository, tips and help pages with links in their text, a “Watch the tutorial” pointing at a video, toasts saying “Exported: Show in folder”, links found in a terminal’s output, and agents asking the application to open something. Today there is no rule for any of it:
ctx.open_urlis the only way out, and on native it does nothing: egui-pop builds eframe without itslinksfeature, so egui-winit only logs “Cannot open url” (the terminal’s Ctrl+click and the gallery’s hyperlink are silent no-ops, against ADR 0003). On the web build it callswindow.openin a new tab or the same tab.- egui’s
Hyperlinkopens on a plain click, without showing where it goes (url_in_tooltipis off), without a context menu, without a confirmation, whatever the scheme. - Nothing can render markdown or HTML, fetch an image only once the user agrees, reveal a file in the file manager, or open a local file.
- Nothing can observe, veto or record an open request; an agent has no verb for it; tests cannot see that a click asked for a URL.
A photo editor (Helios) needs help pages that work offline, links in tips and About, “Show in folder” for images and exports, agents asking to open a file, and a headless node that receives such a request with no screen at all.
Decision
One links service, one step, a replaceable opener. Every open
goes through links::open(app, request) and the link.open step
(ADR 0011): before-hooks veto or redirect, a run-hook replaces, the
journal records link.opened or link.failed. The request names the
target, how (Auto, Outside, Inside, Reveal), its
source (declared by the application, found in content, asked by an
agent) and its origin (Origin::User, Origin::Agent(..)). The
pure parts (parsing, classifying the target, the policy that decides
how and whether to confirm) live in egui-pop-model::links; the
service, the widget and the confirmation in egui-pop-api::links. The
actual opening is an Opener the host can replace (ADR 0010):
EguiOpener(default, every build): web pages andmailto:through egui’sOpenUrl(eframe’slinksfeature turned on), a new tab on the web build;SystemOpener(egui-pop-platform, featureplatform-open): adds local files, folders and reveal, through the desktop portal inside Flatpak and Snap,xdg-openand the file manager’s D-Bus interface elsewhere on Linux,openandopen -Ron macOS,ShellExecuteand Explorer’s selection on Windows;RecordingOpener(tests): records each request and answers what the test scripted;NullOpener(headless): refuses with the reason, or forwards to an attached interface when the host offers one.
egui’s own OutputCommand::OpenUrl (from ui.hyperlink, third-party
widgets, the markdown renderer) is taken out of the frame’s output
by the service and routed through the same step, so no link bypasses
the policy.
What a click does, per kind of target. The policy classifies the
target and picks the default (Auto):
| Target | Plain click | Ctrl+click, middle click |
|---|---|---|
Web page (https:, http:) | the system browser; a new tab on the web build | the same |
| Video on the web (YouTube, Vimeo, a remote video file) | the system browser; a YouTube video in the viewer’s web view with the opt-in webview feature on Linux (a trial) | the same |
| Local video file | the viewer when it has a video player (the opt-in video feature), else as a local file below | outside |
Markdown or HTML page shipped by the application (docs: pages) | the in-app viewer when its plugin is present, else the online copy in the browser | outside |
| Remote markdown or HTML | the browser, unless its host is one the application declares as its documentation | outside |
| Image | local: the viewer, else the system’s default application; remote: the browser | outside |
| Local file | the system’s default application, after a confirmation; executables refused, Reveal offered instead | Reveal |
| Local folder | the file manager | the same |
mailto: | the mail client | the same |
The application’s own scheme (<app>://) | deeplink.open, inside the application, no round trip through the system | the same |
command: | runs the command, only in text the application declared | nothing |
Anything else (javascript:, data:, file: to a device, unknown schemes) | blocked, with the reason | blocked |
The link widget. links::link(ui, app, label, target) draws a link
in the theme’s link colour: a pointing hand, the real target on hover (a
tooltip with the full URL, the host emphasised, an internationalised
host shown in its punycode too), a context menu (Open, Open
outside when the default is inside, Reveal in folder for files,
Copy link), Enter and Space activate it, role link with the label
as its name and the target as its description. A link whose text looks
like a URL but differs from its target is always confirmed, both shown.
Short texts (tips, toasts, settings descriptions) accept an inline
subset (emphasis, code, links) drawn with this widget.
An egui-native viewer, opt-in. ViewerPlugin brings a panel (the
workbench can detach it into its own window) that shows markdown, a
safe subset of HTML and images, with back and forward, an
address bar (editable, showing the real target), its session
history, find in page (Ctrl+F), zoom (the interface zoom
keys, scoped to the page), Open outside and Copy link. Markdown
renders through egui_commonmark (MIT OR Apache-2.0, wrapped behind a
feature); HTML is parsed by html5ever, cleaned by ammonia’s allow-list
(no scripts, no styles, no forms, no iframes) and mapped to the same
blocks as markdown; images go through egui’s loaders. It works on
native and on the web build alike. What needs a real web engine
(YouTube, full HTML, JavaScript) opens outside. A local video file plays
inside when the opt-in video page is built in, without a web engine.
No webview now: wry
needs GTK and X11 for a child view on Linux and the egui integration is
experimental; Servo and Blitz bring MPL code that deny.toml refuses.
An opt-in webview plugin stays an open question.
Trust and privacy.
- Allowed schemes:
https,http,mailto,file, the application’s own scheme,docs, andcommandfrom declared text. The host may add or remove schemes; everything else is blocked. - Confirmation (a
Confirmdialog showing the full target, with Open, Copy link, Cancel, and “Trustfor this session”): never for a declared web or mail link; for a link from content to a host not yet trusted; always for an agent’s request (the dialog names the agent) and for opening a local file. Reveal of a declared path is not confirmed. - No request to a third party before the user asks: remote images in
the viewer, video thumbnails and link previews load only after a
click on “Load images from
” (remembered per host in the settings). A video link shows as a card (title, host, duration when declared) with no image fetched. - Opens need a user gesture or a confirmation: content cannot open anything on its own; an agent has one pending confirmation per session, further requests are queued (at most five) then refused.
Offline and failures. An outside open that fails (no browser, no mail client, the portal refused, the file is gone) ends in a warning toast with the reason and a Copy link action; a blocked scheme says which. The viewer shows an error page in place (no network, not found, too large, a type it cannot render) with Retry, Open outside and Copy link. A dead link opened outside is the browser’s to report.
Checking. A link lint (links::lint, run by a test in the gate)
walks the links the application declares (menus, About, tips, toasts’
actions, docs: pages and their own links): each must parse, use an
allowed scheme, name an existing command or docs: page or bundled
file. Checking that remote links are alive is a separate, opt-in xtask,
never in the gate. Tests install RecordingOpener and click: the
record holds the target, how, source and origin. Agents get
links.open (target, how, dry_run: a dry run answers the kind,
how it would open, whether it needs a confirmation and the policy’s
verdict, opening nothing) and links.check, plus a links collector
on the debug bridge (the recent requests and their outcome).
Survey. egui’s Hyperlink, OpenUrl and clicked_with_open_in_background
are kept and intercepted. webbrowser (through eframe’s links) and
opener (with reveal) are adopted behind EguiOpener and
SystemOpener; ashpd (already in the tree through rfd) is wrapped
for the portals. egui_commonmark is wrapped in the viewer; html5ever
and ammonia are adopted for the HTML subset, its mapping to blocks
owned. The policy, the widget, the viewer’s navigation and the
confirmation are owned: no crate has them. wry and egui_webview
wait; Servo, Blitz and CEF are rejected (licence, size).
Consequences
- Every link goes through one policy and one step: observable, vetoable, testable, the same for the user, a widget, the terminal and an agent.
- Links work on native again (today a silent no-op), and on the web build they never replace the application’s tab.
- Help pages and shipped HTML render offline, on native and the web, with no web engine in the binary.
- No third-party request happens before the user asks.
- Remote videos and full web pages are not shown inside; that is a choice,
revisited only with the webview question or a trial of an embedded player
(no promise either way). Local videos play inside with the
videofeature. - The terminal’s Ctrl+click moves onto
links::open(source: content); thefiles.revealcommand the toasts’ example names becomes real.
Open questions
Each with the default this ADR proposes (the analysis gives the reasons):
- The viewer: a panel or its own window? A panel in the end side bar, detachable through the workbench; one page at a time, no tabs.
- Markdown: egui_commonmark or our own renderer? egui_commonmark in the viewer (behind a feature); our own inline subset for short texts.
- HTML: render a safe subset inside? Yes for pages the application ships or declares; remote HTML opens outside.
- Confirm before leaving the application? Not for declared web and mail links; yes for content links to an untrusted host, for local files, and always for agents.
- Remote images and video thumbnails? Never before a click, then remembered per host.
- A webview? Not now; later an opt-in plugin, native only, in its own window. The web build opens a new tab.
- Take egui’s
OpenUrlout of every frame? Yes, so every link meets the policy. file:links in content? Confirmed, executables refused with Reveal offered.command:links? Only in text the application declares.- Visited links? No state kept, beyond the viewer’s session history.
- Checking remote links alive? An opt-in xtask, never in the gate.
- An open request on a headless node? Refused with the reason, or forwarded to an attached interface when the host offers one.
- Web build: new tab or same tab? Always a new tab, except
mailto:(same tab, which hands it to the mail client). - Rate limits? One pending confirmation per agent session, five queued, then refused; content opens only on a click.
Answers to the open questions (2026-10-28)
The owner accepted the proposed defaults above, with the analysis’s
fifteenth: the viewer is a viewer module in egui-pop-views behind a
markdown feature rather than a new crate. Steps 1 to 4 of the
analysis come first; the viewer (step 5) follows.
Done ahead of the steps
Nothing yet. Step 1 of the analysis is the fix found while reading the
code: links do nothing on native because eframe’s links feature is
off.
Built (2026-10-28)
Steps 1 to 4 of the analysis: eframe’s links feature on; the model
in egui-pop-model::links (targets, requests, the policy, the lint’s
check); the service in egui-pop-api::links (LinksPlugin, in
DefaultPlugins: the link.open step, EguiOpener,
RecordingOpener, NullOpener, the interceptor of egui’s OpenUrl,
the confirmation with a per-session trust, the agents’ rate limits,
warning toasts with Copy link, links.open, links.check,
files.reveal, the links collector, the widget and the lint);
SystemOpener in egui-pop-platform (feature open, through the
opener crate, whose Reveal falls back on the OpenURI portal; inside
Flatpak xdg-open is the portal’s, so ashpd is not needed for it); the
terminal’s Ctrl+click on the service; a gallery page. The guide is
docs/links.md. Left: the viewer and the inline subset
for short texts (step 5, built below), the HTML subset (step 6), an
opt-in online check of declared links. The gallery’s built-in widgets page keeps
egui’s own Hyperlink, which it shows as one of egui’s widgets: the
interceptor routes it through the policy.
Step 5 (2026-10-28): the viewer, viewer in egui-pop-views behind
the markdown feature (egui_commonmark 0.25, the release on egui
0.36): ViewerPlugin, a closed panel of the end side bar, installs
itself in the links service as its Inside way, so docs: pages
(from the Docs the application ships), documentation hosts’ markdown
and local images open there; back, forward, reload, the address bar,
find in page, the page’s zoom, anchors, the error page, remote images
behind a per-host click remembered in the viewer.image_hosts
setting, viewer.state and the viewer collector for agents. A page
is drawn block by block (its top-level blocks, each through
egui_commonmark) so find in page and anchors know where each block
is; links in a page are taken through egui_commonmark’s link hooks
and opened through the links service. Remote pages and images need a
Fetch the host gives: egui-pop adds no HTTP client. The inline
subset for short texts (links::Inline) is owned, without a markdown
crate, and drawn in tips, toasts and settings descriptions. Left: the
HTML subset (step 6, its pages show an error page with Open outside),
the lint walking the links inside docs: pages, an opt-in online check
of declared links.
Step 6 (2026-10-30): the HTML subset, feature html of egui-pop-views
(the facade’s views-html). A page is parsed by html5ever (MIT OR
Apache-2.0) and mapped to the viewer’s blocks through markdown, as
decided. ammonia is replaced (decided by the owner, 2026-10-30): every
release of it since 4.1 depends on cssparser, cssparser-macros and
dtoa-short (MPL-2.0, not optional), which deny.toml refuses, and the
4.0 line, the last without them, fails its advisories check
(RUSTSEC-2021-0157, RUSTSEC-2021-0158, RUSTSEC-2026-0373). The allow-list
is owned instead, in the mapping: only href, src, alt, a heading’s
id and a list’s start are read, addresses are checked against the
policy’s schemes, scripts, forms, frames and media go with their content
and are named on the page, text is escaped, and no HTML is written back
for anything to read again, so a sanitiser’s reason to exist (markup
handed to a browser) does not arise. This replaces what the decision and
the survey above say of ammonia. Left: the lint walking the
links inside docs: pages, an opt-in online check of declared links.
What a page in the viewer reaches (2026-10-30): one check for markdown and
HTML. A link keeps its markup when what it resolves to uses a scheme the
page may use, and stays as text otherwise, so a page from the network has
no file: link to confirm; the confirmation of question 8 stays for a
page or an application that may link to a file. An image reads a scheme the
page may use and, from the network, never docs:, though a link there
stays; what is refused is named on the page. Nesting past 512 levels
is refused while the page is parsed, on an error page: parsing stays on
the interface’s thread, as it must on the web build, and is quadratic in
the depth. A limit needs no second path through the viewer; parsing on a
thread would need one on native alone, and the limit on the web all the
same.
Local video inside (revised 2026-11-01)
This revises “video opens outside” for local files only, as the owner
decided on 2026-11-01. With the opt-in video feature of egui-pop-views (the
facade’s views-video), a local video file plays in the viewer: play and pause,
seek, volume, the time, with sound. Without the feature, on the web build, or
with a host that gives no player, it opens outside as any local file, after the
same confirmation.
- The policy classifies a local file with a video extension as
Kind::Videoand sends it inside whenCaps::videois set, which the links service reads from the viewer (Inside::plays_video). It is confirmed as a local image is: not inside, except for an agent; always outside. - Remote video and YouTube stay outside. Whether an embedded player is worth a trial is an open question: nothing here promises one, and a trial decides nothing until the owner has read its result.
- GStreamer decodes (
gstreamer,gstreamer-app,gstreamer-video, MIT OR Apache-2.0). Its libraries are LGPL and installed on the system, not crates: no LGPL code enters the crate tree, anddeny.tomlis unchanged. The survey is in the appendix. The player sits behindVideoBackend, which a host may replace. - Default builds and the web build do not need GStreamer. The crates are
optional and never built for
wasm32. - A machine without GStreamer’s libraries does not start a binary built with
the feature: the bindings link them. An application offering the feature
declares them as a package dependency. What is missing at run time beyond that
(the
playbinplugin, a demuxer, a decoder) and what cannot be read (a bad file, a refused permission) ends on the viewer’s error page with Open outside.
YouTube inside: a trial (amended 2026-11-03)
A trial of an embedded player, behind an opt-in feature, off by default. It decides nothing about a general web view; whether it stays is the owner’s call.
- What. With the
webviewfeature ofegui-pop-views(the facade’sviews-webview), on Linux, a YouTube link (watch?v=,youtu.be/,embed/,shorts/,live/, overhttps:) plays in the viewer, in a web view: wry (MIT OR Apache-2.0) over the system’s WebKitGTK. The policy sends a remote video inside only when the viewer says it plays it (Caps::web_video,Inside::plays_web_video) and the link names a YouTube video; everything else (other hosts, Ctrl+click, no feature, another system, the web build) opens outside as before. A link from content is still confirmed for an untrusted host, as outside: the web view reaches YouTube as the browser would. - What loads. The privacy-enhanced player
(
youtube-nocookie.com/embed/<id>) as the page itself, its request carrying aRefererthrough wry’swith_url_and_headers: without one YouTube’s player refuses to play (its error 153). Since 2026-11-04 theReferernames the application,https://<app id>/fromAppBuilder::app_id(ViewerPlugin::embed_referrerreplaces it), as YouTube’s Required Minimum Functionality asks; it washttps://localhost/before. Every other navigation is refused in the web view and handed to the links service, outside. - Where. On X11 (Xwayland included) a child window over the panel, following it; on Wayland, or with the panel detached, a window of its own: wry’s child web views need X11. GTK starts on the interface’s thread and its loop is turned once per pass, without blocking, while a web view is open.
- Costs. WebKitGTK must be installed to build and to run (the binary links
it). A child web view floats above egui: egui’s popups over the panel go
under it. On Linux wry brings
option-ext(throughdirs), MPL-2.0, whichdeny.tomlrefuses in general; the lead maintainer accepted it (2026-11-03) as a narrow exception for that crate alone: it is copyleft per file, used unmodified behind an opt-in feature, and none of egui-pop’s code falls under it. wry’s Android-only part (dom_query,selectors,cssparser,cssparser-macros,dtoa-short, MPL-2.0 too) is never compiled for the platforms egui-pop builds, whichdeny.tomlnow lists ([graph] targets). - YouTube’s terms (2026-11-04, the owner’s choice: keep the trial, opt-in,
and make it comply): the
Referernames the application, the player is never smaller than 200 by 200 (a card with Open outside over a smaller panel), and nothing of egui-pop’s is drawn over it; an application turning the feature on accepts YouTube’s terms (links.md). - What was checked, in a headless nested compositor: the trial’s results.
0017, appendix: the analysis behind links and outside content
The analysis that led to ADR 0017, kept for the reasons it gives. Where it differs from the ADR, the ADR wins.
What exists today
Read from the code on main (2026-10-28), egui, eframe and egui-winit
0.36.2.
In egui-pop
| Site | What it does | How | Gaps |
|---|---|---|---|
Terminal, Ctrl+click on a link (egui-pop-editors/src/terminal/view.rs, around line 415) | opens http://, https:// and file:// addresses found in the output (terminal/links.rs), and emits TerminalSignal::Link | ctx.open_url(OpenUrl::new_tab(..)) | bug: a no-op on native (see below); a file:// link would go to a browser, never to the file manager; no step, no confirmation for text a program printed |
Gallery, built-in widgets page (egui-pop-gallery/src/pages/builtins.rs) | ui.hyperlink_to("Hyperlink", <repository>) | egui’s Hyperlink | the same no-op on native; no hover target |
Hover cards (egui-pop-core/src/hover_card.rs) | “links” that run a command with arguments | ui.link, the owner runs the command | fine: command links declared by code; they are the model for command: links |
Toasts (egui-pop-api/src/toasts.rs) | an action button running a command; the module’s example uses files.reveal | a command | files.reveal exists in no plugin: “Show in folder” has nothing to run |
Single instance and deep links (egui-pop-platform, docs/instance.md) | <app>:// links given at launch or by a second launch run deeplink.open | a step and a command | fine: the application’s own scheme already has its way in; a click inside the application can reuse it |
Theme (egui-pop-core/src/theme.rs) | hyperlink_color from the accent | egui visuals | url_in_tooltip stays off: a link never shows where it goes |
Tips (docs/tips.md) | title and plain text | no link in a tip; “tips in files (tips/<id>.md)” is listed as not done | |
Files (docs/files.md) | choosing files and folders | rfd, the portal | nothing reveals or opens a file outside |
Dialogs (egui_pop::api::dialogs::Confirm) | a confirmation running a command | ready for an open confirmation | |
| Debug bridge, agents | no links collector, no open verb | an agent cannot ask to open anything, a test cannot see a request |
What egui and eframe do with a link
egui::Hyperlinkdraws aLink(accessibility rolelink, egui’sWidgetType::Link), and on a click emitsOutputCommand::OpenUrl { url, new_tab }; a click “to open in the background” (Ctrl or Cmd held, or the middle button) forcesnew_tab: true. The URL shows on hover only when the style’surl_in_tooltipis on (off by default). Every scheme is accepted.- Native (egui-winit’s
open_url_in_browser): callswebbrowser::open(url)when thelinksfeature is on, else logs “Cannot open url - feature "links" not enabled.” and does nothing. eframe’slinksfeature is in its default set, but egui-pop depends on eframe withdefault-features = falseand does not listlinks;webbrowseris not inCargo.lock. Every link is a silent no-op on native today (ADR 0003). An application that turns the feature on itself gets it back through feature unification, unknowingly. - Web (eframe’s
web::open_url):window.open(url, new_tab ? "_blank" : "_self")._selfreplaces the application’s page: the application is gone. A pop-up blocker may refuse_blankwhen the browser no longer counts the click as a user gesture. - The commands are in the frame’s
PlatformOutputuntil eframe handles them after the frame: an application can read and remove them (ctx.output_mut(|o| o.commands.retain(..))) at the end of its own frame. That is how the service intercepts everyOpenUrl, whichever widget made it.
What the inventory says
- The fix comes first: links do nothing on native.
- The terminal already distinguishes “click” from “Ctrl+click” and
reports a signal; it needs a target classified (a
file://path is not a web page) and a policy (its text comes from a program). - The application’s own scheme and command links already exist; they only lack a way in from a click.
- Nothing to migrate except two
open_urluses and one hyperlink.
Survey
Openers (native and web)
| Crate | Licence | What it does | Verdict |
|---|---|---|---|
egui OpenUrl and eframe | MIT OR Apache-2.0 | web pages; new or same tab on the web | keep, intercepted; turn eframe’s links on |
| webbrowser 1.x | MIT OR Apache-2.0 | guarantees a browser opens, even for local files; $BROWSER honoured on Linux; a hardened feature refuses everything but http(s); wasm opens the default browser | adopt (through eframe’s links) for web pages |
| opener 0.9 | MIT OR Apache-2.0 | open (the default application), open_browser, reveal (feature reveal, D-Bus through zbus on Linux) | adopt in SystemOpener for files, folders, mailto: and reveal |
| showfile | MIT | reveal only | skip: opener covers it |
| ashpd 0.13 | MIT | the desktop portals: OpenURI.OpenURI, OpenFile (version 2), OpenDirectory (version 3, opens the folder of a file) | wrap inside Flatpak and Snap; already in the tree through rfd (with zbus) |
own spawn of xdg-open, open, ShellExecuteW | no: the crates above do it and know the corner cases (WSL, $BROWSER) |
Per platform:
- Linux.
xdg-openpicks the desktop’s handler. The freedesktoporg.freedesktop.FileManager1.ShowItemsD-Bus call reveals a file selected in its folder (Nautilus, Dolphin, Nemo and others implement it; a fallback opens the parent folder). Inside Flatpak the runtime’sxdg-openforwards to theOpenURIportal;OpenFiletakes a file descriptor, so the sandbox can only open what it can read; a writable descriptor must say so or the portal rejects it. Users report links doing nothing when no portal backend answers OpenURI: the error must reach a toast. Inside Snap, the base’sxdg-openforwards to the host throughsnap userd(thedesktopplug); its scheme list has been short (http, https, mailto), and local files go through a prompt. - macOS.
open <url>,open -R <path>to reveal (NSWorkspace underneath); opener does both. - Windows.
ShellExecuteWwith theopenverb (it would also run an executable: the policy refuses those before), andSHOpenFolderAndSelectItems(orexplorer /select,) to reveal. - Web build. Only
window.open: no local files, no reveal, no default application.mailto:works in the same tab (the browser hands it over and the page stays); in a new tab it leaves an empty tab behind in some browsers.
Showing markdown, HTML and images without a web engine
| Crate | Licence | What it brings | Verdict |
|---|---|---|---|
| egui_commonmark 0.26 | MIT OR Apache-2.0 | CommonMark plus GitHub tables, strikethrough, task lists, footnotes; images through egui’s loaders (fetch for remote ones, svg), code highlighted by syntect (better_syntax_highlighting, syntect already in the tree for the editors), a hook to render inline HTML (RenderHtmlFn) and maths; links drawn as egui hyperlinks (so intercepted); it follows egui’s minors (0.26 is on egui 0.37) | wrap in the viewer, behind a feature, its version tied to egui’s |
| pulldown-cmark | MIT | the parser egui_commonmark uses | through egui_commonmark; directly for our inline subset |
| egui_markdown, egui demo’s “easy mark” | not checked | smaller renderers | skip: less complete |
| html5ever | MIT OR Apache-2.0 | a spec-compliant HTML parser (Servo’s, published on its own) | adopt for the HTML subset |
| ammonia | MIT OR Apache-2.0 | an allow-list HTML sanitiser on html5ever | adopt: no scripts, styles, forms, iframes, event attributes; links’ schemes checked |
| own mapping | the cleaned tree mapped to the viewer’s blocks (headings, paragraphs, lists, tables, code, quotes, images, links) | own: no crate draws HTML in egui | |
| egui_extras loaders | MIT OR Apache-2.0 | file and image (and svg) loaders; http fetches any http(s) URI an image is given (through ehttp) | adopt file, image, svg; the http loader is not installed: remote images go through a loader of ours that asks the policy first |
Rendering inside needs no network for shipped pages and works the same on the web build: these are egui widgets.
Web engines
| Option | Licence | Platforms | Cost | Verdict |
|---|---|---|---|---|
| wry (Tauri) | MIT OR Apache-2.0 | WebView2 on Windows, WKWebView on macOS, WebKitGTK on Linux | little in the binary (the system’s engine), but on Linux GTK must be initialised and its loop pumped beside winit; a child view inside a winit window works on X11 only, Wayland needs a GTK container (so its own GTK window); WebKitGTK must be installed (in Flatpak, a runtime that ships it, such as GNOME’s; to be checked per runtime version); the web view floats above egui (no egui popup over it) | wait: an opt-in plugin, in its own window, a later question |
| egui_webview (hello_egui) | MIT | wry inside egui | experimental, unreleased, unsafe around Send and Sync, needs a wry change for screenshots | wait |
Servo (servo 0.1 on crates.io, 2026) | MPL-2.0 | an engine compiled in | large (not measured here), an embedding API still moving | reject: deny.toml refuses MPL |
| Blitz (Dioxus) | MIT OR Apache-2.0, on Stylo (MPL-2.0) | HTML and CSS, no JavaScript, beta; renders through Vello or into a wgpu texture | would be the natural “safe HTML” engine, but Stylo is MPL and it brings a second renderer | reject for now; watch |
| CEF | BSD-3-Clause | Chromium | well over 100 MB per platform, its own process model | reject |
An <iframe> over the canvas (web build) | the browser itself | a DOM element above egui’s canvas: popups and menus go under it, focus leaves egui | wait, with the webview question |
So: YouTube, video and full pages need a real engine, which costs a GTK dependency or MPL code or 100 MB; none fits by default. The thumbnail that opens outside gives most of the value: a card with the title, the host and the duration the application declares, a play icon, a click opening the browser. Its image is either shipped with the application or fetched only after the user allows that host.
Playing a local video
Added on 2026-11-01, for the revision of the ADR. The versions and licences are those crates.io gave that day. “Plays” means what the viewer needs: pictures and sound in step, seek, volume, from any common file.
| Crate | Licence | What it brings | Verdict |
|---|---|---|---|
gstreamer, gstreamer-app, gstreamer-video 0.25 | MIT OR Apache-2.0; the GStreamer libraries are LGPL and installed on the system, not crates | a whole player (playbin): file formats and decoders by plugin, sound, a shared clock, seek, volume; its threads decode, an appsink hands over the pictures; Rust 1.92 | adopt behind the feature; the page, the controls and the stopping are owned |
iced_video_player 0.6 | MIT OR Apache-2.0 | the same design for iced: playbin, an appsink, a texture | a model only, read for the design; no code taken, though its licence would allow it. It uses GStreamer 0.23 and iced’s renderer |
egui-sharkplayer 0.5 | Unlicense, over libmpv2 (LGPL-2.1) | a player for egui | reject: egui 0.35 against our 0.36; OpenGL first with a slow wgpu path; libmpv2 is a crate under the LGPL, which deny.toml refuses |
egui-video 0.9 | MIT | a player for egui | reject: last release in 2024; ffmpeg and SDL2 |
re_video 0.41 (Rerun) | MIT OR Apache-2.0 | video decoding for Rerun’s viewer, read briefly from its manifest and not tried: optional rav1d for AV1, ffmpeg-sidecar to drive a separate ffmpeg executable; nothing for sound output among its dependencies; many of Rerun’s own crates; Rust 1.98 against our 1.95 | reject: a decoder, not a player; we would own what GStreamer gives |
video-rs 0.12 | MIT OR Apache-2.0, over ffmpeg-next | frames read and written through ffmpeg’s libraries, which must be there at build and run time like GStreamer’s; read briefly from its manifest and not tried: nothing for sound output among its dependencies | reject: same system dependency, far less of a player |
Neither of the two last is better than GStreamer for this. Both would leave sound output and keeping it in step to be written here, and neither removes a system library or a separate program for common formats.
The bindings link GStreamer’s libraries when the program starts, so their absence cannot be turned into an error page: see the ADR.
YouTube in a web view: the trial
Run on 2026-11-03 with WebKitGTK 4.1 (2.54) and wry 0.57.1, in labwc, headless
(pixman renderer), 1280x800, on the test video 5TGDf7crzXI. A screenshot
counts as playing when later ones show later pictures of the video.
What YouTube’s player needs: a referrer. Loaded in WebKitGTK directly (a Python probe) and then through wry:
| How the player was loaded | Result |
|---|---|
youtube.com/embed/<id> as the page, no referrer | YouTube’s error 153 (player configuration) |
a page of about:blank origin (wry’s with_html, which passes no base URL) holding an <iframe> of the player | error 153 |
a page of a wry custom protocol (with_custom_protocol, a secure scheme) holding the <iframe> | error 153 |
a page with an https: base URL holding the <iframe> (youtube.com) | loads, still at 0:00 after 24 s |
the same on youtube-nocookie.com | plays |
youtube-nocookie.com/embed/<id> as the page, with a Referer header (https://app.example.org/, https://localhost/, https://github.com/) | plays |
youtube.com/embed/<id> as the page, with a Referer header | plays |
So the wry API is WebViewBuilder::with_url_and_headers with Referer: wry
0.57’s with_html gives no base URL, and a custom scheme’s origin is not
taken. The trial loads the privacy-enhanced host.
In a real egui-pop window (the gallery, release build, its “YouTube in the viewer” story, the link clicked):
| Path | Result |
|---|---|
| Wayland: winit on Wayland, the web view in a GTK window of its own | plays (pictures move between 20 s and 44 s); the panel says the video plays in its own window |
| X11: winit and GDK on Xwayland, the web view a child window over the viewer panel | plays inside the panel, at the panel’s place |
| X11, the viewer’s tab put behind another | the web view goes; brought back, it opens again and plays from the start |
| X11, the panel resized | not checked in the compositor (the drag did not move the dock’s splitter); a widget test checks that the place given to the web view follows the panel |
Two things had to be found on the way. wry’s build_as_child takes a window
handle, which only unsafe code can make from the window’s X11 id here (the
workspace forbids unsafe): the child is made as wry makes it, an X11 child
window (through x11rb, safe) taken by GDK as a foreign window holding a GTK
window, with wry’s build_gtk inside. And that X11 window must be destroyed only
after GTK let go of it: destroyed first, GDK’s next request failed and GDK ended
the program on the X11 error.
GTK’s loop beside eframe: gtk::init on the interface’s thread (restricted
to X11 by gdk::set_allowed_backends("x11") when the main window is an X11
one), then each application pass turns the loop without blocking
(gtk::events_pending and gtk::main_iteration_do(false), at most 64 events),
and asks for another pass in 15 ms while a web view is open. Nothing else runs
GTK’s loop, so it stays on one thread with egui.
Sound was cut off from the later runs (its server pointed nowhere), and WebKitGTK played on without it.
Prior art
| Application | Links and help | Embedded content | What carries over |
|---|---|---|---|
| VS Code | Links in the editor follow on Ctrl+click (a hover says so); a link to a host not in the user’s trusted domains opens a dialog showing the full URL with Open, Copy, Cancel and “Configure Trusted Domains”; command: URIs in hovers and webviews run only in markdown marked trusted | Markdown preview in a webview with a Strict security level by default: no scripts, no http images, an alert offering to change it; an integrated browser for localhost links | Ctrl+click, the confirmation dialog with Copy and a per-host trust, command links only in trusted text, remote content blocked until allowed |
| Blender | F1 or the context menu’s “Online Manual” opens the page for the control under the pointer in the system browser; Help menu links likewise; an alert when a control has no page | none: the manual is a website | context help from a control to a docs page; no embedded browser |
| Krita | The welcome screen’s community links (help, development fund, source, community) open the browser; the handbook is online | the welcome screen’s news is off by default, because showing it fetches from krita.org | no third-party request before the user opts in |
| Obsidian | Notes are markdown rendered in the application; links to notes stay inside, external links open the system browser | the Web viewer core plugin (desktop, off by default) opens external links in tabs inside, on Chromium’s webview, with ad blocking and a reader mode; its help warns that plugins can read its cookies | markdown inside; a web engine only as an opt-in plugin, with its risks written down |
| egui ecosystem | Hyperlink opens on a click, Ctrl or middle click for a new tab, no confirmation, no URL on hover by default | egui_commonmark for markdown, egui_webview experimental | keep the widget’s habits (click, Ctrl+click, middle click), add the target on hover and the policy |
What carries over
- Plain click opens, Ctrl+click (and middle click) opens outside, as in egui and editors.
- The real target is always visible before the click (hover) and in the confirmation; Copy is offered wherever Open is.
- A per-host trust, asked once per session, avoids a dialog on every click without opening everything silently.
- Remote content (images, previews, news) loads only after the user allows it.
- Markdown is rendered inside; a web engine is an opt-in extra, never the base.
The questions, answered
1. What a click does, per kind of target
The policy classifies a target from its scheme, its host and its path’s extension (never by fetching it):
- Web page: outside (the system browser; a new tab on the web build). Inside only when the host is one the application declares as its documentation and the page is markdown or HTML the viewer can render.
- Video (
youtube.com,youtu.be,vimeo.com, a remote.mp4or.webm): outside, always. A link declared as a video can be drawn as a card that opens outside. - Markdown, HTML:
docs:pages (shipped with the application, resolved by the host) open inside when the viewer is present; without it, the host’s online copy opens outside, or a toast says there is none. - Image: a local one inside (the viewer’s image page), else in the system’s default application; a remote one outside.
- Local file: the system’s default application, after a
confirmation; an executable or a script (by the platform’s rules:
the executable bit,
.exe,.bat,.sh,.desktop,.app…) is refused and Reveal is offered. - Folder: the file manager.
mailto:: the mail client.- The application’s own scheme:
deeplink.open, in-process. command:<id>?<json>: runs the command, from declared text only.
Modifiers: Ctrl+click (Cmd+click on macOS) and middle click mean
outside; Shift is left free. Hover shows the real target (a tooltip
after the usual delay, and the status bar’s message slot when the
application has one). The context menu offers Open, Open outside (when
the default is inside), Reveal in folder (files), Copy link. Keyboard:
links are in the Tab order, Enter and Space open, Shift+F10 or the Menu
key opens the context menu. Accessibility: role link, the label as
name, the target as description.
2. The viewer
A panel (links.viewer), detachable, one page at a time:
- a toolbar: back, forward, reload, the address bar (shows the real target; typing a target opens it through the same policy), Open outside, Copy link;
- history for the session (back and forward stacks), no history kept across runs;
- find in page (Ctrl+F, F3 and Shift+F3), searching the rendered text;
- zoom (Ctrl+plus, Ctrl+minus, Ctrl+0 while it has the focus), scaling the page only;
- links inside a page go through the service: a link to another
docs:page stays inside, a web link goes outside; - anchors (
#section) scroll to the heading; - remote images replaced by a placeholder and one bar, “Images from
<host>are not loaded: Load”, remembered per host.
What renders without a web engine: markdown (egui_commonmark), the HTML
subset (html5ever, ammonia, our mapping), images (egui’s loaders). What
does not: JavaScript, CSS layout, video, YouTube’s player, forms: those
open outside. Because the viewer is egui widgets, it works on the web
build too, where docs: pages are fetched from the same origin as the
application.
3. Opening on each platform
EguiOpener emits egui’s OpenUrl after the policy approved it (the
service marks it so its own interceptor lets it through). On native it
needs eframe’s links feature (webbrowser); on the web, a new tab,
except mailto: in the same tab. SystemOpener (in
egui-pop-platform) adds files, folders and reveal: inside Flatpak or
Snap (detected by /.flatpak-info or $SNAP) through the portal
(ashpd: OpenURI, OpenFile, OpenDirectory), elsewhere through
opener (open, reveal). On the web build SystemOpener is not
available: reveal and local files are refused with the reason. A host
replaces the opener entirely (a kiosk that opens nothing, a host that
opens in its own browser).
4. Trust and privacy
Every request carries its source:
| Source | Example | Web and mail | Local file | Reveal | Command |
|---|---|---|---|---|---|
| Declared | About, menus, tips and toasts shipped by the application, docs: pages | open | confirm | open | run |
| Content | a document, a remote page, the terminal’s output, a paste, text from an agent displayed in a page | open when the host is trusted, else confirm | confirm | confirm | refused |
| Agent | links.open | confirm, always | confirm, always | confirm, always | refused (agents run commands directly, under their own rules) |
Disguised links: the label and the target are both shown when the
label looks like a URL and differs; an internationalised host shows its
punycode form beside it; the host is emphasised in the dialog. Schemes
allowed by default: https, http, mailto, file, docs, the
application’s own, command (declared). Blocked: everything else,
javascript: and data: first. Privacy: no request to a third party
before a click (remote images, video thumbnails, favicons, link
previews); the viewer never sends a referrer or cookies (it has none);
the “load images from this host” choice is a setting the user can
clear. Rate limits: content opens only on a click (one click, one
open); an agent has one confirmation pending per session, five
requests queued, then refusals with the reason.
5. Offline and failures
| Case | Outside | Inside (viewer) |
|---|---|---|
| No network | the browser reports it | error page: “No connection”, Retry, Open outside, Copy link |
| Dead link (404, host unknown) | the browser reports it | error page with the status |
| Blocked scheme | warning toast naming the scheme, Copy link | the same |
| No handler (no browser, no mail client, portal refused or absent) | warning toast with the opener’s reason and Copy link | n/a |
| File gone | warning toast, Reveal the folder if it exists | error page |
| Too large or a type it cannot render | n/a | error page, Open outside |
| Headless | link.failed with the reason in the journal | n/a |
Every failure also ends the link.open step with an error, so a hook,
an agent or a test sees it.
6. Checking
links::lint(&app)lists every declared link: menu items whose command islinks.open, About’s links, tips’ and toasts’ texts,docs:pages and the links inside them. Each must parse, use an allowed scheme, name an existing command,docs:page, anchor or bundled file. A test in the gate runs it on the gallery and on the extension template.cargo xtask links --online(opt-in, never in the gate) checks that declared remote links answer.RecordingOpenerrecords(target, how, source, origin)and answers as scripted (success, a given failure); kittest tests click a link by its role and name and read the record.- Agents:
links.open(target,how,dry_run) andlinks.check(target: the classification and the verdict, nothing opened); thelinkscollector shows the recent requests, their source, the decision and the outcome.
7. The API
// egui-pop-model::links (pure)
pub enum How { Auto, Outside, Inside, Reveal }
pub enum Source { Declared, Content, Agent }
pub enum Kind { Web, Video, Doc, Markdown, Html, Image, File, Folder, Mail, AppLink, Command, Blocked(Reason) }
pub struct Target { /* the parsed URL or path */ }
pub struct Request { pub target: Target, pub how: How, pub source: Source, pub origin: Origin }
pub struct Decision { pub kind: Kind, pub how: How, pub confirm: bool, pub refused: Option<Reason> }
pub struct Policy { /* schemes, trusted hosts, docs hosts, video hosts */ }
impl Policy { pub fn decide(&self, r: &Request, caps: &Caps) -> Decision; }
// egui-pop-api::links
pub const LINKS: ServiceToken<Links> = ServiceToken::new("app.links");
pub const STEP_OPEN: StepId = StepId::from_static("link.open");
pub trait Opener: Send + Sync {
fn caps(&self) -> Caps; // web, files, reveal, inside
fn open(&self, target: &Target, how: How) -> Pending<Result<(), OpenError>>;
}
pub fn open(app: &AppHandle, request: Request) -> Pending<Result<Opened, OpenError>>;
pub fn link(ui: &mut egui::Ui, app: &AppHandle, label: &str, target: &str) -> egui::Response;
pub struct LinksPlugin; // in DefaultPlugins: the service, the step, the interceptor, `links.open`
pub struct ViewerPlugin; // opt-in: the panel and the `Inside` way
ctx.open_url stays usable: whatever emits it, the interceptor routes
it as Source::Declared for http(s) and mailto (what an
application’s own hyperlink is) and as Source::Content otherwise. The
terminal moves to links::open with Source::Content and
How::Outside (a file:// link becomes a confirmed open, or Reveal
from its context menu). An application’s About uses links::link. A
plugin’s files.reveal command is links::open with How::Reveal.
8. In a photo editor
- Help: “Documentation” in the Help menu opens the
docs:index in the viewer, offline (pages shipped with the application); its “Online manual” opens the website outside. F1 over a control opens the page the control’s command declares (as Blender does), a later step. - Tips with links: a tip’s text links a
docs:page (inside) or a tutorial video (a card, outside, no thumbnail fetched unless shipped). - About: the repository and the website open outside without a confirmation (declared); the licence opens inside; each has Copy link.
- “Show in folder”: the toast after an export and the library’s
context menu run
files.reveal(How::Reveal, declared): the file manager with the file selected, through the portal in Flatpak. - An agent asking to open a file:
links.open { target, how: "reveal" }raises a confirmation naming the agent and the path; the answer goes back to the agent; a dry run first tells it a confirmation will be asked. - A headless node receiving an open request: its host installs
NullOpener, or a forwarding opener when an interface is attached: the request is answered “no interface to open it in” or relayed to the interface, where the user confirms.
Flows
A link in About, on native and on the web
The user clicks “Source code”. The widget calls links::open with
Source::Declared. The policy classifies a web page, Auto gives
outside, no confirmation. link.open runs, EguiOpener emits the
approved OpenUrl; on native webbrowser opens the default browser, on
the web build a new tab. link.opened goes to the journal.
A tip with a tutorial video
The tip declares a video link. The card shows the title, the host and the duration, a play icon, no image. A click opens the browser. Had the application shipped a thumbnail, it would be shown; it never fetches one from the video host.
A link printed in the terminal
A program prints https://example.org/report. Ctrl+click asks with
Source::Content. The host is not trusted: a confirmation shows the
full URL with Open, Copy link, Cancel and “Trust example.org for this
session”. Open: the browser opens, the terminal’s Link signal is
still emitted.
An agent asking to reveal an export
The agent calls links.open with a dry run: the answer says kind
File, how Reveal, confirmation required. It calls again without the
dry run: the dialog says “Agent <name> asks to show
<path> in the file manager”. The user accepts; the file manager opens;
the agent receives the result. Refused: the agent receives the refusal.
A docs page offline, with a remote image
The user opens “Documentation”. The viewer shows the shipped page; an
image on another host is a placeholder with “Images from <host> are not
loaded: Load”. Nothing has left the machine. Load: the image is fetched
through our loader; the choice is remembered for that host.
Open questions, with the defaults proposed
- The viewer: a panel or its own window? A panel, detachable; one page at a time.
- Markdown renderer? egui_commonmark in the viewer, behind a feature; our own inline subset (emphasis, code, links) for tips, toasts and settings descriptions, so short texts need no extra crate.
- HTML inside? The safe subset, for declared pages only.
- Confirmation? Declared web and mail links: none. Content links: when the host is not trusted. Local files: always. Agents: always.
- Remote images and thumbnails? After a click, remembered per host.
- A webview? Not now; later an opt-in plugin, native, own window.
- Intercept egui’s
OpenUrl? Yes. file:in content? Confirmed; executables refused, Reveal offered.command:links? Declared text only.- Visited links? Not tracked.
- Remote links alive? An opt-in xtask.
- Headless? Refuse with the reason, or forward to an attached interface.
- Web build? New tab;
mailto:same tab. - Rate limits? One confirmation pending per agent, five queued, then refused; content opens one per click.
- Where does the viewer live? A
viewermodule inegui-pop-viewsbehind amarkdownfeature (an L4 component), rather than a new crate.
Steps
- Fix: turn on eframe’s
linksfeature inegui-pop-api, so links open on native again (webbrowser, MIT OR Apache-2.0); a test that a hyperlink click reaches the platform output. egui-pop-model::links(parse, classify, policy) andegui-pop-api::links(service, step, interceptor,EguiOpener,RecordingOpener, the confirmation, toasts on failure, the widget,links.open,links.check, the collector); the terminal moved onto it; a gallery page.SystemOpenerinegui-pop-platform(platform-open): files, folders, reveal, the portals;files.reveal.- The lint and its test; the inline subset for short texts.
- The viewer: markdown,
docs:pages, navigation, find, zoom, the image consent. - The HTML subset.
- The webview question, if the owner asks for it: a YouTube trial, behind a feature, above.
Sources
Read on 2026-10-28.
- egui and eframe source, 0.36.2:
egui/src/widgets/hyperlink.rs,egui-winit/src/lib.rs(open_url_in_browser), eframe’sCargo.toml(links), https://github.com/emilk/egui/blob/main/crates/eframe/src/web/mod.rs - webbrowser: https://docs.rs/webbrowser/latest/webbrowser/
- opener: https://docs.rs/opener/latest/opener/
- showfile: https://lib.rs/crates/showfile
- freedesktop file manager interface: https://wiki.freedesktop.org/www/Specifications/file-manager-interface
- Flatpak portals: https://github.com/flatpak/flatpak/wiki/Portals, the OpenURI interface versions (https://nest-open-source.googlesource.com/manifest_repos/glib/+/HEAD/gio/org.freedesktop.portal.OpenURI.xml), the writable descriptor rejection (https://github.com/flatpak/libportal/pull/26), links doing nothing without a backend (https://forum.manjaro.org/t/link-in-flatpak-apps-wont-open-on-click-since-anymore-last-update/149907?page=2)
- Snap’s
xdg-open: https://forum.snapcraft.io/t/allowing-xdg-open-to-open-files/3789, https://forum.snapcraft.io/t/stric-confinement-application-must-open-firefox-web-browser/9789 - egui_commonmark: https://github.com/lampsitter/egui_commonmark, https://docs.rs/egui_commonmark/latest/egui_commonmark/
- egui_extras loaders: https://docs.rs/egui_extras
- wry: https://docs.rs/crate/wry/latest, https://github.com/tauri-apps/wry/discussions/996
- egui_webview: https://github.com/lucasmerlin/hello_egui
- Servo on crates.io: https://lwn.net/Articles/1067467/, https://en.wikipedia.org/wiki/Servo_(software)
- Blitz: https://github.com/DioxusLabs/blitz
- YouTube’s privacy-enhanced mode: https://www.stefanjudis.com/blog/the-lie-of-youtubes-privacy-enhanced-embed-mode, https://axbom.com/embed-youtube-videos-without-cookies/
- VS Code: link protection (https://github.com/orgs/community/discussions/58344, https://docs.posit.co/ide/server-pro/user/vs-code/reference/faq.html), markdown preview security (https://code.visualstudio.com/docs/languages/markdown), command URIs (https://www.eliostruyf.com/command-uri-vscode-webview-open-files-links/), the integrated browser (https://code.visualstudio.com/docs/debugtest/integrated-browser)
- GStreamer’s licensing:
https://gstreamer.freedesktop.org/documentation/frequently-asked-questions/licensing.html,
playbin: https://gstreamer.freedesktop.org/documentation/playback/playbin.html - Blender’s help system: https://docs.blender.org/manual/en/latest/getting_started/help.html
- Krita’s welcome screen: https://docs.krita.org/reference_manual/welcome_screen.html, the discussion that made its update check opt-in https://bugs.kde.org/show_bug.cgi?id=363319
- Obsidian’s Web viewer: https://obsidian.md/help/plugins/web-viewer, https://obsidian.md/changelog/2025-01-30-desktop-v1.8.3
0018: Collector actions say whether agents may call them, through one step
Date: 2026-11-03. Status: accepted (2026-11-03, by the lead maintainer’s decision under GOVERNANCE, without the comment period).
Context
The debug bridge runs a command for an agent only when the command is
offered (CommandSpec::no_agent) and applies where it is called, and the
host sees its origin (ADR 0010). Collector actions had none of this.
dialogs.answer, files.answer, plugins.set_enabled, store.set, the
jobs and contexts actions and the others ran for anyone holding the
bridge, without a step a plugin could veto (ADR 0011). Only the devtools
panel went through one (devtools.call), and only for its own calls.
An agent could disconnect the plugin that guards it, or turn on a
setting only its owner writes.
Decision
- Every collector action says whether agents may call it
(
ActionSpec::agent). By default it may when the action only reads, and may not when it writes. A collector offers a writing action withFnCollector::agent; egui-pop offers one,commands.run, which checks the command’s own flag. - The bridge’s calls are the agent’s (
Origin::Agent("debug-bridge")). Only the user (debug_call_as(.., Origin::User)) may call an action not offered to agents. Anyone else’s call is refused before it runs, in the bridge’s log and on the journal (debug.call.refused). - One step for every call:
debug.call(collector,action,args,origin). A plugin may veto it for every caller, and a redirection cannot change who calls. The devtools panel is the user’s. It keeps itsdevtools.callstep, then calls throughdebug.call, so a kiosk’s veto covers the panel and agents alike. A call that only reads is journaled and traced only when vetoed, so polling fills neither. - The application may offer a writing action to agents it trusts
(
AppBuilder::offer_to_agents), such as a test harness or its own automation. A name that matches no action is reported (agent-offer-unknown, ADR 0003).
Consequences
- An agent that wrote through collector actions moves to commands
(
value.set,job.cancel,context.hold…) or is offered the action by the application. Code acting as the person callsdebug_call_aswithOrigin::User. This breaks the debug bridge’s behaviour; the changelog says how to move. - Collector actions still do not know who called them:
commands.runruns asdebug-bridge, andstore.setwrites as the framework, whoever calls. Carrying the caller into them, the value’s writers, and the dialogs’ target command are later decisions. - The origin is still a label from code in the process, not a credential: a plugin can call as the user. A transport that exposes the bridge controls who reaches it.
0019: Collector actions and value writes act as their caller
Date: 2026-11-03. Status: accepted (2026-11-03, by the lead maintainer’s decision under GOVERNANCE, without the comment period).
Context
ADR 0018 settled who may call a collector action, but the action
itself did not know who called it. commands.run ran every command as
debug-bridge, the user’s call from devtools included. store.set and
the value.set, value.reset, value.undo and value.redo commands
wrote as the framework, which may write any path (ADR 0016). An agent
could therefore turn on a setting that only its owner writes, through
value.set, or through store.set once offered.
Decision
- An action gets its caller.
Collector::calltakes the call’s origin.FnCollector::action_asgives it to the action, andFnCollector::actionstays for actions that do not need it.commands.runruns the command as its caller. The user, from devtools, may run a command kept from agents; anyone else may not. - A write is made by its caller’s writer (
Origin::writer). The user writes through the framework, as the settings form does. Anyone else writes as itself (agent:debug-bridge,script:<name>…). The value’s declared writers then apply, under the store’s writer check: refused by default, warned about underWriterCheck::Warn. This holds forstore.setand for thevalue.setandvalue.resetcommands. - An undo or a redo by a writer is held to the same check
(
Store::undo_by,Store::redo_by): all or nothing, every path the step changed.store.undo,value.undoandvalue.redogo through it. Undo through the history (edit.undo,history.*) is unchanged. - To let an agent write a value, its owner names the agent among the
value’s writers (
Descriptor::writers,Origin::writer()as the id), or lets anyone write it.
Consequences
- An agent that set values it does not own is refused. The application names it among those values’ writers, or acts as the user.
- The rest of the plan uses the caller:
dialogs.answerandfiles.answeranswer as their caller and can check the target command’s flag for it; thecontextsactions request as their caller; a command’s handler can carry its origin into the commands it starts. These still act asdebug-bridgetoday.
0020: Answers carry their caller, and a dialog keeps its command’s flag
Date: 2026-11-03. Status: accepted (2026-11-03, by the lead maintainer’s decision under GOVERNANCE, without the comment period).
Context
ADR 0018 lets an application offer dialogs.answer and files.answer
to agents. Once offered, an agent’s acceptance ran the dialog’s command
without checking its agent flag. A command kept from agents
(no_agent) could therefore run because an agent accepted the dialog
that confirms it. File choices reached their consumer without saying
who made them. ADR 0019 gave every action its caller, but these two
still answered as a fixed debug-bridge.
Decision
dialogs.answer,files.answerand thecontextsactions act as their caller (FnCollector::action_as). A dialog accepted through the bridge runs its command with the caller’s origin, and a context hold is made in the caller’s name.- A dialog keeps its command’s flag. An answer that would run a
command not offered to agents is refused to anyone but the user,
even when the application offers
dialogs.answer, and whoever gives it: the bridge, or code callingDialogs::answerwith another origin. The journal saysdialog.answer.refused, from the caller. The dialog stays open, and cancelling it stays allowed. - A file choice carries its origin to its consumer: in the result
(
files::chosen_origin), in thefile.chosenstep’s arguments (origin), and in the collector’s last choices (by).Files::deliver_asnames the origin;Files::deliveris the user’s. Nothing refuses an agent’s choice: a choice has no command whose flag could decide it. The consumer decides, or a hook onfile.chosen.
Consequences
- Offering
dialogs.answerlets an agent answer dialogs. It does not let the agent run, through a confirmation, what it could not run directly. - A consumer of a file choice that should act only on a person’s choice
checks
chosen_origin. Existing consumers, which read only the paths, are unchanged. - Origin stays a label from code in the process. Carrying it through the commands a handler starts is the next decision.
0021: The origin goes along the chain of commands; deep links are remote
Date: 2026-11-03. Status: accepted (2026-11-03, by the lead maintainer’s decision under GOVERNANCE, without the comment period).
Context
ADRs 0018 to 0020 hold the debug bridge’s own calls to the agent flag
and to the caller’s origin. Past the first command, the origin was
lost. A handler that started another command with AppHandle::run ran
it as the user, so an agent’s offered command could start one kept from
agents. App::run and AppHandle::run_as took any origin without
checking the flag. Deep links from a launch, which any program of the
user’s can send through the single-instance socket, ran the
application’s links command as the user.
Decision
- A handler acts for its command’s origin. While a command’s
handler runs, or its host dispatch for one the host runs in process,
AppHandle::acting_originis that origin. Outside a command it is the user. - What a handler starts keeps that origin.
AppHandle::runruns for the acting origin. - No claim to the user. While a command runs for anyone but the
user,
AppHandle::run_asrefusesOrigin::User. While one runs for an agent, it refuses anything but an agent’s origin. The refusal is on the journal (command.refused, from the acting origin) and in the log. The explicit escape is to ask the user: a dialog, whose answer comes from the user outside the handler and runs its command as the user. A plainrun_as(Origin::User)would let any agent-run handler claim the user, so there is no such method. - The
agentflag holds for every run.App::run, and so everything queued byAppHandle::run_as, refuses a command not offered to agents for an agent origin (command.refused). - Deep links are remote. A link that comes with a launch runs the
links command for
Origin::Remote("deeplink")(instance::deeplink_origin), with the origin indeeplink.open’s arguments. The chain and writer rules above apply to it as to any origin but the user. A link of the application’s scheme clicked inside the application runs for the click’s origin.
Consequences
- An application whose handler ran other commands as the user while
serving an agent, a script or a deep link gets
command.refused. It asks the user, or runs them with the acting origin. - Code outside a handler still names any origin: a plugin’s own code, a
step’s hook, a timer. Work a handler leaves for later (a thread, a
host’s
Reply::Later) does not inherit the origin, and names it itself. The origin stays a label from code in the process, not a credential.
0022: Sections and a toolbar row move into egui_stack as plain-egui cores; egui-pop wraps them
Date: 2026-11-03. Status: accepted (2026-11-03, by the lead maintainer).
Context
egui_stack continues egui_dock (MIT) on egui 0.37 and means to hold more
of an application’s panel management: stackable sections and toolbars.
egui-pop has both today (sections,
toolbars). Sections are a widget in egui-pop-core
over egui-free arithmetic in egui-pop-model; toolbars are menus drawn
as buttons in egui-pop-api. What ties them to egui-pop is narrow: the
kit paints them, the strings provider names them, the gesture map gives
the pull’s keys, the debug bridge reads them; for toolbars, the command
world (menus, when, keys, arguments, providers, the icon registry).
The analysis is in egui_stack directions,
section 5.
Decision
- egui_stack holds the plain cores, egui and nothing else:
sections::plan: the arithmetic as it is (fit,plan_drag,keep_title,pin_plan,rows_least), without egui types;sections::Sections,Section,Stack: the widget with its three body kinds, its behaviour, keyboard and accessibility, its persistedLayoutby key andlaid_out;toolbar::ToolRow: a row or column of caller-given items (icon, label, tooltip, enabled, checked, busy, separator, submenu) with the overflow into a More button, returning what was clicked and what was laid out.
- Three seams, no egui-pop type: a painter trait per widget
(
SectionsPainter,ToolRowPainter), defaulting to egui’sVisuals; a labels struct with English defaults; configuration values (the pull’s modifiers, sizes). - egui-pop wraps them:
egui_pop::core::sectionsandegui_pop::api::toolbarskeep their API, implementing the painters with the kit, the labels with the strings provider, the pull’s keys from the gesture map; commands,when, keys, arguments, list providers, the icon registry, the value store, the debug collectors and the focus plugin stay egui-pop’s. egui_stack never depends on egui-pop. - Sections move first, once their behaviour has settled; the toolbar row follows.
- Layering (ADR 0001): egui_stack is an external dependency of
egui-pop-core(L2).egui-pop-modellosessections; its path is kept as a deprecated re-export fromegui-pop-corefor one release.
Consequences
- The widgets serve any egui application and get their testers; egui-pop keeps less code and its tests unchanged, run against the wrapper.
- A change of behaviour lands in egui_stack first, then in egui-pop on a bump: two repositories in step while sections still evolve.
- Sections can later become a container kind of egui_stack’s tree (direction N of the analysis), so a panel could move between tabs and a section stack.
- Alternatives set aside: keeping both in egui-pop (no reuse, egui_stack without its stated growth); a third crate for sections alone (one more repository for a widget meant to meet the dock); moving the whole toolbars module (it is the command world, which egui_stack must not know).
Progress
- Sections: done (2026-11-04). egui_stack 0.22.2 has
sections(Sections,Section,Stack,Layout,laid_out, the arithmetic insections::plan); the painter seam is the existingDockPainter(section_band,section_boundary) rather than aSectionsPainterof its own, the labels areLabels::resize_section, and the pull is configured by apull_whenclosure.egui_pop::core::sectionswraps it with its API kept; the memory key becameegui_stack.sections, and a layout stored under egui-pop’s old key moves there on first load.egui-pop-modelcannot re-export the arithmetic, as egui_stack depends on egui and the model must not (ADR 0001, its layering test): itssectionsstays as a deprecated, unused copy for one release, and the arithmetic is re-exported asegui_pop::core::sections::plan. - Toolbar row: done (2026-11-05). egui_stack 0.22.3 has
toolbar::ToolRow(Tool,ToolDisplay,laid_out,focused,focus), painted through three newDockPaintermethods (tool_item, within_menufor the rows of its More menu,tool_more,tool_separator), its More button named byLabels::more_toolsandmore_tools_in, and one Tab stop byTabFocus::Roving.egui_pop::api::toolbars::Toolbarkeeps its API and builds the row’s tools from the menu’s items:whenand its reasons, arguments, list providers, the busy spinner and the run on a click stay in egui-pop, as do the tooltips (title, key, why greyed, the last run’s error), the icon registry record, the Fluent names of More tools, submenus (aTool::menudrawing the menu’s rows) and thetoolbarscollector. The kit’sDockPainterpaints the tools withtoolbar-buttonand the More and Dropdown glyphs, and the More menu’s rows withmenu-item; egui-pop’s own measuring, cut, painting andtab::rovingwrapping are gone.
0023: Every command goes through the host’s dispatch; history walks are held to the writers
Date: 2026-11-03. Status: accepted (2026-11-03, by the lead maintainer’s decision under GOVERNANCE, without the comment period).
Context
ADR 0010 makes Host::dispatch the one place a command is run, so a
host can guard every command there, refusing agents for instance. 29
commands bypassed it:
- undo and redo (
edit.undo,edit.redo); - the agents’
history.*; - the context stack’s
nav.*andcontext.*; - the clipboard’s
edit.cut/copy/paste/pasteSpecialandclipboard.*.
Their handlers call the host themselves (Host::history,
Host::contexts, Host::clipboard), and a dispatch holds the host, so
they ran in the interface without being dispatched. A guard in the host
did not see them. Undoing replayed values as the framework, so an
agent’s undo took back what its own write would have been refused (ADR
0019).
Decision
- Every command is dispatched. For one whose handler calls the host
(
Dispatch::deferred()says so), the dispatch gets a stand-in in-process handler.run_localapproves the command and answersnullat once; once the dispatch returns and the host is back, the interface runs the real handler, and the command’s result is the handler’s.- A host refuses such a command as it refuses any other: by answering
an error without calling
run_local. - A host that answers on its own without calling
run_localgives the command’s result itself. - Running the handler inside the dispatch would not be sound: the host it calls is held there, and re-entering it would deadlock or fail. Approving first and running after keeps one dispatch per command and leaves the host free.
- A host refuses such a command as it refuses any other: by answering
an error without calling
- History walks are held to the writers. Undo, redo, jump, restoring
a snapshot, undoing one step out of order and walking to a replaced
line all write by the walker’s writer (
Origin::writer, ADR 0019). This coversedit.undo,edit.redoandhistory.*with the store’s owner. Every path the walk changes is checked first, all or nothing. The user’s writer, the framework, may write every path, so nothing changes for the user.
Consequences
- A host that refuses agents in
dispatchrefuses them everywhere. - A host that wrapped
run_localto time or journal it seesnullat once for the 29 deferred commands. It readsDispatch::deferred. - An agent’s undo of a value it may not write is refused (
not_writer). An application names the agent among the value’s writers to let it undo there. - Collector actions, code calling a step or
AppHandle::undodirectly, and a text field’s own undo inside egui are not commands and are not dispatched. Thedebug.callstep (ADR 0018) and the steps’ hooks cover them.
0024: The debug bridge has a mode; commands say when they only read
Date: 2026-11-03. Status: accepted (2026-11-03, by the lead maintainer’s decision under GOVERNANCE, without the comment period).
Context
ADRs 0018 to 0023 hold the bridge’s callers to the agent flags, their
origin and the values’ writers. The bridge itself was always fully on.
An application could not turn it off, or make it read-only, for a kiosk,
a release build or an agent that should only look.
commands.run always said it mutates, so an agent could not tell a
command that reads from one that writes, and nothing could allow the
first kind alone.
Decision
- The bridge has a mode, set by
AppBuilder::debug_bridge(BridgeMode). It holds anyone but the user:On(the default): every action and command offered to agents;ReadOnly: only calls that change nothing, meaning actions withmutates: falseandcommands.runof a read-only command;Off: no call at all.
- The user’s calls are never held by the mode (the devtools panel,
debug_call_aswithOrigin::User). A refusal goes on the journal asdebug.call.refused, as for an action not offered (ADR 0018). Snapshots stay readable by code in the process. - Commands say when they only read.
CommandSpec::read_onlymarks them, and egui-pop marks its own readers.commands.runreportsmutatesfrom that flag, through a per-callCollector::mutates, and a read-only bridge runs only those commands.- The flag is the command author’s word. Nothing checks that a read-only command does not write.
- A failed read goes on the journal. A call that only reads is
published as
debug.callwhen it fails or is vetoed, and not when it succeeds. So a refusedcommands.runis on the journal exactly once, whatever its command.
Consequences
- A kiosk, or a release build, turns the bridge off or makes it read-only in one line. Its devtools panel keeps working for the user.
- An application’s own reading commands add
.read_only()so that a read-only bridge can run them. - Still open, and documented:
- redacted snapshots;
- a rate limit;
- a blocking wait;
- in-process code calling as the user.
0025: Application windows are deferred viewports with an Rc shim; the main window is always the first
Date: 2026-11-11. Status: accepted (2026-11-11, by the lead maintainer’s decision under GOVERNANCE, without the comment period).
Context
An application wants several OS windows that behave almost as separate
applications: each with its own content, title, keys and dialogs, none
blocking the others, an idle one costing nothing while another animates.
egui-pop’s application (AppHandle) is Rc, one per process; its
detached panels are immediate viewports, repainted with their parent.
A spike (crates/egui-pop-gallery/examples/multi_window_spike.rs, run in
wbox on labwc, headless mutter and Xwayland) measured eframe 0.37:
- deferred viewports repaint on their own, and their
Send + Synccallbacks run on the main thread, so a thread-local registry keyed by viewport reachesRcstate from them; - winit 0.30 cannot hide a window on Wayland, so a hidden coordinator root is impossible there;
ViewportInfo’s rects stay empty for deferred windows on Wayland, and no position is ever known there;- on headless mutter a FIFO present stalls every window (one UI thread
waits on one surface);
AutoNoVsync(Mailbox) does not, and stays paced at the display rate by winit’s frame callbacks.
Decision
AppHandle::open_window(WindowSpec, content)opens a deferred viewport, declared from the main window’s pass. The content is a closure (FnMut(&mut Ui, &mut WindowUi)) that may holdRcstate; the callback egui keeps holds only the viewport id, and finds the window in egui-pop’s thread-local registry, with a debug assertion that it runs on the UI thread.- The main window is always the first window, never hidden. Closing
it while other windows are open cancels the close and moves the window
worked in last into it (content, title, id); closing the last window
quits.
Raising the main window (
raise_window(&WindowId::main()),window.switch { window: "main" }) while a moved content holds it sends that content back to a window of its own (its id, title, saved geometry and keys) and draws the shell again (2026-11-12).AppHandle::quit(used byapp.quit) closes everything instead of moving a window into the main one. - Titles come from the content (
WindowUi::set_title), sent to the system as soon as they change; there is no generic word. - Geometry is read from each window’s own pass and kept per window id
in
windows.jsonunder the persistence directory; the position only where the platform gives it. - Per window: keys are dispatched in its own pass (
appWindownames it inwhenclauses); a modal open in an application window blocks that window only. - Each window’s shell is its own (2026-11-11). A window group is
an application window, or the main window with its detached panels
(
AppHandle::window_group). What opens belongs to the group it was opened from: the window being drawn, the window whose command opened it (itsappWindow), the window an agent’s call names, else the active one.- Toasts: each group stacks its own (
Toasts::notify_innames one); a closed window’s go to the main window. - Dialogs: one queue per group, one dialog shown in each at a
time; a dialog blocks its group only.
modalOpenis per group (overlay::modal_open, withoverlay::set_separate_windows): a modal in an application window no longer makes!modalOpencommands refuse in the main window. A closed window’s dialogs are cancelled with it (2026-11-13), as a file choice asked from it is; a window moved into the main window takes its dialogs there. - The palette: one per group, opened where it is asked, offering and running in that window’s context (its commands and the global ones), Escape closing that one only.
- Agents:
callandsnapshottakewindow(a window id,mainfor the main window; the active window without one), anddescribelists the open windows (id,title,main,active). - Quick pick:
window.pick(Window > Switch to window…) lists the open windows by title in a choice with a filter, in the window it is asked in. - The shell’s bars (2026-11-13): a window opened with
WindowSpec::shell_bars(true)shows the main window’s bars, as VS Code’s windows do: the title bar’s start (theCAPTION_STARTzone: the menu button, the name or logo) and the main menu (app.main, when the application has a menu bar), evaluated and run in that window’s context. A command whosewhenholds only in another open window (appWindow == 'main') is greyed there, its tooltip naming that window (“Only in the Demo window”). A menu opened as a popup (menus::popup_at) is drawn in the window it was opened in.
- Toasts: each group stacks its own (
- Geometry when a window moves into the main window: the main
window keeps its own geometry under its own id (
main), and the moved content keeps the one saved under its id; the main window’s size is never written under the content’s id. AppBuilder::multi_window(true)makesrun_nativeuseAutoNoVsyncon Wayland (WAYLAND_DISPLAYset) andAutoVsyncelsewhere, unless the application chose a mode.
Consequences
- Applications keep
Rcstate; nothing moves toArc<Mutex>. Should eframe ever run deferred callbacks off the main thread, the debug assertion and the empty registry say so at once. - Commands a window’s keys start run before the main window’s next pass (one pass later, in the window’s context).
- Raising a window is best effort on Wayland (no activation token for an existing window in winit 0.30).
egui_pop_test::windows::MultiWindowdrives such an application headless, each window’s pass on its own.- A
whencontext asked for another group than the window being drawn (an agent naming a window from the main window’s pass) has that group’sappWindow,windowandmodalOpen; its focus-chain keys stay those of the window being drawn. - Not yet per window: the workbench layout. An application window’s content is a closure, not a workbench; when it moves into the main window it replaces the shell there (the shell’s detached panels are not drawn meanwhile). A workbench per window (its own layout, its detached panels following it) is left for a later slice.
0026: Layers have ranks, pinned under base layers at the bottom of the foreground
Date: 2026-11-11. Status: accepted (2026-11-11), implemented (issue #352).
Context
egui has no z-index. Inside an Order, a layer goes to the top when it
is first shown, shown again, clicked or dragged (Area calls
Areas::move_to_top), and egui keeps the rest in the order they had.
egui_stack draws a zone lying over its neighbour and a flyout as their
own Areas in Order::Foreground (layout/fold.rs). egui-pop’s
overlays (toasts, the tips card, hover cards, popovers, the zen way
out) and an application’s own (tvty’s “Did you know?” card) share that
order, so a click on a panel lying over the centre puts it over the
card: the order follows the clicks, not what each layer is (issue
#352).
What egui 0.37 offers, read in its source:
Order(Background,Middle,Foreground,Tooltip,Debug): fixed, but only five, and windows, popups and the shell’s areas each already sit in one.move_to_topadds a layer to a set; at the end of the pass the set goes to the top in the order its layers already had. Calling it in rank order every pass therefore does not sort them, and a layer shown for the first time still lands over the others for a pass.Areas::order()is not public; nothing moves a layer down.set_sublayer(parent, child)(Context,Areas): at the end of the pass every child is moved directly above its parent, after themove_to_topsort, whatever was clicked. Both must share anOrder. It lasts one pass (called again each pass), and is one level deep: nested sublayers are unspecified.Areas::child_layersreads them. egui-pop already uses it for the canvas overlays (#337) and the indicator’s overhang: a layer kept right above another.- Layers are never dropped from egui’s order, and each viewport has its
own
Areas.
Decision
-
Ranks, bottom to top, in each viewport:
Docked: the shell’s docked panels and the central panel (Background, egui panels); nothing to enforce.Over: zones lying over their neighbour and flyouts.Overlay: egui-pop’s and the application’s overlays: cards, popovers, toasts, the zen way out.Popup: menus, combo lists, context menus, dialogs’ backdrops and any foreground layer nobody ranked.Tooltip: egui’sOrder::Tooltip; nothing to enforce.
Floating windows (
Order::Middle) stay between 1 and 2, as today. -
Enforcement: one base layer per pinned rank, sublayers above it. egui-pop owns two empty foreground layers,
base(Over)andbase(Overlay). At the start of each passlayers::begin_passcallsset_sublayer(base, placeholder)for both, in rank order: on the first pass this puts them into egui’s order before any other foreground layer, and since nothing ever raises them they stay at the bottom of the foreground,OverunderOverlay. Every ranked layer is made a sublayer of its rank’s base each pass, so egui moves it right above that base at the end of the pass, whatever was clicked:base(Over), lying-over zones and flyouts,base(Overlay), overlays, then every layer nobody ranked. Rank 4 needs no base: an unranked layer (egui’s menus and popups, a dialog, an application area not yet ranked) is above both bases and their sublayers. -
Two levels made one. A ranked layer may itself be a parent (a
Sceneor a canvas overlay inside a lying-over panel). At the end of egui-pop’s pass,layers::end_passalso makes each ranked layer’s own children (Areas::child_layers) sublayers of the base, so they stay together whatever order egui walks the parents in. -
egui_stack exposes a hook, not ids:
LayoutArea::sublayer_of(parent)makes the lying-over zones’ and the flyout’s layers sublayers ofparenteach pass. The shell passeslayers::base(ctx, Rank::Over). egui_stack keeps its area ids private; a host without ranks keeps today’s behaviour. -
The public API (
egui_pop_core::layers, re-exported by the facade):enum Rank { Over, Overlay }, the ranks a layer can be put at (the others are egui’s orders or the default);layers::rank(ctx, layer, rank), called each pass the layer is shown, for a layer drawn some other way (alayer_painter);layers::area(ctx, area, rank, add_contents), which sets the area’s order toForeground, shows it and ranks its layer: what an application calls instead ofctx.move_to_top;layers::base(ctx, rank), for a host or a component drawing its own lying-over surface. egui-pop’s own overlays (toasts, tips card and halo, hover cards, popovers, zen way out, quick look) takeRank::Overlay.
-
Several windows. egui keeps one
Areasper viewport, so each window (an application window of ADR 0025, a detached panel) has its own bases and its own order; a layer is ranked in the pass of the viewport it is drawn in, which is its window group’s. Between OS windows, the system decides. -
Popups opened from a lying-over panel (a combo list, a context menu, a popover asked to be a popup) are unranked foreground layers, hence above the panel and above the overlays. A popover egui-pop opens from a lying-over panel is an overlay, above the panel too.
-
Escape hatch. An application that wants a layer above the overlays leaves it unranked; one that wants it under the lying-over zones makes it a sublayer of
base(Over)itself.
Consequences
- The order inside the foreground no longer depends on clicks between ranks; inside a rank, egui’s last-clicked rule still applies (two panels lying over, two toasts).
- A foreground layer shown before egui-pop’s first pass would stay under the bases. egui-pop starts every pass of its viewports, so only a layer drawn outside egui-pop could.
- Dialogs (egui-pop’s modal backdrop is a foreground area) stay above the overlays; a toast under a dialog’s backdrop is what a modal wants.
- egui-pop needs an egui_stack release with
LayoutArea::sublayer_ofbefore the shell can use it. - Should egui gain a z-index or a public
order(),layerskeeps its API and changes its enforcement.
Slices
- egui_stack:
LayoutArea::sublayer_of(quazardous/egui_stack#74), then a release. - egui-pop core:
layers(ranks, bases,rank,area,begin_pass/end_passfrom the application’s pass); the shell pins its lying-over zones and flyout; a headless test with an application overlay atForegroundand a lying-over panel clicked. - egui-pop’s overlays take
Rank::Overlay; the facade re-exportslayers; the guide shows the application call.
Implementation notes
layers::install, called by the application on each pass before it shows anything, adds an egui plugin runningbegin_passandend_passin every pass of every window, and starts the current one.layers::rank_from(ctx, layer, rank, opener)ranks a layer only when the layer it opens from is at that rank or below it: a hover card or the file browser’s quick look opened from a dialog or a menu stays unranked, above it. A popover is ranked unless a modal or a menu is open under it in the overlay stack; a menu (Kind::Menu) is never ranked.layers::rank_oftells the rank a layer had this pass or the previous one, the lying-over zones egui_stack pinned included.
0027: Every public module belongs to one component family, which says what it owns and refuses
Date: 2026-11-15. Status: accepted (2026-11-15).
Context
egui-pop covers a lot: windows, docking, focus, undo, the clipboard, the
context stack, selection, editors, a terminal, an image viewport, a node
graph, jobs. Each crate has its place in the layering (ADR 0001), the
interactions between families are decided in ADRs 0012 to 0017 and 0025,
and docs/stability.md gives tiers crate by crate and item by item. What
was missing (an outside review, docs/review-2026-11.md, point 1): one
place that says, per family, what egui-pop owns, what it refuses, how
firmly it is kept, and where its contract is written. Without it a new
module lands without anyone deciding which promise it falls under, and a
reader cannot tell a refusal from a gap.
Decision
- Families, not crates, carry the promise. A family is a set of
public modules across the layers (its pure model in
egui-pop-model, its drawing inegui-pop-core, its plugin inegui-pop-api, or a crate of its own). The table below is the list. - Every public module of every published crate is in exactly one
family row. A crate without public modules is listed by its name; a
crate with public modules is listed by its modules only.
cargo xtask families --checkreads the table’s Modules column and the crates’src/lib.rs, and fails on a module in no row, in two rows, or a row naming a module that does not exist. pr-lint runs it, so a new module comes with its family. - The tier is
docs/stability.md’s, quoted here, never decided here: when the two disagree, stability.md wins and this table is fixed. “Not listed” would mean stability.md says nothing yet, a gap to fix there. - Refuses is a decision: a request in that list is answered with “out of scope, build it on top”, not a new module.
- A new family needs an application adopting it, an owner, frame tests, a contract doc and a row here before its first release.
- A family may leave the repository when it has no egui-pop
dependency it could not take from crates.io (as
ortho-routerandegui-pop-hooksalready could) and its own release rhythm: it moves to its own repository, keeps its crate name, and its row here becomes a dependency line.
The gallery and consumer-smoke (not published), xtask and the
templates are examples and tools, outside the table.
Families
| Family | Owns | Refuses | Tier | Modules | Contract |
|---|---|---|---|---|---|
| Foundations | Typed ids, diagnostics, owner-tagged registries, plugin order, clocks, fuzzy matching, versioned documents and their atomic persistence, egui-memory slots, settings folders | A storage engine or database; sync over a network; egui types in the model | Stable (ids, documents, persistence); Supported (configuration folder) | egui-pop-model::{ids, diagnostics, registry, order, clock, fuzzy, doc}; egui-pop-core::{persist, state}; egui-pop-api::dirs | ADR 0002, 0003, 0008, 0028; docs/dirs.md |
| Values and binding | The value store (descriptors, Set, gestures, writers), the three binding modes, late values, latest-wins loads | Reactive signals or a general state-management library; deriving UI from structs | Stable (value store, binding); Experimental (late, latest) | egui-pop-model::values; egui-pop-core::{binding, late, latest} | ADR 0009, 0016, 0028; docs/state-or-event.md, docs/linked-panels.md, docs/late-values.md |
| Tokens and themes | DTCG tokens, the resolver, contrast checks, palettes, theme packages, egui visuals and fonts from tokens, the motion clock, text and scroll-bar settings, the theme editor | Literal colours and sizes in components; a CSS engine; per-widget style overrides outside tokens | Stable (tokens, theme); Supported (scroll-bar setting); theme editor Experimental | egui-pop-tokens::{apca, cache, contract, contrast, package, palette}; egui-pop-core::{theme, fonts, motion}; egui-pop-api::{text, scroll_bars, theme_editor} | ADR 0006; docs/tokens.md, docs/themes.md, docs/fonts.md, docs/theme-editor.md |
| Visual kits | A component’s boxes per state and tone as data, kit folders and packages | Arbitrary drawing code in a kit; images other than the kit’s own | Experimental | egui-pop-tokens::kit; egui-pop-core::kit | docs/kit.md, docs/kit-packages.md |
| Controls | egui’s small widgets through the kit, the decorated input, numbers, field states, sliders and their gestures, knobs, the parameter widget, ratings, compact controls for dense rows, role-named layout helpers, busy state on command-bound controls | A second widget toolkit beside egui’s; date pickers and rich text fields | Supported (slider, parameter widget, busy state); Experimental (inputs, field states, slider gestures, compact, knob, rating, number) | egui-pop-core::{widgets, input, number, field, slider, knob, param, rating, compact, segmented, ui}; egui-pop-model::field; egui-pop-api::{sliders, busy} | docs/widgets.md, docs/inputs.md, docs/sliders.md, docs/knob-interaction.md, docs/rating.md, docs/compact.md |
| Feedback, hints and icons | Progress, placeholders, micro-indicators, notes (inline messages in sentences), notices (one message raised once, its bus points, store and routing), tooltips, hover cards, the area registry (an edit area’s grips at rest and hover card), icons by role and an application’s icon set, toasts, tips | Animated illustrations; an icon font other than the bundled one as a default | Supported (toasts, icons, icon set, placeholders); Experimental (progress, micro-indicators, notes, notices, tips, tooltips, hover cards, the area registry) | egui-pop-model::notice; egui-pop-core::{progress, placeholder, indicator, note, tooltip, hover_card, areas, icon, icon_set}; egui-pop-api::{toasts, tips, notices} | ADR 0028; docs/progress.md, docs/indicators.md, docs/notices.md, docs/design/indicators.md, docs/icons.md (the icon set: section 8), docs/tips.md, docs/workbench.md (interactive areas) |
| Overlays, placement and layers | The overlay stack, placement of a floating element next to its anchor, layer ranks, header bands of movable surfaces | A z-index beyond the ranks; windows of the system drawn as overlays | Stable (overlays); Supported (placement, band); Experimental (layers) | egui-pop-core::{overlay, placement, layers, band} | ADR 0026, 0028, 0029; docs/overlays.md |
| Focus and keyboard | Focus scopes and the focus chain, Tab order, F6 regions, the key dispatcher, the keymap and its resolution, when clauses, the focus mode, keys in the system scope | Input methods and text editing keys (egui’s); OS-wide hotkeys (platform services) | Stable (focus, dispatcher, keymap, when); Supported (keymap at run time, F6 regions); Experimental (focus mode, system scope) | egui-pop-core::{focus, tab, regions, keys, focus_mode}; egui-pop-model::{tab, keymap, when}; egui-pop-api::system_keys | ADR 0007, 0028; docs/regions.md, docs/focus-mode.md, docs/design/navigation.md |
| Commands, menus and toolbars | Commands as the one action vocabulary, declared menus, the command palette, declared toolbars | Menus or toolbars drawn by whoever fills them; actions that are not commands | Stable (commands, menus); Supported (palette, menus drawn); Experimental (toolbars) | egui-pop-model::{commands, menus}; egui-pop-api::{menus, palette, toolbars} | ADR 0023, 0028; docs/toolbars.md, docs/plugins.md |
| Pointer and canvas | Gesture profiles (wheel, scroll, pinch, drag), the table canvases read, the canvas in use and its navigation commands | Gesture recognition beyond egui’s events; touch-first layouts | Experimental | egui-pop-model::pointer; egui-pop-core::{pointer, canvas}; egui-pop-api::pointer | docs/pointer-gestures.md (the canvas in use), docs/design/pointer-gestures.md, docs/cursors.md |
| Workbench and layout | Declared panels, zones and blocks, the workbench’s areas over egui_stack, layout controls, arrangements, strips, floating palettes, collapsible sections, folds inside a panel and a hand-built tree’s rows | A docking engine of its own (egui_stack is it); free-form canvases of panels | Stable (zones and blocks); Experimental (workbench, arrangements, strips, sections, folds) | egui-pop-model::{panels, layout, sections}; egui-pop-core::{sections, fold}; egui-pop-api::{workbench, layout_controls, arrangements, strips, palettes, zones} | ADR 0005, 0022, 0028; docs/workbench.md, docs/sections.md, docs/linked-panels.md, docs/status-bar.md |
| Windows, frame and scale | The window’s own frame and hit regions, the window’s place, application windows, scale per window, the interface zoom | A windowing system of its own (eframe and winit are it); multi-process windows | Supported (frame, scale, zoom, window’s place); Experimental (application windows, what draws a window’s own surfaces) | egui-pop-core::{frame, scale, window_surface}; egui-pop-api::{frame, window, windows, zoom} | ADR 0025, 0029; docs/workbench.md |
| Operating system layers | The few unsafe calls the frame and the viewport need: Win32 hit testing, a Wayland subsurface, winit’s raw handles | Anything a platform crate (winit, raw-window-handle) already offers; egui types | Not covered | egui-pop-win32::{ht, wm, dwm}; egui-pop-wayland; egui-pop-winit | ADR 0001; docs/wayland-colour.md |
| Application API | Plugin, Ctx, AppBuilder, App, services, steps, alter hooks, the bus (the window lifecycle’s requests, listeners and registry, and the window invariants checked against it), the host, reads, waiting on the application, the native runner and the main window’s frames owed (main_wake), gallery stories | An application’s kernel (the host wraps it); async runtimes; a plugin ABI across dynamic libraries | Stable (plugin, ctx, app, services, steps, hooks); Experimental (bus, window invariants, host, shell hooks, runner, main_wake, reads, wait) | egui-pop-api::{app, ctx, plugin, services, steps, hooks, bus, window_invariants, host, reads, wait, runner, main_wake, stories} | ADR 0004, 0010, 0011, 0028, 0029; docs/plugins.md, docs/extensions.md, docs/first-app.md, docs/threading.md, docs/runner.md |
| Hook kernel | Typed hook points, ordered listeners, alter and collect, the per-listener error boundary, introspection, without egui | UI of any kind; event buses across processes | Experimental | egui-pop-hooks | ADR 0028, 0029; docs/hook-kernel.md; crate docs; docs/standalone.md |
| Slot layout | Plain boxes packed into a grid in standard slot sizes: forms, orientations, pins, groups and their bands, growth, hysteresis, logical and visual order, without egui (formerly the separate egui_fit) | Drawing, widgets or values; a constraint solver or general box model (egui’s layouts and UiPop’s rows are those) | Experimental | egui-pop-fit | crate docs (crates/egui-pop-fit/README.md); docs/standalone.md |
| Containment | Fault boundaries around panels, the main window’s paint guard | Recovering application state after a panic; crash reporting (platform services) | Supported (fault boundaries); Experimental (paint guard) | egui-pop-core::fault; egui-pop-api::paint_guard | ADR 0003, 0029; docs/containment.md |
| Mount contract | What components need and hosts offer, checked across crates | Dependency injection beyond the declared offers | Supported | egui-pop-model::mount; egui-pop-api::mounts; egui-pop-views::mounts; egui-pop-editors::mounts; egui-pop-viewport::mounts; egui-pop::mounts | ADR 0013, 0028; docs/hosts.md |
| Context and selection | The context stack projected from the kernel, the application-wide selection | Owning the application’s places or selection model (the kernel does) | Experimental | egui-pop-model::{context, selection}; egui-pop-api::{contexts, selection} | ADR 0012; docs/contexts.md, docs/selection.md, docs/status-and-context.md |
| Undo | Histories routed by focus, one step for many writes, the history panel | Owning the application’s history (the kernel does); collaborative or branching undo | Stable (value store undo); Experimental (histories, history panel) | egui-pop-model::history; egui-pop-api::{history, history_view, group} | ADR 0014, 0028; docs/history.md |
| Clipboard | Typed items in several formats, hooked at each boundary | Owning the application’s items (the kernel does); drag and drop between applications | Experimental | egui-pop-model::clipboard; egui-pop-api::clipboard | ADR 0015; docs/clipboard.md |
| Links, files and the viewer | One service opening links through one policy, choosing files, the in-app viewer for safe content | A web browser engine; a file manager | Experimental | egui-pop-model::links; egui-pop-api::{links, files}; egui-pop-views::viewer | ADR 0017; docs/links.md, docs/files.md |
| Jobs | The host’s background work folded from job.* events, the jobs centre | A thread pool or scheduler (the host runs jobs) | Experimental | egui-pop-model::{jobs, job_rows}; egui-pop-api::{jobs, jobs_centre} | ADR 0028; docs/progress.md, docs/threading.md |
| Standard windows and dialogs | Dialogs, the settings form, window and custom pages, About | Wizards spanning several applications; a form builder for arbitrary data (admin forms) | Supported (dialogs, settings window); Experimental (About) | egui-pop-api::{dialogs, settings, settings_pages, settings_window, about} | ADR 0028, 0029; docs/dialogs.md, docs/about.md, docs/plugins.md |
| Admin forms | The administration app: full-page forms declared as data | Business logic behind the forms | Experimental | egui-pop-model::admin; egui-pop-api::admin | docs/design/admin-forms.md |
| Strings and translations | Fluent catalogues and fallback chains, locale formatting, the extractor and checks, each crate’s own strings with English fallbacks | Machine translation; translating the application’s data | Supported | egui-pop-i18n::{catalog, check, extract, format, locale, plugin}; egui-pop-core::strings; egui-pop-api::strings; egui-pop-viewport::strings; egui-pop-views::strings; egui-pop-editors::strings; egui-pop-platform::strings; egui-pop-agent::strings | docs/i18n.md |
| Agent bridge and devtools | Collectors describing the running app, the element picker, devtools, the socket served out of process, its agents’ pairing and grants, the user’s confirmation of their destructive calls, argument schemas checked before a run, its MCP server, egui’s inspection protocol carried over the socket | Remote control over a network; authentication beyond the socket’s permissions | Supported (collector names, snapshot shapes); Experimental (devtools) | egui-pop-core::{debug, inspect, schema}; egui-pop-api::devtools; egui-pop-agent::{confirm, grants, inspect, mcp, pairing} | ADR 0018, 0019, 0020, 0021, 0024, 0029; docs/agent-socket.md, docs/agents.md, docs/debugging.md, docs/inspection.md, docs/design/agent-control.md |
| Accessibility | Names for custom widgets, the announcer | A screen reader of its own; platform bridges (AccessKit is it) | Supported | egui-pop-core::a11y | docs/accessibility.md; CREDO.md (point 7) |
| Image viewport | The view model and mapping, tile sources and the cache, the GPU path, the display transform, the Wayland image surface, gestures, hooks, cursors, the loupe, overlays in image coordinates, navigation, the debug collector, a demo source | Decoding image formats; colour management beyond the display transform; raw development | Experimental | egui-pop-viewport::{view, widget, source, tiles, device, gpu, display, image_surface, gestures, hooks, cursor, loupe, overlay, navigation, tokens, debug, demo} | docs/viewport.md (the contract), docs/wayland-colour.md, docs/cursors.md |
| Image tools | The histogram, curves, colour wheels, zoom control and navigator, their shared change and steps, a preview dialog | Computing histograms or applying curves to pixels (the application does) | Experimental | egui-pop-viewport::{change, curve, histogram, wheel, navigator}; egui-pop-imaging::preview | docs/image-tools.md |
| Node graph | A node graph editor over the application’s graph, its steps, orthogonal wire routing | Evaluating the graph; a visual programming language | Experimental | egui-pop-viewport::graph; egui-pop-imaging::graph; ortho-router | docs/node-graph.md |
| Thumbnails | Thumbnails and their virtualised grid | Generating thumbnails from files (the application or platform services do) | Experimental | egui-pop-core::thumbnail; egui-pop-viewport::thumbnail | docs/thumbnails.md, docs/library.md |
| Data views | The live tree, lists, list items, property rows, the data table, the text log, selection by key, charts, the timeline | A spreadsheet; a query engine over the data | Experimental | egui-pop-views::{item, list, property, select, table, text_log, tree, steps, plot, timeline} | docs/tree.md, docs/table.md, docs/list-items.md, docs/plot.md, docs/timeline.md |
| Media and library | Video played in place, a photo library’s import, culling and sorting widgets | Codecs; a photo catalogue’s storage | Experimental | egui-pop-views::{video, library} | docs/video.md, docs/library.md |
| Text and code editors | The line buffer, selection and history, virtualised drawing, search and replace, markers, folding, a pluggable highlighter, code assist providers, the editors’ steps and tokens | A language server; an IDE’s project model | Experimental | egui-pop-editors::{assist, buffer, code, fold, highlight, history, markers, model, search, selection, steps, text, tokens} | docs/editors.md (the contract) |
| Terminal | vt100’s emulator drawn over a source (a PTY or a log) | A shell; terminal multiplexing | Experimental | egui-pop-editors::terminal | docs/editors.md |
| Platform services | A single instance and deep links, notifications, a tray icon, global shortcuts, logs and crash reports, the focus mode, the system clipboard and opener, system thumbnails, text scale, wheel lines, raising the window | Services an OS crate covers better (each wraps one); an installer or updater | Experimental | egui-pop-platform::{clipboard, crash, dirs, focus, instance, keys, logs, notify, open, text_scale, thumbnails, tray, wheel_lines, window} | docs/instance.md, docs/notifications.md, docs/tray.md, docs/global-shortcuts.md, docs/logs.md, docs/focus-mode.md, docs/dirs.md |
| Test kit | Themed harnesses, mock hosts, scripted jobs, scenarios, waits, keyboard walks, several windows, a test tile source, the critical attribute | A test runner; pixel-perfect comparisons across GPUs | Supported | egui-pop-test::{hosts, jobs, scenario, wait, walk, windows, viewport}; egui-pop-test-macros | docs/testing.md, docs/scenarios.md |
| Facade | The paths users depend on and the prelude | Items of its own beyond re-exports and the mount list | Stable | egui-pop::prelude | ADR 0006; docs/getting-started.md |
Consequences
- A pull request adding a public module adds it to a row (or a new row,
with the bar above);
cargo xtask families --checksays which. - Moving a module between families is an edit of this table, and of stability.md when the tier changes.
- The table is not the contract: each row’s contract doc is. A row whose doc is missing is a gap below, not a promise.
Known gaps
Found while writing the table (egui-pop next, 2026-11-15); each is left
to its own change.
- Modules without a contract doc of their own: placeholders,
tooltips and hover cards (Feedback, hints and icons) have a tier in
docs/stability.mdbut no page; they are documented in their module docs only. - Families split across crates in ways a reader may not expect:
thumbnails live in
egui-pop-coreand are re-exported by the viewport; the in-app viewer is inegui-pop-viewsbut belongs to the links family.
0028: A removed contributor’s work in flight is closed, refused or kept dormant, and said
Date: 2026-11-15. Status: accepted (2026-11-15).
Context
ADR 0004 removes everything a plugin registered through Ctx when it is
disconnected (remove_owner on every registry), and tests check the
registries come back to their previous state
(everything_a_plugin_registers_goes_away_with_it,
disconnecting_a_plugin_disconnects_those_requiring_it_first). It says
nothing of what the plugin left in flight: a command queued with
run_as, a dialog open on its command, steps in a history, a job the
host runs for it, a user’s key bound to its command, an icon, a mounted
component, a value still loading. An outside review
(docs/review-2026-11.md, point 1) asked for that decision.
Other hosts of extensions: VS Code calls an extension’s deactivate
and disposes what it pushed to context.subscriptions (commands, views,
listeners); user keybindings naming a command no longer contributed stay
in keybindings.json and do nothing until it comes back; an open
webview of the extension is closed. Blender’s add-on unregister
removes its classes (operators, panels, keymap items it added); the
user’s keymap entries naming a gone operator stay, shown as unknown;
undo steps are memory snapshots and outlive the add-on.
A “contributor” here is a plugin (ADR 0004), or anything that registers under an owner id and can go: a panel’s block, a component mounted in a host (ADR 0013), a custom dialog’s body.
Decision
- Removal happens between passes, never inside a command. A plugin
asks for it through
AppHandle::set_plugin_enabled(or the agent bridge’sset_enabled); the request is queued and done in request order before the next pass. Requests queued before it run while the plugin is still there; those queued after find it gone. Dependents go first (ADR 0004). - Each kind of work has one rule and one cleaner, in the table
below. The kernel (the host, ADR 0010) owns what it runs and keeps;
egui-pop owns what it registered, drew or queued; the contributor’s
disconnectand itsDropown what it holds outside the framework. - Nothing goes silently (ADR 0003). The disconnection itself is a
journal event (
plugin.disconnected, with what went, by kind) and alog::info!; each thing refused or closed later because its owner is gone says so where its kind already reports: the journal (command.refused,dialog.cancelled), the diagnostics list, the key trace. - What the user made is kept, dormant, and comes back. Values they changed, keys they bound, a panel’s place: kept while the plugin is off, persisted, alive again when it reconnects. What only made sense while it ran (a dialog, an overlay, a queued run) is closed or refused, never replayed on reconnection.
| Work in flight | Guarantee | Who cleans | What the user sees | What is logged |
|---|---|---|---|---|
| Commands, menu items, toolbar items, palette entries, keys it declared | Removed | egui-pop (remove_owner) | They disappear; a menu item of another plugin naming one is shown greyed | unknown-command warning in the diagnostics, per item |
A run of its command queued (run, run_as, a menu, a toast’s or a finished job’s action, an accepted dialog) | Refused | egui-pop (App::run_in) | Nothing runs; a toast’s action of a gone command is greyed | command.refused on the journal with “its plugin x is disconnected”, from the caller |
| A dialog open on its command (or with its custom body) | Cancelled | egui-pop (dialogs plugin, on Disconnected) | The dialog closes as cancelled; the next queued one shows | dialog.cancelled with the reason |
| Overlays, popups, flyouts drawn by its blocks or panels | Closed at the next pass | egui-pop (an overlay its owner stops showing is closed) | They close; the focus goes back as on Escape | the overlay’s close, as any |
| Panels and blocks it mounted | Removed; a panel’s place in the layout is kept dormant | egui-pop (remove_owner, layout repair) | The panel and its detached window go; when the plugin comes back, the panel comes back where it was | layout: info line per panel |
| Components and host offers it declared (ADR 0013), their mounts | Removed with their mounts | egui-pop (mount registry) | Nothing more | the mounts collector no longer lists them |
| Hooks, step hooks, lifecycle handlers, value listeners, collectors, context providers, clipboard formats, link handlers | Removed | egui-pop (remove_owner, On::Disconnected listeners) | Nothing | the census in tests; collectors leave the bridge |
Listeners in a standalone hook kernel (egui-pop-hooks) | Removed by Kernel::forget(owner) | the application that holds the kernel | Nothing | the kernel’s introspection |
Icons it registered (<plugin>:<name>, command icons it set) | Removed | egui-pop (icon set, command icons) | A reference to one shows the unknown-icon mark | unknown-icon diagnostic per reference |
Its jobs (run by the host, followed from job.* events) | Cancelled when the job names it (owner, or command) and is cancellable; otherwise (not cancellable, or published by the plugin itself) kept and marked orphaned | the host runs job.cancel; egui-pop asks it as the plugin goes | The jobs centre shows the job cancelling, or “its plugin x is off” with Dismiss | job.cancel dispatched by the framework with the reason, then the host’s job.* events; job.orphaned; both counted on plugin.disconnected |
| Late values and latest-wins loads its panels hold | Dropped with the panel; a running load is told to stop, its result dropped | the contributor’s drop (Latest’s Drop) | Nothing | nothing (no state left) |
| Undo steps in the value store’s histories | Steps touching only its paths are dropped; a step mixing its paths with others’ is dropped too | egui-pop (value store remove_owner) | Undo skips them; the history panel no longer lists them | a log::info! and a journal note with the count dropped, per history |
| Steps in histories the kernel owns (ADR 0014) | The kernel’s call | the kernel (it sees Disconnected) | as the kernel decides | the kernel’s |
| Its local undo scopes (a component’s own history) | Removed | egui-pop (history::remove_owner) | Undo in that surface no longer applies | nothing |
| Values it declared, changed by the user | Kept dormant (pending), persisted, back on reconnection | egui-pop (value store) | They are not shown while it is off | nothing |
| Keys the user or the workspace bound to its commands | Kept dormant, persisted, alive on reconnection; a dormant binding does not resolve, the key falls through | egui-pop (keymap) | The shortcuts editor lists them as dormant, with the plugin’s name | dormant in the key trace (the because of a lost verdict until the verdict enum can take a variant), the keys collector’s dormant list, an info line |
| Its own files, threads, sockets, caches | Its business | the plugin’s disconnect and Drop | as it decides | as it decides; egui-pop never deletes data |
Consequences / to do
Each line is a gap between the code of 2026-11-15 (egui-pop next,
when this was written) and the decision above, small enough to be its
own change with its frame test. All nine are closed (2026-11-15);
the frame tests are in crates/egui-pop-api/tests/it/removal.rs.
- No trace of the disconnection itself.
App::disconnectemitsLifecycle::Disconnectedto handlers only: no journal event, no log line. Addplugin.disconnectedwith counts by kind (crates/egui-pop-api/src/app.rs,disconnect,remove_owner). Closed (2026-11-15):plugin.disconnectedfromegui_pop, with the reason and what went by kind, and an info line. - A queued run of a gone command leaves no journal entry.
run_inskipsrecordforRunRefused::Unknownand the request loop only logs a warning; refuse it ascommand.refusedwith the owner that went (crates/egui-pop-api/src/app.rs,run_inandprocess_requests). A key dispatched to a gone command only logs at info level (dispatch_keys). Closed (2026-11-15): such a run is acommand.refusedevent naming the plugin that went. - Open dialogs survive their command’s plugin. A dialog has no
owner; it stays open, and accepting it publishes
dialog.answeredthen queues a command that is refused. Tag a dialog with its command’s owner (and a custom body with its opener) and cancel it onDisconnected(crates/egui-pop-api/src/dialogs.rs,Open,apply). Toasts’ actions naming a gone command are not greyed (crates/egui-pop-api/src/toasts.rs). Closed (2026-11-15): a dialog on a gone plugin’s command, or a custom one it opened, is cancelled at once (dialog.cancelledfromegui_popwith itsreason); a toast’s action naming a gone command is greyed with the plugin’s name (AppHandle::command_gone_with). - A panel’s place is forgotten. Layout repair drops panels no longer
declared, and the repaired layout is what is saved; keep their place
dormant instead (
crates/egui-pop-model/src/layout.rs,repair). Closed (2026-11-15):SavedLayout::dormantkeeps the place (docked, detached, floating or closed), saved, andrepairgives it back when the panel is declared again. - Mount declarations outlive their plugin. Components and host
offers are kept by owner but never removed, and
Mountedrecords carry no owner (crates/egui-pop-api/src/mounts.rs,Registry,record_mount;remove_ownerinapp.rs). Closed (2026-11-15): its components, host offers, the mounts of either and those made while its code ran are removed, counted onplugin.disconnected. - Icons are never removed. The icon set keeps every name for the
process and has no way to remove one, though
docs/icons.mdsays a plugin’s icons go with it (crates/egui-pop-core/src/icon_set.rs;remove_ownerinapp.rs). Closed (2026-11-15):icon_set::unregister_owner, called when a plugin goes. - Jobs have no owner.
job.*events carry none, so nothing can cancel or mark a gone plugin’s job; add an optionalownertojob.startedand act onDisconnected(crates/egui-pop-model/src/jobs.rs,crates/egui-pop-api/src/jobs.rs). Closed (2026-11-15):job.startedcarriesownerandcommand; as a plugin goes, the framework runsjob.cancel(with the reason, kept asJob::reason) for its jobs that name it and can be cancelled, and publishesjob.orphanedfor the others (Job::orphaned, shown by the jobs centre, dismissable, taken back byjob.adoptedon reconnection);plugin.disconnectedcounts them (jobs_cancelled,jobs_orphaned). The model changes through the journal’s events alone. - Undo steps go without a word. The value store drops them, mixed
steps included, and says nothing
(
crates/egui-pop-model/src/values/mod.rs,Store::remove_owner). Closed (2026-11-15):Store::remove_owner_reportcounts them per history, logged and carried byplugin.disconnected. - Dormant keys still resolve. User and workspace bindings naming a
gone command stay in the keymap (right) but win their key and fail at
run time, and
derived.keyslists only declared commands, so the shortcuts editor does not show them (crates/egui-pop-model/src/keymap.rs, resolution;crates/egui-pop-api/src/app.rs,rebuildanddispatch_keys). Closed (2026-11-15):Keymap::set_dormanttakes the bindings of a gone plugin’s commands out of the resolution (the key goes to the next binding, they show no key and make no conflict) while they stay in their layer, saved;AppHandle::dormant_keysgives them with the plugin, and the shortcuts editor lists them under “Dormant keys”; they are live again on reconnection. The trace says so through a lost verdict’sbecause(keymap::DORMANT): a variant of its own would break the stableVerdictenum, and waits for the next breaking release.
Already as decided: removal between passes, dependents first; registry
contents by owner; overlays closed when their owner stops drawing them
(crates/egui-pop-core/src/overlay.rs); store values kept pending and
back on reconnection; local undo scopes; collectors leaving the bridge;
Latest stopping its load on drop; the standalone kernel’s forget.
0029: What is not on the bus does not exist: a module knows the bus, not its neighbours; the window lifecycle first
Date: 2026-11-15. Status: accepted (2026-11-15, by the lead maintainer’s decision under GOVERNANCE, without the comment period).
This ADR decides and lists; it changes no behaviour. Each slice at the end is its own change.
Since egui-pop 0.15, every point and listener id this ADR names carries
the pop. prefix (window.close is now pop.window.close,
window.registry is pop.window.registry); see the hook kernel’s
“Names”. The ids below are kept as they were decided.
Context
An application (Helios) reported a black window without a title bar
after closing the Settings app shown in its own window. The application’s
state said “Settings is closed” while a system window was still on
screen. A first fix guarded only the main window: the guard was put where
the fault was guessed. A second one (#439) gave application windows one
close path and a paint guard on every window. The application’s log then
showed the cause: the close happened in two steps. The Settings
window’s entry went at once, in that window’s own pass (“a pass of
viewport 9FA2 after its window went … it paints nothing”); the rest
followed at the main window’s next pass, which came 1.0 to 1.7 seconds
later: the admin app’s flags caught up (follow_window), the viewport
stopped being declared, the application logged “the Settings app is
closed”. In between, the backend still had the viewport and presented
passes that drew nothing: black on GNOME under Wayland, where hiding a
window does nothing.
What that showed is wider than one window:
- Two truths. What egui-pop believes is shown (its entries, the
overlay stacks, each module’s
openflag) is never compared with what exists (the backend’s viewports and what they painted). - No single owner of a window’s life. Application windows
(
windows.rs), detached panels (workbench.rs), the Settings app’s window (admin/shell.rs), the frame’s close (frame.rs), the paint guard (paint_guard.rs), dialogs, overlays and popups each show and hide on their own. - Cascades to remember. Closing an application window ends in
window_closed(crates/egui-pop-api/src/windows.rs), a function whose whole job is to remember who else must be told, in order: the thread-local registry, the paint guard’s watch, the dialogs, the overlay’s window separation, the journal, a repaint. A seventh part that cares (the runner’s handles, a file choice, a web view) is added by whoever remembers to. The Settings window adds a second layer (follow_window, a four-case match keeping two flags in step with the window), and the application copies it for each of its own windows. Forgetting one call is silent. - Following instead of being told. These “follow” functions poll in the main window’s pass and catch up with what changed elsewhere. They are only as fast as that pass: the two-step close above is their failure.
The pieces of a central bus already exist, apart:
- Requests: steps (ADR 0011): named, with arguments, vetoable, replaceable, traced; commands go through the host (ADR 0023).
- Events: the host’s journal (
AppHandle::publish,AppHandle::events_since): facts with a source and a cause, which tests and agents wait on (The native runner, reads and waiting). - Ordered listeners: the hook kernel
(The hook kernel): listeners with ids,
after/before, priority, an error boundary and deadlines per listener, introspection in run order. No egui-pop crate uses it yet; the steps’ after-hooks run in registration order.
Decision
The principle
- A module or component knows the bus, not its neighbours. A state change another part may care about is a request (asked on the bus, with who asks and why) and an event (said on the bus, once done or refused). Whoever cares listens. Nobody calls a neighbour to tell it.
- Not on the bus is a defect, as a silent no-op is (ADR 0003): a state another part can see or depend on that changed without its request and event is a bug, whatever else works.
- The smell this removes is the function whose job is to remember: one that notifies or cleans several other parts, in an order its author knew. It becomes one request, and each part it called becomes a named listener that declares where it runs. Adding a part that cares adds a listener, and edits no other module.
- The bus is the three pieces above, joined: a bus point is a
step (the request:
<noun>.<verb>), its journal events (<noun>.<past>,<noun>.refused), and the listeners of each, registered in a hook kernel the application holds (egui-pop-apitakesegui-pop-hooks, L0, as a dependency). The kernel stays what it is (no transport, nothing across processes); the journal stays the record.
Ordering
- Every listener is named (
<module>.<what>:window.registry,dialogs.cancel-on-close) and owned (its plugin oregui_pop), so it goes with its owner (ADR 0028). - Order is declared with
after/before, then priority. Registration order is never relied on: a listener whose place matters and declares nothing is a review finding. - The order run is printable. For each point, the listeners in run
order with their owner and constraints (
bus_kernel::Kernel::listenersgives it): abuscollector on the debug bridge, a text dump in debug builds, and a test that keeps the dump of the window points as a reviewed file. “Who runs when” is read, not remembered. - A cycle or a missing target fails tests. A cycle is already
refused at registration. A missing
after/beforetarget is reported and ignored at run time (a plugin may be off); the test kit fails a test that ends with one on an egui-pop point. - An invariants listener runs after all others of its point. The kernel has no such constraint today: it gains “last” (one per point, a second refused), not a low priority that a later listener could undercut.
- Listeners run on the interface thread, inline, inside the kernel’s
error boundary: one that fails or panics is reported (
hook.failed) and the others still run.
Timing
- A request’s listeners all run in the same pass, in the call that
asked. When the request returns, every listener has run, in its
declared order, each seeing what the ones before it left; the event
(
window.closed) is published after the last one, so whoever reads it finds the owner’s state, the focus and the registry already agree. - Nobody follows by polling. A part that compares flags in a later
pass to catch up with a change made elsewhere (the
followfunctions) is a listener that was never registered. It goes in the slice that moves its path. - What may defer, and only this: what the backend or the disk does
on its own clock.
- The system window’s destruction: eframe drops a deferred viewport at
the next main pass that no longer declares it. The registry has
already marked the window closed, so it is no longer declared; the
window is hidden where the system allows, and a main pass is asked
at once. A pass of that viewport in between draws the window’s last
page or the paint guard’s fallback, never nothing; it is the “one
pass” invariant 1 allows, and a second one is a
window.invariant. - Writing the place to disk:
window.placeupdates the place in memory in the pass; the write follows persistence’s own schedule.
- The system window’s destruction: eframe drops a deferred viewport at
the next main pass that no longer declares it. The registry has
already marked the window closed, so it is no longer declared; the
window is hidden where the system allows, and a main pass is asked
at once. A pass of that viewport in between draws the window’s last
page or the paint guard’s fallback, never nothing; it is the “one
pass” invariant 1 allows, and a second one is a
- A listener that needs a frame of its own to do its work (drawing the closing window once more) is not a listener: the window’s pass reads the registry instead.
- The 1.0 to 1.7 seconds between “its window went” and “the Settings app is closed” in the context above are the counter-example: under this ADR they are one request, and its test asserts both in the same pass.
Exceptions
The list below is closed: an exception names one of these reasons, and a new reason is an ADR.
| Reason | What stays off the bus | Why |
|---|---|---|
| Per-frame painting | Drawing, layout, hover and animation state of a pass; egui’s own tooltips; a field’s list drawn while the field is (a combo box’s choices, completions) | Nobody can act on it by the next pass; the bus would carry noise; a field’s list has no life of its own worth a request |
| Pixel and bulk data | Tiles, textures, thumbnails, text buffers | Too large; their arrival is an event, their content is not |
| Private internals | State no other part reads or depends on (a cache, a scroll offset, a widget’s memory slot) | No neighbour exists to forget |
| Hot paths | Pointer moves, key repeats, scroll deltas, job progress ticks | Rate; their settled result is an event (zoom.change, a finished gesture) |
How one is declared: where a lint guards the raw call
(clippy::disallowed_methods), an #[expect(clippy::disallowed_methods, reason = "bus: per-frame painting, …")] at the call; all of them listed
in xtask/bus.allow, one line per call site with its reason, checked by
cargo xtask bus --check (a call missing from the file fails; a line
matching nothing fails, so the file shrinks as paths move). The list
only shrinks: a pull request adding a line says so in its description
and is reviewed as a decision.
First application: the window lifecycle
“Window” below is anything that occupies the screen with a life of its own: the main window, an application window (ADR 0025), a detached panel’s window, a native child window egui does not paint (the system file chooser, the viewer’s web view). A “popup” is what floats inside or over a window and closes by rules: a dialog, a palette, a menu, a flyout, a popover, a hover card.
Requests (steps), each with owner (a plugin, a command, or a
parent window), reason (user, command, parent-closed,
owner-gone, guard, system, quit) and the cause’s sequence number:
| Request | Asks |
|---|---|
window.open | A window of a kind, with its id, title, parent if any |
window.close | A window closed; the main window: the application’s close (ADR 0025’s move-in rule is a listener’s answer) |
window.reparent | A window’s content moved to another window (into the main window and back; a panel docked back or detached) |
window.activate | A window becomes the active one, the window worked in: the person pressed or typed in it (user), the system gave it the focus (system), the application asks it to the front (command) |
popup.open | A popup in a window, with its parent (a window, or the popup under it) |
popup.close | A popup closed |
Events (journal):
| Event | Says |
|---|---|
window.opened | The registry holds it: id, kind, owner, parent, viewport |
window.closed | It left the registry: who asked, why |
window.painted | Its first paint; then each change between painted and painted nothing |
window.orphaned | Its owner or parent went and it is still there (then closed by the children listener, or kept and marked, per ADR 0028) |
window.activated | The active window changed: which, from which, who asked and why |
window.refused | A request not done: vetoed, unknown id, no owner, a parent that does not exist |
window.invariant | An invariant below does not hold: its rule, the window, its owner and state |
popup.opened and popup.closed say the same for popups. The names
published today that say less (window.moved, window.outlived,
window.painted_nothing, window.focus_hole) become window.reparent’s
event and rules of window.invariant as their path moves; they are
Experimental.
The registry is a listener, and the one truth. window.registry
listens to the requests and holds every window and popup: id, kind,
owner, parent, viewport, opened by which request, painted or not, since
when. Nothing else keeps a list of windows: the thread-local shim, the
paint guard’s watches, the overlay’s window separation and the
workbench’s auxiliary list read it or are derived from it. It is read
as windows.list (the application, the debug bridge, tests), and
because every change is a journal event, “what was on screen and why”
can be replayed after the fact.
The active window is the registry’s (amended 2026-11-16). Which
window the person works in (where a dialog, a toast or the palette opens,
which window a close hands the focus back to) is asked with
window.activate, not polled: a press, a key or text in a window asks it
(user), a window gaining the system’s focus asks it once (system), the
application asking a window to the front asks it (command). Its
listeners: window.registry holds it as active (with the order windows
were worked in), window.raise brings a window asked by a command to the
front (shown, restored, focused; on Wayland the main window asks for
attention), the one place ViewportCommand::Focus is sent;
window.keys, a local listener, drops every window’s shortcut in
progress when the active window changes (each window keys with its own
dispatcher, so a chord begun in one window is never finished in
another; amended 2026-11-16); window.invariants last. window.activated is said after them when the
active window changed. windows.list marks the active window. On
window.close, window.focus hands the activation to the window worked
in before the closing one, whatever its kind (main, application, detached
panel), by its own window.activate (system); window.reparent’s
window.focus activates the main window the same way.
Invariants, checked by window.invariants at the end of every pass
of the main window and after every window request:
- The registry’s windows are the backend’s viewports (egui’s
raw.viewports, the runner’s windows): none more, none fewer, past the one pass the backend needs to create or destroy one. - A shown window painted something within N passes and the guard’s
delay (three passes and two seconds today,
egui_pop_api::paint_guard::DEFAULT_DELAY). - No window or popup without an owner.
- A popup’s parent exists.
- A closed parent has no live child.
A violation is one window.invariant event and one error line naming
the window, its owner and its state; the paint guard’s fallback page
and hiding (Containment) are how it is contained.
In tests (the test kit’s harnesses, MultiWindow, scenarios) a
violation fails the test; in release builds it is logged.
The listeners of window.close, in their declared order:
| # | Listener | Does | Declares |
|---|---|---|---|
| 1 | window.children | Asks window.close / popup.close (parent-closed) for every child: its dialogs cancelled, its overlays, its file choice, its native children | first |
| 2 | the owner’s listener (admin.window, an application’s <app>.window) | The window’s owner closes the state the window showed: the Settings app closes, an application’s focus or import state closes. Registered by the owner | after 1, before 3 |
| 3 | window.focus | The active window and the keyboard focus move to the window worked in before; modal blocking is recomputed | after 2 |
| 4 | window.registry | Marks it closed: no longer declared to the backend, hidden where the system allows; forgets its handles | after 3 |
| 5 | window.place | Saves its place (the one owner of a window’s place, eframe comparison) | after 4 |
| 6 | window.invariants | Checks the five rules | last |
The owner’s listener may veto in its before-hook (unsaved changes: the
step’s veto, window.refused); once the close runs it cannot defer.
window.open runs the owner (its state open), registry, place
(restored), focus, invariants; window.reparent runs registry, place
(each id keeps its own), focus, invariants.
What the code does today: the migration list
Every place that shows, hides or closes a viewport, a native window or
a popup (egui-pop next, 2026-11-15).
File (under crates/) | Today | Becomes |
|---|---|---|
egui-pop-api/src/windows.rs | open_window pushes an entry, fills a thread-local registry, tells the paint guard, publishes window.opened; close_entry (the one close path of #439) marks the entry, keeps the geometry, sends Visible(false), then window_closed calls the registry, the paint guard, the dialogs, the overlay separation, publishes, repaints; move_into_root and the way home swap contents and publish window.closed / window.moved / window.opened by hand; declare_windows calls show_viewport_deferred and first lets the Settings app follow; quit and the root pass send ViewportCommand::Close | window.open / close / reparent; window_closed split into the listeners above; declare_windows is the registry’s one raw call |
egui-pop-api/src/app.rs | The main pass sees the root’s close request, tries move_into_root, sends CancelClose; calls forget_closed_windows | A window.close of the main window; the move-in is a before-hook’s redirect to window.reparent |
egui-pop-api/src/admin/shell.rs | follow_window: a four-case match per pass between “the app is open”, “its window is there” and a window_shown flag; window_content closes the app and the window from the window’s pass | The Settings app asks window.open / window.close with itself as owner, and listens to window.closed to close; no flag |
egui-pop-api/src/workbench.rs | Detached panels are show_viewport_immediate per pass from the layout’s auxiliary list; a close request runs the workbench.close_window step, CancelClose on a veto; forget_closed_windows rebuilds the list of live windows for the overlays | Detach and dock back ask window.open / window.reparent; the registry holds the windows the overlays keep |
egui-pop-api/src/frame.rs | The frame.close step sends ViewportCommand::Close to the viewport it is drawn in; the system menu is an overlay | frame.close asks window.close |
egui-pop-api/src/paint_guard.rs | Its own tables of watched and closed windows (app_window_opened, app_window_closed), watch_closed_windows compares them with raw.viewports and publishes window.outlived; orphan_pass sends Visible(false) and Close | The watch reads the registry; its findings are window.painted and window.invariant; closing an orphan is a window.close (guard) |
egui-pop-api/src/runner/native.rs | Pairs winit windows with viewports, forgets handles on Destroyed | Feeds invariant 1 with the windows that exist; handles forgotten by window.registry |
egui-pop-api/src/dialogs.rs | One queue per window group, drawn with overlay::show; window_closed is called by windows.rs to cancel a closed window’s dialogs | popup.open / popup.close; dialogs.cancel-on-close listens to window.close |
egui-pop-api/src/files.rs, files/browser.rs | The in-app chooser is an overlay; the system chooser (rfd) is a native window parented by a recorded handle, its request tied to the window that asked | The in-app one a popup; the system one a native child in the registry |
egui-pop-views/src/viewer/wry_view.rs | A GTK child window created and closed by the viewer | A native child in the registry (owner: the viewer’s mount) |
egui-pop-core/src/overlay.rs | The overlay stack per viewport in egui’s memory: show, hold, close, retain_windows; it closes what is above and gives the focus back by itself | Stays the model of popups inside a window; its opens and closes are popup.*, its per-window stacks derived from the registry |
egui-pop-api/src/menus.rs, palette.rs, strips.rs, admin/quick.rs, admin/shell.rs (overlay mode), settings_window.rs | Each calls overlay::show / hold / close with its own open flag; popup menus through egui::Popup | popup.open / popup.close with their owner |
egui-pop-api/src/jobs_centre.rs, toolbars.rs, palettes.rs, egui-pop-core/src/input.rs, egui-pop-editors/src/assist_ui.rs, egui-pop-views/src/library/tags.rs | egui::Popup and bare egui::Area popovers (the jobs popover, a toolbar’s overflow, choice lists, completions) | Popovers with a life (opened, closed by rules) are popups; a list drawn only while its field is focused is per-frame painting, declared |
egui-pop-core/src/hover_card.rs, tooltip.rs | A hover card has open / close and an area; a tooltip is egui’s | Hover cards are popups; tooltips are the per-frame exception |
egui-pop-api/src/toasts.rs, tips/screen.rs, zen.rs, window.rs, egui-pop-viewport/src/navigation.rs | Areas drawn each pass from a state (toasts per window group, the tips card, zen’s reveal bar, floating panels, the navigator) | Not windows; toasts already journal; reviewed in the popups slice and declared where they stay off |
egui-pop-platform/src/window.rs | raise sends Visible(true), Minimized(false), Focus to the main window | window.activate of the main window (command); window.raise is its listener (done, 2026-11-16) |
egui-pop-test/src/windows.rs | MultiWindow plays the backend: declared viewports, their commands | The “backend” side of invariant 1 in tests |
egui-pop-gallery/src/lib.rs, examples/multi_window*.rs | Raw ViewportCommand::Close and show_viewport_deferred in the smoke exit and the spike | The gallery asks window.close; the spike is an example, declared |
In the first application, Helios (crates/helios-gui/src/), the same
shapes, moved in its own pull requests once egui-pop’s slice for them
has landed:
| File | Today | Becomes |
|---|---|---|
shell/focus_window.rs | follow: the Activity, Calibration and Library foci each open and close their window from a four-case match in the main pass, with an open flag and a shown id; the window’s own pass closes the focus and calls window.close and hide_closing_window | The focus asks window.open / window.close as owner; its listener closes its state |
shell/import_window.rs | The same follow match for the import window, close_window, and hide_closing_window (raw Visible(false), Minimized(true), Focus to the main window) | Same; the hiding is window.registry’s |
shell/trace.rs, shell.rs | Screen::follow samples the Settings app’s state in the main pass and logs “the Settings app is open / closed” when it changed (the line that came 1 to 2 seconds late) | Logs from window.opened / window.closed and the admin app’s events |
shell/health.rs, shell/storage.rs | Read whether the Settings app is open on a scope, each pass | Read the registry / the admin app’s state; unchanged where per-frame painting |
main.rs | Raw ViewportCommand::Close for the session’s end, a restart after a restore, the end splash | window.close of the main window with reason quit / system; the splash (before the shell exists) is declared |
shell.rs (open_window) | Opens the main window before the shell exists | The registry’s first entry once the shell is built |
Slices
One pull request each, in this order; each lands with its acceptance
test and leaves next green. Slices 1 and 2 come first; the paths of
3 to 8 move in that order; 9 to 11 close the set.
- Registry, events and the close of an application window.
egui-pop-apitakes the hook kernel; the window and popup points exist;window.registryholds every window (paths not moved yet report to it);windows.list; the kernel’s “last” constraint; the order dump.window.closeof an application window is the first request moved:close_entryandwindow_closedbecome its listeners, and the Settings app’s owner listener (admin.window) closes the app in the same call, whoever asked. Test: the two-step close reproduced with the Settings app in its own window, closed by its title bar, the page’s Close, Escape andwindow.close: no pass of the viewport after its window went, and the app closed in the pass its window closed; it fails on the commit before the slice and passes after. Also: each kind of window gives the events above and the rightwindows.list; the window points’ order dump matches its reviewed file; a missing target fails. - Invariants listener, failing tests. The five rules, run every
pass;
window.invariant; the test kit fails on one. Test: each rule broken on purpose (a viewport shown outside the registry, a window that paints nothing, no owner, a popup whose parent closed, a child left alive) fails its test with the window named; the existing suites stay green, or what they find is fixed or filed first. - The Settings app’s window. Opening goes through
window.open;follow_windowand itswindow_shownflag go;followno longer runs in the main pass. Test:admin_window: opened and closed every way (title bar, the page’s Close, Escape, the command, the app closing under it, its plugin disconnected), the registry and the backend agree after each. Done (2026-11-16): the app is its window’s owner and askswindow.open(opened, or brought to the front) andwindow.closewhere what it wants changes (Admin::open,Admin::close, theadmin.windowsetting written through the app, a focus-screen wizard starting or ending), in that call;admin.windowlistens to both points (first onwindow.open; afterwindow.children, beforewindow.focusonwindow.close), closing the app unless it moves over the main window (“Pop in”). Its plugin disconnected closes its window throughwindow.owner-gone, a listener ofplugin.disconnect. The overlay reads the registry to know whether the window draws the app. Left: theadmin.windowsetting changed by another writer (the settings store,settings.set) is followed at the app’s next request, until settings changes are on the bus. - The shell: application windows, the main window, detached
panels.
open_window, moving into the main window and back (window.reparent), the main window’s close,quit,frame.close, detach and dock back. Test:app_windowsandwindow_guardpass unchanged; closing the main window with a window open moves it in as awindow.reparent; a vetoed panel close leaves the registry unchanged. First part done (2026-11-16):open_windowis awindow.openowned by the application (request_window_openfor an owner of its own); the main window’s close, from the system, its title bar,close_windoworquit(reasonquit), is onewindow.closeof the main window, vetoable by its step’s before-hook; with another window open and not quitting, its step answers with awindow.reparentof the window worked in last into the main window, and raising the main window asks the way back.window.reparentrunswindow.registry,window.place,window.focus, the invariants; the main window’s close closes every other window by its ownwindow.closefirst (window.children). An application window’s title-bar Close still asks the system’s close request (its content may refuse), which its pass answers withwindow.close. Left: detached panels (detach, dock back, their close), once slice 2’s panel reports are onnext. Second part done (2026-11-16): the workbench owns its panels’ windows (panel:<id>, owneregui_pop.workbench). Detaching a panel is its window’swindow.open, docking it back (by command, or moved to an area as a dragged tab is) itswindow.reparentinto the main window, closing its window (title bar, the system, the command, anyone asking) itswindow.close; the workbench’s listenerworkbench.windowchanges the layout on all three, beforewindow.registry. A vetoed close (theworkbench.close_windowstep’s orwindow.close‘s) leaves the registry and the layout unchanged. Another workbench change that adds or ends a detached window (a panel joining another window, a layout put in, panels declared again) asks the same requests in the call that changed it, so slice 2’s per-pass panel report is gone. The detached panels’ windows leave the registry while a window’s content holds the main window, and come back with the shell. The raw viewport calls of these windows are in the bus’s panels module; the test kit’sMultiWindowrenders immediate viewports, so a detached panel’s window is a real viewport there and invariant 1 holds for it. - Dialogs and choosers. Dialogs, the in-app and system file
choosers, the viewer’s web view. Test: a window closed with a
dialog and a file choice open leaves
popup.closed(parent-closed) for each and no child inwindows.list. First part done (2026-11-16): a dialog coming up asks itspopup.open(dialog:<id>, its parent the window of its group), a file choice started itspopup.open(file:<id>) or, for the system’s chooser, a native window’swindow.open(AppHandle::request_native_open); each ends by its close.window.childrencloses every popup and native window of a closing window by its own request (parent-closed), and the owners’ listeners (dialogs.popup,files.choice) cancel the dialog or the choice in that call;dialogs.cancel-on-closecancels the dialogs still waiting in its queue. A window’s content moving into the main window takes its popups with it. The dialogs’ deferred cancel and the files’ per-pass check of the asking window are gone. Second part done (2026-11-16): the viewer’s web view is a native window (web-view:<n>, owned byegui_pop.viewer, its parent the window its page is drawn in), itswindow.openasked before the backend; each place it is dropped (page left or hidden, too small, failed, its own window closed, drawn in another window) asks itswindow.close, and the viewer’s local listener (viewer.web_view) drops it in that call, on the interface’s thread. Slice 5 is done. - Popups, menus and tooltips. The overlay stack’s opens and closes,
popup menus, the palette, flyouts, popovers, hover cards; tooltips and
field-bound lists declared as exceptions. Test: every overlay of
the gallery opened and closed appears in and leaves
windows.list; invariant 4 holds while a parent closes under a menu. First part done (2026-11-16): the overlay stack tells every opening and closing of every window’s overlays to a watcher (overlay::watch), in the call that made it; egui-pop’s watcher asks the popup’spopup.openorpopup.closethere, with its owner (named byAppHandle::name_overlay:palette@<window>, elseoverlay:<id>@<window>), its window as parent, and how it closed (how:escape,outside,chosen,owner,below,gone). The egui popups the stack follows (overlay::follow_popup: context menus, the menu bar’s menus, the jobs popover, hover cards) are told the same way. A popup closed by a request (its window closing,parent-closed) closes in the stack (overlay.stack) and its owner’s state in that call: the popup menu (menus.popup,menu@<window>, whose opening and closing are its own requests) and the palette (palette.popup) close with their window instead of moving to the main window. egui-pop’s code closes an overlay by its popup’s request (AppHandle::close_overlay), never directly, but for the dialogs and file choices, which ask their own (a test scans for it). Tooltips and a field’s lists are the per-frame exception above. Left: toasts, the tips card, zen’s bar, floating panels and the navigator (reviewed, areas drawn from a state: not popups), and the remaining egui popups of the views and the viewport (the node graph’s own popup, a toolbar’s overflow, the palettes’ menu) once their owners are on the watch. Second part done (2026-11-17): the remaining egui popups are on the watch, throughoverlay::follow_menu(a widget’s own menu) oroverlay::follow_popup: a toolbar’s overflow (More tools), a palette group’s menu, the breadcrumb’s and the status bar’s overflow, the viewport’s zoom menu, the library filter’s add menu, a table column’s menu and the file chooser’s folder menu. The node graph’s menus were already the claimed context menus (pointer::claim::context_menu), on the watch since the first part; a gallery test opens one with the toolbar’s overflow and a palette group’s menu. Submenus belong to their menu’s popup. Slice 6 is done. - Standard windows. The settings window, About, the jobs centre, tips. Test: each opened from a second window belongs to it, and goes with it.
- The application’s own windows (in Helios, its own pull
requests): the import window, the focus windows, the screen log, the
raw closes of
main.rs, from the table above. Test: the application’s window tests close each window every way and find the owner’s state closed in the same pass. - The Clippy list.
show_viewport_deferred,show_viewport_immediate,send_viewport_cmd/send_viewport_cmd_towithClose,VisibleorCancelClose, andoverlay::show/hold/closeare disallowed outside the registry, in egui-pop and in the application;xtask/bus.allowandcargo xtask bus --checkin pr-lint. Test: the check itself, with a fixture that must fail. - The agent bridge’s
windows.list. Thewindowscollector gives each window and popup with owner, parent, kind, painted or not;describeand the MCP server follow. Test: the bridge’s answer equals the registry’s in a two-window scenario. - The journey asserts the window set at every step. The test kit’s scenarios take an expected window set per step; an application’s end-to-end journey compares it with the compositor’s list after each step. Test: a step that leaves a window behind fails naming it.
Next candidates
After windows, each its own later slice set, in the order an application’s bugs ask for:
- Plugins connecting and disconnecting
(ADR 0028 already
journals
plugin.disconnected):remove_owneron every registry is the same remembering function; each registry becomes a listener. - Jobs: moved (2026-11-16).
job.cancel,job.pause,job.resumeandjob.retryare requests whose listeners arejobs.modelthenjobs.host; the jobs model is thejobs.modellistener of thejob.*events, which the bus delivers once each, in journal order; cancel-on-disconnect and the return of a plugin’s jobs are listeners ofplugin.disconnect(asked beforeplugin.disconnectedis said) andplugin.connect. Forgetting a finished or orphaned job (JobsService::dismiss,clear_finished) is still a direct call, the jobs view’s own list. - Files dropped from another program: moved (2026-11-16). Every
window’s pass (the main window, an application window, a detached
panel’s window) reads the files the system says over it or dropped on
it once, in
bus::files, the one reader of egui’shovered_filesanddropped_files(a test scans for any other). Files dropped are that window’sfiles.droprequest (FileDrop: the window, the paths, the pointer), asked at the end of its pass; whoever takes them is a listener and says so;files.droppedfollows, orfiles.refusedwhen nobody took them or the window is not open. The file browser’s part isfiles.browser, first. While files hover a window and no widget shows where they would go, the window says whether anything takes files. - Drags across windows: moved (2026-11-16). A drag of any typed
payload is a session (
bus::drag) that outlives the pass of the window it began in: the source starts it (drag.start: its kind, its window); drop targets register each pass by window and by id; let go, the payload is delivered once to the target under the pointer, in the source window or another (from the screen’s coordinates where the system tells where windows are, else to the first window that sees the pointer over a target once the drag lets it go), asdrag.dropthendrag.dropped; a target refusing it, a drag let go over nothing, or cancelled, isdrag.refusedwith the reason. The workbench’s tabs and tab groups are payloads of the same session; its detached windows are targets. Where a drag hovers each pass stays off the bus (per-frame painting). - Panels and layout: the workbench’s changes are steps already; their followers (layout repair, persistence, focus) are calls.
- Selection: has subscribers of its own (
selection.rs), beside the journal. - Settings changes: moved (2026-11-16). The value store, the one
writer of a setting (ADR 0016), says
every change of a
settings/path once assettings.changed(SettingChange: path, scope, by), made here or by another client of the host’s store (by:store). Its listener runs under the store’s lock, so the change is said right after, at the next of these points on the interface’s thread: the start of the application’s logic, after its requests, after the Settings app’s sync applied changes made elsewhere, and at the end of the main window’s pass. The theme (theme.install: the accent, the text size and fonts, the scroll bars, light or dark), the pointer profile (pointer.profile) and the main window’s decorations (frame.decorations) are its local listeners; their per-pass comparisons are gone. Left: theadmin.windowsetting changed by another writer, still followed at the app’s next request.
Consequences
egui-pop-apidepends onegui-pop-hooks; the kernel’s contract page says who uses it. The kernel gains “last” and nothing else.- Steps’ after-hooks on bus points get names and declared order; elsewhere they keep registration order until their family moves.
- More journal events per window change; the journal’s capacity (1024)
holds,
window.paintedbeing said on change, not per pass. - A module’s tests no longer need its neighbours: it emits a request and asserts the events.
- Until slice 9, nothing forbids a new raw call: reviews do.
0030: The bus is a contract the application supplies
Date: 2026-11-16. Status: accepted (2026-11-16, by the lead maintainer’s
decision under GOVERNANCE, without the comment period). Slices 1 to 3
done; slice 3 (2026-11-19, egui-pop 0.17) took the contract’s Journal
as it shipped in bus-contract 0.3 rather than a new trait: see its
entry below.
This ADR decides; the slices at the end are each their own change.
Context
ADR 0029 put egui-pop’s window, popup, job and
plugin points on a bus: requests, events and named listeners in a
declared order, registered in a hook kernel (egui-pop-hooks) that
egui-pop-api creates for each application (AppHandle::bus).
That bus belongs to the library. The first application, Helios, already runs buses of its own: the shell’s journal, the node relay, the vault’s and the engine’s (four sources it polls each pass), and is moving its modules’ extension points onto a hook kernel too. Each library owning its bus means two sources of truth for one fact and bridges written by hand between them, the very thing the bus was meant to end.
The maintainer’s principle (2026-11-16): each part offers contracts;
whether to run one bus or several belongs to the client, not to the
library. The model is PHP’s PSR-3 (logging) and PSR-14 (event
dispatching): a library describes a contract, the application installs
the implementation. Rust has the same shape in log (a trait and
macros; the application installs the logger), tracing (a
Subscriber), raw-window-handle and embedded-hal.
One difference from log and tracing: their implementation is a
process-global. A bus is not: several applications, or several buses,
in one process or one test must work (the test kit builds many
applications per test binary). So the bus is passed at construction,
never installed globally.
Decision
A contract crate: bus-contract, outside egui-pop
The contract is its own crate in its own repository,
bus-contract (decided by
the maintainer, 2026-11-16), MIT OR Apache-2.0 like egui-pop, so any
Rust library or application can take it without taking egui-pop.
It has no dependencies (std only), no egui and no egui-pop
vocabulary: points, listeners, requests, events, alter, collect, the
order dump. It holds the contract and nothing that runs; egui-pop
depends on it like on any external crate:
-
Point: a hook point is a type: itsID(dotted,doc.close), theInputevery listener reads, theValuea listener edits, and itsKIND(below). Moved fromegui-pop-hooksunchanged, plusKINDwith a default. -
PointKind: what a point is for, for introspection and review:Request: a request (<noun>.<verb>, egui-pop’s ADR 0029): its listeners do the work in a declared order; the value is what each did.Event: an event’s listeners, each event delivered once, in journal order.Alter: one value passed through the listeners in turn.Collect: each listener adds its own part.
The kind is declared, not enforced: a request is an
alteremit over a request’s input, an event point analterwith a unit value. -
PointSpec(description, deadline),ListenOpts(owner,after,before,last, priority, deadline, threaded),Failure,Refused,HookError,Altered,Collected,PointInfo,ListenerInfo,DEFAULT_DEADLINE,PLUGIN_DEADLINE,LAST,FAILED_FACT: moved fromegui-pop-hooksunchanged; the kind is added toPointInfo. -
Bus, the trait an implementation provides, object safe andSend + Sync, its values type-erased:Method Does declare_point(key, spec)Declares a point: its description, deadline and kind listen_any(key, id, opts, run)Registers a listener under an id and an owner, ordered by after/before/last, then priority, then registrationunlisten(point, id)Removes one listener forget(owner)Removes every listener of an owner, on every point (ADR 0028) alter_any(key, input, value, clone)Passes the value through the listeners in order (requests, events, alter points) collect_any(key, input, fresh)Gives each listener a fresh value, gathers the parts add_failure_sink(sink)Receives each dropped contribution (an error, a panic, a missed deadline) points(),listeners(point)Introspection: points, listeners in run order, owners, constraints, missing targets, counters A
PointKey(ID, kind,TypeId, type name) names a point to the erased methods, so an implementation refuses an id registered with two types.Arc<B>is aBuswhenBis, so&Arc<dyn Bus>goes where&dyn Busis asked. -
The typed calls (
declare::<P>,listen::<P>,alter::<P>,collect::<P>,on_failure) are methods ondyn Busitself, written once in the contract crate over the erased ones. Code that holds anArc<dyn Bus>callsbus.listen::<WindowClose>(…)exactly as it called the kernel; no implementation writes them again. -
Tools on the contract:
order_dump(bus, points)andmissing_targets(bus, points)move here and take&dyn Bus, so the reviewed order files, the test kit and the debug bridge’sbuscollector read any implementation the same way. -
The contract table: a library publishes its points as a constant,
pub const POINTS: &[PointDecl], eachPointDeclbuilt by aconst fnfrom the point’s type (PointDecl::of::<WindowClose>(…): its id, kind, description, deadline and a function giving its key).declare_all(bus, POINTS)declares them. The application reads the table to know what it will host before building anything; the listeners a library registers are its other half, read after installation withorder_dumpand kept as reviewed files (in egui-pop,crates/egui-pop-api/tests/bus/*.txt).
What the contract does not hold, and why:
- No journal yet. Events are the host’s journal
(
AppHandle::publish,AppHandle::events_since): facts with a sequence number, a source and a cause, catch-up from a sequence. Its contract (Journal: publish,since(revision), the last revision, the event type an associated type, since egui-pop’s events carry JSON and the contract crate has no dependencies) is slice 3 below, written when an application supplies its own: Helios’s journal has the same shape (helios_core::bus::Bus:publish,since,last_seq), so the trait is cut against two real implementations, not one. - No transport. Out-of-process listeners stay the caller’s
transport, given a longer deadline (
PLUGIN_DEADLINE).
What stays in egui-pop-hooks
egui-pop-hooks is the default implementation: its Kernel
implements Bus (ordering, the error boundary with caught panics,
inline and threaded deadlines, sinks, counters). It re-exports the
contract’s types, so egui_pop_hooks::{ListenOpts, Point, PointSpec, LAST} keep their paths; Kernel keeps its typed methods as inherent
ones for code that holds a Kernel and not a dyn Bus. It depends on
bus-contract and on nothing else.
How a library receives the bus
- A library never constructs the bus it publishes on. It declares
its points (
POINTS), registers its listeners, and asks requests on the bus the application gives it. - egui-pop:
App::builder().bus(bus)takes anArc<dyn Bus>. Without it the builder makes the default, anbus_kernel::Kernel: an application that does not care changes nothing but the major version.AppHandle::bus()returns theArc<dyn Bus>. - One egui-pop application per bus. egui-pop’s listeners hold that
application’s window registry; a second application on the same bus
would find its points declared and its listener ids taken. The
builder refuses it (
BuildError::Bus, naming the point), and the application gives each egui-pop application its own bus or one bus per subsystem, as it chooses. - A check keeps the rule:
cargo xtask bus --checkfails when a library crate’s source (crates/*/src, outsideegui-pop-hooksitself and the builder’s default inegui-pop-api’sbus.rs) constructs aKernel(Kernel::new,Kernel::with_default_deadline,Kernel::default). Tests, examples, the gallery and applications may.
Dyn, not generic
The bus is an Arc<dyn Bus>, not a type parameter:
- A generic
App<B: Bus>would carryBthroughAppHandle,Ctx, every plugin’s registration and every view that holds a handle: the whole public API ofegui-pop-apiand of each extension, for a choice most applications never make. - Bus calls are not per frame. Per user action or per job state:
window and popup requests, job requests, plugin connect and
disconnect. Per pass: only
AppHandle::deliver_events, which reads the journal (not the bus) and emits on the bus only for the job events it finds, usually none. Per-frame painting and hot paths (pointer moves, scroll deltas, progress ticks) stay off the bus by ADR 0029’s exceptions. - The cost of erasure per emit: one virtual call, the input in an
Arc, the value in aBox, one downcast per listener. The kernel already clones the value per listener for its error boundary and takes a lock; erasure adds nothing of another order.
Migration and versions
bus-contract: a new crate in its own repository, released on its own; egui-pop depends on0.1.0from crates.io (published 2026-11-16).egui-pop-hooks: major (0.x). The types move tobus-contractand are re-exported;PointInfogainskind(a struct literal or pattern without it no longer builds);PointgainsKINDwith a default (no change for implementors).egui-pop-api: major.AppHandle::bus()returnsArc<dyn Bus>instead ofArc<Kernel>;bus::order_dumpandbus::missing_targetstake&dyn Bus(re-exported from the contract);AppBuilder::busis new. Callers ofbus()keep their code: the typed methods are ondyn Bus.- The order files and the existing bus tests stay unchanged: the listeners, their names and their order do not move.
For Helios
Helios is the application, so the choice is its own. Its intent is one bus:
main.rs(the composition root) builds oneArc<dyn Bus>(the default kernel, or its own implementation) and hands it to egui-pop (App::builder().bus(bus.clone())) and to each Helios crate that publishes or listens, at construction. No Helios library crate constructs a kernel; the same check runs in its xtask.- Its points (
health.reportfirst, then the rest of its hooks design) are declared from each owner crate’sPOINTStable on that bus; the debug bridge’sbuscollector then shows egui-pop’s and Helios’s points in one dump. - The vault, the engine and the node relay publish on that bus instead of their own. The B11 change of Helios’s bus audit (“join the four polled sources”) becomes “the four sources join the one bus”: their facts go through the journal contract (slice 3), and their listeners are listeners of the one bus, ordered and named like egui-pop’s.
- Helios may still choose several buses (a separate one for a subsystem, a node process with its own): each library takes whichever it is given.
Survey: crates that already do this
Checked on crates.io on 2026-11-16 (version, licence, last release).
bus-contract and egui-pop are MIT OR Apache-2.0 and the contract takes no
dependency; Helios (GPLv3) takes only permissive ones. What we need:
listeners ordered by name (after, before, last), owners and
forget, requests with a veto (steps, ADR 0011), alter and collect
with an error boundary and deadlines, introspection and an order dump,
synchronous and inline on the interface thread with no async runtime,
a journal with catch-up.
| Crate | Version, licence, last release | What it is | Verdict |
|---|---|---|---|
signals2 | 0.3.3, BSL-1.0, 2023-04 | Boost.Signals2 port: slots in ordered groups, combiners, disconnect | Closest in spirit. Groups are numbers, not names (no after a listener), no owners, no deadlines or error boundary, no introspection; little used (≈500 downloads in 90 days), no release since 2023. Own |
event-listener | 5.4.2, MIT OR Apache-2.0, 2026-07 | A notification primitive (wake waiters) | A building block below a bus: nothing to order or collect. Not used |
tokio::sync::broadcast | tokio 1.54.1, MIT, 2026-10 | Multi-consumer channel | Fan-out of values, asynchronous delivery, needs the runtime for waiting; no order, no result back. Not used |
async-broadcast | 0.7.2, MIT OR Apache-2.0, 2024-12 | Async broadcast channel | Same as above. Not used |
postage | 0.5.0, MIT, 2022-04 | Async channels | Same; unmaintained since 2022. Not used |
bus | 2.4.1, MIT OR Apache-2.0, 2023-08 | Lock-free single-producer broadcast channel | A channel: one producer, no ordering, no answer. Not used |
eventbus | 0.5.1, AGPL-3.0+, 2018-12 | Event bus with priorities | Licence excluded, unmaintained. Excluded |
pharos | 0.5.3, Unlicense, 2021-10 | Observer pattern over async streams | Fan-out, asynchronous, no order or result. Not used |
bevy_ecs events and observers | 0.20.1, MIT OR Apache-2.0, 2026-10 | Events read by systems; observers triggered on entities | Tied to the ECS world and its schedule; ordering by system sets, not per listener; far too large a dependency for a contract. Not used |
qubit-event-bus | 0.21.3, Apache-2.0, 2026-11 | Typed sync and async event-bus facades with pluggable providers | The same idea (a facade, providers plugged in), but young (≈800 downloads), five dependencies of its own family, no ordering by name or deadlines. Not used; noted as prior art for the facade |
typed-emitter, event-emitter-rs, omnibus | 0.2.0 MIT 2026-10; 0.1.4 MIT OR Apache-2.0 2020-08; 0.1.0 MIT 2026-03 | Node-style emitters, a small pub/sub | Fan-out without order or result. Not used |
log, tracing | MIT OR Apache-2.0 | Facade crates: a contract, the application installs the implementation | The shape we adopt (a contract crate, the implementation chosen by the application), not the global install |
None fits as the default implementation behind the contract: what
makes the bus ours (named ordering, owners, the error boundary,
deadlines, introspection) is exactly what they lack. Own the
contract and keep egui-pop-hooks as its default implementation; an
application that prefers another implementation writes one against the
contract.
Slices
- The contract crate and the kernel on it:
bus-contract(its own repository) with the traits, the typed calls ondyn Bus,PointDeclanddeclare_all,order_dump,missing_targets;egui-pop-hooks’sKernelimplementsBusand re-exports the types. Test: the kernel’s suite unchanged, run throughArc<dyn Bus>as well; a contract test with a minimal implementation. - egui-pop-api on the contract:
AppBuilder::bus, every point and listener throughdyn Bus, egui-pop’sPOINTStable, thecargo xtask bus --checkrule in pr-lint. Test: the bus suites (window_bus,window_invariants,jobs_bus,admin_window,shell_windows,removal) and the order files unchanged; an application-supplied bus (a test implementation recording each call) receives egui-pop’s points and listeners, in their order, and the requests asked on it. - The journal contract:
Journalinbus-contract, the host’s journal implementing it,AppBuilder::journal; cut against Helios’s journal as the second implementation. Done (2026-11-19):Journalcame in bus-contract 0.3 as a capability of the bus (Bus::journal), cut against Helios’s fact journal. So noAppBuilder::journal: when the bus given toAppBuilder::busoffers the capability and the host keeps no journal of its own, egui-pop’s journal is that one, its events entries of the journaled pointpop.journalsharing one numbered sequence with the application’s facts; agents’waitreads it (The hook kernel, “One journal per process”, says what changes for await). - Helios (its own pull requests): one bus built in
main.rs, given to egui-pop and to each crate; its points declared from their owners’ tables; the vault, engine and node relay on it (B11).
ADR 0029’s slices 5 to 11 continue after slice 2, on the contract.
Consequences
- A library’s dependency on the bus is a dependency on a crate with no code to run; the application picks the implementation.
- Tests may hand egui-pop a recording or failing bus to check what it declares and asks, without a window.
- Two majors at once (
egui-pop-hooks,egui-pop-api); code that only callsbus()and the typed methods compiles unchanged. - The kernel’s contract page (The hook kernel)
describes the default implementation; the contract is described by
bus-contract’s documentation.
Micro-indicators: survey, places of use and the indicator module
Status: design note, accepted (2026-10-14). The owner settled the
open questions on 2026-10-14 (section 5). The first step is
implemented on the visual kits (kit.md, 2026-10-19): the
dot, badge, pip, flag and swatch kinds, the icon kind for built-in
icons, the gallery page and the tests; the guide is
indicators.md. The kits changed how the tokens and
the tone are expressed: section 6 lists each deviation from sections 3
and 5. The workbench tab’s modified dot (decision 7) is not in it:
panels have no modified state yet and egui_dock has no slot for a
tab’s decoration.
Micro-indicators are the small marks that say a state in very little space, attached to something else: a dot or LED, a count badge, an activity pip, an icon whose glyph follows a state, a flag on a row or a tile, a colour swatch. Examples: the active colour in a menu entry, an activity LED in a dialog, a modified dot on a tab, an error count on a status bar item. Some are passive; some are buttons.
This note has four parts: what exists (section 1), where the marks
serve in egui-pop and in an application such as Helios (section 2),
the proposed indicator module (section 3), and what it depends on
(section 4). Open questions close it (section 5).
1. Survey
Verdicts follow egui-pop’s usual vocabulary: adopt (depend on it as it is), wrap (depend on it behind an egui-pop type), own (write it in egui-pop, maybe after the idea).
1.1 egui itself (0.36)
| Piece | What it gives | What it misses | Verdict |
|---|---|---|---|
Painter::circle_filled, rect, text | Every shape a mark needs | Everything else: tokens, a11y, placement | Adopt as the drawing layer |
Spinner | An arc turning on input.time, size, colour, role ProgressIndicator | No label, no delay, no reduced motion, repaints every frame (already noted in widgets.md) | Already owned: egui_pop_core::progress::paint_spinner and motion::Busy |
color_picker::show_color, Ui::color_edit_button_* | A swatch rectangle with a checkerboard under alpha; a swatch button opening egui’s picker | No token outline, no name for AccessKit, the button opens egui’s picker only | Wrap show_color for the alpha checkerboard, own the swatch widget |
Atom / AtomLayout (Atom::custom) | A reserved rectangle inside a button’s layout, painted after layout; egui-pop’s menus already put their tick and icon there | Nothing indicator-specific | Adopt as the inline anchor inside buttons and menu entries |
Response::widget_info, Context::accesskit_node_builder | Role, name, value, set_busy on a node | Nothing for “decoration of another node” | Adopt: an indicator’s state goes into its host’s description, or into its own node when interactive |
egui::Image with a tint | Dynamic icons from images | Nothing more | Adopt through icon::Source |
1.2 Crates around egui
Searched on crates.io and GitHub on 2026-10-14 (“egui badge”, “notification”, “indicator”, “led”, “dot”, “status”, “spinner”, “swatch”). No crate is dedicated to LEDs or dots. The crates found are either toasts, icon fonts, or design-system kits that include a badge.
| Crate | Version, egui | Licence | What it has for marks | Verdict |
|---|---|---|---|---|
| egui-phosphor | 0.14, egui 0.36 | MIT OR Apache-2.0 | The Phosphor icon font, already egui-pop’s icon source | Adopt (already a dependency) as the glyph source of dynamic icons |
| egui_material_icons | 0.8, egui 0.36 | MIT (font Apache-2.0) | Material Symbols font | Not needed; an application can register it through the icon registry (section 4) |
| egui_dock | 0.21, egui 0.36 | MIT | TabViewer::title, is_closeable, on_close (can veto), tab_style_override | No modified mark on tabs; the dot that replaces the close button cannot be done without patching. Own the mark; an upstream issue for a tab “decoration” slot is worth filing (docs/upstream.md) |
| egui-notify, egui-toast | 0.23 and 0.22, egui 0.36 | MIT | Toasts with a spinner or a bar | Out of scope (egui-pop has its own notifications) |
| egui-elegance | 0.16, egui 0.36 | MIT OR Apache-2.0 | Indicator (a status light: On, Connecting, Off), StatusPill (lights with labels), Badge with tones, Spinner, ProgressRing | Fixed look, not token-driven, its own colour scheme. Ideas only: the light’s three states and the pill of lights |
| egui-elements | 1.3, egui 0.36 | MIT | A corner Badge (a circle with optional text) anchored to one of four corners of a button | Ideas only: corner anchoring |
| egui-material3 | 0.0.9, egui 0.33 | MIT OR Apache-2.0 | Material 3 Badge: tones, sizes 16/20/24, positions | Behind on egui; ideas only |
| kylig-ui, kylig-fx | 0.3, egui 0.36 | MIT | Badge, Severity, ProgressRing; prefers_reduced_motion(ctx) as an application-set flag | Ideas only; egui-pop already has its reduced motion (motion.duration = 0) |
| shadcn-egui | 0.4, egui 0.34 | MIT | A shadcn Badge port | Ignore |
Verdict: own. No crate combines token theming, AccessKit names, an interactive mode with button rules and test hooks, and each badge is a few dozen lines on the painter. Adopting one would bring a second theme system. egui-phosphor stays the glyph source.
1.3 What egui-pop already has
egui-pop has many marks already, each written for one component. None
is shared, and four Tone enums coexist. (That was the state when
this survey was written. Since the kits, three remain:
egui_pop_core::kit::Tone, the one tone indicators, progress, the
status bar and the library share; egui_pop_core::icon::Tone, an
icon’s content colour; and egui_pop_model::admin::Tone, the admin
forms’ own. See section 6.2.)
| Where | What | Notes |
|---|---|---|
egui-pop-api::strips | Indicator and IndicatorState: status bar items reduced from the host’s journal (text, Tone Quiet/Active/Success/Warning/Error, count, progress line, busy spinner, detail tooltip, a command on click) | The count is drawn as "text (n)", not a badge. The name Indicator is taken (section 5, question 1) |
egui-pop-api::jobs | The status bar’s jobs item: a ring (determinate or turning), “n running”, “n failed” in the danger colour, a popover | A pip and a count, hand-drawn |
egui-pop-api::menus | The menu entry’s tick, icon, or a spinner in the icon’s place while a command runs (busy::busy_shown), AccessKit set_busy | The first inline pip; it lives in an Atom::custom slot |
egui-pop-core::icon | Icon by role (Dot, Diamond, Warning, Visible/Hidden, Lock/Unlock…), Size, Tone (Default, Muted, Strong, Accent, OnAccent, Danger, Warning, Success, Info), .label(), .sense_click() | The base of the dynamic icon kind |
egui-pop-core::progress | Tone (Accent, Info, Success, Warning, Danger, Muted), ProgressTokens (progress.ring), paint_spinner, rings | The base of the pip kind |
egui-pop-core::motion | The motion clock, phase static under reduced motion (motion.duration = 0), animate rate-limited, Busy (300 ms delay, 500 ms minimum) | The base of the pulse |
egui-pop-views::library | Flag (pick, reject), ColorLabel (five labels, each a shape of its own: circle, triangle, square, diamond, hexagon), RatingStars, ColorLabels, FlagToggle (interactive, named), Badge (text + its own Tone Neutral/Info/Success/Warning/Danger) drawn as pills in tile corners, library.* tokens | The most complete marks; flags and label shapes are the model for “never colour alone” |
egui-pop-views::tree | Row icon (TreeView::icon, a Source), row widgets at the right end (row_widgets), a failed row in the danger colour | No mark slot of its own: an application puts its marks in row_widgets |
egui-pop-viewport::graph | Ports as circles (PORT_R 5.0, hit square PORT_HIT 16.0), coloured by type token, a hover ring | Literal sizes; a 16 px hit square is under the 24 px target used below |
egui-pop-editors::markers | Gutter markers: diagnostics, breakpoints, diff marks | Gutter-specific; out of scope, but they could reuse the dot and the tones |
egui-pop-api::theme_editor, gallery pages::swatch/chip | Two private swatch functions (outline from border.strong or border.default, no checkerboard, Sense::hover) | Duplicates; the swatch kind replaces both |
docs/widgets.md | The component survey already lists “Badge and counter: own (small), never colour only” | This note details it |
Verdict: own the module, built from what is here (motion clock, spinner, icons, library shapes, tokens), and move the existing marks onto it.
1.4 Prior art
Behaviour is described from public documentation; no code is taken.
- VS Code.
- Status bar items:
text with
$(icon)codicons ($(sync~spin)turns), a tooltip, a command,accessibilityInformation(label and role). The background is a closed set: onlystatusBarItem.errorBackgroundandstatusBarItem.warningBackground. - View badges:
{ value, tooltip }on a view and its activity bar icon, coloured byactivityBarBadge.backgroundand.foreground. - Editor tabs: the modified dot takes the close button’s place and
turns back into the close button on hover;
workbench.editor.highlightModifiedTabsadds a top border. - File decorations:
a badge of at most two characters, a theme colour, a tooltip, and
propagateto parent folders (a count rolls up the tree). - The Problems item: an icon and a count per severity; a click opens the panel.
- Status bar items:
text with
- GTK 4 and libadwaita.
AdwViewStackPage:needs-attention(a dot) andbadge-number, combinable.AdwTabPage:indicator-icon,indicator-activatable(the tab view emitsindicator-activated, for example to mute a tab playing sound),indicator-tooltip,needs-attention,loading(a spinner replaces the icon). This is the clearest model of a mark that is passive by default and can be made interactive, with its own tooltip.AdwSpinner,GtkLevelBar(continuous or discrete, named offsets mapped to style classes). Animations followgtk-enable-animations.
- Qt and KDE. Qt has no badge widget: applications use
QTabBar::setTabButton,setTabIcon, aQToolButtonwith a painted overlay,QStatusBar::addPermanentWidget.KStatusNotifierItemhas a status (Passive, Active, NeedsAttention) with an attention icon. Launcher counts go through the LauncherEntry D-Bus interface (count,progress,urgent). - macOS.
NSDockTile.badgeLabel(free text); SwiftUI.badge()on list rows and tab items, zero hides it;NSWindow.isDocumentEditedputs a dot in the close button (the dot replacing the close button again);NSColorWell(an interactive swatch); Finder tags (coloured dots, several per item, each named). - Fluent.
Badge,CounterBadge,PresenceBadge: six sizes from tiny to extra-large, appearances (filled, ghost, outline, tint), shapes, a closed colour set (brand, danger, important, informative, severe, subtle, success, warning).CounterBadge:overflowCount99 gives “99+”,showZerofalse by default, adotmode.PresenceBadgegives each presence its own icon, not only a colour. Badges are not interactive: the meaning goes into the host’s accessible name (“Inbox, 3 unread”). WinUI’sInfoBadgehas three forms (dot, icon, number). - Material 3. Badges: a small 6 dp dot without text, a large 16 dp badge with a number of at most four characters (“999+”), anchored on the top-end of an icon.
- Photo applications. Lightroom Classic: pick, reject, unflagged; colour labels; stars 0 to 5. darktable: stars, reject, five colour labels that combine, clickable overlays on thumbnails. egui-pop’s library already follows both.
- Accessibility rules (WCAG 2.2): 1.4.1 colour is never the only carrier; 1.4.11 non-text contrast 3:1 for marks that carry a state; 2.5.8 targets of 24 by 24 px, or spaced so a 24 px circle on each does not overlap a neighbour’s; 2.2.2 moving content lasting over 5 s can be stopped; reduced motion swaps a pulse for a still shape.
Takeaways.
- Sizes: dot 6 to 8 px; a numeric badge 16 px high, at least as wide, a pill as it grows; a 24 px target for anything clickable.
- Overflow:
cap+, the cap a parameter (Fluent 99, Material 999); zero hidden by default; a dot mode; the real count in the accessible name even when capped. - Placement: a badge on the top-end corner of its host, overlapping the edge; inline marks after the label.
- The modified dot takes the close button’s slot (VS Code, macOS).
- Passive by default, with the meaning in the host’s name; opt-in
activatable marks with a tooltip and a name of their own (libadwaita,
darktable,
NSColorWell, VS Code’s status items). - Severity is a closed set of tokens; free colours only for data (swatches, colour labels), and those still get a name.
- A loading state replaces the icon (libadwaita, egui-pop’s menus already do it).
2. Places of use
Each place gives: which kinds serve there, passive or interactive, the anchor, and a rule.
2.1 egui-pop
- Menus. A swatch for the active colour (passive: the entry is the
button), a dot for an on/off state without a tick, a badge for a
count (“Recent files 12”), the pip already drawn while a command
runs. Anchor: the icon gutter (an
Atom), or the trailing column before the shortcut. Rule: the mark never takes a click of its own inside an entry; the entry’s AccessKit name carries the state (“Accent colour: blue”). - Tabs and panel headers. VS Code’s dirty dot: a modified dot that becomes the close button on hover or focus; an error badge on a panel’s tab or activity bar icon. Anchor: the close slot (dot) or the icon’s top-end corner (badge). Rule: a dot that turns into a close button follows button rules in its close state only.
- Tree rows. Flags (modified, pinned, error), a pip while a lazy node loads, a count of children. Anchor: inline before the row widgets, or the icon’s corner. Rule: passive in the row (the row is the target; Space and Enter are the tree’s); an interactive mark is a row widget with its own name and stays outside the selection.
- Status bar. Today’s
strips::Indicatorbecomes a composition of kinds: an LED for a connection, a badge for a count (not"(n)"), a pip for work, a dynamic icon. Anchor: inline. Rule: the item is the button, with the full button rules; the marks inside it are passive. - Dialogs. An activity LED (a probe, a preview rendering), a field state flag (modified, required, invalid), a swatch for the current value. Anchor: inline after a label, or the field’s corner. Rule: passive; a field’s state goes into the field’s description.
- Buttons and toolbars. A badge on an icon button (“3 filters”), a dot for “something new”. Anchor: the icon’s top-end corner, overlapping the button’s frame. Rule: the badge never grows the button’s hit rect; the button’s name includes the count.
- Node graph ports. A port is already an interactive dot; a node header gets a busy pip and an error badge. Anchor: the port centre, the header’s end. Rule: an interactive port keeps a hit target of the interactive size even when drawn at 10 px (section 3.2).
2.2 Helios
Current ad hoc marks, found in the Helios GUI crate:
- Status bar. A text glyph “● REC” in the error colour while a
recording runs: no tooltip, no name beyond its text, and “error”
borrowed to mean “recording”. The jobs item is egui-pop’s. Proposed:
an LED kind
Recording(its own token, a solid dot plus the word), an LED for node and AI provider connections, the jobs pip, a badge for notifications. - Library thumbnails. Flags, colour labels, stars, stack counts
and the
RAWbadge all come from egui-pop’s library views. Helios only gives data, which is the target state. TheRAWtext is a literal (it is a format name, so not necessarily translated). Proposed: unchanged for Helios; inside egui-pop the library’s pills and label shapes become the badge and flag kinds. - Masks tree. Kind icons are Unicode glyphs and emoji (the emoji
depend on egui’s emoji font); the eye and lock toggles are egui-pop
Icons with a tone, a label and a tooltip, the cleanest marks in the tree. Proposed: the kind icons move to the icon registry (section 4); the eye and lock become dynamic icons, interactive; a mask in error gets a flag. - Parameters panel. Three painted marks with literal sizes (a 3 px dot in a 10x18 slot, a 4 px dot or 4.5 px diamond in a 12x18 slot): “changed from default” (interactive: a click resets, tooltip only, no AccessKit name), “held by another origin” (warning colour) and “moved by another origin” (a diamond that fades). Their tooltips are not translated. A documented “outside the soft range” mark is not drawn. Proposed: the dot and the flag kinds, with the reset dot as an interactive dot (button rules), its name “Reset to default”.
- Stack review. A “★” glyph prefixes the proposed best member;
screen readers read “star”. Proposed: a flag kind
Bestwith a name. - Connection states. None: a lost node link shows only in a job’s log. Proposed: an LED per node link and per AI provider in the status bar (off, connecting with a pulse, on, lost), each with a tooltip and a click opening its detail.
- Jobs. Everything is egui-pop’s jobs item; it would gain the pip kind and a failure badge instead of coloured text.
Inconsistencies to remove on the way: glyph marks next to painted marks (the parameters panel paints because fonts may lack glyphs, the status bar and stack review use glyphs), sizes as literals, colour meanings borrowed (error for recording, the selection colour for two marks), tooltips without AccessKit names.
3. The proposed indicator module
3.1 Where it lives
egui-pop-core::indicator (L2): it needs the theme, the motion clock,
icons and AccessKit, nothing from the application API. The status bar
item (strips), the jobs item, the library and the tree use it from
their own layers. Its tokens join the contract in egui-pop-tokens.
3.2 Six kinds
| Kind | Shape | States or content | Default size |
|---|---|---|---|
| Dot / LED | A filled circle; an LED adds a ring and a glow token | Off (ring only), On, Busy (pulse), Success, Warning, Error, Attention; each state has its own shape cue (off hollow, warning a triangle notch, error a square or cross) | indicator.dot.size 8 px |
| Badge | A pill with a count or up to three characters | A number (capped: 99+ by default, the cap a parameter), a short text (!, NEW), or a dot when the count is shown as presence only; tone | indicator.badge.height 16 px, min width = height |
| Activity pip | The existing spinner, or a determinate ring | Indeterminate, a fraction, done (a tick for indicator.pip.linger), failed; the busy delay and minimum of motion::Busy | progress.ring (shared) |
| Dynamic icon | An Icon (or a registry name) chosen by a state | A map from state to glyph and tone: eye and eye-off, link and unlink, a level (battery-like, stepped), lock and unlock | size.icon.inline |
| Flag | A corner triangle, a stripe, a chip or a label shape | Modified, pinned, picked, rejected, required, best, invalid; colour labels as their shapes | indicator.flag.size 6 px (triangle), stripe 3 px |
| Swatch | A rounded square with an outline; a checkerboard under alpha | A colour (a token or a value), live; optional “none” (a slash) and “mixed” | indicator.swatch.size = size.icon.inline |
Passive or interactive, per instance (.interactive(...), off by
default):
- Passive:
Sense::hover()at most (for the tooltip), no focus, no AccessKit node of its own. Its state is written into its host’s description: the host widget’s name gets a suffix (“Masks, 3 errors”), or its AccessKit description is set. Fluent’s and Material’s guidance is the same: a badge is not a control. - Interactive: the full button rules of egui-pop:
- a hit target of at least
indicator.target(24 px, WCAG 2.5.8), centred on the mark, never drawn; when the target would overlap a neighbour’s, the indicator is laid out with its target, not its mark; - focus: in the tab order, the theme’s focus ring around the target;
- keyboard: Space and Enter activate;
- a tooltip (required: an interactive mark has no visible text);
- an AccessKit node of its own, role
Button(orCheckBoxfor a dynamic icon that toggles, with its toggled state), a name that says the action and the state (“Hide mask”, “Reset exposure to its default”); - disabled with a reason in the tooltip, like every egui-pop button;
- its activation can run a command (
CommandId), so it is a step and reachable by agents.
- a hit target of at least
Never colour alone: every state has a shape, glyph or text, and a name. Colour labels keep the library’s shapes.
3.3 Tokens
(As first designed; the kit’s names are in section 6.)
Component tokens aliasing system tokens, as progress.* and
library.* do:
- sizes:
indicator.dot.size,indicator.led.ring,indicator.badge.height,indicator.badge.font(aliasfont.size.smallscaled),indicator.badge.padding,indicator.flag.size,indicator.swatch.size,indicator.swatch.radius,indicator.target(24 px), and the corner offsetindicator.offset; - colours by one shared tone set:
neutral,accent,info,success,warning,danger, plusrecord(aliasstatus.dangerby default, but separate so a theme can tell recording from an error; decided 2026-10-14);indicator.badge.<tone>(fill) andindicator.badge.<tone>-text;indicator.led.off;indicator.outline(the ring that separates a badge or swatch from what it sits on, alias of the surface); - motion:
indicator.pulse.period,indicator.pulse.count(an attention pulse runs a few times, then stays still), reusingmotion.spinner.*for pips; - contrast: pairs in
contrast::PAIRS: each badge text on its fill (4.5:1), each dot and flag tone againstsurface.panel,surface.raisedand the menu surface (3:1, interface parts), the outline against the badge fill.
The tone set is the occasion to settle the four existing Tone
enums: they merge into one (section 5, decision 2; it became
egui_pop_core::kit::Tone, section 6.2).
3.4 Anchoring
An indicator is a decoration, never a host (ADR 0013): it does not change its host’s size or layout unless placed inline.
- Inline:
ui.add(indicator)allocates its size (or its target when interactive) in the flow, like a label; inside a button or menu entry it goes in anAtom::customslot. - On a rect:
indicator.paint_at(ui, host_rect, Anchor::TopEnd)after the host is drawn. Anchors: the four corners,Start,End(vertically centred),Center; anoffsetin points;insetoroverhang(a badge overlaps the corner of an icon by half its height, as Material and Fluent do).TopEndfollows the layout direction (right in left-to-right, left in right-to-left). - On a response:
response.with_indicator(indicator, Anchor)(an extension trait), which also merges a passive indicator’s state into the response’s AccessKit description. - An overhanging badge is drawn on a foreground layer above its host’s layer, with no clipping (decided 2026-10-14), so a badge on an icon at the edge of a panel is never cut.
3.5 Pulse and reduced motion
- A pulse (LED busy, attention on a change to error) is an opacity and
scale oscillation on
motion::phase, so a frozen test clock gives the same frame every run. - Under reduced motion (
motion.duration= 0) there is no pulse: the mark shows its “busy” or “attention” shape still (a ring around the dot, a thicker outline), so the state is not lost. - An attention pulse runs
indicator.pulse.counttimes after the state changes, then stops; continuous pulses are only for busy. - Frames are asked through
motion::animate(rate-limited, not when hidden, not under reduced motion), only while the indicator is drawn. - Screen readers: a change of state is announced politely once (the AccessKit live region of the host, or egui-pop’s announcement channel), not on every count update; counts coalesce.
- A user can silence status bar items only (decided 2026-10-14); other indicators cannot be muted.
3.6 State visible to agents and tests
Following egui-pop’s conventions (the debug bridge’s collectors,
describe() returning JSON, the test kit’s AccessKit dump):
- Each indicator has an optional id (
Id) and adescribe():{ "kind": "badge", "id": "...", "host": "...", "state": "count", "value": 3, "text": "3", "tone": "danger", "interactive": false, "pulsing": false }. - Indicators drawn in a frame with an id are recorded in a per-frame
registry in the context’s temp data; a core collector
indicatorssnapshots it (what the user sees now), so an agent callsindicatorsinstead of reading pixels. The status bar’sstrips::Indicatorstates join the same snapshot. - Interactive indicators run commands, so they are already steps; passive ones produce no steps.
- Test hooks in
egui-pop-test:indicators(&harness)(the frame’s records),assert_indicator(&harness, id, state), and the existingassert_all_namedcovering interactive ones. The AccessKit dump shows a passive indicator in its host’s description.
3.7 API sketch
use egui_pop_core::indicator::{Anchor, Badge, Dot, DynIcon, Flag, Indicator, Pip, Swatch, Tone};
// Passive, inline.
ui.add(Dot::led(LedState::On).name("Node connected"));
ui.add(Pip::busy(job.started).name("Exporting"));
ui.add(Swatch::color(current).name("Accent colour"));
// On a host's corner, passive: the state joins the host's name.
let r = ui.add(Icon::Bell.size(Size::Toolbar).label("Notifications").sense_click());
r.with_indicator(Badge::count(unread).tone(Tone::Danger), Anchor::TopEnd);
// Interactive: button rules, a command.
if ui
.add(Dot::new(Tone::Accent).interactive("Reset exposure to its default"))
.clicked()
{ /* reset */ }
// A dynamic icon that toggles.
let shown = ui.add(
DynIcon::toggle(mask.visible, Icon::Visible, Icon::Hidden)
.names("Hide mask", "Show mask")
.interactive(),
);
// A flag in a tile's corner.
Flag::modified().paint_at(ui, tile_rect, Anchor::TopStart);
// Badge content.
Badge::count(n) // "0" hidden unless .show_zero(), "99+" over the cap
.cap(999)
.tone(Tone::Danger);
Badge::text("NEW");
Common builder methods: .id(..), .name(..) (AccessKit, required for
interactive), .tooltip(..), .tone(..), .size(..) (a size step,
not points), .interactive(name), .command(CommandId),
.pulse(Pulse::Attention), .disabled(reason).
strips::IndicatorState gains marks: Vec<Mark> (or keeps its fields
and draws them with the new kinds; not decided). The library’s Badge
and its pills move onto indicator::Badge, keeping the library’s
names as re-exports.
3.8 Tests
- Unit (no rendering): badge text and cap (
0,9,99,100gives99+, a custom cap, negative refused), anchor geometry in left-to-right and right-to-left, the hit target never underindicator.targetwhen interactive, the pulse phase static under reduced motion,describe()JSON. - kittest interaction: an interactive dot found by role and name, activated by click, Space and Enter, focus ring shown on Tab; a passive badge adds no node and changes its host’s name; a disabled interactive mark says why; a toggle reports its toggled state.
- AccessKit:
assert_all_namedon the gallery page; announcements once per change, not per frame. - Agents: the
indicatorscollector lists what the page draws, with ids and states. - Tokens: every new contrast pair passes in every built-in theme and density.
- Snapshots per theme of the gallery page, at rest and frozen mid-pulse, and with reduced motion.
3.9 Gallery page
An “Indicators” page:
- one row per kind, every state side by side, passive then interactive, at rest, hover, focus and disabled;
- the anchors on a sample icon button, tab, tree row, tile and menu entry (corners, inline, overhang), in left-to-right and right-to-left;
- a playground: kind, state, count, tone, size, anchor, interactive, pulse, reduced motion;
- a live line: a fake status bar with an LED cycling connection states, a jobs pip, a badge counting fake notifications;
- the page’s indicators visible in the debug page through the
indicatorscollector.
4. Dependencies
- The mount contract (ADR 0013, accepted, on the
wip/mount-contractbranch, not yet on main). Indicators are decorations: they declare noMountableof their own and need no host offer. What they need from it: the vocabulary for “decoration on a host” (so the generated host matrix does not list them as components), and the status bar’s offer (one row), which bounds the badge and LED heights. Inline and on-rect anchoring do not wait for it. The gallery page and theindicatorscollector do not either. Waits: movingstrips::Indicatoronto the new kinds, since the status bar’s offer and its items are reworked by that branch. - The icon registry (pending: icons declared once on commands and
object kinds, shown in menus, the palette, toolbars and the status
bar). The dynamic icon kind maps states to icons. With today’s
Iconenum it can ship for the built-in roles (eye, lock, link, check, warning). Waits for the registry: dynamic icons naming a plugin’s own icons, a command’s “on” icon (the registry’s second icon for the on state), icons resolved by name indescribe()and from agents, the status bar items built from a command’s icon, and the Helios masks kind icons. The menu gutter (the registry’s aligned icon column) is where menu swatches and dots sit, so menu placement also follows the registry. - Field states (the forms work: modified, required, invalid): the flag kind provides the marks; the forms decide where they go.
- No new dependency; the module is egui and egui-pop only.
Order of work proposed: tokens and the five kinds that need nothing (dot, badge, pip, flag, swatch), the gallery page and tests; then the library and tree moved onto them; then, after the mount contract, the status bar items; then, after the registry, the dynamic icon’s named icons and the menu placement. Helios adopts in the same order.
5. Decisions
The owner settled the questions below on 2026-10-14:
- The name.
indicatornames the new module;strips::IndicatorbecomesStatusItem. The rename waits for the mount contract branch to land; until then only the new module is added. - One tone. The four
Toneenums merge into one sharedTonein core before 0.1 (asked as atonemodule of core; it becameegui_pop_core::kit::Tone, section 6.2), as a commit of its own. - Badge cap. A badge reads
99+past its cap; the cap stays a parameter. - Recording has its own tone,
record, which defaults to the danger colour. - Overhanging badges draw on a foreground layer above their host, with no clipping.
- Silencing. The user can mute only status bar items.
- Workbench tabs get the modified dot, which turns into the close button on hover.
The questions as they were asked:
- The name.
strips::Indicatoralready names a status bar item. Keepindicatorfor the new module and rename the status bar’s toStatusItem, or call the new modulemarks(which the library already uses for rating, labels and flags)? Proposed: rename the status bar’s type,indicatorfor the module. - One tone enum. egui-pop has four (
icon::Tone,progress::Tone,strips::Tone,library::grid::Tone). Merge them into one shared tone in core (breaking, before 0.1 is published), or map each to the indicator tones? - Badge cap:
99+by default (VS Code, Fluent, Material small) or999+(Material large)? - Recording as its own tone, or
danger? - Overhanging badges: clipped to the host’s layer widened, or a foreground layer of their own?
- Silencing: may the user mute any indicator, or only status bar items?
- Dirty dot on tabs: does the workbench adopt VS Code’s dot that becomes the close button, given that tabs hide their close buttons today?
6. Deviations under the visual kits
The note was written before egui-pop drew its components through
visual kits (kit.md): every component is data per state
and tone, named component.state.term, compiled once at install, and
nothing is drawn outside a kit. The indicators follow that rule; where
it forces a different choice from sections 3 and 5, the choice is
listed here (2026-10-19). Decisions 1, 3, 5, 6 and 7 are unchanged.
6.1 Components instead of an indicator.* group
Six kit components, plus two the kit already had:
| Component | Part | Handler |
|---|---|---|
indicator-dot | a dot or an LED | colours only; the shapes are code |
indicator-badge | a count or a short text | pill |
indicator-flag | a flag | colours only; the shapes are code |
indicator-swatch | a swatch’s outline over its colour | box |
indicator-outline | the ring between an overhanging mark and its host | colours only |
indicator-button | an interactive mark’s target | box |
spinner, progress-ring (existing) | activity pips | colours only |
The tokens of section 3.3 map onto them:
| Section 3.3 | Under the kit | Why it moved |
|---|---|---|
indicator.dot.size | indicator-dot.width | the vocabulary’s size term |
indicator.led.ring | indicator-dot.rest.border-width | the ring of an off LED is its border; pulses use the same width |
indicator.led.off | indicator-dot.rest.border-color | idem |
indicator.record | <component>.tone.record.* on indicator-dot, indicator-badge, indicator-flag, indicator-button and status-indicator, each aliasing danger | see 6.2 |
indicator.badge.height, .padding | indicator-badge.height, .padding-x | vocabulary |
indicator.badge.font | indicator-badge.font-size (an alias of egui’s small text size) | the vocabulary’s font-size term, added for it (6.5) |
indicator.badge.text | indicator-badge.rest.text (the panel, on every tone, as decided) | vocabulary; the library’s pill keeps text.on-accent |
indicator.badge.<tone> | indicator-badge.tone.<tone>.fill | the kit’s tone dimension |
indicator.outline | indicator-outline.rest.ring-color, .ring-width | a ring outside the mark, following its corners |
indicator.flag.size | indicator-flag.width | vocabulary |
indicator.swatch.size, .radius | indicator-swatch.width, .rest.radius | vocabulary |
indicator.swatch.border (none in 3.3; added when built) | indicator-swatch.rest.border-color, .border-width | vocabulary |
indicator.target | indicator-button.width and .height, never under 24 points in code | the target is a part of its own, with its states |
indicator.offset | space.xs | the kit’s offset points outside, and an alias cannot be negated |
indicator.pulse.period, .count | motion.pulse.period, motion.pulse.count | times of motion live in the system’s motion tier, read once at install (drawing resolves nothing by name) |
The interactive target gains what the kit gives every box: its hover,
active and focus looks are data (surface.hover, the focus ring), a
toggle that is on is selected, and a disabled mark takes
indicator-button.disabled.text.
6.2 The tone (decisions 2 and 4)
- Decision 2 asked for a
Tonein atonemodule of core. The kits already had a tone dimension,kit::Tone, which progress used; it became the one tone instead, andstrips::Toneandlibrary::Toneare re-exports of it. Deviation: its path iskit::Tone, and its set is the kit’s (Neutral,Accent,Info,Success,Warning,Danger,Muted) plusRecord: theStrongandOnAccentof the first implementation are not tones (kit.md: colours of content), soicon::Tonestays as icons’ content colour, mapped bykit_tone. - “Before 0.1”: 0.1.0 was published on 2026-10-18, before the merge; it is a breaking change of the next minor, said in the changelog.
- Decision 4 holds:
recordis a tone of its own, the danger colour by default (on spinners, rings and pills too since 6.5). Deviation: it is not one system token but each component’stone.record, since a system token may only alias the reference tier (arecordaliasingdangerwould be system to system) and a theme changingdangerwould otherwise need its ownrecord. A kit telling recording from errors sets the components’tone.record.*.
6.3 Shapes as glyph roles
At first the shapes that tell states apart stayed code, so that a kit
could not leave colour alone to carry a state. The owner decided
otherwise on 2026-10-19 (6.5): the LEDs’ and the named flags’ shapes are
glyph roles of the kit. Badges and swatches, whose shape says nothing,
are drawn by handlers a kit can change. The “none” slash and the
“mixed” dash of a swatch share indicator-swatch.rest.text (the first
implementation drew the dash in text.default). The shapes an
application picks itself (Indicator::flag_shape) are its own and stay
as it asks.
6.4 Left to component dependencies
indicator-button repeats icon-button’s values (transparent, hover,
a focus ring). It is one more case for the component dependencies of
#22 (a component
based on another): it stays as it is until that is decided, and then
moves with the other copies listed there.
6.5 Decided by the owner (2026-10-19)
- A font term. The kit’s vocabulary gains
font-size(a component term: the size of its text, in points, an alias of afont.*size; the widget’s own size when not given). The badge readsindicator-badge.font-size, which the default kit aliases to egui’s small text (font.text-style.small), so it keeps its size. - Record everywhere danger is.
spinner,progress-ringand the library’spillgive arecordtone too, aliasingdangerlike the others (tone.record.indicator-color,pill.tone.record.filland.text), so a recording pip or badge is not drawn neutral. - The LEDs are kittable. The shapes of the LEDs (
glyph.led-off,led-on,led-busy,led-warning,led-error) and of the named flags (glyph.flag-modified,flag-pinned,flag-required,flag-invalid) are glyph roles, mapped to any icon like the disclosure arrows; their defaults are new painted icons of the set (circle,disc,square,triangle,asterisk,corner, with the existingdiamond), so the default look does not change. The safeguard stays:egui_pop_tokens::kit::DISTINCT_GLYPHSlists the roles that must differ (the four LED states, a busy LED from all but the on one since it pulses, the four flags);kit::checkreports a kit breaking it (Problem::SameGlyph), and at install both roles go back to their default shapes with a problem inKit::problems. Acornerflag still turns to the corner it sits in.
Agent control: transports, scenarios and invariants
Status: design note, proposed (2026-11-08). Built since: schemas
and bridge.wait, the in-process scenario runner, the socket and MCP
transports, live scenario runs over the socket, and the ui side on the
socket (see Scenarios). It answers an application’s need (Helios): agents drive a running
application, turn what they find into tests, and run those tests
without a person.
Goal
An agent can:
- drive an egui-pop application from outside its process: run its commands, read its state, see its screen, click and type;
- write what it did as a scenario, a data file of steps and checks;
- replay scenarios headless, as regression tests, with invariants checked at every step, so a scenario catches more than it asserts.
The framework is agnostic. The application codes against egui-pop’s
bridge only. Transports, protocols and outside tools (egui’s
egui_inspection, Rerun’s egui_mcp, an MCP SDK) sit behind adapters
that can be swapped or dropped, the way egui_stack sits behind its host
contract. It grows by registering more, never by changing the core.
1. What exists
Most of the core is already here (Agents and the debug bridge).
| Need | Exists | Where |
|---|---|---|
| A registry of capabilities | yes: collectors and their actions, and every command | DebugBridge, debug_describe |
| Discovery | yes, as JSON: names, descriptions, mutates, agent, an example of the arguments | debug_describe, the commands snapshot |
| Running as the agent | yes: Origin::Agent, the agent flags, the bridge modes (on, read-only, off), the debug.call step and its vetoes | ADR 0018 to 0024 |
| Reading state | yes: about 50 collectors’ snapshots | debug_snapshot |
| The journal | yes: journal.since, command.done and command.failed with their cause | journal collector |
| Tree, screenshots, input in a live window | the agent socket’s ui and inspect methods; outside the bridge, eframe’s inspection feature and egui_mcp (unauthenticated, development builds only) | agent-socket.md, inspection.md (the gallery only) |
| Tree, screenshots, input in tests | yes: egui_kittest, egui_pop_test::a11y_tree | Testing |
| A headless real window | yes: wbox | tools/wbox |
Missing (when this note was written; most is built since, see the status above):
- a transport that carries the bridge out of the process;
- schemas for the arguments (today an example, free JSON or a schema);
- a blocking wait;
- the scenario format, its runner and its invariants;
- fixtures;
- an application-side switch (Helios has none of this wired).
2. The capability model
A capability is a bridge entry, either a collector action or a command, described by:
| Field | Today | Proposed |
|---|---|---|
name | collector.action, or a command id | unchanged |
description | yes | unchanged |
mutates | yes | unchanged |
agent | yes | unchanged |
args | an example, free JSON or a schema | a JSON Schema when the author gives one; the example stays as example |
result | none | an optional JSON Schema |
debug_describe gains a protocol version, and the commands’ entries
are listed beside the collectors’ actions, as one list a client reads.
Adding a capability never breaks a client: a client calls only names
that describe lists.
The generic capabilities, by egui-pop:
- the existing collectors;
commands.run;journal.since;- a new
bridge.wait. It replies when a journal event matches (name,cause), or when the jobs are idle and the frame settled, or at a deadline. It is the blocking wait the known gaps list as missing, held by the transport, never by the UI thread.
An application’s capabilities are its commands and its collectors, as today. Helios already declares its shell commands; it adds collectors where an agent needs state (the library’s counts, the import window’s sources, the jobs).
3. Transports, as adapters
One dispatcher, the bridge, does the checks once, for every transport:
- the mode;
- the
agentflags; - the
debug.callstep; - the origin;
- the journal.
A transport only carries requests to the UI thread and replies back.
| Adapter | Carries | Crate or feature | State |
|---|---|---|---|
| In-process | Rust calls | the bridge itself | exists |
| Local socket | JSON-RPC 2.0: describe, snapshot, call, wait | egui-pop-agent (new, opt-in) | built |
| MCP | the same, as MCP tools generated from describe: a new capability becomes a tool with no code | egui-pop-agent, feature mcp, on an MCP SDK (below) | built: egui-pop-agent-mcp |
| UI: tree, input | the socket’s ui method: the AccessKit tree, and raw egui events queued by an egui plugin’s input_hook | egui-pop-agent | built (2026-11-08) |
| UI: screenshot | egui’s egui_inspection protocol, or the application’s own screenshot command | the socket’s inspect method, to an in-process InspectionPlugin (no port); eframe’s inspection feature in development builds, as the gallery does | built (2026-11-21) |
The UI side stays egui’s protocol, with egui_mcp or our own client. An
agent holds two connections: the bridge for meaning, inspection for
pixels and pointer. A later step may join them in one MCP server, which
proxies inspection’s requests as ui.* tools. Either way the
application depends on neither tool: both are features it can leave off.
Survey for the MCP side, verdicts in egui-pop’s usual words:
| Crate | Notes | Verdict |
|---|---|---|
rmcp | the official Rust SDK (modelcontextprotocol/rust-sdk), 3.9, about 46 M downloads, active | adopt, behind the mcp feature |
rust-mcp-sdk | 2.0, active, smaller | no: rmcp is the reference |
mcp-attr, mcpr | small, quiet since 2025 | no |
egui_mcp (Rerun) | an MCP server for the inspection protocol | adopt as a client tool, not a dependency |
egui-mcp (dijdzv) | Linux only, AT-SPI over D-Bus, an in-app client on Tokio; text and combo items do not work | no |
egui-mcp (aydiler) | an E2E bridge crate, 0 stars | no |
Security. Nothing listens unless the application turns a transport on, and the user or a test asks for it (a flag, an environment variable). The socket is a Unix socket in the user’s runtime directory (mode 0600), or a named pipe on Windows, not TCP. The bridge mode applies as today: read-only is a sound default for a transport the user did not ask for.
4. Scenarios
A scenario is a RON file of steps. Each step is a capability call or a check:
Scenario(
name: "import-without-library",
fixtures: [Folder(jpeg: 3, png: 1)],
steps: [
Call("commands.run", (id: "library.importWindow", args: (source: "$folder"))),
Wait(Settled),
Ui(Click(label: "Import")),
Wait(Event("command.done") | Event("command.failed")),
Expect(NoError),
Expect(Tree(has: (role: "window", label: "Import photos"))),
Shot("after-import"),
],
)
- Calls are capability names from
describe, nothing else, so the format grows with the registry. - Ui steps (
Click,Type,Key,Scroll, by label or role) go through egui_kittest in-process and throughinspectionlive. They are the same step either way. - Expectations read snapshots, the journal or the tree.
Expect(Value("collector.path", 12))compares a snapshot’s value. - Shots are snapshot images, compared like the kittest snapshots, only where the scenario asks.
- Fixtures are capabilities too:
test.*collectors that the application registers in test builds (a new library, a fake card, a folder of N JPEG and M raw files), so a scenario sets up its world without Rust code.
One runner, two places:
- in-process: a kittest harness in
egui-pop-test, the application building itsApp; this is what CI and the box run; - live: against a running instance over the socket and
inspection, in wbox.
Recording. With a live session, the transport can write every call
an agent makes, with the replies, as a scenario. When an agent finds a
bug, it trims the recording to the steps that show it and saves it
under the application’s tests/scenarios/. From then on it is a
regression test.
5. Invariants
Checked after every step, in both places, unless a scenario lifts one
by name (allow: [ErrorToast]):
| Invariant | Breaks when |
|---|---|
NoErrorToast | an error notification shows, not expected by the scenario |
NoFailedCommand | command.failed on the journal, not expected |
NoUnknownCommand | a command run that is not registered (a “no command” refusal) |
NoPanic | a panic, caught by the harness or the crash hook |
StableWindows | a window or modal’s rect still changes after Settled |
FrameBudget | a frame over the budget (in-process: CPU time of the update; generous, a guard against loops) |
NoMissingText | an i18n key shown untranslated |
An application adds its own: a predicate on snapshots, registered with the runner.
6. Order of work
- Schemas and
bridge.waitin the bridge;protocolindescribe; the commands’ entries in the same list. - The scenario runner, in-process, with the invariants, in
egui-pop-test; gallery scenarios as its tests. egui-pop-agent: the socket transport, then MCP overrmcpgenerated fromdescribe, then recording.- The
ui.*side live over eframe’sinspection: documented for any application, beyond the gallery. - Applications: Helios turns on the transport behind a flag, adds
its fixtures and collectors, and writes its first scenarios.
Exploration (an agent walking every command from
describewith fixtures, reporting what breaks an invariant) comes after.
Step 2 is the first to pay off: in-process scenarios on CI give autonomous tests before any live transport exists.
7. Open questions
- RON or JSON for scenarios: RON reads better and matches the snapshots’ tooling; JSON is what an MCP client emits when recording. The proposal is RON, with the recorder writing RON.
- Settled (2026-11-08): the
uiside lives on the socket, as raw egui events queued into the next frames by an egui plugin, and the AccessKit tree of the frame just drawn. One connection, no windowing system’s help, the same headless and on a desktop;inspectionstays for pixels. - Where fixtures live:
test.*collectors compiled only with atest-fixturesfeature, or a separate registry the runner owns.
Icons: an inventory of where they serve
Status: inventory, decided (2026-10-22). Sections 1 and 2 describe what exists, read from the code of egui-pop and of Helios, an application built on it. Sections 3 to 5 were proposed and are decided (2026-10-22), with the owner’s answers in section 7. Section 6 is the order of work that follows. The “Today” column of section 2 follows the work: the registry of step 2 (section 6) is in, and so are the menus of step 3.
egui-pop draws icons by role (Icon, in egui_pop_core::icon):
a name such as search or warning, never a codepoint, drawn from the
Phosphor font with the phosphor feature or painted otherwise, sized
by a token and coloured by a tone. An application adds its own SVG
icons by name (icon_set::register, feature svg). A kit remaps the
small marks widgets draw through glyph roles (glyph.check,
glyph.disclosure-open…; kit.md). What is missing is a
rule for which icon a surface shows and who declares it: today each
widget has a field of its own, or picks its icon in its code.
1. Two families
An icon says one of two things, and they are declared in different places.
- Command icons say an action: Save, Undo, Export, Toggle the
grid. The command is declared once (
CommandSpec), and so is its icon; every surface that runs the command (a menu, the palette, a toolbar, the shortcut editor, a status item) shows the same one. A command that toggles may have a second icon for its “on” state (eye and eye-off). - Object-kind icons say what a thing is: a node type, a file type, a job kind, a mask element, a severity, a place or a mode, a panel. They are declared on the kind, not on a command: a row in a tree, a chip in the status bar or an entry in quick open shows the icon of the kind of thing it holds.
Two neighbours stay outside both families:
- Glyph roles (check, radio, disclosure, sort, submenu, close, window buttons, LED and flag shapes) are the marks widgets draw for their own mechanics. Their vocabulary is fixed and a kit remaps them with data. They are already one registry, and they stay as they are.
- Application and document icons in the system’s places (the window’s icon, the tray icon, desktop files, notifications) are pictures handed to the system, not icons of the set (packaging.md).
2. Where icons serve
Each table gives, for every surface:
- Rule: required, optional or not used, and why.
- Family: command, object kind, or glyph role when the mark is a widget’s own.
- Size and states: the size token (
size.icon.inline16 points,size.icon.toolbar20,size.icon.panel24, each 4 points smaller in the compact density) and the states the icon follows. - Accessibility: decorative when a visible text already names the thing (the icon adds nothing for AccessKit), or only label when the icon is all there is, and then which text names it.
- Today: the file and the field, or “hard-coded in the widget”.
- Gap: what is missing for the rule.
Paths are relative to crates/. “Name lookup” means a string resolved
with Icon::by_name (egui-pop’s names, then the application’s
registered ones).
2.1 Shell: the window frame and the status bar
| Surface | Rule | Family | Size and states | Accessibility | Today | Gap |
|---|---|---|---|---|---|---|
| Window menu button (title bar) | Required: no room for text in the bar; the menu icon is the convention | Command (opens the system menu) | toolbar; hover, pressed | Only label: “Window menu” | Hard-coded Icon::Menu in egui-pop-api/src/frame.rs (menu_button) | None needed; could read the opening command’s icon once commands have one |
| Window buttons (minimise, maximise, restore, close) | Required: system convention | Glyph role (window-*) | Drawn on the pixel grid; hover, pressed, the close’s danger hover | Only label: each button’s name | Kit glyphs in egui-pop-core/src/frame.rs | None |
| Overflow and main menu entries (“More menus”, “Main menu”) | Required: the menu bar folded into one button | Command | toolbar; hover, open | Only label: “More menus”, “Main menu” | Icon::More and Icon::Menu hard-coded in bar_within (egui-pop-api/src/menus.rs) | None needed |
| Layout controls (title bar) | Required: icon-only by place, as VS Code’s | Command (the area toggles, “Customize layout”) | toolbar; hover, pressed; the toggle’s state is the icon itself: filled (layout-left, layout-bottom, layout-right) while the area shows, outlined (-off) while folded or hidden | Only label: the command’s title; a toggle is announced as toggled | layout-* built-in icons, always painted, chosen by side in egui-pop-api/src/layout_controls.rs (toggle_icon); the toggle commands also declare them (CommandSpec::icon and icon_on), so menus show them in their gutter, mirrored with the primary side bar on the right (command_icon) | None |
| Caption items (the application’s marks in the title bar) | Required: icon-only by place | Command (each opens something) | toolbar; a count badge, a ring, a busy state | Only label: the command’s title; the state joins the name | Chosen by the application per item (Helios: Icon::Notification hard-coded) | Should come from the command the item runs |
| Breadcrumb crumbs | Optional: the text names the place; an icon on every place that declares one, hidden in the compact density (decided 2026-10-22) | Object kind (a place, FrameSpec) | inline; the current crumb strong | Decorative | FrameSpec.icon (egui-pop-model/src/context.rs), drawn before the crumb by status_context (egui-pop-api/src/strips.rs), not in the compact density; contexts::crumb_icons and the strips collector give the names; the separator is a literal › | The separator should be a glyph role (chevron-end) |
| Mode chips | Optional: a mode is named by its text; an icon makes an active mode visible at a glance | Object kind (a mode, FrameSpec) | inline; the mode’s tone | Decorative | FrameSpec.icon by name lookup, copied to Chip.icon (egui-pop-api/src/contexts.rs), drawn by strips.rs as Mark::icon; an unknown name is an unknown-icon diagnostic | An unknown name still draws nothing on the chip |
| Status items (indicators) | Optional: most items are short texts; an item that is icon-only (a connection, a sync) needs one | Command when the item runs one, object kind otherwise (a connection) | inline; tone, busy spinner, error and warning counts | Decorative beside text; only label when alone: the item’s label | Indicator::icon (by name, checked; IndicatorState::icon from a reducer), else the icon of the command it runs; drawn before the text in the item’s colour, alone when the text is empty, named by the label (docs/status-bar.md); the error and warning counts are hard-coded Icon::Error and Icon::Warning (strips.rs) | The counts’ icons should be the severity kinds |
| Status item popovers and hover cards | Optional: content drawn by the application | Either | inline | As for the content | Drawn by the item’s PopoverFn or HoverFn (strips.rs, egui-pop-core/src/hover_card.rs) | None in egui-pop |
| Busy slot of a command control | Required: a spinner replaces the icon while a run waits | Command | The control’s icon size; busy after motion.spinner.delay | Decorative; AccessKit’s busy flag carries the state | busy::paint_slot(.., icon: Option<Icon>, ..) in egui-pop-api/src/busy.rs, the icon given per call | The icon should be the command’s |
2.2 Menus and commands
| Surface | Rule | Family | Size and states | Accessibility | Today | Gap |
|---|---|---|---|---|---|---|
| Menu bar titles | Not used: every platform shows text titles | — | — | — | Text | None |
| Menu items (bar, context and popup menus) | Optional, in an aligned gutter (section 5); following the menus.icons setting (section 3) | Command | inline; disabled (greyed), checked (a tick in the gutter, or a frame around the icon), busy (a spinner in the gutter), the “on” icon of a toggle | Decorative: the title is the name; a check item is announced as a check box | Every row starts with the gutter of section 5 (command_row in egui-pop-api/src/menus.rs): the command’s icon (icon, icon_on while checked), framed while checked; the tick or the radio dot (MenuItem::radio) of an item without one; the spinner while running. menus::rows_drawn gives each row’s icon, mark and label start | Done (step 3); full-colour icons are not yet masked in high contrast |
| List-provider entries | Optional, as menu items; an entry naming a thing (a recent file, a profile) takes that thing’s kind icon | Command, or object kind | As menu items | Decorative | ListItem::icon, by value or by name (menus.rs), serialised by name for the lists collector | Set per entry; an entry without one does not fall back to its command’s |
| Submenu entries | Optional: Apple and Microsoft both allow an icon on the entry; its arrow is a glyph | Command group (no command of its own) | inline; open | Decorative | Item::Submenu { menu, label } (egui-pop-model/src/menus.rs) has no icon; the arrow is the submenu glyph role, in the menu’s last column | No icon on a submenu |
| Command palette | Optional: shown in a fixed column when the command declares one; text stays the label | Command | inline; disabled entries greyed | Decorative | The command’s icon in a column before the title, kept on every row while a match has one (egui-pop-api/src/palette.rs) | Done (with step 3) |
| Quick open (a list of things to go to) | Required when the list mixes kinds (a module, an image, a workspace): the icon says which kind a match is | Object kind | inline | Decorative; the kind joins the accessible name when the text does not say it | egui-pop has none; Helios builds it on the choice dialog, whose rows are text only (choice_row in egui-pop-api/src/dialogs.rs) | Choice rows take no icon |
| Toolbars | Required: a toolbar is icon-first, with a tooltip giving the title and the key | Command | toolbar; disabled, on (selected), busy | Only label: the command’s title | toolbars::Toolbar draws a menu’s items as buttons from the commands’ icons (docs/toolbars.md): titles and keys in tooltips, on and greyed states, separators, More tools, icons, titles or both, a row or a column | None; CommandButton still takes its icon from the caller |
| Command buttons with text | Optional: text is the label | Command | inline; busy | Decorative | CommandButton::icon (busy.rs) | Per instance |
| Split buttons | Optional on the main part, not used on the arrow (a glyph) | Command | inline | Decorative | input::split_button(ui, text, items) (egui-pop-core/src/input.rs): text only | No icon |
| Toggle chips | Optional: a chip may be an icon alone | Command or object kind | inline; on | Only label when alone: ToggleChip::name | ToggleChip::glyph(Icon) (egui-pop-core/src/widgets.rs) | Per instance |
| Shortcut editor rows | Optional: helps to scan a long list; the title stays the label | Command | inline | Decorative | Text only (the shortcuts section of egui-pop-api/src/settings_window.rs) | Reads nothing |
2.3 Panels and the workbench
| Surface | Rule | Family | Size and states | Accessibility | Today | Gap |
|---|---|---|---|---|---|---|
| Activity bar | Required: an icon-only strip by convention | Object kind (a panel) | panel; selected (the shown panel), hover, focus, an indicator | Only label: the panel’s title | PanelSpec::icon: String (egui-pop-model/src/panels.rs) by name lookup in activity_bar (strips.rs); empty or unknown: the title’s first letter, an unknown name being an unknown-icon diagnostic | None |
| Folded strips and flyouts | Required: same as the activity bar | Object kind (a panel) | panel; selected, an indicator’s dot or count | Only label: the title and its key | Built on the wip/folded-strip-icons branch from PanelSpec::icon, not yet on main | The same name lookup |
| Panel tabs | Optional, behind a setting off by default (decided 2026-10-22): the title is the label and tab bars are narrow | Object kind (a panel) | inline; active | Decorative | Text only (the tab bar in egui-pop-api/src/workbench.rs) | None now; when wanted, the same PanelSpec icon |
| Floating palette bands (close, roll up, pin) | Required: a band has no room for text | Glyph role (close, roll), command (pin) | The band’s side; pin is selected while on | Only label: Close, Roll up / Roll down, Pin / Unpin | band::button(ui, side, icon, name, on) (egui-pop-core/src/band.rs); Icon::ChevronDown/ChevronUp and Icon::Lock/Unlock hard-coded in egui-pop-api/src/palettes.rs | Pin uses the lock icons; roll should be a glyph role |
| Settings categories (the window’s tree) | Optional: categories are text; icons help on a long tree (as macOS and GNOME settings do) | Object kind (a settings section or page) | inline | Decorative | Text only (settings_window.rs, settings_pages.rs; SettingsPage has no icon) | No icon on a section or page |
| Theme editor token groups | Not used: groups are named by role and few; colour swatches already mark the rows | — | — | — | Text; undo and redo are text buttons (egui-pop-api/src/theme_editor.rs) | None; undo and redo could take the commands’ icons if they become commands |
| Gallery page list | Optional: a long list of pages; a kind icon per page family would help scanning | Object kind (a page family) | inline | Decorative | Text only (egui-pop-gallery/src/shell.rs) | None needed for the gallery’s purpose |
| Empty states | Required: the icon says what is empty; the title says why | Object kind | Drawn large in the empty-state component; danger tone on failure | Decorative: the title is the name | EmptyState::new(icon, title) (egui-pop-core/src/placeholder.rs) | Per instance |
2.4 Views
| Surface | Rule | Family | Size and states | Accessibility | Today | Gap |
|---|---|---|---|---|---|---|
| Tree rows | Optional per tree, required where rows mix kinds (files and folders, mask elements) | Object kind | inline, in the row’s text colour; selected | Decorative | TreeView::icon(Fn(&Node) -> Option<Source>) (egui-pop-views/src/tree/mod.rs), a name given with Source::named; each row’s icon name reported to agents (the icons collector’s drawn) | A closure per tree, so the same kind may look different in two trees (kinds: step 6) |
| Tree disclosure | Required | Glyph role (disclosure-*) | inline; open, closed | Decorative (the row’s expanded state is announced) | Kit glyphs | None |
| Row actions (buttons on a row) | Required: icon-only on hover or focus, by space | Command | inline; on/off for toggles | Only label: the command’s title | Each application draws its own (Helios: eye and lock in the masks tree) | No row-action helper reading commands |
| Table and list headers | Not used, except the sort mark | Glyph role (sort-*) | inline | Decorative (the sort is announced) | Kit glyphs in egui-pop-views/src/table.rs | None |
| Table cells | Optional: drawn by the application | Object kind | inline | Decorative | Application code | None in egui-pop |
| File chooser (in-app picker): places | Optional: home, recent, bookmarks and mounted volumes are told apart by an icon on every platform | Object kind (a place) | inline | Decorative | Text only (egui-pop-api/src/files.rs) | No icons; the built-in home, history, folder exist unused there |
| File chooser: entries | Optional: a folder or a file type | Object kind (file type) | inline | Decorative; the type joins the name when hidden | Text only; folders end with a literal / | Folders and files look the same but for the slash |
| Library marks (stars, pick and reject flags, colour labels) | Required: the mark is the information | Glyph role | The component’s size; on, off, hover | Only label: the rating or flag as text | Painted shapes in egui-pop-views/src/library/marks.rs (paint::flag, paint::cross), outside the icon set | A kit cannot remap them; they should become glyph roles |
| Library grid and filmstrip badges | Required where they mark a state (a failed thumbnail’s warning, a stack’s chevron) | Glyph role or severity kind | Scaled with the thumbnail, at most panel | Decorative beside text, else the state’s name | Icon::Warning, ChevronDown/ChevronRight hard-coded in library/grid.rs; Icon::Warning in library/compare.rs; Icon::Search in library/filter.rs; Icon::Close on tag chips in library/tags.rs | Hard-coded; chevrons should be the disclosure role, the warning the severity kind |
| Editors’ gutter | Required: a diagnostic’s severity, a fold | Object kind (severity), glyph role (fold) | Line height; error, warning, info | Decorative: the diagnostic’s text is reachable | Icon::Error/Warning/Info and ChevronRight/ChevronDown hard-coded in egui-pop-editors/src/view.rs | Hard-coded |
| Find bar | Required: compact buttons | Command (next, previous), glyph role (close, toggles) | inline | Only label: each button’s name | Icon::ChevronUp/ChevronDown hard-coded, close from the kit, in egui-pop-editors/src/find_bar.rs | Next and previous are not commands with icons |
2.5 Imaging
| Surface | Rule | Family | Size and states | Accessibility | Today | Gap |
|---|---|---|---|---|---|---|
| Node graph: node kinds | Optional on a node’s title, required in the “add a node” menu when it is long | Object kind (node type) | inline in the title; selected, bypassed, in error | Decorative: the title names it | graph::Kind { id, title } (egui-pop-viewport/src/graph/model.rs): no icon | No icon on a kind |
| Node graph: port types | Required as a shape: a type is told by colour today, and egui-pop never says a state by colour alone | Object kind (port type) | The port’s size; connected or not | The type joins the port’s name | PortType { name, color }: a colour token only | Add a shape (a glyph) per type |
| Node graph: group fold | Required | Glyph role (disclosure-*) | inline | Decorative | Icon::ChevronRight/ChevronDown hard-coded in graph/mod.rs | Should be the disclosure role |
| Navigator and zoom control | Required: compact buttons | Command (zoom in, zoom out) | inline | Only label: the command’s title | Icon::Plus/Minus hard-coded in egui-pop-viewport/src/navigator.rs | Should read the zoom commands’ icons |
| Slider quad button | Optional: an eyedropper, a toggle beside a slider | Command | inline; on for a toggle | Only label: the given label | Slider::quad(icon, label), quad_toggle (egui-pop-core/src/slider.rs) | Per instance |
| Viewport tools | Required in a tool palette (icon-first) | Command | toolbar; the active tool selected | Only label: the command’s title | No tool palette in egui-pop; tools are the application’s | None in egui-pop yet |
| Tool cursors | Not icons: cursors, drawn in the icon set’s line style | — | The cursor size | — | egui-pop-viewport/src/cursor.rs (cursors.md) | None; out of this inventory |
| Viewport overlays (handles) | Not used: handles are shapes | — | — | — | Overlay kit | None |
2.6 Feedback, dialogs and forms
| Surface | Rule | Family | Size and states | Accessibility | Today | Gap |
|---|---|---|---|---|---|---|
| Toasts | Required: the severity icon, with its tone | Object kind (severity) | inline; info, success, warning, error | Only label for the level: the level’s name is the icon’s label | Level::icon() in egui-pop-api/src/toasts.rs, hard-coded; close is Icon::Close | Hard-coded; severities should be kinds a kit or an application can restyle |
| Notifications inside the window (toast actions) | Not used on action buttons: text, the verb matters | — | — | — | Text | None |
| Jobs centre: job rows | Optional: a job kind’s icon (import, export); the state is text and a ring | Object kind (job kind), severity for a failure | inline; running ring, failed | Decorative: the state is text | Text and a ring; the log toggle is Icon::ChevronDown/ChevronRight hard-coded (egui-pop-api/src/jobs_centre.rs) | No job kind icon; the log toggle should be the disclosure role |
| Jobs status item and panel | Required in the status item (a ring), optional on the panel | Object kind (the Jobs panel) | inline | The item’s text names it | A ring painted in jobs.rs; the panel declares .icon("history") | None |
| Tips | Optional: the info icon marks a tip card | Object kind (severity: info) | inline | Decorative: the heading names it | Icon::Info hard-coded in egui-pop-api/src/tips.rs; Tip has no icon | A plugin’s tip cannot have its own |
| Micro-indicators (icon kind) | Required: the icon is the mark | Either: an on/off pair is a command’s, a state mark is a kind’s | inline; on/off, tone | Only label: the mark’s meaning | Indicator::icon, Indicator::toggle(on, when_on, when_off) (egui-pop-core/src/indicator.rs), each icon by value or by name | No Indicator::command(id) taking a command’s icon pair yet (design/indicators.md) |
| Field state marks | Required: a state is never said by colour alone | Glyph role | inline; disabled, invalid, pending, modified, read-only | Decorative: the state joins the field’s name | field::icon(Mark) in egui-pop-core/src/field.rs | Hard-coded mapping; could be glyph roles |
| Inputs: leading and trailing icons | Optional: a search field’s magnifier, a path field’s folder | Object kind (what the field holds) | inline | Decorative | Input::leading_icon, trailing_icon (egui-pop-core/src/input.rs), by value or by name, reported to agents (the icons collector’s drawn); search fields add Icon::Search | Per instance; no kind (file/folder) yet |
| Inputs: attached buttons | Optional: an icon button when the action is standard (clear, browse) | Command | inline | Only label: Attached::icon(icon, label) | Attached::icon in input.rs, by value or by name | Per instance |
| Dialog titles | Not used: the title and the buttons say it; a danger dialog is marked by its buttons | — | — | — | None | None |
| Dialog buttons | Not used: the verb matters | — | — | — | Text (egui-pop-api/src/dialogs.rs) | None |
| Dialog close | Required | Glyph role (close) | Band button | Only label: “Close” | Kit glyph on a band-icon-button (dialogs.rs) | None |
2.7 Platform
| Surface | Rule | Family | Size and states | Accessibility | Today | Gap |
|---|---|---|---|---|---|---|
| OS notifications | Optional: the application’s icon by default; a themed icon name on Linux | Application icon | The system’s | The system’s | Notification::icon: Option<String>, a themed icon’s name or a file path (egui-pop-platform/src/notify.rs) | A system name space, not the registry’s; keep it apart |
| Tray icon | Required: it is the icon | Application icon | The system’s | Tooltip text | tray::Icon RGBA pixels (egui-pop-platform/src/tray.rs), a disc by default | None |
| Tray menu entries | Optional, following the platform: the system draws that menu | Command | The system’s | The system’s | Entry has no icon; entries become muda items without icons | No icon; menus.icons should apply when the system allows |
| Desktop file actions and jump lists | Not used: the desktop draws them, most without icons | — | — | — | Packaging (packaging.md) | None |
2.8 Helios
Helios is read at release 0.24.0. It declares about a hundred commands, fourteen panels, three places and three modes; none declares an icon, since commands cannot and the panel and frame fields are left empty.
| Surface | Rule | Family | Size and states | Accessibility | Today | Gap |
|---|---|---|---|---|---|---|
| Commands (open, export, undo and redo, the masks tools, culling marks, view modes) | Optional in menus and the palette, required in toolbars and caption items | Command | As the surface | As the surface | None: CommandSpec has no icon | Declare once the registry exists |
| Panels (Image, Graph, Vault, Modules, Masks, Navigator, Parameters, Scopes, Filmstrip, Queue, Log, Compare, Stacks, Duplicates) | Required in the activity bar and strips | Object kind (panel) | panel | Only label: the title | helios_panels() in helios-gui/src/lib.rs sets no PanelSpec::icon: strips show letters | Fourteen icons to choose |
| Places and modes (Library, Darkroom, Network; Culling, Mask editing, Compare) | Optional on crumbs and chips | Object kind (place, mode) | inline; the mode’s tone | Decorative | helios-template/src/contexts.rs sets no FrameSpec::icon | Six icons to choose |
| Modules list and pipeline nodes | Optional on rows and node titles, required if module groups become icon-only tabs | Object kind (node type) | inline | Decorative, or only label for icon tabs | None; the graph’s kinds carry no icon | Waits for kind icons in the graph |
| Masks tree: element kinds (shape, parametric, luminance, raster, AI object, group, refinement) | Required: rows mix kinds | Object kind (mask element) | inline | Decorative | Item::icon() in helios-gui/src/mask_tree.rs: Unicode glyphs and emoji (○, ◎, ✏, 🖼, ✨…), drawn with Source::glyph | Emoji depend on the emoji font and ignore the theme; move to kind icons |
| Masks tree: visibility and lock | Required: row actions | Command (toggle, with an “on” icon) | inline; on, off | Only label: the hint text | Icon::Visible/Hidden, Icon::Lock/Unlock hard-coded in mask_tree.rs | Should be the commands’ icon pairs |
| Library marks (rating, flags, colour labels), stacks, compare, duplicates | Required for marks; optional for the panels | Glyph role (marks), object kind (panels) | As in 2.4 | As in 2.4 | egui-pop’s library views (2.4); Helios gives data | Follows egui-pop |
| Templates and workspaces | Optional: an icon per workspace in pickers and the recent list | Object kind (workspace) | inline | Decorative | meta.icon: Option<String> in helios-template/src/workspace.rs, offered to agents as “a short generic icon name”; stored, edited, never drawn | Not checked against any name list; not shown |
| Quick open (modules, images, workspaces) | Required: one list of three kinds | Object kind | inline | Decorative | helios-gui/src/quick_open.rs on the choice dialog: text only | Waits for choice rows with icons |
| Status items (images, zoom, history, culled) | Not used: short texts | — | — | — | helios-gui/src/status_items.rs: text | None |
| Caption items (jobs, decisions, profile) | Required: icon-only in the title bar | Command | toolbar; a count badge, a ring | Only label: the action’s text | Ring painted; the decisions bell is Icon::Notification hard-coded in helios-gui/src/caption.rs | Should come from the command it runs |
| Jobs (import, export, batch, calibration) | Optional: a job kind’s icon in the jobs centre | Object kind (job kind) | inline | Decorative | Text | Waits for job kinds in egui-pop |
| Node and AI connection indicators | Required when built: icon-only status items with a state | Object kind (a connection), with an LED | inline; off, on, busy, error | Only label: the connection’s name and state | Not built (a connected node’s jobs are relayed, with no indicator) | Waits for status items with icons |
| Tray and desktop menus | Optional, following the platform | Command | The system’s | The system’s | Not used by Helios | None now |
| Viewport tools and overlays | Required for a tool palette; not used on overlays | Command | toolbar | Only label | The picker is a slider’s quad button (Icon::Picker, helios-gui/src/params.rs); mask handles are overlays | No tool palette yet |
| Parameters sections | Required | Glyph role (disclosure-*) | inline | Decorative | Icon::ChevronDown/ChevronRight hard-coded in params.rs | Should be the disclosure role |
2.9 Count and main gaps
Counting each row once (glyph-role rows included, as they are surfaces too; a conditional rule counts by its first word):
| Required | Optional | Not used | Rows | |
|---|---|---|---|---|
| egui-pop (2.1 to 2.7) | 27 | 27 | 9 | 63 |
| Helios (2.8) | 9 | 6 | 1 | 16 |
The gaps that matter most:
- Commands have no icon.
CommandSpecdeclares none, so menus, the palette, toolbars, the shortcut editor and status items cannot show one, and every command control takes its icon from its caller. Declared since step 2 (CommandSpec::icon,icon_on); menus read them since step 3. - Icon names are not checked.
PanelSpec::icon,FrameSpec.iconand a workspace’s icon are free strings; an unknown name becomes a letter or nothing, with no diagnostic (against ADR 0003). Closed by step 2 for egui-pop’s declarations (theunknown-icondiagnostic, theiconscollector); a workspace’s icon is Helios’s. - Icons are chosen inside widgets: severities in toasts, the editors’ gutter and the status bar’s counts; chevrons in the jobs centre, the library grid, the graph and Helios’s parameters (which should be glyph roles); the palettes’ pin; the library’s painted marks, which a kit cannot remap.
- Agents see only part of it. Panel and frame icons and the
indicators’ icon names are reported;
ListItem::iconis skipped, tree and input icons are closures or fields nobody describes. Closed by step 2: list entries, commands, tree rows and inputs are reported by name. - Port types are told by colour alone in the node graph.
- The breadcrumb ignores
FrameSpec.icon, which says it serves the crumbs. Closed by step 2. - The vocabulary is small. About 57 built-in names cover egui-pop’s own needs; an application’s commands (Export, Crop, Import) need its own SVGs or a larger set (section 4.5).
- Helios declares nothing: no panel, place, mode or command icon, and its mask kinds are emoji.
3. Platform conventions for menu icons
What each platform says, with its source:
- Windows. The Win32 guidelines say: “Consider providing menu item
icons for the most commonly used menu items, menu items whose icon is
standard and well known, menu items whose icon well illustrates what
the command does”, and “If you use icons, don’t feel obligated to
provide them for all menu items”
(Menus, Icons).
The system menu’s visual style has a gutter of its own: the theme
parts
MENU_POPUPGUTTER,MENU_POPUPCHECK(MC_CHECKMARKNORMAL,MC_BULLETNORMAL) andMENU_POPUPCHECKBACKGROUND, whoseMCB_BITMAPstate is the box drawn behind a checked item’s bitmap (Parts and States, MENU). WinUI gives the same advice forMenuFlyoutItem.Icon, at 16 by 16 pixels (Menu flyout and menu bar, Icons). Office (Word) follows this layout: icons in the left gutter, ticks in the same column, a checked item with an icon shown as the icon in a highlighted frame. That last point is observed in Word, not written in a guideline;MCB_BITMAPis the system’s part for it. - macOS 26 (Tahoe). The Human Interface Guidelines gained a section on menu item icons on 2025-07-28, updated on 2026-06-08: “Use menu item icons sparingly and with purpose. Icons allow people to find menu items more quickly, and help clarify what selecting an item does”, and “provide icons for all menu items in a group, or none of them” (Menus, Icons). The same page asks to “represent common actions consistently” with the system’s standard icons.
- GNOME and GTK 4. The GNOME guidelines for menus mention check
boxes and radio buttons and no item icons
(Menus).
GTK 4 accepts an
iconattribute on a menu item, “names of icons that may be displayed” (GtkPopoverMenu), but an item that has a label does not show it: ingtk/gtkmodelbutton.c,update_visibility()shows the image only whenhas_icon && (self->iconic || !has_text), and only the sections drawn as rows of buttons are iconic (gtk/gtkmenusectionbox.c) (source at 49eeaf8a). So, by default, no icons in GNOME menus. - KDE Plasma. Icons are shown by default and a user setting turns
them off: Plasma’s Qt platform theme reads
ShowIconsInMenuItemsfrom the[KDE]group, defaulttrue, and sets Qt’sAA_DontShowIconsInMenusfrom it (updateShowIconsInMenuItemsinqt6/src/platformtheme/khintssettings.cppof plasma-integration, source at 46eddde9).
All four agree on two things: an icon is never the only label of a menu item, and icons are for the common, well-known actions, not for every item.
The menus.icons setting (decided, 2026-10-22)
A setting under Appearance, menus.icons, with three values:
on(default): the Word-like gutter (section 5) in every menu, with the icons the commands declare.off: no icons in menus. Ticks and radio dots keep their column, reserved only in a menu that holds a check or radio item.platform:onon Windows, macOS and KDE Plasma;offon GNOME (read fromXDG_CURRENT_DESKTOP); on Plasma, followShowIconsInMenuItemswhen it can be read.
The default is on, Word’s look, as the owner asked (an established
application’s habit) rather than the platform; off and platform are
the other choices, platform being there for GNOME users. The setting changes menus only: the palette,
toolbars and other surfaces keep their own rule. Tray menus follow it
when the system lets an application draw icons there.
4. The icon registry (decided, 2026-10-22)
One place where commands and object kinds declare their icon once; every surface reads it, no widget picks an icon for a command or a kind, and agents read the names.
4.1 Names, not values
An icon is referred to by name wherever it is declared: the model
crate has no egui (ADR 0001), and PanelSpec::icon already works this
way. A name is egui-pop’s (settings, history, the kebab-case
Icon::name), a Phosphor glyph’s (section 4.5) or one a plugin
registered (plugin-id:name, section 4.5). Every name is checked
against that vocabulary; resolution happens in egui-pop-core,
through Icon::by_name.
An unknown name is reported (a diagnostic naming the declarer, the surface and the name, ADR 0003) when the plugin connects and again when the theme is installed, and drawn as a neutral placeholder (the title’s first letter, as the activity bar does today), never silently dropped.
In code: egui_pop_core::icon::registry holds the vocabulary
(lookup, which keeps each answer; resolve, which also reports;
unknown; search), IconRef lets a widget take an Icon or a name,
and Source::named gives a tree row’s icon by name. egui-pop-api checks
every command’s, panel’s and frame’s icon when it resolves the
declarations (the unknown-icon diagnostic) and its icons collector
shows the whole of it to agents.
4.2 Command icons
CommandSpec gains two optional fields:
CommandSpec::new(id, "Show the grid", "View")
.icon("grid") // the action
.icon_on("grid-off") // optional: shown while `checked` holds
Every surface that runs a command reads them: menu items, the palette,
quick open entries that run commands, CommandButton, toolbars,
caption items, status items with a command, the shortcut editor, and
indicators made from a command (Indicator::toggle from icon and
icon_on). A caller may still pass an icon for one control (a
different size of the same idea), but the default is the command’s.
egui-pop’s own commands declare theirs from the built-in names, so
they show without the phosphor feature: Undo and Redo (undo,
redo, and the editor’s and the history’s), Cut, Copy, Paste and
Paste special (cut, copy, paste, paste-special, built-in names
added for them), Settings (settings), the command palette
(command), Full screen (fullscreen, exit-fullscreen while on),
the light and dark toggle (theme), the window’s Minimize, Maximize
(window-restore while maximized), Close and its menu, Back and Up in
the context stack (chevron-left, up), Find and Save in the editors
(search, save), the resets of the palettes and the arrangement
(reset). egui-pop declares no Select all command: a text field keeps
egui’s own.
An application sets the icon of a command it does not own (one of
egui-pop’s, another plugin’s) with Ctx::command_icon(id, icon, icon_on): both names replace the declared ones on every surface, the
last plugin to set one wins, and the change goes with its plugin. A
command that is not declared is reported (unknown-command), and the
names are checked as a declaration’s (unknown-icon, owned by the
plugin that set them). The commands collector gives icon_set_by,
the plugin whose icon is shown.
4.3 Object-kind icons
A kind is a namespaced id (<domain>/<kind>) mapped to an icon name,
declared by the plugin that owns the domain (ADR 0004) and listed in
the registry:
| Domain | Examples | Declared by |
|---|---|---|
panel/<id> | panel/egui_pop.jobs | PanelSpec::icon, unchanged |
frame/<id> | frame/darkroom | FrameSpec::icon, unchanged |
severity/<level> | severity/info, severity/warning, severity/error, severity/success | egui-pop |
file/<type> | file/folder, file/image, file/raw | egui-pop (folder, file), the application (its types) |
place/<id> | place/home, place/recent, place/bookmark | egui-pop’s file chooser |
job/<kind> | job/import, job/export | the application |
node/<kind> | node/blur | the application, on its graph kinds |
port/<type> | port/image, port/mask | the application, as a shape beside the colour |
settings/<section> | settings/appearance | the plugin owning the section |
4.4 The existing fields read from it
| Field | Becomes |
|---|---|
ListItem::icon: Option<Icon> | ListItem::icon(name) or ListItem::kind(kind); empty: the command’s icon; serialised for agents |
FrameSpec.icon | Unchanged as a declaration; the chips and the crumbs both read it |
PanelSpec::icon | Unchanged as a declaration; the activity bar, the strips and (when wanted) tabs read it, with the diagnostic of 4.1 |
Input::leading_icon, Attached::icon | Also accept a name or a kind (file/folder for a path field) |
TreeView::icon closure | Keeps returning a Source, with a new Source::kind(kind) so a tree names kinds instead of icons |
Indicator::icon, Indicator::toggle | Accept names; Indicator::command(id) takes the command’s icon pair |
| Hard-coded icons in widgets | Severities become severity/* kinds; chevrons used as disclosures become the disclosure-* glyph roles; the library’s painted marks become glyph roles |
4.5 Plugins and the vocabulary
A plugin registers its SVGs by name at connect time and declares its
kinds; both are owned by the plugin and removed with it. A plugin’s
own names are prefixed by its id, plugin-id:name (helios:mask-circle),
so two plugins never clash; egui-pop’s names stay bare.
The contributor’s removal cleans its registrations: when the
application API removes a plugin’s registrations (it is disconnected,
or it failed to connect), it calls
egui_pop_core::icon_set::unregister_owner with the plugin’s id. Its
names stop resolving at once, and their textures go at the next theme
install. An application registering icons outside a plugin calls
egui_pop_core::icon_set::unregister (one name) or unregister_owner
itself. A name keeps its id: registered again, it resolves to the same
icon.
The built-in vocabulary is about 57 names. With the phosphor feature
on (the default), every Phosphor glyph is in the font already, and they
are exposed by name, under the same prefixed form (phosphor:export),
which gives applications a large set with no SVG to ship. Without the
feature, a Phosphor name does not resolve and is reported as unknown.
4.6 What describe reports
- The
commandscollector gives each command’siconandicon_onnames, and whether each resolves. - A new
iconscollector lists the vocabulary (egui-pop’s names, each registered name with its owner and its paint, single-colour or full-colour), the kinds with their icon and owner, and the unresolved names with who declared them. - Menus, the palette, list entries, tree rows, status items and indicators report the icon name each entry shows, so an agent reads what is drawn without pixels.
5. The menu gutter (decided, 2026-10-22)
The rows of a menu already reserve an inline square on their left
(section 2.2). The gutter makes it a column with rules.
- Width. A new datum of the
menu-itemcomponent,gutter, defaulting to{size.icon.inline}plus{space.s}on each side: 24 points in the comfortable density, 16 in the compact one, since the density overlays move both tokens. Every row of a menu, with or without an icon, starts its label after the gutter, so labels align. Withmenus.iconsoff and no check or radio item, the gutter is not reserved. Built as a part of its own,menu-item-gutter, since the “on” frame needs states: itswidthterm is the gutter (the default above when not given,Kit::menu_gutter), itsselectedstate the frame. - Without an icon. A checked item draws the
checkglyph role in the gutter; the chosen item of a radio group draws theradioglyph role (a radio group is new: an item kind whosecheckedclause picks one of a group). A mixed state draws nothing, as Windows advises. - With an icon, “on”. The icon stays and is framed, as Word does:
a box the size of the gutter behind the icon, in a new
checkedstate ofmenu-item’s gutter (fill{surface.active}, a 1-point border in{accent.default}), so the state does not rest on the fill alone. A command with anicon_onshows that icon instead, framed the same way. - Busy. A running command shows the spinner in the gutter, as today, over whatever it holds.
- Columns on the right. The shortcut keeps its own column, right
aligned, in the
mutedtone; the submenu arrow (thesubmenuglyph role) takes the last column. A menu’s width is the widest label, plus the widest shortcut, plus the arrow, plus the gutter. - Disabled. The icon and the tick take the item’s disabled colour, as the label; the reason stays in the tooltip.
- High contrast. Icons are drawn in the item’s text colour, never in a tone; full-colour application icons are drawn as they are only when the theme is not a high-contrast one, else as their single-colour mask. The “on” frame keeps its border.
- Accessibility. The gutter is decorative: AccessKit reads the title, and a check or radio item is announced as checked or not.
- Tests. Labels of rows with and without icons start at the same x; a ticked row and a framed row; both densities; high contrast.
6. Delivery order
- This inventory, reviewed by the owner (decisions in section 7, 2026-10-22).
- The registry, model side:
CommandSpec::iconandicon_on, kind declarations, names checked with diagnostics, theiconscollector and the names indescribe;ListItemby name and serialised. Done, but for the kind declarations (<domain>/<kind>, section 4.3), left to step 6 with the surfaces that need them; the breadcrumb’s icons (from step 6) came with it. - Menus: the gutter of section 5, radio items, the
menus.iconssetting (defaulton); the gallery’s menus page with icons, ticks, radios, framed and disabled entries; snapshots and alignment tests; the extension template declares an icon on its command. Done (2026-10-27). - Command surfaces: the palette’s icon (when the command declares
one; done with step 3),
CommandButtonand caption items from the command, the shortcut editor; choice rows with icons (for quick open). - Icons out of widgets: severities as kinds (toasts, the editors’ gutter, the status bar’s counts, tips), disclosure chevrons as glyph roles (jobs centre, library, graph), the palette’s pin, the library’s marks as glyph roles.
- Object kinds where the table says required: the file chooser’s places and entries, the breadcrumb’s icons (hidden in the compact density), panel tabs’ icons behind a setting (off by default), the graph’s node kinds and port shapes, job kinds, settings sections.
- Toolbars: a toolbar component in egui-pop (overflow, icon or
text mode). Done (2026-10-28,
docs/toolbars.md), with icons on status items, on egui-pop’s own commands andCtx::command_icon. - Helios: icons for its panels, places and modes, commands (open, export, undo and redo, the masks tools, culling marks, view modes), mask kinds instead of emoji, job kinds, a workspace’s icon checked and shown, the caption’s bell from its command.
7. Decisions (2026-10-22)
The owner accepted the plan on 2026-10-22 and settled the open questions:
menus.iconsdefaults toon(the Word-like gutter);offandplatformare the other choices.- A checked command with an icon shows the icon framed, as Windows and Word do. Without an icon, the tick goes in the gutter.
- Phosphor glyphs are exposed by name, and every name is checked against the vocabulary.
- A plugin’s icon names are prefixed by its id:
plugin-id:name. - The breadcrumb shows an icon on every place that declares one, hidden in the compact density.
- Icons in panel tabs sit behind a setting, off by default. Folded strips (and the activity bar) always show icons.
- The command palette shows an icon when the command declares one.
- egui-pop gets a toolbar component.
8. An application’s own icons: the contract
The icon set (egui_pop_core::icon_set) is where an application or a
plugin adds SVG icons to the vocabulary. It belongs to the family
“Feedback, hints and icons” (ADR 0027).
Owns: registering SVGs by name, drawing them like egui-pop’s own
(Icon::Custom), rasterising them per icon size and pixel density, the
names agents read.
Refuses: an icon font as a default other than the bundled one; animated icons; colouring a full-colour icon.
use egui_pop_core::icon_set::{self, Paint};
const MASK: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle cx="8" cy="8" r="6"/></svg>"#;
fn setup() {
// An application's own name stays bare; a plugin's is prefixed by its id.
let icon = icon_set::register("mask-circle", MASK, Paint::Mono);
let theirs = icon_set::register_for("my-plugin", "mask-circle", MASK, Paint::Mono);
let _ = (icon, theirs, icon_set::by_name("my-plugin:mask-circle"));
}
A plugin calls Ctx::icon, which registers under its id. Once
registered, the name works everywhere a name does: CommandSpec::icon,
PanelSpec::icon, a kit’s glyphs (glyph.<role>: "<name>").
- Paint:
Paint::Monois a white mask tinted at draw with the colour the widget gives (one texture for every colour);Paint::Colouris drawn as it is (a logo). - Rasterising:
egui_pop_core::icon_set::install(run with the theme) rasterises every icon at the theme’ssize.icon.*and the window’s pixels per point; an icon drawn at another size is rasterised once at that size, then kept (a scaled texture would blur). - Registering again under a name replaces its SVG, in use from the
next theme install. A name keeps its id for the whole process, even
unregistered (
unregister,unregister_owner: the name stops resolving at once, its textures go at the next theme install) and registered again (see 4.5).
Failure: register refuses (IconError) a name of egui-pop’s own
or in the phosphor: name space (Taken), an SVG that does not parse
(Svg), and everything without the svg feature (Unsupported). A
name nobody registered is reported where it is declared and drawn as a
placeholder (4.1).
Accessibility: an icon is never a name; the widget drawing it takes its name from its command or its caller.
Tier: Supported with the icons, decided in API stability on 2026-11-15 (released since 0.8; the names and their prefixes are what declarations and kits store).
Tests: unit tests in crates/egui-pop-core/src/icon_set.rs (a name
and a mask, a plugin’s prefix, refusals, a kit glyph naming an
application icon, one texture per size, a size rasterised once);
frames in crates/egui-pop-core/tests/icon_set.rs (a mask tinted, a
full-colour icon drawn as it is, a size rasterised at that size, a name
drawn from the next install and gone at once when unregistered, the
refusal without the svg feature); commands drawn with their icons in
crates/egui-pop-api/tests/it/command_icons.rs.
Pointer gestures: a survey, and profiles instead of one rule
Status: design note, decided (study 2026-10-20; decisions 2026-10-20 and 2026-10-21, at the end). Section 7 keeps the questions as they were asked. It answers issue #47 (“Canvases: one rule for the mouse wheel and the middle button”) and its follow-up, which widened the scope to every pointer button, the modifier keys, trackpads, and the keymap.
The issue starts from one inconsistency (the image viewport zooms with the wheel, the node graph pans with it). The answer proposed here is not one fixed rule but profiles: named presets a user picks (“darktable”, “Adobe”, “Document”, “Blender / node editors”, “Trackpad”), stored as a layer of the keymap, with per-gesture overrides on top. Helios defaults to the darktable profile, because Helios users come from darktable.
Contents:
- What egui-pop does today
- How egui delivers the pointer
- The survey: two comparison tables
- darktable in detail
- Conflicts and platform constraints
- Proposed profiles, storage and overrides
- Open questions
- References
Conventions: “wheel” is a mouse wheel notch (MouseWheelUnit::Line);
“two-finger scroll” is a trackpad’s smooth scroll (Point); “Ctrl”
means Cmd on macOS wherever egui’s Modifiers::command applies
(section 5). Left/right are the logical primary/secondary buttons:
a left-handed setup swaps them in the OS and the app never sees it.
1. What egui-pop does today
Paths are relative to the repository; egui 0.36.2.
| Canvas / widget | Wheel | Shift + wheel | Ctrl + wheel / pinch | Left drag | Middle drag | Right click / drag | Double click |
|---|---|---|---|---|---|---|---|
Image viewport (viewport/src/widget.rs, Gestures) | zooms at the pointer; stops once at 100 % | pans (egui moved the delta to x) | zooms (zoom_delta branch) | pans on free canvas, moves a handle on a handle | pans anywhere | nothing | fit (DoubleClick::Fit); resets a handle |
Node graph (viewport/src/graph/mod.rs, egui Scene) | pans | pans horizontally | zooms at the pointer | rubber band (Shift/Ctrl add); moves nodes; draws wires | pans | click: menus (canvas, node, port); drag: pans | fits; collapses a node from its title |
Graph minimap (graph/minimap.rs) | zooms (does not consume the scroll) | pans (any button) | pans | pans | fits | ||
Image navigator (viewport/src/navigator.rs) | steps the zoom ladder (sign of the raw event) | moves the frame | fits | ||||
Library compare (views/src/library/compare.rs) | scrolls the parent | zooms at the pointer | pans (any button) | pans | pans | resets | |
Library grid (views/src/library/grid.rs) | scrolls | thumbnail size | rubber band | activates | |||
Curve editor (viewport/src/curve.rs) | nothing | moves a point (Ctrl finer, Shift coarser); adds on the curve | deletes a point | deletes a point; resets elsewhere | |||
| Colour wheels, histogram | nothing | relative drag (Ctrl finer, Shift coarser) | resets | ||||
Sliders (core/src/slider.rs, slider::Gestures) | scrolls the panel; steps the value only if focused or Alt held | relative drag (Ctrl finer, Shift coarser), any button | drags | drags | resets | ||
Lists, tree, table (views/src/select.rs) | scrolls | drag and drop | context menu (tree) | opens a branch / activates |
Also: Space + drag pans the viewport and the graph; Escape cancels a
drag; Gestures (viewport) and slider::Gestures live in context
slots meant for “input profiles”, but nothing sets them, nothing
persists them, and the settings window has no input section. The
keymap (model/src/keymap.rs, ADR 0007) knows keys only: Chord { ctrl, alt, shift, meta, key }. No code reads MouseWheelUnit, touch
events, pen pressure or tilt.
Inconsistencies a user meets:
- the plain wheel zooms (viewport, minimap), steps (navigator), pans (graph) or scrolls (library, sliders);
- the right button pans in the graph and the compare panes, deletes a point in the curve editor, opens a menu elsewhere, and does nothing on the viewport;
- some drags accept any button (minimap, compare, sliders), others one;
- the docs disagree: the graph page says Shift or Ctrl “adds”, the code toggles; lists say Ctrl toggles and Shift extends a range;
- the viewport’s “other wheel action” modifier is Shift while the rest of egui uses Ctrl for zoom.
2. How egui delivers the pointer
Read from egui 0.36.2 input_state/mod.rs and wheel_state.rs:
InputOptionsdefaults:zoom_modifier = COMMAND,horizontal_scroll_modifier = SHIFT,vertical_scroll_modifier = ALT,line_scroll_speed40 points native and 8 on the web,scroll_zoom_speed1/200.- Units are normalised early:
Line×line_scroll_speed,Page× the viewport height,Pointas is. After that,smooth_scroll_deltano longer says whether a wheel or a trackpad produced it. - With the zoom modifier held, the wheel goes into
zoom_deltaandsmooth_scroll_deltastays zero.zoom_delta()returns the multi-touch pinch when there is one, else that factor: a pinch and Ctrl + wheel look the same at that level. - Shift moves the whole delta to x; Alt forces it to y.
Scenepans withsmooth_scroll_deltaand zooms withzoom_delta; itsdrag_pan_buttonsdefault to all buttons.
Consequence: a profile cannot be implemented on top of
smooth_scroll_delta/zoom_delta. The canvases have to read the raw
Event::MouseWheel { unit, delta, modifiers } and Event::Zoom
(pinch) themselves, or the app sets InputOptions from the profile
(zoom_modifier, the two scroll modifiers) so egui’s conversion agrees
with it. The first is more precise (it keeps the line/point split); the
second keeps plain egui widgets (ScrollArea) consistent. Probably both:
InputOptions follow the profile for generic scrolling, and canvases
read raw events.
On the web, browsers deliver a trackpad pinch as a wheel event with
ctrlKey = true (Chrome, Firefox; Safari also has its own gesture
events), so on the web a pinch and Ctrl + wheel are indistinguishable
even in raw events, except by unit (a pinch has pixel deltas, a wheel
notch usually line deltas, depending on the browser).
3. The survey
Sources are cited by key; the keys are in section 8. “—” means nothing documented; “(s)” marks a secondary source (forum, blog, source code) where official docs are silent. darktable cells cite source files, see section 4.
3.1 Photo and painting applications
| Gesture | darktable | Lightroom Classic | Capture One | Photoshop | GIMP 3 | Krita (default profile) | Affinity Photo 2 | RawTherapee |
|---|---|---|---|---|---|---|---|---|
| Wheel on the image | zooms at the pointer, soft stops at fit/100 % [DT-zoom] | — (zoom is click/Space) [LR1] | zooms in steps (preference) [C1a] | scrolls vertically; zooms with “Zoom with Scroll Wheel” [PS1] | scrolls vertically [GI1] | zooms at the pointer [KR2] | scrolls vertically [AF1] | zooms at the pointer (s) [RT3] |
| Shift + wheel | on a mask: feather / hardness / compression [DT-masks] | — | — | — | scrolls horizontally [GI1] | — | scrolls horizontally [AF1] | — |
| Ctrl + wheel | zooms past the soft stops [DT-zoom]; on a mask: opacity | zooms (s) [LR6] | — | scrolls horizontally (s) [PS2] | zooms [GI2] | — | rotates the canvas (preference) [AF3] | resizes a colour picker (s) [RT3] |
| Alt + wheel | (colour zones: next channel) | — | scrolls the tool panel when wheel-on-slider is on [C1b] | zooms (s) [PS2] | tool opacity (Ctrl+Alt: size…) [GI3] | — | zooms [AF2] | — |
| Middle drag | — | — | — | — | pans [GI4] | pans; Ctrl: zoom; Shift: rotate [KR1] | — | — |
| Middle click | cycles 100 % → 200 % → fit at the pointer [DT-mid] | — | — | — | (GTK: paste) | — | — | — |
| Left drag on free canvas | pans [DT-drag] | pans once zoomed; hold-to-zoom [LR1] | pans with the Pan cursor [C1a] | tool | tool | tool | tool | pans with the hand tool [RT2] |
| Shift + left drag | crop: vertical only; path: Bezier one handle | Develop: scrubby zoom (s) [LR2] | — | adds to a selection; constrains [PS3] | adds (before); square (after) [GI5] | brush size [KR2] | constrains to 0/45/90° [AF1] | pans/scales the crop [RT2] |
| Ctrl + left drag | crop: horizontal only; ellipse/brush: rotates | zoom to a box (s) [LR2] | — | (Move: toggles auto-select) | subtracts (before); from centre (after) [GI5] | samples colour [KR2] | corner: scales from centre [AF1] | curves: fine (s) [RT2] |
| Alt + left drag | (ellipse: proportional feather on click) | brush: erase; crop: from centre [LR3] | — | moves a copy; subtracts a selection [PS3] | moves the outline [GI5] | — | subtracts a selection [AF1] | — |
| Space + drag | — | (Space toggles zoom) [LR1] | pans [C1a] | pans [PS3] | pans (preference) [GI6] | pans [KR1] | pans [AF4] | — |
| Double click on the image | back to the lighttable [DT-dbl] | Loupe ↔ Grid (s) [LR2] | Pan cursor: 100 % ↔ fit [C1a] | (on the Hand tool icon: fit) [PS3] | — | — | (on the View tool icon: fit) [AF2] | — |
| Right click on the image | straighten (draw the horizon) [DT-right] | context menu | floating navigator [C1a] | context menu [PS3] | image menu [GI1] | pop-up palette [KR1] | context menu [AF3] | back to the default cursor [RT2] |
| Two-finger scroll | pans [DT-tp] | — | pans (since 22, s) [C1c] | pans (macOS gestures) [PS1] | scrolls | pans (macOS, Wayland) [KR2] | pans [AF5] | — |
| Pinch | zooms [DT-tp] | — | zooms (s) [C1c] | zooms [PS1] | zooms or rotates (s) [GI7] | zooms and rotates (touch) [KR2] | zooms; two-finger double tap: 100 % [AF5] | — |
| Wheel over a slider | changes the value (Ctrl fine, Shift coarse); Ctrl+Alt scrolls the panel; preference swaps [DT-slider] | — | changes it if the preference is on; Alt scrolls [C1b] | steps a focused field (s) [PS4] | — | — | — | scrolls the panel; Shift + wheel changes the value [RT1] |
| Drag a slider | absolute; any modifier: relative, Ctrl fine, Shift coarse [DT-slider] | Shift finer (s) [LR4]; colour wheels: Alt fine [LR5] | — | scrubby label: Shift ×10 [PS5], Alt ÷10 (s) [PS4] [PS6] | Shift or right: fine; Ctrl: coarse [GI3] | Shift fine (relative), Ctrl snaps [KR3] | scrubby label [AF1] | hold still: fine [RT1] |
| Right click on a slider | fine-tune popup, type a value [DT-slider] | — | — | — | text edit, value selected [GI3] | text entry [KR3] | context menu | — |
| Double click on a slider | resets [DT-slider] | on the name: resets [LR3] | resets [C1d] | — | — | text entry [KR3] | — | (reset button) [RT2] |
| Thumbnail grid: Ctrl / Shift click | toggles / range [DT-lt] | toggles / range [LR3] | adds / range [C1e] | — | — | — | — | — |
| Thumbnail grid: Ctrl + wheel | thumbnails per row [DT-lt] | — | — | — | — | — | — | — |
3.2 Node editors, design tools and 3D
| Gesture | Blender 3D viewport | Blender node editors / 2D | Unreal Blueprint | Unity Shader Graph | ComfyUI (default “Drag Navigation”) | Figma | Inkscape 1.x |
|---|---|---|---|---|---|---|---|
| Wheel | zooms [BL1] | zooms [BL2] | zooms [UE1] | zooms [UN1] | zooms (“Standard” mode: pans) [CU1] | pans vertically; zooms with “Use scroll wheel zoom” [FI1] | scrolls vertically [IN1] |
| Shift + wheel | pans vertically [BL1] | pans vertically (s) | — | — | — | pans horizontally [FI1] | scrolls horizontally [IN1] |
| Ctrl + wheel | — | pans horizontally (s); over a field: steps the value [BL5] | zooms past 1:1 [UE1] | — | — | zooms [FI1] | zooms [IN1] |
| Alt + wheel | — | — | — | — | — | — | Selector: cycles stacked objects [IN1] |
| Middle drag | orbits; Shift: pans; Ctrl: zooms [BL1] | pans; Ctrl: zooms [BL2] | — | — | — | — (feature request) | pans; Shift: zoom box; Ctrl: rotates [IN1] |
| Middle click | — | — | — | — | — | — | zooms in; Shift: out [IN1] |
| Left drag on empty canvas | select box (left-click select) [BL3] | box select; Ctrl+Alt: lasso [BL4] | marquee [UE1] | marquee [UN1] | pans (“Standard”: selects) [CU1] | marquee [FI2] | rubber band [IN1] |
| Shift + left click / drag | extends the selection | adds [BL4] | adds [UE1] | — | adds [CU2] | toggles [FI2] | toggles / adds [IN1] |
| Ctrl + left click / drag | — | — | toggles / removes [UE1] | — | adds [CU2]; Ctrl+Shift drag: fast zoom [CU1] | deep select [FI2] | selects in groups; constrains a move [IN1] |
| Alt + left drag | (Industry Compatible: orbits) [BL6] | detaches links [BL4] | Alt+click a pin: breaks links [UE1] | pans [UN1] | — | duplicates (s) [FI3] | touch select [IN1] |
| Space + drag | — | — | — | (Space: create node) [UN2] | pans [CU2] | pans [FI1] | pans (preference) [IN1] |
| Right click | context menu (left-click select) [BL3] | context menu | context menu [UE1] | menu [UN1] | menu | context menu [FI2] | context menu; Ctrl: zoom in [IN1] |
| Right drag | — | Ctrl: cuts links; Ctrl+Alt: mutes [BL4] | pans [UE1] | — | — | pans (preference) [FI1] | Shift/Ctrl: pans [IN1] |
| Double click on canvas | — | — | goes to the node’s target [UE1] | — | opens node search [CU2] | enters a child [FI2] | edits / enters a group [IN1] |
| Two-finger scroll | orbits; Shift: pans; Ctrl: zooms [BL7] | pans | — | — | pans [CU1] | pans [FI1] | scrolls |
| Pinch | — | zooms | — | — | zooms [CU1] | zooms [FI1] | zooms [IN2] |
| Wheel over a value | Ctrl + wheel steps [BL5] | same | — | — | — | — | only after a click into the field; Ctrl: larger steps [IN2] |
| Presets offered | keymaps: Blender, 2.7x, Industry Compatible; Emulate 3 Button Mouse [BL6] | same | — | Shortcuts Manager [UN2] | Navigation Mode: Standard / Drag / Custom [CU1] | two checkboxes [FI1] | one toggle (removed in 1.1) [IN3] |
3.3 Patterns
- The plain wheel zooms in darktable, Krita, Capture One, RawTherapee, Blender, Unreal, Unity and ComfyUI’s default; it scrolls in Photoshop, Affinity, GIMP, Inkscape, Figma (document tools, which inherit the browser’s page model). Those move zoom to a modifier: Ctrl (GIMP, Inkscape, Figma) or Alt (Photoshop, Affinity).
- Almost every app has a toggle for it (Photoshop, Affinity, Figma, Capture One, ComfyUI). The richer ones ship presets: Blender keymaps, Krita input profiles named after rival apps, ComfyUI navigation modes; GIMP 3 has a button × modifier table and maps every wheel × modifier pair to any action.
- Space + drag pans nearly everywhere except Blender, Unreal, Unity (Space opens menus there) and Lightroom (Space toggles zoom).
- Middle drag pans in GIMP, Krita, Inkscape, Blender (orbits in 3D) and egui-pop; the Adobe tools and Capture One do not document it. On Linux, GTK binds the middle click to paste.
- The right button opens a context menu almost everywhere; the exceptions are useful: Unreal pans with a right drag, Figma can, Krita opens a palette, darktable straightens the horizon.
- A left drag on empty canvas is a marquee in design and node tools and pans in photo viewers (darktable, Lightroom zoomed, ComfyUI’s default). Shift adds almost everywhere; Ctrl toggles or subtracts; Alt duplicates in design tools.
- Wheel over a value is guarded in most apps (RawTherapee needs Shift, Inkscape a focus, Blender Ctrl, Capture One a preference). darktable is the exception that changes values on a plain wheel, with a preference to swap, and its users rely on it.
- Fine and coarse: Ctrl fine / Shift coarse (darktable, egui-pop today), Shift fine / Ctrl snap (Blender, Krita), Shift coarse / Alt fine (Photoshop scrubby labels, Adobe’s arrow keys, Lightroom’s colour wheels). No consensus: it belongs to the profile.
- Trackpads: two fingers pan and a pinch zooms everywhere except Blender’s 3D view (two fingers orbit).
4. darktable in detail
darktable is Helios’s reference. Read from darktable master as of
2026-10-11 (commit 6271f5378; most files cited are unchanged in the
Helios fork). Line numbers drift; the function names are the stable
reference. Paths are under src/.
4.1 Mouse gestures in the shortcut system
gui/accelerators.c binds mouse moves together with keys: a
dt_shortcut_t (accelerators.c:36) holds a key and modifiers, a
button bit mask (left, middle, right), a click kind (long, double,
triple), a move (dt_shortcut_move_t in accelerators.h:116:
scroll, pan = horizontal wheel, horizontal / vertical / diagonal / skew
drag) with a direction, and a speed. In dt_shortcut_dispatcher
(accelerators.c:4948):
- with no ordinary key held, mouse events go straight to the widget under the pointer; Ctrl + wheel or Shift + drag alone are never shortcuts. Mouse shortcuts are “hold a key, then scroll, drag or click” (e.g. hold a key and scroll to change a slider anywhere);
- while a key is held, the wheel becomes
MOVE_SCROLL/MOVE_PANunit steps (dt_gui_get_scroll_unit_deltas), the pointer becomes a move every 10 px whose kind follows the angle, buttons become the bit mask with double/triple/long clicks; tablet buttons above 7 are a separate device.
Fallbacks give extra modifiers and buttons a default meaning for a
whole class of actions (_action_fallbacks_value, accelerators.c:458;
slider fallbacks bauhaus.c:4516): Ctrl ×0.1, Shift ×10, left double
click = reset, Ctrl+Shift = beyond the soft limits, right button +
vertical move = zoom the slider’s range. They are off by default
(accel/enable_fallbacks).
Speed: dt_accel_get_speed_multiplier (accelerators.c:5634)
applies darkroom/ui/scale_step_multiplier (1),
scale_rough_step_multiplier (10, Shift) and
scale_precise_step_multiplier (0.1, Ctrl) to every wheel or drag step
on a widget, so Ctrl is fine and Shift coarse across darktable.
Editing: the visual mapping mode (libs/tools/global_toolbox.c,
_main_do_event_keymap) binds by doing: hover a widget, press a key or
key + button, or scroll while holding a key. The wheel over a widget in
that mode changes the shortcut’s speed, a middle click reverses its
direction. Shortcuts are saved as text tokens (left, middle,
right, double, long, move names). Conflicts are resolved at
insertion (_insert_shortcut, accelerators.c:1500): the dialog lists
clashing shortcuts across the views the action belongs to and asks to
remove them; an identical one offers to remove or disable a default.
4.2 Sliders, comboboxes and the side panel (bauhaus)
- Wheel (
_widget_scroll,bauhaus/bauhaus.c:3427): steps the slider (_slider_add_step: linear step × multiplier; log sliders multiply), toggles a toggle, moves a combobox to the next entry. Ctrl+Shift crosses the soft limits; in the outer 10 % of the slider, Ctrl+Shift+wheel zooms the slider’s visible range. - Panel or value: preference
darkroom/ui/sidebar_scroll_default(“mouse wheel scrolls modules side panel by default”, default off): off, the wheel changes the control under the pointer and Ctrl+Alt + wheel scrolls the panel; on, the reverse (gui/gtk.c,_dt_gui_ignore_scrolland_scroll_sidebar). - Left click / drag (
_widget_button_press,_widget_motion): a click in the bar jumps to the pointer and the drag is absolute; with any modifier the drag is relative and fine/coarse. - Left double click resets to the default; Ctrl + double click reapplies the module’s auto-presets.
- Right click opens the fine-tune popup: the further the pointer is from the line, the finer the drag; typing digits enters a value; the wheel zooms the range; a middle click resets the zoom.
- Middle click toggles the soft and the hard range.
- Notebook tabs: the wheel switches tab; a double click on a tab resets every slider on it. Module groups: the wheel cycles groups; right click opens the manager. Module header: left click expands (Shift inverts “single module”), Ctrl+click renames the instance, right click opens presets, a drag reorders the pipe.
4.3 Darkroom image
Events go first to the colour picker, then the masks, then the focused
module, and only then to the view (views/darkroom.c, button_pressed,
mouse_moved, scrolled). Holding A bypasses masks and modules
(“force pan/zoom/rotate with mouse”).
- Wheel zooms anchored on the pointer (
dt_dev_zoom_move(DT_ZOOM_SCROLL), anchoring indevelop/develop.c_dev_zoom_move): ×1.1 per notch below 200 %, ×2 above; fit, 100 % and 200 % are stops; withdarkroom/ui/constrain_zoom(on) the zoom stays between fit and 100 %; Ctrl + wheel lifts the stops and limits. Shift and Alt have no zoom meaning (masks and modules see them first). - Left drag on free image pans; while a mask or module drags, the view only auto-pans past the border.
- Left double click (not taken by a mask or module) returns to the lighttable.
- Middle click zooms at the pointer: 100 % → 200 % → fit with
darkroom/mouse/middle_button_cycle_zoom_to_200_percent(on), fit ↔ 100 % otherwise; Ctrl + middle forces the 200 % step. - Right drag draws a horizon line handed to the rotate and
perspective module (
dev->proxy.rotate); masks consume right clicks. - Touchpad (
darkroom/ui/touchpad_gestures, on;dt_gui_scroll_should_paningui/gtk.c): a smooth scroll from a touchpad pans instead of zooming, unless Ctrl is held; a pinch zooms (GtkGestureZoom); a touchscreen one-finger drag is a mouse move. Smooth deltas are attenuated (_scroll_proxy_real), wheel notches are not. - Pen: pressure is read for pen devices and used by the brush mask
(
pressure_sensitivity,brush_smoothing); tilt is not used. - No left-handed, natural-scrolling or inverted-wheel option: darktable
leaves those to the OS, except
masks_scroll_down_increases. - Navigation minimap (
libs/navigation.c): left or right drag centres the view, middle click runs the zoom cycle, the wheel zooms at the mapped point (Ctrl lifts the limits), touchpad pans, pinch zooms.
4.4 Masks and on-image tools
The wheel and its modifiers change what is adjusted (not only how
finely) on a hovered or selected shape (develop/masks/*.c, size step
×0.97):
| Shape | Wheel | Shift + wheel | Ctrl + wheel | Ctrl+Shift + wheel | Clicks and drags |
|---|---|---|---|---|---|
| Circle | size | feather | opacity | drag moves; Shift(+Ctrl)+click while creating places the clone source; right click deletes | |
| Ellipse | radii | feather | opacity | rotation | Alt+click proportional feather; Ctrl+drag rotates |
| Brush | size | hardness | opacity | drag paints with pressure; Ctrl+drag rotates; Shift+click on a segment adds a node; right click deletes a node or the shape | |
| Path | grows / shrinks | feather | opacity | resize around the centroid | click adds a node, Ctrl+click a sharp one; right click closes / deletes |
| Gradient | curvature | compression | opacity | double click resets curvature; Shift+click linear ↔ sigmoid | |
| Liquify | radius and strength | strength | strength direction | Ctrl+click adds a node; Ctrl+Alt+click line ↔ curve; right click cancels |
Ctrl + click on a shape button keeps creating shapes of that kind. Crop: Shift+drag moves vertically only, Ctrl+drag horizontally only, Shift on an edge resizes around the centre, right click resets. Rotate and perspective: right drag draws the horizon; Shift + left / right drag selects / deselects lines in a box; the wheel scales the selection radius.
4.5 Curves
Tone curve, base curve, RGB curve (iop/tonecurve.c, rgbcurve.c):
hovering selects the nearest node; the wheel moves it vertically
(0.001 × multiplier: Ctrl fine, Shift coarse); a drag moves or adds;
Ctrl+click adds at the pointer’s x; a double click resets the curve; a
right click deletes a node (resets an endpoint). A + wheel zooms the
graph (RGB curve). Colour zones: Alt + wheel switches the channel tab;
in “edit by area” the wheel sets the brush radius; Ctrl + right click
sets a node to zero. RGB levels: the wheel moves the active handle.
4.6 Lighttable and culling
- File manager: the wheel scrolls one row (or pixels with
thumbtable_fractional_scrolling); Ctrl + wheel changes the thumbnails per row; Ctrl/Cmd+click toggles, Shift+click selects a range, a click on empty space clears; selection happens on release; a double click opens the darkroom. No rubber band, nothing on middle or right click. Dragging thumbnails exports ids and URIs. - Zoomable lighttable: the wheel zooms, a left drag pans, touchpad pans, pinch zooms.
- Filmstrip: the wheel moves one image, Shift + wheel a page, Ctrl + wheel resizes the bottom panel.
- Culling / preview (
dtgtk/culling.c): the wheel goes to the next image; Ctrl + wheel zooms all images, Ctrl+Shift + wheel only the hovered one; a left drag pans all, Shift + drag only the hovered one; a middle click toggles 100 % (Shift: hovered only). - Map view: the wheel zooms at the pointer; over a location shape, plain / Shift / Ctrl + wheel resize both / one / the other radius.
4.7 What darktable teaches
- The wheel is overloaded on purpose and follows the pointer: over the image it zooms, over a shape it sizes it, over a curve node it moves it, over a slider it changes it, over a thumbnail grid it scrolls. Users expect the object under the pointer to take the wheel.
- Modifiers on the wheel mean fine/coarse on values (Ctrl / Shift)
but another parameter on shapes (Shift = feather, Ctrl =
opacity). egui-pop’s rule “a modifier never changes what a gesture
adjusts, only how finely” (
gestures.rs) does not hold there; the profile must allow both, per canvas kind. - Ctrl + wheel “lifts the limits” on zoom, and the ladder has stops at fit, 100 % and 200 %: the same idea as egui-pop’s 100 % detent.
- A guarded escape hatch exists for the panel: Ctrl+Alt + wheel, and a preference to swap the default.
- Mouse shortcuts in the keymap are keyed (hold a key + scroll/drag); plain modifier + pointer gestures are hard-wired in the widgets. egui-pop can do better: bind modifier + pointer gestures in the keymap directly.
5. Conflicts and platform constraints
- Linux window managers. GNOME (mutter) uses Super + left drag
to move a window, Super + middle to resize, Super + right for the
window menu (
mouse-button-modifier). KDE (KWin) now defaults to Meta, or Alt if chosen; it moved away from Alt partly because of conflicts with GIMP and Blender. Xfce still uses Alt + drag, and Alt + wheel zooms the whole desktop. So: no default binding should rely on Alt + drag or Super + anything; Alt + wheel is unreliable on Xfce. A profile that uses Alt (Adobe: Alt + wheel zooms) needs a warning in the editor on Linux. - macOS. Cmd plays Ctrl’s role; egui’s
Modifiers::command(and egui-pop’s keymap, which maps Cmd toctrl) already handles it. Ctrl + click is a secondary click, so “Ctrl + left click” must not be bound on macOS unless it means the context menu. A two-finger click or tap is the secondary click. - Browsers. Ctrl + wheel zooms the page. A web build must take the
wheel event with a non-passive listener and
preventDefaultbefore the browser (to verify: whether eframe’s web runner already does this when egui wants the pointer). A trackpad pinch also arrives as Ctrl + wheel. Firefox’s Shift + right click bypasses the page’s context menu; on Windows a middle click starts autoscroll and on Linux pastes. - Trackpads. A trackpad emits
Pointunits; a wheelLineunits. This split is the cheapest way to tell them apart, but it is not reliable: some mice (Apple Magic Mouse, high-resolution and free-spinning wheels on Linux with libinput, browsers that report pixels) emitPointunits too. darktable uses GDK’s source device (GDK_SOURCE_TOUCHPAD) instead, which egui does not expose. A per-device override (“this wheel is a mouse”) is the escape hatch. - Pinch vs Ctrl + wheel. egui merges them in
zoom_delta(); Windows legacy apps and browsers deliver pinch as Ctrl + wheel. A profile cannot give Ctrl + wheel a different meaning from pinch on those platforms; the profiles below keep them compatible (Ctrl + wheel is some kind of zoom in every profile but Adobe’s, where it scrolls horizontally, as in Photoshop). - Left-handed setups. The OS swaps the buttons; egui receives the logical primary button. Nothing to do, except never naming the buttons “left/right” in the UI (say “primary/secondary”, or follow the OS). Krita offers a Ctrl/Alt swap for keyboards without a right Alt.
- Pen and touch. egui gives touch events and a pinch, not pen pressure or tilt. Pen buttons arrive as mouse buttons. Out of scope here, but the gesture model should not assume a wheel exists: the Trackpad profile covers pens and touchscreens too.
- Middle button absent (trackpads, many laptops): every middle gesture needs an alternative (Space + drag, or Blender-style “emulate 3 buttons” with Alt + left, which hits the Linux WM).
6. Proposed profiles
6.1 The model
Gesture actions are commands like any other, with an argument (the amount, the delta), grouped per canvas kind:
- view:
view.zoom(at the pointer),view.zoom_free(no stops or limits),view.pan,view.pan_x,view.pan_y,view.zoom_cycle(fit → 100 % → 200 %),view.fit,view.zoom_box,view.leave(the app’s “back” action: darktable’s double click); - selection:
select.replace,select.add,select.toggle,select.range,select.box,select.box_add; - objects:
object.move,object.move_constrained,object.duplicate,object.menu; - values:
value.step,value.step_fine,value.step_coarse,value.reset,value.edit(typed entry / fine-tune popup),value.beyond_limits; - handles (masks, nodes, points):
handle.size,handle.feather,handle.opacity,handle.rotate,handle.delete,handle.reset; panel.scroll,panel.scroll_x.
Pointer triggers extend the keymap’s Chord: the same
ctrl/alt/shift/meta modifiers, plus a pointer part instead of a key:
Wheel WheelX Scroll ScrollX Pinch (Wheel = line units, Scroll = point units)
Primary Secondary Middle Back Forward (+ Click, DoubleClick, Drag, LongPress)
Space+PrimaryDrag (a held key + a pointer gesture, as darktable)
e.g. "Ctrl+Wheel", "Shift+MiddleDrag", "Space+PrimaryDrag",
"SecondaryClick", "Pinch". A trigger is bound in a scope, one
per canvas kind (surface:canvas.image, canvas.graph, canvas.curve,
canvas.minimap, widget.value, widget.list, widget.grid) and,
inside a canvas, on a target: empty canvas, a handle or node, a
port. The keymap’s existing layers (default, workspace, user), when
clauses, resolve trace and conflicts() apply unchanged.
A profile is a named set of default-layer bindings for every scope
(as Blender’s keymap presets and Krita’s input profiles), plus the
InputOptions it implies (zoom and scroll modifiers). Choosing a
profile is one setting, input.pointer_profile. Overrides are
ordinary user-layer bindings on top, and survive a profile change
(ComfyUI instead flips to “Custom”; Blender copies the preset). The
shortcuts editor shows the profile name with “(2 changes)”, a filter
“pointer gestures”, and a “reset to profile” per binding.
Two global options sit beside the profile, because they cut across all of them: wheel device (auto from units / always a mouse / always a trackpad) and zoom direction (wheel up zooms in / out).
The canvases read the resolved bindings (a Gestures per canvas kind,
built from the keymap) instead of their own defaults; Scene’s input
handling is switched off for the graph and its transform driven from
the same resolution. The modifiers held change the cursor and, where a
status line exists, a hint (“drag: pan · Shift: add · Ctrl: toggle”),
using the cursor query that already carries the modifiers
(cursors.md).
6.2 The profiles
Cells name the action; “—” means unbound (it falls through to the parent, e.g. the panel scrolls). In every profile: Escape cancels a drag, two-finger scroll pans and pinch zooms on canvases (the Trackpad profile only changes the rest), primary click / Shift / Ctrl on lists and grids select / range / toggle (the OS convention, not a profile matter), and a secondary click on an object opens its menu unless the table says otherwise.
A. darktable (default for Helios)
Close to darktable as section 4 reads it; where darktable has no such canvas (the node graph), it follows node editors.
| Trigger | Image viewport | Node graph | Curves | Minimap / navigator | Sliders / values | Lists / grids |
|---|---|---|---|---|---|---|
| Wheel | zoom at pointer, stops at fit/100/200 % | zoom at pointer | over a point: move it (value.step) | zoom at mapped point | value.step | scroll; grid: — |
| Shift + wheel | over a handle: feather; else pan x | pan x | coarse step | — | coarse step | scroll x |
| Ctrl + wheel | zoom free; over a handle: opacity | zoom free | fine step | zoom free | fine step | grid: thumbnails per row |
| Ctrl+Alt + wheel | panel.scroll | panel.scroll | panel.scroll | panel.scroll | panel.scroll | — |
| Alt + wheel | — | — | (colour-zones style: next channel) | — | — | — |
| Primary drag, empty | pan | box select | add a point / move | move the frame | absolute drag | rubber band |
| Shift + primary drag | handle: constrain / one handle | box add | coarse move | coarse | relative coarse | extend |
| Ctrl + primary drag | handle: rotate | box toggle | fine move | fine | relative fine | toggle |
| Space + primary drag | pan | pan | — | — | — | — |
| Middle drag | pan | pan | — | pan | — | — |
| Middle click | zoom cycle 100 → 200 → fit at pointer | fit | — | zoom cycle | soft ↔ hard range | — |
| Primary double click | view.leave (back to the browser) | fit; on a node title: collapse | reset curve; on a point: delete | fit | reset | activate |
| Secondary click | handle: delete; empty: — | menu | delete point | centre | value.edit (fine-tune, type) | menu |
| Secondary drag | tool secondary (straighten) | — | — | centre | — | — |
| Two-finger scroll | pan | pan | — | pan | panel.scroll | scroll |
| Pinch | zoom | zoom | — | zoom | — | grid: thumbnail size |
Preference “the wheel scrolls the side panel” (darktable’s
sidebar_scroll_default) swaps value.step and panel.scroll on
widgets.
B. Adobe (Lightroom Classic, Photoshop, Capture One-ish)
The proposal, as first made; since 2026-10-22 it ships as two profiles, Photoshop and Lightroom Classic, each following its application (the notes after the table).
| Trigger | Image viewport | Node graph | Curves | Minimap / navigator | Sliders / values | Lists / grids |
|---|---|---|---|---|---|---|
| Wheel | pan y (“Zoom with scroll wheel” toggles to zoom) | pan y | — | — | panel.scroll | scroll |
| Shift + wheel | pan x | pan x | — | — | panel.scroll | scroll x |
| Ctrl + wheel | pan x (Photoshop) — or zoom if pinch must equal Ctrl + wheel (open question) | zoom | — | — | panel.scroll | — |
| Alt + wheel | zoom at pointer | zoom | — | zoom | — | — |
| Primary click, empty | zoom toggle fit ↔ 100 % at pointer (Lightroom) | clear selection | add point | centre | jump | select |
| Primary drag, empty | pan when zoomed | box select | move point | move frame | absolute drag | rubber band |
| Shift + primary drag | constrain; scrubby zoom | box add | constrain | — | coarse | extend |
| Ctrl + primary drag | zoom box | box toggle | — | — | — | toggle |
| Alt + primary drag | duplicate / from centre | duplicate selection | — | — | fine | — |
| Space + primary drag | pan | pan | — | — | — | — |
| Space+Ctrl + click / Space+Alt + click | zoom in / zoom out | same | — | — | — | — |
| Middle drag / click | pan / — | pan / — | — | — | — | — |
| Primary double click | fit | fit | delete point | fit | on the label: reset | activate |
| Secondary click | menu | menu | menu | — | menu | menu |
| Two-finger scroll / pinch | pan / zoom | pan / zoom | — | pan / zoom | panel.scroll | scroll |
Photoshop and Lightroom Classic (2026-10-22). A profile follows the application it is named after; where that application has no equivalent, the gesture is left unbound rather than invented.
Photoshop (photoshop):
- Image: the wheel scrolls vertically [PS1], Ctrl + wheel sideways and
Alt + wheel zooms (s) [PS2]; Shift + wheel is not documented and
left unbound. A primary drag pans, as the Hand tool [PS1]. A click
does nothing: only the Zoom tool zooms on a click [PS1], and an
image viewer is under the Hand tool. A double click on the image
does nothing either (
image_double_click: nothing); Photoshop’s double clicks that fit or show 100 % are on the Hand and Zoom tools’ icons [PS1]. The middle button is not documented: unbound. Two fingers pan and a pinch zooms [PS1]. - Values: Shift + drag ten times coarser [PS5], Alt (Option) + drag ten times finer (s) [PS4] [PS6], Ctrl nothing. The arrows follow the drag: Shift with them is coarser, as Shift with the Up and Down Arrow keys steps a pop-up slider by 10 % [PS5]. Alt with a drag comes with the shortcuts editor’s Linux warning (Xfce and KWin take it).
Lightroom Classic (lightroom):
- Image: a click toggles the two zoom levels, fit and 1:1 [LR1]; a
primary drag pans, as the Hand tool in the Loupe [LR1]. A double
click goes from the Loupe back to the Grid (s) [LR2]: the profile
leaves the view (
image_double_click: leave). The double click’s first click toggles the zoom; its second press runs the double click alone, as in every profile, so the zoom left behind is whatever that first click gave, which no longer matters once the view is left. The plain wheel neither zooms nor pans the Loupe [LR1], and Ctrl + wheel zooms (s) [LR6]; Shift and Alt with the wheel and the middle button are not documented: unbound. Lightroom’s Space toggles the zoom, and held with a press zooms in to pan [LR1]; egui-pop’s Space + drag pans in every profile, which comes close. Shift + drag (scrubby zoom) and Ctrl + drag (zoom to a box) in Develop (s) [LR2] have no gesture command yet: unbound. - Values: a Shift drag on a Develop slider is slower, for fine tuning
(s) [LR4]; no modifier makes a drag coarser; Alt while dragging a
Basic panel slider shows the clipped areas [LR5], an application’s
matter, so Alt + drag is unbound. The arrows take their own
modifiers (
value_keys): Shift with them gives larger increments [LR3], Alt smaller ones (s) [LR4]. Alt on the colour wheels is a fine adjust mode [LR5], which a wheel widget of an application’s own may follow.
Neither application has a node graph: both profiles take Photoshop’s canvas wheel there (the wheel pans, Ctrl + wheel pans sideways, Alt + wheel zooms; two fingers and a pinch as everywhere), and Space + drag pans it.
The id adobe, the single profile shipped before 2026-10-22, is an
alias of lightroom, the closer of the two for a photo editor: an
application or a saved setting naming it gets Lightroom Classic
(pointer::ALIASES; the settings document’s version 2 rewrites it).
No picker lists it.
C. Document (GIMP, Inkscape, Figma, the web)
Everything scrolls like a page; zoom is Ctrl + wheel (the browser’s own convention, so it is also the natural web default).
| Trigger | Image viewport | Node graph | Curves | Minimap / navigator | Sliders / values | Lists / grids |
|---|---|---|---|---|---|---|
| Wheel | pan y | pan y | — | — | panel.scroll | scroll |
| Shift + wheel | pan x | pan x | — | — | panel.scroll | scroll x |
| Ctrl + wheel | zoom at pointer | zoom at pointer | — | zoom | when focused: coarse step | grid: thumbnail size |
| Primary drag, empty | tool / pan if no tool | box select | add / move | move frame | GIMP: absolute | rubber band |
| Shift + / Ctrl + primary drag | add / subtract (GIMP) | box add / toggle | coarse / fine | — | fine (Shift) / coarse (Ctrl) | extend / toggle |
| Space + primary drag | pan | pan | — | — | — | — |
| Middle drag | pan | pan | — | pan | value.edit (GIMP) | autoscroll / — |
| Shift + middle drag / Ctrl + middle drag | zoom box / zoom | zoom box / zoom | — | — | — | — |
| Primary double click | — | enter / fit | delete point | fit | — | activate |
| Secondary click | menu | menu | menu | — | value.edit | menu |
| Secondary drag | — | pan (Figma option) | — | — | fine drag (GIMP) | — |
| Two-finger scroll / pinch | pan / zoom | pan / zoom | — | pan / zoom | panel.scroll | scroll |
D. Blender / node editors (Blender, Unreal, Unity, ComfyUI, Houdini)
| Trigger | Image viewport | Node graph | Curves | Minimap / navigator | Sliders / values | Lists / grids |
|---|---|---|---|---|---|---|
| Wheel | zoom at pointer | zoom at pointer | — | zoom | panel.scroll | scroll |
| Shift + wheel | pan y | pan y | — | — | panel.scroll | — |
| Ctrl + wheel | pan x | pan x | step point | — | value.step | — |
| Primary drag, empty | box select / tool | box select | move point | move frame | relative drag | rubber band |
| Shift + primary drag | box add | box add | fine | — | fine | extend |
| Ctrl + primary drag | box remove (Unreal) | box remove | snap | — | snap | toggle |
| Ctrl+Alt + primary drag | lasso | lasso | — | — | — | — |
| Middle drag | pan | pan | — | pan | — | — |
| Ctrl + middle drag | zoom (scrubby) | zoom | — | — | — | — |
| Secondary click | menu | menu | menu | — | menu | menu |
| Secondary drag | — | Ctrl: cut links (Blender); plain: pan (Unreal) | — | — | — | — |
| Primary double click | fit | fit / open group | reset | fit | value.edit | activate |
| Alt + primary drag | (emulate middle, off by default) | detach links | — | — | — | — |
| Two-finger scroll / pinch | pan / zoom | pan / zoom | — | pan / zoom | panel.scroll | scroll |
Reset a value: Backspace over it (Blender), plus double click.
E. Trackpad (laptops, tablets, no middle button)
For devices with no wheel and no middle button. Never changes values on scroll (accidental edits are the main complaint on trackpads).
| Trigger | Image viewport | Node graph | Curves | Minimap / navigator | Sliders / values | Lists / grids |
|---|---|---|---|---|---|---|
| Two-finger scroll | pan | pan | — | pan | panel.scroll | scroll |
| Pinch | zoom at pointer | zoom | — | zoom | — | grid: thumbnail size |
| Ctrl (Cmd) + two-finger scroll | zoom | zoom | fine step | zoom | value.step | — |
| Two-finger double tap (where the OS sends it) | zoom toggle fit ↔ 100 % | fit | — | fit | — | — |
| Primary drag, empty | pan (image) | box select | move | move frame | relative drag | rubber band |
| Space + primary drag | pan | pan | — | — | — | — |
| Shift / Ctrl + primary drag | coarse / fine on handles | box add / toggle | coarse / fine | — | coarse / fine | extend / toggle |
| Secondary click (two-finger click) | menu | menu | delete point | — | value.edit | menu |
| Primary double click | fit | fit | reset | fit | reset | activate |
| Long press | menu | menu | — | — | value.edit | menu |
6.3 Defaults
- Helios: the darktable profile, with the wheel device on “auto”
(line units zoom, point units pan, as darktable’s
touchpad_gestures). - egui-pop’s gallery (and the library’s built-in default): also the darktable profile for canvases. It is what issue #47 proposed (wheel zooms, middle pans, smooth scroll pans, pinch zooms) and what node editors do; only the sliders differ: the gallery keeps today’s guarded wheel (panel scroll unless focused or a modifier is held), since a library default should not edit values by accident. On the web build, “Document” is the safer first choice if taking Ctrl + wheel from the browser proves unreliable (open question).
- A profile picker in the settings’ input section (“Pointer: darktable / Adobe / Document / Blender / Trackpad”), with a one-line description and a link to the shortcuts editor filtered on pointer gestures.
6.4 Steps (once the questions are settled)
Chordgains a pointer part; the keymap schema version goes up; parsing and the editor’s capture accept wheel, clicks and drags.- Gesture actions as commands; per-canvas
Gesturesresolved from the keymap and published in the context slots that exist today. - Canvases read raw wheel events (unit, modifiers) and
Event::Zoom; the graph drivesScene’s transform itself;InputOptionsfollow the profile. - Profiles as default-layer documents shipped with the library; Helios selects darktable.
- Cursor and status hints from the resolved bindings.
- kittest tests per profile and canvas: line wheel, point scroll, pinch, middle drag, each modifier.
- One gestures page in the docs, linked from the viewport, graph, slider and shortcuts pages.
7. Open questions
- Profiles at all: is the profile set (darktable, Adobe, Document, Blender / node editors, Trackpad) right, too many, or missing one (Krita, Capture One)? Should Helios ship all five or only darktable plus Trackpad?
- Gallery default: darktable for canvases with guarded sliders (as proposed), or Document on the web build only?
- Pointer gestures in the keymap document (one editor, one conflict check, a schema bump) or in a sibling “pointer map” document shown in the same editor?
- Overrides across a profile change: keep them (proposed) or reset them like ComfyUI’s “Custom”?
- Wheel over sliders in the darktable profile: change the value (darktable’s default) with Ctrl+Alt + wheel for the panel, or egui-pop’s guard (focus or a modifier)?
- Modifiers change what, or how finely: darktable’s masks use
Shift + wheel for feather and Ctrl + wheel for opacity, against the
rule in
gestures.rs. Accept “per target” meanings in the profile? - Primary double click on the image: darktable leaves for the
lighttable; the viewport today fits. Map it to
view.leavein Helios’s darktable profile (the app decides what “leave” means) or keep fit? - Primary drag on an empty image: pan (darktable, Lightroom) in every profile for the image viewport, and box select only on the graph?
- Secondary button: context menu everywhere except where a profile says otherwise (darktable: slider fine-tune, straighten on the image; Unreal: pan)? The graph pans with a right drag today; keep it in the darktable profile?
- Fine/coarse modifiers: Ctrl fine / Shift coarse (darktable, today) everywhere, or per profile (Blender and Krita: Shift fine)?
- Alt: should any default use Alt (Adobe’s Alt + wheel zoom), given Xfce and KWin-with-Alt? Warn in the editor on Linux, or avoid?
- Ctrl + wheel on the web: take it from the browser (every profile zooms with it) or bind zoom elsewhere on the web?
- Device split: is the line/point unit split enough, with a “wheel device” override, or do we need per-device settings (egui does not expose the device)?
- Scope of a profile: do profiles also carry the keyboard navigation keys (Space, +/-, 0/1/2, arrows), like Blender’s keymaps, or pointer gestures only?
- Held-key + pointer bindings (darktable’s “hold a key and scroll to change that slider”): in scope now, or later?
8. References
darktable: source files and functions cited in section 4, from
https://github.com/darktable-org/darktable/tree/6271f5378/src.
Short keys used in section 3.1: [DT-zoom] views/darkroom.c scrolled,
develop/develop.c _dev_zoom_move; [DT-masks] develop/masks/*.c;
[DT-mid] develop/develop.c (zoom cycle), views/darkroom.c
button_pressed; [DT-drag], [DT-dbl], [DT-right] views/darkroom.c
button_pressed / mouse_moved; [DT-tp] gui/gtk.c
dt_gui_scroll_should_pan, views/darkroom.c gesture_pan,
gesture_pinch; [DT-slider] bauhaus/bauhaus.c _widget_scroll,
_widget_button_press, gui/gtk.c _dt_gui_ignore_scroll;
[DT-lt] dtgtk/thumbtable.c.
Adobe and Capture One help pages were read through web.archive.org snapshots (they refuse automated fetches); the URLs are the originals.
- [PS1] https://helpx.adobe.com/photoshop/using/viewing-images.html
- [PS2] (s) https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-can-i-change-zoom-and-scroll-modifiers-in-photoshop/td-p/14833929
- [PS3] https://helpx.adobe.com/photoshop/using/default-keyboard-shortcuts.html
- [PS4] (s) https://planetphotoshop.com/scrubby-slider-shift-click-trick.html
- [PS5] https://helpx.adobe.com/photoshop/using/panels-menus.html (scrubby sliders: “Holding down the Shift key while dragging accelerates the scrubbing by a factor of 10”; pop-up sliders: Shift with the Up or Down Arrow key changes the value in 10 % increments)
- [PS6] (s) https://planetphotoshop.com/micro-control-of-scrubby-sliders.html (Option or Alt: “the sliders change at 1/10 speed”)
- [LR1] https://helpx.adobe.com/lightroom-classic/help/view-photos.html
- [LR2] (s) https://jkost.com/blog/2020/07/zooming-in-lightroom-classic.html
- [LR3] https://helpx.adobe.com/lightroom-classic/help/keyboard-shortcuts.html (Develop module: “Increase/decrease selected slider in larger increments: Shift + Up Arrow / Shift + Down Arrow”)
- [LR4] (s) https://community.adobe.com/t5/lightroom-classic-discussions/sliders-in-the-develop-module/m-p/9359357 (a Community Expert: Shift while dragging “will slow the slider down”; with the pointer over a slider, Shift with the Up and Down Arrow keys increases the increments, Alt or Option makes them smaller)
- [LR5] https://helpx.adobe.com/lightroom-classic/help/image-tone-color.html (colour wheels: “Alt (Windows)/Option (macOS): Fine Adjust mode”; Basic panel: Alt or Option while moving a slider shows the clipped areas)
- [LR6] (s) https://community.adobe.com/t5/lightroom-classic-discussions/zoom-with-mouse-scroll-wheel-windows-11-lr-classic-13-3-1/m-p/15061527 (a Community Expert: zoom in the Grid and the Loupe by holding Ctrl with the mouse wheel)
- [C1a] https://support.captureone.com/hc/en-us/articles/360002473237
- [C1b] https://support.captureone.com/hc/en-us/articles/360002484097
- [C1c] (s) https://support.captureone.com/hc/es/community/posts/4416440456721-Zoom-with-trackpad
- [C1d] https://www.captureone.com/blog/11-nifty-tips-and-tricks-for-capture-one
- [C1e] https://support.captureone.com/hc/en-us/articles/360002480877
- [GI1] https://docs.gimp.org/3.0/en/gimp-image-window.html
- [GI2] https://docs.gimp.org/3.0/en/gimp-tool-zoom.html
- [GI3] https://docs.gimp.org/3.0/en/gimp-tools.html
- [GI4] https://docs.gimp.org/3.0/en/gimp-prefs-canvas-modifiers.html
- [GI5] https://docs.gimp.org/3.0/en/gimp-tools-selection.html
- [GI6] https://docs.gimp.org/3.0/en/gimp-prefs-canvas-interaction.html, wheel mapping: https://docs.gimp.org/3.0/en/gimp-prefs-input-controllers.html
- [GI7] (s) https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/401
- [KR1] https://docs.krita.org/en/user_manual/getting_started/navigation.html
- [KR2] (s, source) https://invent.kde.org/graphics/krita/-/raw/master/krita/data/input/kritadefault.profile and the sibling profiles (Photoshop, SAI, Clip Studio compatible)
- [KR3] https://docs.krita.org/en/reference_manual/special_widgets.html
- [AF1] https://affinity.help/photo2/en-US.lproj/pages/Workspace/shortcuts.html
- [AF2] https://affinity.help/photo2/en-US.lproj/pages/GetStarted/zoom.html
- [AF3] https://affinity.help/photo2/en-US.lproj/pages/Workspace/preferences.html
- [AF4] https://affinity.help/photo2/en-US.lproj/pages/GetStarted/pan.html
- [AF5] https://affinity.help/photo2/en-US.lproj/pages/Extras/trackpads.html
- [RT1] https://rawpedia.pixls.us/general_comments_about_some_toolbox_widgets/
- [RT2] https://rawpedia.pixls.us/keyboard_shortcuts/
- [RT3] (s, source) https://github.com/RawTherapee/RawTherapee/blob/dev/rtgui/cropwindow.cc
- [BL1] https://docs.blender.org/manual/en/latest/editors/3dview/navigate/navigation.html
- [BL2] https://docs.blender.org/manual/en/latest/interface/window_system/regions.html
- [BL3] https://docs.blender.org/manual/en/latest/editors/preferences/keymap.html
- [BL4] https://docs.blender.org/manual/en/latest/interface/controls/nodes/editing.html
- [BL5] https://docs.blender.org/manual/en/latest/interface/controls/buttons/fields.html
- [BL6] https://docs.blender.org/manual/en/latest/interface/keymap/industry_compatible.html, https://docs.blender.org/manual/en/latest/editors/preferences/input.html
- [BL7] https://docs.blender.org/manual/en/latest/getting_started/configuration/hardware.html
- [UE1] https://dev.epicgames.com/documentation/en-us/unreal-engine/blueprint-editor-cheat-sheet-in-unreal-engine
- [UN1] https://docs.unity3d.com/Packages/com.unity.shadergraph@17.1/manual/Shader-Graph-Window.html
- [UN2] https://docs.unity3d.com/Packages/com.unity.shadergraph@17.1/manual/Keyboard-shortcuts.html
- [CU1] https://docs.comfy.org/interface/settings/lite-graph
- [CU2] https://docs.comfy.org/interface/shortcuts
- [FI1] https://help.figma.com/hc/en-us/articles/1500004414582
- [FI2] https://help.figma.com/hc/en-us/articles/360040449873
- [FI3] (s) https://forum.figma.com/t/option-drag-a-locked-layer-results-in-duplicating-it/3804
- [IN1] https://inkscape.org/doc/keys.html
- [IN2] https://wiki.inkscape.org/wiki/Release_notes/1.0
- [IN3] https://wiki.inkscape.org/wiki/Release_notes/1.1
Operating systems and browsers:
- macOS trackpad gestures https://support.apple.com/en-us/102482; secondary click https://support.apple.com/guide/mac-help/right-click-mh35853/mac
- Windows touchpad https://support.microsoft.com/en-us/windows/touchpad-gestures-for-windows-a9d28305-4818-a5df-4e2b-e5590f850741; pinch as Ctrl + wheel for legacy apps https://learn.microsoft.com/en-us/windows/win32/wintouch/windows-touch-gestures-overview
- GNOME
mouse-button-modifierhttps://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/-/raw/master/schemas/org.gnome.desktop.wm.preferences.gschema.xml.in; left-handed mouse https://help.gnome.org/users/gnome-help/stable/mouse-lefthanded.html.en - KWin window actions https://docs.kde.org/stable_kf6/en/kwin/kcontrol/windowbehaviour/index.html; the move from Alt to Meta https://phabricator.kde.org/D20730
- Xfce Alt + drag and Alt + wheel (s) https://gitlab.xfce.org/xfce/xfwm4/-/issues/159
- GTK middle-click paste https://docs.gtk.org/gtk4/property.Settings.gtk-enable-primary-paste.html
- Wheel events,
ctrlKeyfor pinch,deltaModehttps://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event, https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/deltaMode; passive listeners https://developer.chrome.com/blog/scrolling-intervention-2; Firefox pinch as Ctrl + wheel https://bugzilla.mozilla.org/show_bug.cgi?id=1052253; logical buttons https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
Decisions (maintainer, 2026-10-20)
- Profiles: the five proposed (darktable, Adobe, Document, Blender / node editors, Trackpad). Helios ships all five, with darktable as its default.
- The gallery’s default profile: Document.
- User overrides on a profile change: to study. Likely a dialog that asks what to do with them when the profile changes (keep them on top of the new profile, or drop them).
- The wheel over sliders and values: an option, not a fixed rule; each profile gives its default.
- A double click on the image: an option (leave the view, as darktable does, or fit); each profile gives its default.
- Ctrl and the wheel on the web: egui-pop takes it from the browser.
Questions 7 and 12 were settled with these (decisions 5 and 6).
Decisions (maintainer, 2026-10-21)
The answers the first implementation took (see
pointer-gestures.md) are confirmed, with
question 9 amended. Each is data in the profile documents
(crates/egui-pop-model/profiles/*.json) or a setting, so changing one
later is an edit there, not in code.
- Question 6 (modifiers change what, or how finely): a binding’s meaning is per canvas scope, so a profile may give a modifier another action (Blender’s Ctrl + wheel pans sideways). Per-target bindings (a handle, a node, a port) are not built: the wheel over a handle adjusts that handle, whatever the profile.
- Question 8 (primary drag on an empty image): it pans in every profile; a box select stays the graph’s.
- Question 9 (secondary button), amended: the secondary button
opens a context menu everywhere by default, except where a profile
binds a secondary drag: only Blender / node editors pans the graph
with it (darktable’s profile does not). Any particular widget that
needs the right click for something else may opt out and take the
secondary button for itself (a curve editor deleting a node, a
colour swatch resetting, a canvas binding a right drag): it claims
the secondary click, the drag or both on its rect
(
egui_pop_core::pointer::claim). While it does, neither the enclosing canvas’s profile binding for that gesture nor a context menu above it fires there. The claim shows in the debug bridge’spointercollector, and the shortcuts editor lists the widget’s use when the claim says what it does. The curve editor claims the secondary click (it deletes the point under the pointer). - Question 10 (fine and coarse): per profile. Ctrl finer and Shift coarser in Document, darktable and Trackpad; Shift finer and Ctrl coarser in Blender / node editors. Document keeps the earlier default rather than GIMP’s Shift-finer cell. Amended 2026-10-22: a profile follows the application it is named after, and the Adobe profile is split in two (see the decisions of 2026-10-22).
- Question 11 (Alt): used only where the source applications use it (Photoshop’s Alt + wheel zoom and Alt finer on values, Lightroom’s Alt finer with the arrows) or egui-pop already did (Alt + wheel steps a slider without the focus, in Document and darktable); the shortcuts editor warns, on Linux, of a gesture bound with Alt and a drag or the wheel.
- Question 13 (device split): the line / point split, with a
global override (
input.wheel_device: auto, mouse, trackpad); no per-device settings. - Question 14 (scope of a profile): pointer gestures only; the keyboard navigation keys (Space, +, -, 0, 1, 2, arrows) stay as they are, and Space + drag pans in every profile.
- Question 15 (held key + pointer): left for later; a held key other than a modifier is not part of a pointer chord yet.
Every question of section 7 is now settled.
Implementation notes (2026-10-21): the gesture commands are per canvas
kind (gesture.image.zoom, gesture.graph.pan, gesture.value.step)
rather than shared (view.zoom), so the shortcuts editor shows and
changes each canvas’s on its own; a gesture keeps several triggers
(Wheel, Ctrl+Scroll, Pinch). The options of decisions 4 and 5
are settings whose profile choice takes the profile’s default.
Decision 3 is the dialog asking to keep or drop the user’s changes
after a change of profile; they stay until it is answered.
Decisions (maintainer, 2026-10-22)
- Two Adobe profiles. The Adobe profile is replaced by Photoshop
(
photoshop) and Lightroom Classic (lightroom), each following its application, with sources (section 6.2 B). Where the application has no equivalent, the gesture is left unbound. Six profiles ship. - The old id.
adobestays accepted as an alias oflightroom, the closest for a photo editor, and is listed in no picker. - The arrows’ own modifiers. A profile may give a value’s arrow keys
modifiers other than its drag’s (
value_keys): Lightroom Classic’s Shift drag is finer while its Shift with the arrows is coarser. It is profile data the slider reads, not a binding (question 14 stands).
Navigation on canvases larger than their view: a study
Status: accepted, under way (2026-11-08). The maintainer chose B
for Q1 (hand mode: H, and Space held), Q2 (the profile’s key plus F
everywhere), Q3 (the overview when needed), Q4 (the view kept by id)
and Q6 (a one-time hint, dismissed by the first pan or a click); Q5
stays A. Built so far, in egui_pop::viewport::navigation:
- on the node graph: hand mode, the
view.*commands and their keys, fit selection, the overview’s rule, the kept view and the hint; - on the image viewport (2026-11-09): the same commands, keys, hand
mode (which pans from a handle, as Space held does) and canvas
activation; fit and frame the selection both fit the image; the hint
is an option (
Viewport::hint), the kept view stays the application’s; - on plots (2026-11-09): the commands through the canvas in use (fit, zoom, pan, hand); egui_plot keeps its own gestures, and a primary drag already pans a plot;
- the zoom control,
CanvasZoom(2026-11-09): zoom out, the percentage with a menu (fit, frame the selection, 100 %, steps), zoom in and the hand button, over any canvas through the canvas commands (view.zoom_to:<percent>for a step); the gallery shows it under the graph and above the viewport; - touch screens (2026-11-09): two fingers pan every canvas and a pinch zooms it (egui’s multi-touch); while two fingers are down, the first one’s drag is not a pan;
- the profiles’ navigation keys in the keymap (2026-11-09): each
pointer profile gives them (
view_keysin its document), loaded with its gestures into the default layer, so the shortcuts editor shows them and the user rebinds them; in an application the keymap dispatches them, a canvas on its own reads them from the profile.
The curve editor and the histogram neither pan nor zoom: nothing to move there. Still to do: the overview on the image (the navigator) by the same rule, and a keyboard pan and fit on plots without an application.
A report started it: in Helios and in the gallery “you cannot move around in the diagrams”. The quick check (section 1) found a real fault and fixed it; it also showed that egui-pop never asked what moving around a large surface needs, widget by widget and device by device. This note asks it.
Scope. Every widget whose surface is larger than its view:
- the node graph (
egui_pop::viewport::graph), drawn in egui’sScene, and any diagram drawn the same way; - the image viewport (
egui_pop::viewport), as Helios uses it in the loupe and in Compare; - plots (plot.md, over egui_plot);
- canvases to come (a timeline zoomed in, a map, a mask editor).
Scroll areas (lists, pages, editors) are out of scope: the wheel and the scrollbar settle them, and scrolling-survey.md covers them.
1. The quick check (2026-11-08)
The documented gestures (node-graph.md, “Pan and
zoom”; pointer-gestures.md) are the wheel,
two fingers, Ctrl and the wheel or a pinch, a middle drag and a drag
with Space held. Kittests now send each one over the gallery’s node
graph page and over the editor alone, from the empty canvas and from a
node, and assert that the view moved
(the_node_graph_page_moves_with_every_navigation_gesture in the
gallery; a_middle_drag_pans_the_graph_even_from_a_node,
a_drag_with_space_held_pans_even_from_a_node_and_leaves_it_in_place,
two_fingers_pan_the_graph_and_a_pinch_zooms_it_in_every_profile in
egui-pop-viewport/tests/pointer.rs).
What was broken. The wheel, two fingers, the pinch and Ctrl and
the wheel worked. The drags did not, as soon as they started on
anything but the bare canvas: the pan read the drag of the Scene’s
own response, and a node, a folded stack, a group’s band, a port or a
wire on top took the drag first. A middle drag over a node did
nothing; a drag with Space held over a node moved the node. Fitted, the
gallery’s fifty-node overview and Helios’s network leave little bare
canvas between nodes, so the drags seemed not to work at all. Without
a middle button (a laptop), Space and the drag was the only way to pan
by dragging, and it moved nodes instead.
The fix. The editor decides, before its widgets, whether the drag under way pans: a button pressed on the graph (not on a window above it), moving, that the profile pans with, or a primary drag with Space held. While it pans, no node, stack, band or port starts its own drag, and the view follows the pointer (the point under it stays under it). Helios uses the same editor without a wrapper of its own: it gets the fix with the release.
What the check does not cover: whether people find the gestures
(section 2.3: no app relies on the user guessing), and the image
viewport’s and plots’ gestures, which have their own tests in
egui-pop-viewport/tests/pointer.rs and plot.md.
2. Survey of established applications
Sources are listed in section 9. “Unconfirmed” marks what no source we read states; touch and pen are almost nowhere documented (section 2.2).
2.1 Mouse
| App | Pan | Zoom | Left drag on empty space | Fit all / fit selection / 100 % | Keyboard | Overview |
|---|---|---|---|---|---|---|
| Blender, node editor | Middle drag; Ctrl / Shift + wheel (unconfirmed) | Wheel; Ctrl + middle drag | Box select | Home / numpad . (frames, does not zoom in) / — | Numpad +/- | Scrollbars; no minimap |
| Nuke, node graph | Middle drag, Alt + drag | +/- at the pointer; Alt + middle drag | Marquee (unconfirmed) | F (selection, or all when none) / F / — | Bookmarks: Ctrl+F7..F10 set, Shift+F7..F10 go; J jumps to a node | Navigator map at the bottom right, only when the script outgrows the view |
| DaVinci Fusion, node editor | Middle drag; Shift+Cmd + drag | Ctrl / Cmd + wheel | Marquee (unconfirmed) | Menu “scale to fit” (unconfirmed) / — / Ctrl+1 resets the scale | — | Node Navigator at the top right, V toggles |
| Houdini, network editor | Middle drag; Space + left drag | Wheel; Space + right drag | Box select | H / G / — | Enter and U go in and out; PgUp/PgDn along the chain; quick marks Ctrl+1..5 set, 1..5 go; Alt+arrows walk the view history | Overview in a corner, O toggles; “when needed” by default |
| Unreal, Blueprints | Right drag | Wheel; left+right drag; Ctrl to go past 1:1 | Marquee (Shift adds, Ctrl removes) | API zoom to window / Home / — | PgDn / PgUp into and out of a sub-graph | None; a zoom readout and breadcrumbs |
| ComfyUI (frontend 1.25 and later) | Standard: wheel; legacy: left drag on empty space; Space + drag in both | Standard: Ctrl + wheel; legacy: wheel; Alt+= / Alt+- | Standard: select; legacy: pan | . / — / a % field in the zoom popover | V select tool, H hand tool | Minimap, Alt+Shift+M; shown on wide windows |
| Figma | Space + drag, H hand tool; wheel (Shift: sideways); optional right drag | Ctrl / Cmd + wheel; optional “scroll wheel zoom”; Shift+= / Shift+- | Marquee | Shift+1 / Shift+2 / Shift+0 or Ctrl+0 (sources disagree) | — | None; a “recenter” button when far away |
| Miro | Space + drag, H; Mouse mode: right or middle drag | Mouse mode: wheel; Ctrl / Cmd and +/- | Select | Alt+1 / Alt+2 / Ctrl+0 | Arrows move items | Minimap, M toggles |
| darktable, darkroom | Drag the image; drag in the navigation module | Wheel; middle click cycles fit, 100 %, 200 % | Pans the zoomed image | Middle-click cycle; zoom combobox under the preview | — | Navigation module (Ctrl+Shift+N) |
| Lightroom Classic, Loupe | Drag when zoomed; drag in the Navigator | Ctrl / Cmd + = / -; Z and Space toggle; a click toggles | Click toggles fit and the chosen zoom; drag pans | Navigator presets Fit / Fill / 1:1 / a ratio | — | Navigator panel, always there |
2.2 Other devices
| Device | What the apps do |
|---|---|
| Touchpad | Two fingers pan and a pinch zooms where the app says it (Figma, ComfyUI standard, Fusion, darktable with its touchpad option, Blender’s “multi-touch gestures”). The wheel-zooming node editors make a touchpad zoom when two fingers move, which users report as the main annoyance; Miro and ComfyUI add a navigation mode for it (Auto / Mouse / Trackpad; Standard / Legacy / Custom) and Miro’s users complain that Auto guesses wrong on laptops with both. |
| Mouse without a middle button | Blender’s “emulate 3 button mouse” (Alt + left = middle, at the cost of Alt + left’s own uses); everywhere else Space + drag or a hand tool (H). |
| Pen | Blender lowers its drag thresholds for tablets and turns off continuous grab; nothing else is documented. Pens send a primary button, often a barrel button as middle or secondary; Space + drag and a hand tool are what pen users rely on. |
| Touch screen | Only Miro documents it (detected apart from the mouse and trackpad modes): one finger acts, two fingers pan and pinch. |
2.3 Discoverability
No application expects the user to guess. What they use:
- menus that show the key: Blender’s View menu, Houdini’s right click on the background (“viewing controls”), Unreal’s;
- a zoom control with fit and a percentage: ComfyUI’s popover, darktable’s combobox, Lightroom’s Navigator presets, Figma’s zoom menu;
- a shortcut sheet: darktable (H held), Miro (?);
- a way back when lost: Figma’s “recenter” button, Nuke’s navigator appearing as soon as the script outgrows the view;
- status bar hints: Blender shows what each mouse button does now
(egui-pop’s hint line does the same,
pointer::show_hint).
2.4 Patterns
- Space + drag pans everywhere: Figma, Miro, ComfyUI, Houdini, Photoshop. It is the one gesture that works on every device with a keyboard.
- The wheel splits two families: node and 3D tools zoom with it (Blender, Houdini, Unreal, Nuke, ComfyUI legacy); design tools pan with it and zoom with Ctrl (Figma, ComfyUI standard). Miro picks by device.
- A left drag on empty space selects almost everywhere (a marquee); only ComfyUI legacy, the hand tools and the photo viewers pan with it.
- Two framing commands, “all” and “selection”: Home / numpad
., H / G, F (selection, else all), Shift+1 / Shift+2, Alt+1 / Alt+2. A 100 % key belongs to photo and design tools, not to node editors. - An overview that appears when needed (Nuke, Houdini) or toggles with one key (Houdini O, Fusion V, Miro M, ComfyUI Alt+Shift+M).
- Zoom limits are stated: ComfyUI 1 % to 1000 %, Lightroom 6 % to 1600 %, darktable fit to 100 % unless Ctrl, Unreal 1:1 unless Ctrl.
- Places: Nuke’s bookmarks and Houdini’s quick marks keep views to come back to; Houdini also keeps a view history.
3. Devices onto egui-pop’s profiles
egui-pop’s six profiles (pointer-gestures.md) already cover the mouse families and the trackpad:
| Device | Profile today | Fits? |
|---|---|---|
| Mouse with a middle button, node habits | Blender / node editors | Yes: wheel zooms, middle drag pans, secondary drag pans on the graph (Unreal’s right drag) |
| Mouse, document habits | Document (default) | Yes: Figma’s and ComfyUI standard’s rules |
| Mouse, photo habits | darktable, Photoshop, Lightroom Classic | Yes on the image; on the graph each takes the nearest rule (section 6.2 of the study) |
| Mouse without a middle button | any | Space + drag only; no hand tool, no emulation |
| Touchpad | Trackpad | Yes: two fingers pan, a pinch and Ctrl + two fingers zoom, the plain wheel never zooms |
| Pen | none | A pen is a pointer with one button: today it pans only with Space held, and a pen user rarely has a hand on the keyboard |
| Touch screen | none (egui turns one finger into a primary pointer) | One finger draws a rubber band on the graph and pans the image; two fingers send a pinch (egui’s MultiTouch) |
Gaps, and what would fill them:
- A hand mode, not a profile. A pen, a touch screen and a mouse without a middle button lack the same thing: a way to make the primary drag pan. Figma, Miro and ComfyUI use a hand tool (H) or a held key; Blender an emulation. A profile is the wrong place: the same person switches between a pen and a mouse in one session. The proposal (section 6) is a hand mode toggled by a key and a button, and a held Space for the moment.
- A touch profile is not needed. Under the rule “a profile named
after an app behaves like it”, there is no app to name a touch
profile after; touch is Document plus egui’s multi-touch, and one
finger on empty canvas should pan rather than select (Miro, every
map), which is a device fact egui gives us (
Event::Touch), not a preference. - A pen profile is not needed either: a pen is the primary button plus a hand mode; its barrel button, when the driver sends it as a middle button, already pans in every profile that pans with the middle drag.
- A ComfyUI profile could be named after an app and behave like
it (legacy: the wheel zooms, a left drag on empty space pans, Ctrl
- drag selects). Asked in section 7.
4. Needs per widget
| Need | Node graph | Image viewport | Plots | Future canvases |
|---|---|---|---|---|
| Reach any area | Wheel, two fingers, drags (fixed in section 1), the minimap (GraphMinimap, the gallery shows one); missing: a pan from the keyboard | Wheel, drags, the navigator; arrows pan (viewport.md) | egui_plot’s drag and wheel | Same model |
| Framing | Fit all: double click, Home, graph.view {fit}; missing: fit selection, a key for a zoom level | Fit, fill, 100 %, 200 %, the zoom control | Double click resets the bounds | Same model |
| Jump to the selection | The view follows the focus (a node brought into focus is revealed); missing: “frame selection” | n/a (the image is the selection); a mask or a point could be | n/a | A timeline’s playhead |
| Zoom limits and levels | 5 % to 150 % (text blurs above 100 %), three levels of detail | Fit to a maximum, stops at fit and 100 % | egui_plot’s own | Each states its range |
| Keep the place across sessions | Not kept: the view refits on open | Helios keeps the zoom per image (keep_image_open); the viewport’s state is the application’s | Not kept | Same model |
Remarks:
- Fit selection is the one framing command every node editor has
and egui-pop’s graph lacks (Blender numpad
., Nuke F, Houdini G, Unreal Home, Figma Shift+2). - Keeping the place matters on a graph: a refit on every open
throws away where the user was. The view is a
Rectin graph units, already inGraphState; keeping it is a persistence slot. - A pan from the keyboard is missing on the graph: the arrows move the focus between nodes and the view follows, which reaches every node, but not the empty space around them.
5. Accessibility
- Keyboard only. Every canvas must be navigable without a pointer:
move the focus (done on the graph), pan (Ctrl + arrows, proposed),
zoom (Ctrl +
+/-/0, proposed), fit all, fit selection. The keys are data (GraphKeys) and follow the keymap, so a screen reader user’s keys can be remapped. - Announce the view: after a fit or a zoom by key, announce the zoom and the level politely (the graph already announces its level as the canvas’s value).
- Reduced motion. A fit or a frame may animate the view
(Figma, Blender’s smooth view); with reduced motion
(
egui_pop_core::motion) it jumps. Kinetic panning, if ever added, stops at once under reduced motion. - Targets: the minimap and the zoom control are focusable widgets with names (the minimap already is, “Graph overview”).
6. Proposal: one navigation model
One model shared by the graph, the image viewport and future canvases; plots join where egui_plot lets them.
- Gestures by profile, as today (
surface:canvas.*scopes), with the rule that a panning drag pans from anywhere on the canvas (the section 1 fix, to apply to every canvas). - Hand mode: a toggle (H by default, and a button on the zoom control) that makes the primary drag pan, for a pen, a touch screen or a mouse without a middle button; Space held is the same for the moment. On a touch screen, one finger on empty canvas pans.
- Navigation commands, one set for every canvas kind, in the
keymap and in a menu:
view.fit(all),view.frame_selection,view.zoom_in,view.zoom_out,view.zoom_100,view.pan_*(Ctrl- arrows). The graph’s Home stays fit all; the defaults per profile
follow the apps (Blender: Home / numpad
.; Document: Shift+1 / Shift+2 as Figma; darktable: its own). Agents get them as today’sgraph.view.
- arrows). The graph’s Home stays fit all; the defaults per profile
follow the apps (Blender: Home / numpad
- A zoom control (the viewport crate’s, reused): a percentage, fit, fit selection, 100 %, the hand toggle; it shows the keys in its tooltips. This is the discoverability path every app has.
- An optional overview: the minimap (
GraphMinimap, the image navigator), shown in a corner when the content outgrows the view, toggled by a key, its policy an option (when needed / always / never, as Houdini). - A hint overlay: the hint line (
pointer::show_hint) already says what the keys held change; add a one-time hint on a canvas’s first hover in a session (“Wheel: pan · Ctrl+wheel: zoom · Space + drag: pan · Home: fit”), and a “back to the content” button when the view holds none of it (Figma’s recenter). - Keeping the place: the view saved with the application’s state
per document, an option on the widget (
keep_view(id)).
Testing. Kittests per profile: for each profile and each canvas kind, a table of gestures (the wheel, two fingers, a pinch, each drag, from the canvas and from an item on it) and the expected effect (pans, zooms, nothing), run over the editor alone and over one gallery page per canvas. The gallery’s page tests catch what the widget tests cannot: a parent scroll area, a layout, a panel taking the input. The navigation commands get one test each per canvas, reduced motion one test that a fit jumps.
7. Open questions
Q1. Hand mode. How does a user without a middle button pan with a drag?
- A. Space held only (today).
- B. A hand mode toggled by H and a button, plus Space held.
- C. A hand mode chosen in the settings for the device (“pen or touch”).
- Recommended: B. It is Figma’s and Miro’s, and works for a pen.
Q2. Fit selection’s key.
- A. Per profile, after the apps (Blender numpad
., Document Shift+2, darktable none). - B. F everywhere (Nuke: selection, else all).
- C. Shift+Home everywhere.
- Recommended: A, with F as a second binding in Document and Blender, since F is free on the graph.
Q3. The overview’s policy.
- A. Never by default; the application places it (today).
- B. When needed: a corner minimap inside the canvas once the content outgrows the view, toggled by a key.
- C. Always.
- Recommended: B, as Nuke and Houdini.
Q4. Keeping the view across sessions.
- A. Never: refit on open (today).
- B. Kept per document by the widget when given an id.
- C. Left to the application.
- Recommended: B, as an option, on in the gallery and Helios.
Q5. A ComfyUI profile (the wheel zooms, a left drag on empty space pans, Ctrl + drag selects)?
- A. No: Blender / node editors is close enough.
- B. Yes, named after ComfyUI’s legacy mode.
- Recommended: A for now; revisit when a user asks, since a left drag that pans conflicts with the rubber band every other profile has.
Q6. A one-time hint overlay on a canvas’s first hover.
- A. No; the hint line and the zoom control’s tooltips are enough.
- B. Yes, once per canvas kind per installation, dismissed by any gesture.
- Recommended: B: the report that started this note is a discoverability report as much as a bug.
8. Steps (once the questions are settled)
Steps 1 to 4 are done on the graph, the image viewport and plots (see the status above); step 5 on the graph.
- The panning-drag-from-anywhere rule on the image viewport and the plots (the graph has it, section 1).
- The navigation commands and their keys; fit selection on the graph.
- Hand mode; one finger pans on a touch screen.
- The zoom control on the graph; the overview policy.
- Keeping the view; the hint overlay.
The navigation keys per profile (2026-11-09)
Every profile binds Home (fit), F (frame the selection), Ctrl and +,
= or - (zoom), Ctrl+0 (100 %), Ctrl and the arrows (pan) and H
(hand mode), and adds what its application has:
| Profile | Fit | Frame the selection | 100 % |
|---|---|---|---|
| Document | Home, Shift+1 | F, Shift+2 | Ctrl+0 |
| Blender / node editors | Home | F, . | Ctrl+0 |
| darktable | Home, Alt+3 | F | Ctrl+0, Alt+1 |
| Photoshop | Home, Ctrl+0 | F | Ctrl+1 |
| Lightroom Classic, Trackpad | Home | F | Ctrl+0 |
9. Sources (read 2026-11-08)
- Blender: input preferences, 3D navigation, regions, navigation preferences, node editor navigation (2.79).
- Nuke: navigating the node graph, navigating inside windows.
- DaVinci Fusion: Fusion 18 manual, node editor.
- Houdini: navigating networks.
- Unreal: Blueprint editor cheat sheet, graph editor.
- ComfyUI: canvas controls, canvas navigation settings, core settings.
- Figma: zoom and view options, forum: zoom without Ctrl.
- Miro: shortcuts, navigation mode, community: navigation modes.
- darktable: darkroom, navigation module, darkroom preferences.
- Lightroom Classic: keyboard shortcuts, zooming in Lightroom Classic.
One file browser, many views: a design
Status: proposed (2026-11-08). Nothing here is decided until the maintainer answers the questions in section 7.
The request: the file part of a photo import must share one component with
every file dialog, and let the person change how the files are shown:
details, thumbnails, a filmstrip, a carousel, Finder’s columns, an agenda by
date, and any view that comes later. So the view is a contract, not a
match on two cases.
Today egui-pop’s in-app picker (Choosing files) draws a list
and a grid itself (PickerView::List, PickerView::Grid in
egui_pop::api::files), inside a FilePicker that also owns the field, the
places, the preview pane, the selection, the sort and the grouping. A Helios
import window that wants a filmstrip would have to fork it. This note splits
the picker into a file browser that hosts pluggable view modes, fed
by a file source and a thumbnail provider, and moves the file and
folder choosers onto it.
Scope:
- the browser: entries, selection, focus, type-ahead, sort, quick look, drop targets, the mode switcher;
- three contracts:
FileSource,ViewMode(with a registry),ThumbnailProvider; - the six built-in modes;
- the move of
FilePickeronto the browser.
Out of scope: Helios’s catalogue (its image map and thumbnail cache is another piece of work; here we define only the provider contract it will implement), tags and ratings editing, copying and moving files.
1. Survey
Read on 2026-11-08. Sources in section 9. “Unconfirmed” marks what no source we read states.
1.1 View modes
| App | Modes | Switch | Remembered |
|---|---|---|---|
| macOS Finder | Icons, List, Columns, Gallery | Cmd+1..4, a segmented control in the toolbar | Per folder (“Always open in…”), else the last used |
| Windows Explorer | Extra large, large, medium, small icons, List, Details, Tiles, Content | Ctrl+Shift+1..8, Ctrl+wheel steps through them | Per folder type (“Optimize this folder for: Pictures”) and per folder |
| GNOME Files (Nautilus) | Grid, List | Ctrl+1, Ctrl+2, a toggle in the header bar | Per folder (metadata), default in the settings |
| KDE Dolphin | Icons, Compact, Details | Ctrl+1..3, toolbar buttons | Per folder (.directory) or globally, a setting |
| Lightroom Classic, import | Grid, Loupe | G, E | Last used |
| Lightroom Classic, Library | Grid, Loupe, Compare, Survey, plus the Filmstrip always at the bottom | G, E, C, N | Last used |
| Photo Mechanic | Contact sheet (grid), Preview (one image, with a filmstrip), a “Columns” layout of the contact sheet | Double click or Enter opens Preview | Per contact sheet window |
| darktable, import | A list of files, with an optional thumbnail column | An eye icon per row | The thumbnails’ column state |
| darktable, lighttable | File manager (grid), Zoomable lighttable, Culling, Preview; the filmstrip in other views; the timeline at the bottom | A toolbar control, X (culling), W (preview) | Last used |
| digiKam | Thumbnails, Preview, Map, Table; Albums by folder or by date (the Dates view, Timeline) | Toolbar, F3 preview | Last used |
Patterns:
- Every file manager has a list with columns and a grid with a size slider. Those two are the minimum; egui-pop has them.
- Photo tools add a one-image view with a strip (Lightroom’s Loupe and Filmstrip, Photo Mechanic’s Preview, darktable’s filmstrip, digiKam’s Preview). The strip is a view of the same entries, the big image a quick look of the focused one.
- Finder’s columns are the one browsing mode that shows the path as panes; Dolphin and Explorer do not have it. Some people swear by it for deep trees.
- Time is a view in photo tools (digiKam’s Dates and Timeline, darktable’s timeline, Lightroom’s date folders on import), never in file managers, which only group by date (Nautilus’s “Group by”, Explorer’s “Group by > Date modified”).
- A key per mode (Cmd/Ctrl+1..n) everywhere; a toolbar control showing the current mode everywhere.
- Remembered per folder in file managers, last used in photo tools and in dialogs. A dialog that remembers per folder surprises: GTK’s chooser keeps one view for all folders.
1.2 Thumbnails
| App | Sizes | Loading order |
|---|---|---|
| Finder | 16 to 512 points, a slider | Visible first; QuickLook’s thumbnails, cached by the system |
| Explorer | 16, 48, 96, 256 (the icon sizes), Ctrl+wheel in between | Visible first, from thumbcache_*.db; a shell extension per type |
| GNOME Files | Grid zoom levels (about 64 to 256 pixels), the setting “show thumbnails: local only, all, never” | Visible first; the freedesktop cache (~/.cache/thumbnails/normal 128, large 256, x-large 512, xx-large 1024) |
| Dolphin | Zoom slider 16 to 256 | Visible first, then the rest of the folder in the background (KFilePreviewGenerator), size cap for remote files |
| Lightroom import | Thumbnails slider; embedded previews of the raw | The embedded JPEG first, “Standard” and “1:1” previews later (a choice on import) |
| Photo Mechanic | A slider; the embedded JPEG only, never a raw decode | Visible first, then the whole folder; known for being the fastest because it never renders raws |
| darktable import | One small size, on demand per row | Only when asked (the eye) |
| darktable lighttable | Per zoom level, its own mipmap cache (mipmaps-* on disk) | Visible first, then a background generation option |
| digiKam | 32 to 256 (and a “high quality” option), its own thumbnail database | Visible first |
Patterns: visible first, the rest in the background, cancelled when
scrolled away; a small number of sizes cached (the freedesktop cache’s
four, darktable’s mipmap levels) with drawing scaled in between; embedded
previews of raws before any decode. egui-pop’s grid already asks only for
what is in view and drops what left it (the Previews::want queue).
1.3 Selection and keyboard
- Click selects one; Ctrl (Cmd) toggles; Shift extends a range from the anchor; Ctrl+A all; a drag on empty space draws a rubber band in grid views (Finder, Explorer, Nautilus, Dolphin, Lightroom). egui-pop’s picker has all but the rubber band.
- Arrows follow the layout: up and down in a list, the four arrows in a grid, left and right in a filmstrip, left and right between columns in Finder’s column view (Right enters a folder, Left goes back to the parent’s column). Home, End, Page Up, Page Down everywhere.
- In Lightroom’s Loupe and Photo Mechanic’s Preview, left and right go to the previous and next image; the selection follows the focus unless Ctrl is held.
- Selection survives a change of view in every app surveyed: the selected files in the grid stay selected in the list.
1.4 Type-ahead
Finder, Explorer and Dolphin jump to the first name starting with the typed
letters (a short timeout, about one second, resets the prefix); repeating the
same letter cycles through the names that start with it (Explorer). Nautilus
replaced it with a recursive search and never stopped hearing about it (the
file dialogs survey, Nautilus section). egui-pop’s picker has one field that
filters (fuzzy) and becomes a path with / or ~; that stays. Type-ahead is
for the browser when the field is not there (the import window, a mode with
the focus in its entries) and for modes that have no field at all.
1.5 Sorting and grouping
All sort by name (natural in Explorer and Finder), date, size and kind; photo tools add capture time, rating and file name with a sequence number. Groups are headers in the view: Explorer’s “Group by”, Nautilus has none, Finder’s “Use Groups” (by kind, date, size, tags), Lightroom’s import groups by date folders on the source side. digiKam’s albums by date are the agenda: years, months, days.
1.6 Quick look
Finder: Space opens a floating preview, arrows move through the selection behind it, Space closes it. Dolphin: an information panel (F11), and since 22.x an image preview popup is unconfirmed. Explorer: the preview pane (Alt+P). Lightroom: E (Loupe), Z (1:1), Space toggles zoom. Photo Mechanic: Enter or double click. egui-pop’s picker has the preview pane (Alt+P); a quick look adds a large view of one entry over the browser, without leaving it.
2. The browser
FileBrowser is the component every file dialog and Helios’s import draw.
It owns what is the same in every view:
- the entries of the place shown, from a
FileSource(section 3.1), sorted (files::sort), filtered (the field, the type filter, hidden files) and grouped (files::groups): oneVec<BrowserEntry>in display order; - the selection (a set of entry keys, an anchor, a mode: none, one, several, folders only) and the focus (one entry key, the highlight of today’s picker);
- the mode switcher in its toolbar and the current mode, kept per dialog id (section 7, Q2);
- type-ahead, quick look, drop targets (section 5);
- the thumbnail provider (section 3.3), shared by every mode;
- the steps and the collector: a selection change, a mode change and an activation are reported the same way whichever mode drew them.
What it does not own: the places column, the path bar, the field, the
preview pane, the verb buttons and the application’s choices. Those are the
file chooser’s (today’s FilePicker), which becomes a frame around a
FileBrowser. Helios’s import window frames it differently (sources on the
left, options on the right, a big preview).
3. Contracts
3.1 FileSource
Where entries come from. Today it is a FileSystem and a folder; the import
needs more: a camera card read slowly, a recursive listing (“include
subfolders”), a catalogue that knows which files are already imported, a
remote place.
pub trait FileSource: Send + Sync + fmt::Debug {
/// A stable id, for persistence and the collector.
fn id(&self) -> &str;
/// Starts (or restarts) a listing of `place`. Entries arrive in pages
/// through `poll`; the browser never waits.
fn list(&self, place: &Path, options: &ListOptions) -> Listing;
/// Whether `watch` means something here.
fn can_watch(&self) -> bool { false }
/// Asks to be told when `place` changes; a change is a `Page::Changed`.
fn watch(&self, place: &Path) -> Result<(), SourceError> { Err(SourceError::Unsupported) }
}
pub struct ListOptions { pub recursive: Option<u8>, pub hidden: bool }
/// A listing under way: pages, then the end, or an error.
pub struct Listing { /* a channel */ }
impl Listing {
pub fn poll(&self) -> Vec<Page>; // all that arrived since the last poll
pub fn cancel(&self); // also on drop
}
pub enum Page {
Entries(Vec<SourceEntry>),
/// The source learnt more about entries it already gave (sizes, times).
Updated(Vec<SourceEntry>),
Removed(Vec<PathBuf>),
/// Start again: the place changed in a way the source cannot describe.
Changed,
Done,
Failed(SourceError),
}
pub struct SourceEntry {
pub path: PathBuf,
pub name: String,
pub kind: EntryKind, // File, Folder, Link, Other
pub size: Option<u64>,
pub modified: Option<SystemTime>,
pub created: Option<SystemTime>,
/// The time a view sorts or groups by when it is not the file's:
/// a photo's capture time, given by the application's source.
pub taken: Option<SystemTime>,
/// The application's own id for the file (a catalogue's image id).
pub app_id: Option<u64>,
}
pub enum SourceError { NotFound(PathBuf), Denied(PathBuf), Io(String), Unsupported }
- Paged and streamed. A folder of 20 000 raws on a card shows its first
page at once; the browser grows as pages arrive, and the focus and the
selection stay on their keys. Sizes and times may come later
(
Updated), as today’s picker reads them only for the rows in view. - Errors are entries’ state or the listing’s end, never a panic; the browser says them where the entries would be.
- Refresh is a new
list; the browser keeps the focus and the selection by path. - Columns off the frame (built, 2026-11-09): Finder’s columns list
the place’s ancestors and the focused folder through
ColumnListings, shared by the browser and the in-app picker (whose columns list folders alone). Each column is aListingof the source, so on the system’s file system it runs on a thread of its own and streams pages; a column under way ends with a busy row (a spinner and “Listing…”, a progress indicator to assistive technology), the place’s own column too (ModeContext::loading). A listing no longer wanted (the focus moved to another folder, the place changed, the mode left) is dropped, which cancels it;FsSourcechecks the cancellation before reading the folder and between entries, so a huge folder left behind stops at once. - Watch is optional (
notifyon desktop, nothing on the web);Page::ChangedorRemovedcomes through the samepoll. - Built in:
FsSourceover today’sfiles::fs::FileSystem(StdFs,MemoryFs), listing on the interface thread for aMemoryFsand on a worker forStdFs, in pages of 512. The web getsFsSourceover aMemoryFs, synchronously.
3.2 ViewMode and its registry
pub trait ViewMode: Send + Sync {
/// What it is, for the switcher, persistence, agents and screen readers.
fn describe(&self) -> ModeInfo;
/// Draws the entries. The mode reads the context and answers what the
/// person did; it changes nothing itself.
fn show(&mut self, ui: &mut Ui, cx: &ModeContext<'_>) -> ModeOutput;
/// Where the focus goes for a key the mode handles (arrows, Page keys,
/// Home, End); `None` leaves the key to the browser.
fn step(&self, cx: &ModeContext<'_>, key: ModeKey) -> Option<EntryKey> { None }
}
pub struct ModeInfo {
pub id: &'static str, // "details", "thumbnails", "filmstrip"…
pub label: StringKey, // translated name
pub icon: IconId,
pub keys: &'static [ModeBinding], // its own keys beyond the common ones
pub gestures: &'static [Gesture], // wheel, Ctrl+wheel, drags, pinch
pub persist: &'static str, // the key its own settings are kept under
pub role: AccessRole, // list box, grid, tree, carousel
/// What it needs: thumbnails, a time per entry, a hierarchy.
pub needs: ModeNeeds,
}
pub struct ModeContext<'a> {
pub entries: &'a [BrowserEntry], // sorted, filtered, grouped
pub selection: &'a Selection,
pub focus: Option<EntryKey>,
pub thumbnails: &'a dyn ThumbnailProvider,
pub sort: SortOrder,
pub place: &'a Path,
pub settings: &'a mut ModeSettings, // the mode's own, kept under `persist`
}
pub struct ModeOutput {
pub clicked: Option<(EntryKey, Modifiers)>,
pub activated: Option<EntryKey>, // double click, Enter
pub focus_to: Option<EntryKey>,
pub band: Option<Vec<EntryKey>>, // a rubber band's entries
pub sort_by: Option<SortKey>, // a header clicked
pub context_menu: Option<EntryKey>,
pub dropped: Option<(Option<EntryKey>, DropPayload)>,
pub visible: Range<usize>, // what it drew, for type-ahead and the collector
}
- The mode answers, the browser decides. Selection rules (single, several, folders), what Enter does and what a click on a folder does live in the browser, once. A mode draws, reports clicks, activations and the focus it wants, and asks for thumbnails. So a third-party mode cannot break “a click no longer enters a folder”.
- Keys. The browser binds the common keys (Enter, Space, Ctrl+A,
Ctrl+Space, Home, End, type-ahead, the mode keys Ctrl+1..9) as commands of
the keymap; arrows and Page keys go through
step, since only the mode knows its layout. A mode’s own keys (keys) become commands underfile.mode.<id>.*,whenthe mode is shown. - Registry.
ViewModeson the files service, asPreviewsandGroupings:register(Arc<dyn Fn() -> Box<dyn ViewMode>>)with the plugin’s ownership (ADR 0004, taken back indisconnect), ordered by registration, the built-ins first. A browser asks the registry for the modes its request allows (FileRequest::modes(&["details", "thumbnails"]), all by default). - Persistence. The current mode per dialog id, the mode’s own settings
(thumbnail size, the columns shown) under
settings/files.mode.<persist>. - Zoom. The thumbnails’ zoom is a count per row (
ThumbZoom, the library grid’sZoomon the API’s side), not a size: the browser turns it intoModeSettings::thumbnail_sizebefore each draw, from the room the grid has (ThumbnailGrid::room), so it survives a resize and its largest step shows one thumbnail across. A size in points (set_thumbnail_size, an older setting) converts to the count it gives at the width. - Accessibility.
rolesets the container’s role (list box, grid, tree); every entry is an option with its name, selected state and the active descendant, as today.
Built-in modes:
| Mode | Shows | Arrows | Needs | Notes |
|---|---|---|---|---|
details | Rows with columns (name, modified, size, type), headers sort | Up, Down | — | Today’s list, virtualised |
thumbnails | A grid of thumbnails with names, a size slider (64 to 256) | Four arrows | thumbnails | Today’s grid, virtualised, visible first |
filmstrip | One row (or column) of thumbnails, the focused one large above (a quick look in place) | Left, Right | thumbnails | Lightroom’s Loupe and Filmstrip, Photo Mechanic’s Preview |
carousel | The focused entry large, its neighbours smaller on each side | Left, Right | thumbnails | Finder’s Gallery (macOS mode) |
columns | One column per folder of the path, the last one a preview | Up, Down in a column; Right enters, Left goes back | a hierarchy | Finder’s Columns; the place changes as the focus moves |
agenda | Entries grouped by year, month or day of taken (else modified), each group a grid; a level switch | Four arrows across groups | a time | digiKam’s Dates, darktable’s timeline, Lightroom’s date folders |
The agenda (levels built 2026-11-09): Day, Month and Year in its toolbar
(ViewMode::toolbar) or Ctrl+Up (coarser) and Ctrl+Down (finer);
a click on a heading, or Ctrl+Left and Ctrl+Right on the focused
entry’s group, collapses and expands it (the heading’s expanded state is
said to assistive technology), and the arrows skip what is collapsed. The
level and the collapsed groups are the browser’s ModeSettings::agenda, so
they survive a change of mode. Each entry’s day and the agenda’s order are
computed once per listing (ModeContext::generation, bumped by the browser
whenever its entries change), the groups once per level, the lines once
per width and set of collapsed groups; AgendaMode::arrangements counts
the first, for tests. Keys of a mode’s own reach it through
ViewMode::own_key before the browser’s arrows.
3.3 ThumbnailProvider
pub trait ThumbnailProvider: Send + Sync {
/// Asks for a thumbnail at least `size` pixels on its long side.
/// Answers at once from what is made; never blocks the frame.
fn request(&self, req: &ThumbRequest) -> ThumbState;
/// Drops every request not renewed since the last `begin_frame`:
/// what scrolled away is cancelled.
fn begin_frame(&self);
/// Cancels one request (a mode that knows better).
fn cancel(&self, key: &ThumbKey);
}
pub struct ThumbRequest<'a> {
pub entry: &'a BrowserEntry,
pub size: u32, // pixels, long side
pub priority: Priority, // Visible, Near (the next screen), Background
}
pub enum ThumbState {
Ready(egui::TextureHandle, [u32; 2]),
Loading,
/// An icon stands in: a folder, a file without an image.
None,
Failed(String),
}
- Priority:
VisiblebeforeNearbeforeBackground; within one, the order of the requests (the mode asks in reading order from the focus). Requests renewed each frame stay; one not renewed is cancelled, which gives “visible first, cancelled when scrolled away” without the mode’s help. - Sizes: the provider rounds a size up to its own steps (egui-pop’s default: 128, 256, 512, as the freedesktop cache) and the mode scales down when drawing.
- egui-pop’s default (
PreviewThumbnails) wraps today’sPreviews: the preview providers (PNG and JPEG withimage, folders, text) and the optional system thumbnails, decoded off the interface thread on a small pool (two workers on desktop by default, in the frame on the web), cached by path, size and modification time. - Helios implements it over its own image map and thumbnail cache
(embedded raw previews first, its mipmaps), using
app_idfrom itsFileSource.
4. Shared behaviour
- Selection is the browser’s: one or several, of files, folders or
any (
SelectionPolicy), as Choosing files says; a click, the keys, a rubber band, select all andset_selectionkeep to it, and an entry it refuses is still focused and opened. A filter or a query (set_filter,set_query) takes what it hides out of the selection and the focus; a mode change keeps the selection, the anchor and the focus, and the new mode scrolls the focus into view. - Type-ahead: when a mode’s entry has the focus and there is no field
(or the field is not focused), printable keys build a prefix (reset after
one second,
TYPE_AHEAD_RESET); the focus jumps to the first entry in display order whose name starts with it (case-insensitive, natural); repeating one letter cycles. A chooser keeps its field: there, typing goes to the field as today. - Keyboard per mode: the common keys are the browser’s commands;
arrows go through the mode’s
step. Each mode’s keys are listed bydescribeand shown in the switcher’s tips. - Quick look: Space on the focused entry (Finder) opens a large view
over the browser, from the thumbnail provider at the largest size and
then the preview providers; arrows move the focus behind it; Space or
Escape closes it. In a chooser with a field, Space is the field’s: quick
look is then
Ctrl+Y(unconfirmed default; section 7, Q5). - Drop targets (built, 2026-11-09):
FileBrowser::with_drops(accept)turns them on. What is dragged comes from inside the application (aDraggedPathspayload ofegui::DragAndDrop, which any widget sets as a drag starts) or from the system (egui’shovered_filesanddropped_files, where the platform gives them). The target under the pointer is, in order: one of the application’s own targets (with_drop_targets, zones under the toolbar), a folder entry (each mode reports the entry under the pointer inModeOutput::pointed, and Finder’s columns the folders beside the place inpointed_beside), else the folder shown (a file or empty space; also when the platform gives no pointer position during a system drag). The browser refuses a folder dropped into itself or a folder it holds; otherwiseaccept(&DropOffer)decides. While hovering, the target is outlined in the selection’s colour (taken) or the error’s (refused), the cursor says it, and a caption over the entries (“Drop into Photos”, “Cannot drop here”) is said to assistive technology too;FileBrowser::drop_hovergives the same to tests and agents. A drop taken comes out asBrowserOutput::dropped; what it means is the frame’s: a chooser goes to the dropped folder or selects the dropped file (JetBrains’ chooser), an import adds the files. Files from the system come through the bus (2026-11-16): the window’s pass reads them once (bus::files), and a system drop the browser takes is said on that window’spop.files.dropby its listenerpop.files.browser, first, so an application’s listener declared after it leaves the drop alone. Not built: the browser’s own entries as drag sources (they sense clicks only; a rubber band and dragging out need one gesture model). - Canvas-like modes (carousel, agenda zoomed out, a future map) follow
the navigation model: the wheel scrolls, Ctrl and the
wheel or a pinch zooms the thumbnails, hand mode and
view.fitwhere the mode has a canvas. The mode declares it throughgestures.
5. The file and folder choosers
- The contracts and the registry land in
egui_pop::api::files::browserbeside today’s picker, withFsSource,PreviewThumbnailsand thedetailsandthumbnailsmodes made from today’s list and grid code. FilePickerdraws aFileBrowser: its list and grid are replaced by the browser and the two modes; the switcher replaces the List and Grid buttons,files.viewreadslistasdetailsandgridasthumbnails(a migration of the setting),PickerViewstays as a deprecated alias for one release. The field, places, pane, filters, saving and choices do not move. Every test of today’s picker keeps passing; the snapshots change only where the switcher replaces the two buttons. Done since in two steps. The picker’s modes and its switcher came first, the picker drawing its own rows and cells through anEntryDrawer. Then its rows and cells became the browser’s own (PlainDrawer: a selectable row whose columns fit its width, the name, when it last changed, its size and type, said to screen readers; a thumbnail cell; marks as indicators,files.badge:<path>:<text>). The picker keeps a thin drawer of its own: its headers that sort, and its rules on a click, on Tab and on the keys (the selection by kind, the highlight its field drives). It takes the browser’s thumbnails (PreviewThumbnails, a group’s member standing in), its group chips and its rubber band. The filter, the ranking and the selection by kind are the browser’s public API since (FileBrowser::set_filterwith anEntryFilterof extensions and kinds,set_queryfor fuzzy ranking, a group answering to its members’ names, and aSelectionPolicy: files, folders or any, one or several); the picker ranks and filters through the same code. Left: the picker holding aFileBrowserinstance for its listing, keeping only its frame (the path bar, the save name, the buttons).- The folder chooser is the same picker with
ChooseKind::Folder; it getsdetailsandcolumns(thumbnails are of little use for folders). - Helios’s import draws a
FileBrowserwith itsFileSource(the card, recursion, “already imported” fromapp_id) and itsThumbnailProvider, framed by its own panels. - The other built-in modes follow one by one, each with its kittests.
6. Testing
- Switching modes keeps the selection and the focus (every pair of modes).
- The thumbnails mode requests visible entries first and cancels those
scrolled away (a recording
ThumbnailProvider). - Type-ahead: prefix, reset, cycling.
- Keyboard per mode: each arrow’s result on a known layout.
- A
FileSourcethat pages slowly: the focus and the selection hold while pages arrive. - Columns over a source the test feeds: the busy row, entries shown while more may come, the listing the focus left cancelled.
- Drops from the application and from the system: the target lit, the caption, a refusal, the offer on release.
- The agenda: levels from the toolbar and the keys, collapse and expand, the dates computed once per listing.
7. Open questions
Q1. Where the browser lives.
- A.
egui-pop-api(files::browser), beside the picker. - B.
egui-pop-views, with the list and the table. - C. A new crate,
egui-pop-files. - Recommended: A. The picker, the previews and the files service are in
the API crate; moving them is a separate decision and would break every
egui_pop::api::filespath now.
Q2. Which mode a dialog opens in.
- A. The last used, global (today’s
files.view). - B. The last used per dialog id (the request’s
purpose, else the kind). - C. Per folder, as file managers.
- Recommended: B. An import wants thumbnails, a save-as wants details; per folder surprises in a dialog (GTK keeps one view).
Q3. The mode switcher’s look.
- A. A segmented control of icons in the toolbar (Finder, Nautilus).
- B. One button with a menu of modes (Explorer’s “View”).
- C. A segmented control for up to four modes, a menu beyond.
- Recommended: C. A chooser with details and thumbnails stays as today (two buttons); the import with six modes does not fill its toolbar.
Q4. The mode keys.
- A. Ctrl+1..9, in the order of the switcher (Finder, Nautilus, Dolphin).
- B. Ctrl+Shift+1..9 (Explorer).
- C. None by default; rebindable commands only.
- Recommended: A, as commands (
file.mode.1…), since Ctrl+digits are free in the picker.
Q5. Quick look’s key in a chooser with a field.
- A. Space, as Finder, only when an entry (not the field) has the focus.
- B. Ctrl+Y (Finder’s menu key for Quick Look) everywhere, plus A.
- C. No quick look in choosers, only in the import.
- Recommended: B.
Q6. Thumbnail sizes cached by the default provider.
- A. One size per request, cached as asked.
- B. Steps of 128, 256, 512, the mode scaling down (freedesktop’s cache).
- C. Steps and the freedesktop cache written too.
- Recommended: B. The cache stays small and a size slider never decodes again; writing the system’s cache is a separate choice (today we only read it).
Q7. Built-in modes beyond details and thumbnails.
- A. All six in egui-pop.
- B. Details, thumbnails, filmstrip and columns in egui-pop; carousel and agenda in Helios until a second user wants them.
- C. Only details and thumbnails; the rest are Helios’s plugins.
- Recommended: A. The contract is proven by modes unlike each other; the agenda and the carousel are the ones that test it (groups, a canvas).
8. Steps
- This note.
- The contracts, the registry,
FsSource,PreviewThumbnails, thedetailsandthumbnailsmodes, the switcher, the picker on the browser, a gallery demo, kittests. - Filmstrip, columns, then carousel and agenda, each with its tests.
- Quick look and drop targets (done), columns off the frame and the agenda’s levels (done).
- Helios’s import window on the browser, with its source and provider.
9. Sources (read 2026-11-08)
- macOS Finder: Change how folders are displayed, Finder keyboard shortcuts, Quick Look.
- Windows Explorer: Change the view of files, Keyboard shortcuts in Windows, Thumbnail handlers.
- GNOME Files: Files preferences, Thumbnail Managing Standard.
- KDE Dolphin: Dolphin handbook, view modes,
KFilePreviewGenerator. - Lightroom Classic: Import photos, Library views, Keyboard shortcuts.
- Photo Mechanic: User guide.
- darktable: Import module, Lighttable overview, Timeline, Filmstrip.
- digiKam: Main window views, Dates view, Timeline view.
- egui-pop: Choosing files, the file dialogs survey, the navigation study.
Administration as forms: one declarative surface for settings, tools and tasks
Status: accepted (2026-11-08), with the recommendations of section 8
(Q1 to Q10). Slice 1 is built: the model (egui_pop_model::admin:
manifests, value scopes, hooks, argument templates, the settings’
generated pages) and the shell (egui_pop_api::admin, AdminPlugin:
overlay and pop out, scopes and sections in a resizable tree, search, rows with a modified
bar, an origin tag, reset and “Set for”, deep links, commands admin.*,
the admin collector), shown in the gallery’s Settings page.
Slice 2 adds the record bricks: list and table items (Records)
read from a read_only command (an array at a JSON pointer) or a
records hook, with columns, a tone key, row actions and an empty
state; statuses read from read_only commands; when and enabled
evaluated (the context keys plus the section’s values as
form.<field id>; a clause that does not parse is reported). A read is
asked as a command run before the next frame and its answer taken from
the runs; it is kept until a command that changes something runs or an
event a node names in refresh arrives. Tables draw as a striped grid,
not yet through egui-pop-views’ data table; row fields, add and
remove, selection, bulk actions and group-by are still to come. Rows lay
their right-hand controls from the page’s right edge and wrap their help,
so nothing passes the page.
Slices 3 and 4 are on the application’s side (Helios): its scopes and
its settings placed through a bridge (layers: machine, library, person,
command line), then its Storage and Backup pages declared as manifests.
The volume table and the strategy statuses read the application’s own
read_only commands, with row actions over its commands; the scope and
section titles go through the application’s catalogues before they are
declared, since declared titles are shown as given. Its hand-drawn
Storage window went with slice 5, once row fields, confirmations and
the strategy as a form existed.
Slice 5 adds the editing bricks. Row fields (RowField): a
record’s value shown as a toggle, a text (written when left or on
Enter) or a choice (declared choices, and choices the record holds at a
key), written through a command whose arguments name the record
(${row.<key>}) and the value (${value}); in a table one takes the
place of its key’s column or adds a column, in a list it shows under
the record’s title. Confirmations: an action declares one (title,
text, verb, danger; its texts may name the row) and the dialogs’
Confirm asks it before the command runs; a confirm hook is asked the
same way. A meter column (CellKind::Meter): a share from 0 to 1
drawn as a bar with the words of another key. An icon column
(CellKind::Icon, Records::icon) says a state by a symbol, as the
guideline “symbols over text” asks: the record’s value is an
IconCell, a registry icon’s name (phosphor:cloud-slash, warning)
with an optional tone (info, success, warning, danger, muted)
and its reason (tip): plain text, or a CellText key with its English
and arguments ({"key": "node-offline", "text": "Offline since { $since }", "args": {"since": "Monday"}}), translated where it is shown. A bare
name is the icon alone, its reason then read at the column’s text key.
The reason is the tooltip and the accessible name, so screen readers
and agents read why. A name the registry does not know draws the
placeholder, logged once and listed by icon::registry::unknown with
the column (admin table column <key>). Row fields and row
actions read their when and enabled against the record
(row.<key>). A source answering an object at its pointer is one
record, so a single record (a backup strategy) is edited as a list of
one. A deep link scope/section/<record key> marks that record and
scrolls to it. Helios’s Storage and Backup pages are built on these.
Slice 6 makes the Settings app the settings: Ctrl+,, File > Settings
and app.settings open it, and AdminPlugin is in DefaultPlugins
(one added on its own takes the group’s place). What the settings window
drew itself are its pages, as registered widget kinds: Input › Keyboard
shortcuts (shortcuts), Input › Pointer gestures (gestures, the same
editor with the gestures alone), Interface › Fonts (fonts) and one
page per custom SettingsPage (settings-page, in its first setting’s
scope; app.settings.page opens it there). A widget names the settings
it edits in its options’ settings, so the generated pages leave them
out. The window stays behind General › Advanced
(app.settings.window). Helios’s health check is its Health scope
(findings as a record list with their fix and Ignore as row actions).
Slice 7 takes the search inside the pages. A widget kind registers its
search (Admin::widget_search): the shortcuts and gestures editors find
their commands by name and by key. The settings a widget names in its
options’ settings are searched as fields are, and a section is found by
its title, description and keywords. The left panel lists each section
found with up to eight of its items; choosing one, or “Show” on the page
of results, lands on its section with the item marked (a setting id, or
the widget’s item key: Admin::marked), scrolled to once
(Admin::take_key) and said selected to assistive technology. A custom
page now claims its settings (settings-page options’ settings): they
leave the generated pages, so each shows once, and
settings_window::setting_row draws them as the app’s rows while the
app draws the page. A setting id that a widget edits resolves to the
widget’s section (Tree::resolve).
Slice 8 is the wizard kit (section 5.3), in egui_pop_model::admin::wizard
and egui_pop_api::admin::wizard. A manifest declares wizards
(Manifest::wizard); a step is built as a section is, its fields draft
fields (Field::draft) that declare their own Input (default, choices,
range, required) in place of a setting’s descriptor. Flow is the pure
state of a wizard being filled: Next checks the step (each field’s own
checks, its validate hook, the step’s hook; a danger problem blocks, a
warning lets through), a step’s when reads the draft as form.<key>,
an optional step’s Skip takes its values back, going to a step lands on
the first invalid one before it with its reason, and Finish fills the
command’s template from the draft (a field of a step not shown is
null; no template: the draft as an object). While a wizard runs it
fills the Settings app’s page: the stepper on the left (a list whose
items say “Step 2 of 4, Destination, done”), the step’s form with each
problem under its field, and a footer with Cancel, Back, Skip and Next
(the summary’s Finish carries the wizard’s verb), Next greyed with its
reason beside it and in its tooltip; toasts keep off the footer
(toasts::keep_clear), as Finish sits in their default corner. Cancel and Escape ask first once
something was entered. Enter (nothing focused) and Alt+N go next or
finish, Alt+B back. Every gesture is a command (admin.wizard.open,
set, next, back, skip, go, finish, cancel; admin.open {"wizard"} too), each answering the flow’s state, which the admin
collector shows with the last finish. Left for later: the run step with
its job’s progress and results, the draft kept per library and “Continue
where you left”, the page rendering, done_when, the wizard-step
kit component, steps in the search.
A short wizard can run as a sheet instead
(Admin::open_sheet_wizard, admin.wizard.open {"sheet": true}): a
window-modal custom dialog over the window it was opened from, which
blocks that window alone while the other windows keep working. The
Settings app does not open. The sheet shows where the flow stands (“Step
2 of 3, Size”, announced to assistive technology as it changes), the
step’s form, and the same footer; Enter and Alt+N go next or finish,
Alt+B back, Escape is the wizard’s Cancel (a question in front of the
sheet once something was entered). Finishing runs the wizard’s command,
its answer to what opened it, and closes the sheet; the sheet’s window
closing ends the wizard with nothing run. One wizard runs at a time: a
sheet is refused while another runs, and closing the Settings app leaves
a sheet running. A custom dialog drawing its own buttons is
Custom::own_footer.
Slice 9 exports and imports settings (egui_pop_model::admin::transfer,
egui_pop_api::admin::transfer). General › Advanced holds “Export
settings…” and “Import settings…”, two wizards of the kit. The file is a
JSON document of kind settings-export, version 1: the values by setting
id with the version of the settings document they were written at (an
import migrates them as the settings file is), optionally the person’s
keymap layer with its version, and leftOut, the sensitive settings
(Descriptor::sensitive) never written. An export takes the app values
(those changed from their default) or a library’s or workspace’s layer,
every setting or one scope or section, with or without the settings
custom pages edit. An import’s plan judges each value: a change, the same
value, unknown, obsolete (Admin::obsolete), invalid (Descriptor::accept:
type, hard range, choices, count, capacity; never clamped) or sensitive.
Its wizard picks the file (a path field with Browse) and the value
scope, then shows the changes as a multi field (each “Title: now → in
the file”, all ticked) over a table of what is left out and why. The
changes chosen apply as one undo step of the settings’ history;
settings.undoImport also restores a layer and the shortcuts. The
commands settings.export, settings.import (both with dryRun),
settings.importPreview (read-only) and settings.undoImport drive it
without the wizards.
Slice 1 leaves for later: the kit components of section 4.4 (the shell draws
with the existing selectable rows, buttons, combo boxes and indicators);
icons on the scope tabs and their overflow; the scopes’ order and the
search’s filters (@modified, @scope:); statuses read from commands
(done in slice 2); when and enabled clauses on nodes (done in
slice 2); draft fields, record lists and tables (lists and tables done
in slice 2), tasks, the wizard kit (done in slice 8); the alter hook
over the tree (Hook::admin); the last place kept across runs (only the
mode is); the application’s link scheme; Helios’s scopes and its
helios-config bridge.
The request: an application’s non-image side (its settings, its tools, its import and export, its backups, its storage, its health check, its plugins, its keys, its jobs) is one application within the application, built by one framework. It is pure forms, like a DOM, and has no image surfaces. Photo work (viewports, the graph, the darkroom, culling grids) stays in the workbench.
The owner’s rules, all binding:
- One administration app for every non-photo surface.
- Two navigation axes: horizontal for the scope or family (tabs with icons), vertical for the sections and names (a left panel). Changed by the owner on 2026-11-12: the tabs ran off a narrow window and pushed the page past its right edge, so the scopes moved into the left panel, a tree with each scope’s sections nested under it, and a divider the user drags sets its width (kept across runs).
- Full page: an overlay of the main window, or a separate system window that can go full screen.
- Components never draw their own widgets. They declare a contract, a manifest: options, actions, status read-outs, record lists and tables, tasks. The framework renders and manages the panels. Custom hooks are allowed; registered widget kinds are declared exceptions.
- Ultra-standard building blocks: a small, finite set of bricks composes every surface.
- Import and Export use the same framework without living inside the settings universe: standalone task surfaces with their own entry points, built from the same manifests and bricks.
- A multi-step wizard kit: declared steps (each a form), validation per step, next, back and skip, a summary, a run step with progress and results, resumable, cancellable where safe, every step deep-linkable.
Helios is the first consumer and drives the inventory, but the framework is egui-pop’s: any egui-pop application declares into it, and egui-pop’s own settings window becomes its first surface.
Out of scope: the image side (viewports, graph, darkroom, grids), the layout of the workbench (egui_stack), the file browser’s internals (see One file browser, many views; here it is a registered widget kind).
1. What exists
Read on 2026-11-08: egui-pop’s next, Helios’s main.
1.1 egui-pop
| Piece | Where | What it already covers | What it lacks for this note |
|---|---|---|---|
| Value descriptors | egui_pop_model::values::Descriptor | A typed value: Float, Int, Bool, Choice, Floats, Ints, Text; label, description, default; hard and soft ranges, step, coarse step, unit, display scale, precision; choices; list count; text capacity; a path hint (directory or file with extensions, shown with Browse); who may write it (Writers). Serialisable. | No when (shown or enabled when), no validation hook, no dynamic choices, no group or order, no scope beyond the store path, no help link, no “needs restart”. |
| Settings | Ctx::setting(SettingId, Descriptor) | A setting at settings/<id>, owned by its plugin (ADR 0004, 0016), applied live, with its reset; read with AppHandle::setting. | One scope: the user’s. No library or workspace layer for settings (the keymap has one, below). |
| The settings form’s entries | hooks::SettingEntry, Hook::settings | Every setting as the form shows it: id, path, owner, a section title (the owner’s, unless an alter hook changes it). Alter hooks reorder, regroup, remove. | The section is a flat title; no scopes, no groups inside a page. |
| The settings window | settings_window::SettingsPlugin | A modal overlay (OverlaySpec ... Kind::Modal, Ctrl+,, File > Settings): a search field over a tree of sections, the generated form, a reset per setting; its own undo history (SETTINGS, ADR 0014); a shortcuts editor (keys captured, conflicts said, user or workspace layer, per-key reset); the pointer gestures; a Fonts page. Commands app.settings, app.settings.page. A settings_window collector for agents. | A modal of fixed size, one axis only (the tree), not a full page, no separate window, no tasks, lists or statuses. |
| Custom settings pages | settings_pages::SettingsPage, Ctx::settings_page | A page a plugin draws, placed in the tree (under, order), found by search (keywords, its settings), its reset (the settings it edits, plus reset_with), mounted through the mount contract (ADR 0013) in a focus scope and a fault boundary. Helios’s theme editor is one. | It draws its own widgets: the exception this note keeps, but declared as such. |
setting_row | settings_window::setting_row | One setting drawn as the form draws it, for a custom page. | The seed of the row brick. |
| Dialogs | dialogs::{Confirm, Form, Choose} | A Form is fields typed by descriptors and the command they go to (Form::new(title, verb, command), field, field_at); a Confirm names its verb and has a danger style; a Choose is a filtered list. Every open dialog is data for agents. | One page; no steps, no validation per field beyond the descriptor, no preview. |
| Commands | egui_pop_model::commands::CommandSpec | Id, title, category, description, when, checked, keys, menus, palette, agent, read_only, an args description (free JSON or a schema), icon. Every command runs through the host (ADR 0023). | Exactly what an action brick binds to; read_only commands are what a status read-out reads. |
| Jobs | docs/progress.md | A jobs model (progress, “n of m”, time left, cancel, pause, resume, retry, the jobs.estimate step), the jobs centre, busy controls, skeletons and empty states. | The run step of a task binds to it as it is. |
| Data views | egui-pop-views, docs/table.md, docs/list-items.md | A virtualised list, a data table (on egui_table), a tree; list items and property rows; their kit (list-row, table-row, list-item). | The list and table bricks render through them. |
| Collapsible sections | docs/sections.md | Sections in egui_stack’s stack, egui-pop’s look, named and observable. | The group brick. |
| Inputs and Tab order | docs/inputs.md | The decorated input, field states (error, warning, disabled), Tab order, F6 through regions, roving groups. | Every field brick uses them. |
| Deep links | docs/instance.md | A single instance and scheme:// links handed to the running one. | admin.open gets a link form. |
| The kit | docs/kit.md | Components drawn by kit handlers from component.state.term tokens; the default kit is a kit. | New components for the shell, rows and the wizard (section 4.4). |
developer.* settings | egui-pop-api devtools, egui-pop-agent, egui-pop-i18n, platform logs | developer.devtools, developer.agentSocket, developer.show_keys, developer.log_level, each a plain setting under its owner’s section. | A Developer scope gathers them. |
egui-pop’s own settings, by prefix: appearance.* (accent colour, focus,
fonts, interface zoom, language, scroll bars, text size, theme preference,
toast corner), dialogs.* (closable, movable), files.* (folders first,
native chooser, preview), input.* (pointer profile, wheel device and
speed, slider wheel, image double click), menus.icons,
notifications.desktop, palettes.*, tips.*, viewer.image_hosts,
window.* (frame, bar in full screen), workbench.* (panel alignment,
side bar position), developer.*.
What the existing pieces already say. Descriptors and commands cover most of a manifest: a field is a descriptor bound to a store path, an action is a command with arguments, a status is a read-only command, a form is a list of fields and a command. What is missing is the tree (scopes, sections, groups), records (lists and tables with row actions), tasks and steps, the hooks a descriptor cannot express (validation across fields, dynamic choices, previews), and a shell that is a full page with two axes.
1.2 Helios
| Surface | How it is drawn today | Entry | What it holds |
|---|---|---|---|
| Settings window | egui-pop’s, generated | Ctrl+,, the system menu | egui-pop’s settings plus Helios’s three: display.wide-gamut-preview, notifications.jobs, health.destinationDays; the shortcuts editor with the workspace layer; the theme editor (a custom page). |
helios-config settings | Not shown anywhere in the GUI | TOML files, --set KEY=VALUE, helios inspect describe config | Declared once with a concern (machine, project, user) and layers (default, global, project, user, run): system.cache.budget, system.cache.share, system.cache.thumbnails, system.map.exclude, system.map.defaults, system.map.record, system.map.limit, system.map.keepMissing, system.scheduler.workers, system.ai.calls, system.events.journal, system.workflow.keep_days, project.decisions.mode, interface.panels.queue_when_empty, interface.graph.zoom, interface.experimental.workshops. docs/architecture.md says pages come from the page.group.name naming; that page generator was never wired into the desktop. |
| Storage page | Hand-drawn egui::Window (620 by 480, centred), DragValue, ComboBox, frames | Library > Storage… (library.storage, {"volume": id}) | The backup strategy (none, or copies, destinations, off site, when) and “Back up now” (library.backupNow); every volume (name edited in place, kind, capacity, free space, role toggles, off-site and RAID flags, node, last seen, photo count, “Mark this disk…” with a confirmation). Saved at once. |
| Health check | Hand-drawn page | Help > Health check (help.health), the status bar’s badge | Findings by level (problem, warning, fine), each with detail, “Fix…” (a command), “Ignore”; “Ignored (n)” with “Show again”; “Check now” (health.checkNow). Checks: free space, catalogue integrity, the library, the backup strategy, photos backed up, backup disks seen lately, verified copies, cards safe to format. |
| Import window | Hand-drawn egui::Window, three columns, about 1,800 lines with its choices | File > Import… (Ctrl+Shift+I, library.importWindow), the empty library, a card’s toast, drop and paste | Sources (cards, recent folders, favourites, “Choose a folder…”), contents by capture day with ticks and “New only”, choices (copy or add, into and layout with an example path, name pattern with an example, duplicates, darktable edits, “More”), presets (Default, saved, Save as, Delete), totals, Cancel and Import; library.importFiles with the choices as arguments. |
| Import dialog (scripts) | egui-pop Form | library.importSource, library.importFiles without arguments | Referenced or copied, “Remember for this workspace”, darktable edits. |
| Importer plugins | Menu entries, then a file or folder chooser | File > Import from (library.importWith) | An importer a plugin declares. |
| Export | egui-pop Form | File > Export… (Ctrl+Shift+E, library.export) | The workspace’s export settings, “Remember for this workspace”; runs as a parent job with an export per image. |
| Keyboard shortcuts | egui-pop’s shortcuts editor | Settings, the system menu | Keys per command, user or workspace layer. Keymap packages (keymap.package, keymap.package.remove) are commands only. |
| Themes and profiles | System menu lists; the theme editor is a custom settings page | theme.select, profile.use, profile.import, profile.export, theme.exportMerged | A theme and its overrides; profiles saved per workspace. |
| Plugins | CLI and commands only | plugin.list, plugin.enable, plugin.disable, plugin.grant, plugin.revoke | No GUI. |
| GPU and compute | CLI and commands only | compute.list, compute.probe, compute.benchmark, compute.enable, compute.disable, compute.role, compute.route, compute.budget, compute.remote | No GUI; the calibration reports as a job once the desktop opens a compute manager. |
| Jobs | egui-pop’s jobs centre (a panel and the status bar’s popover), job consoles | The status bar | Live jobs, Cancel, logs. |
| Library and workspaces | Commands, Forms, the workspace editor (workspace.edit) | File menu, system menu | library.default, library.db, vault.integrity, workspace.new, workspace.open, workspace.saveAsTemplate, workspace.importParts, workspace.reset. |
| Developer | Plain settings in egui-pop’s window | Settings | developer.devtools, developer.agentSocket, developer.log_level, developer.show_keys; logs.reveal in the palette. |
| Catalogue snapshots | Research only (docs/storage-backup-research.md) | None yet | Snapshots on close and daily, copied to backup volumes; restoring one is a health fix’s suggestion. |
Count. Three hand-drawn windows (Storage, Health, Import), about 3,000 lines of egui calls between them; sixteen declared settings with no GUI; five families of commands (plugins, compute, keymap packages, profiles, snapshots to come) with no GUI at all. Everything else is already declared and generated.
2. Survey
From the products’ documentation and use; the links are in section 9. “Unconfirmed” marks what we did not check against a source.
2.1 Settings and preferences
| App | Navigation axes | Search | Scopes | Contributed settings | Deep links | Reset and modified | Modal or page |
|---|---|---|---|---|---|---|---|
| Blender Preferences | One vertical list of sections on the left (Interface, Themes, Viewport, Editing, Animation, Add-ons, Input, Navigation, Keymap, System, Save & Load, File Paths); one long page with collapsible panels | Inside Keymap, Add-ons and Themes only | App only; per-file settings live elsewhere (the Properties editor) | Add-ons draw their own preferences under their row (AddonPreferences.draw), a counter-example | The operator screen.userpref_show(section=...) | Right click “Reset to Default Value”; no modified marker (unconfirmed for 4.x) | A separate window; saved automatically or by a button |
| darktable | Tabs on top (general, import, lighttable, darkroom, processing, security, storage, miscellaneous, shortcuts, presets, Lua options), then headed groups | In the shortcuts tab | App only | Lua scripts register preferences (darktable.preferences.register), drawn by the host in the Lua options tab: a declarative precedent | None | A double click on a label resets; a changed value is marked (unconfirmed which mark) | Modal dialog |
| Lightroom Classic | Tabs on top (General, Presets, External Editing, File Handling, Interface, Performance, Display, Network…) | None | Two dialogs: Preferences (app) and Catalog Settings (the library) | Plug-ins add sections to the Plug-in Manager and to Export through the SDK’s view factory (LrView: rows, fields bound to property keys): the host’s vocabulary, the plug-in’s layout | None | “Restore defaults” per area | Modal |
| Photoshop | A list of panes on the left (General, Interface, Workspace, Tools, History Log, File Handling, Export, Performance, Scratch Disks, Cursors, Transparency, Units & Rulers, Guides, Plug-ins, Type, Technology Previews), Prev and Next buttons | None (the Discover panel searches features, not preferences) | App only | None | None | “Reset Preferences on Quit”; some panes “need a restart” | Modal |
| Capture One | Tabs with icons on top of the Preferences window (General, Appearance, Image, Color, Exposure, Warnings, Capture, Plug-ins…, unconfirmed list) | None | App; catalogue or session for import and output | Plug-ins in their own tab | None | Unconfirmed | Window |
| VS Code | Search first; a scope axis as tabs (User, Remote, Workspace, Folder); a table of contents on the left (Commonly Used, Text Editor, Workbench, Window, Features, Application, Extensions > each one) | Full text over ids, titles and descriptions; filters @modified, @ext:, @id:, @feature:, @lang:, @tag: | application, machine, machine-overridable, window, resource, language-overridable per setting | Declared: an extension’s package.json contributes.configuration is a JSON Schema per key (type, default, enum and its descriptions, markdown description, scope, order, deprecation, edit presentation); the host renders every one | vscode://settings/<id>; the command workbench.action.openSettings with a query | A bar at the left of a modified row; a gear menu (Reset Setting, Copy Setting ID, Copy as JSON); “Also modified in Workspace” | A page (an editor tab), with a JSON view of the same values |
| JetBrains IDEs | A tree on the left (Appearance & Behavior, Keymap, Editor, Plugins, Version Control, Build, Languages, Tools, Advanced Settings) | Above the tree: filters the tree and highlights matching labels inside pages; options indexed at build time | IDE or project, a marker on project-level pages | Plug-ins declare configurable pages in plugin.xml (applicationConfigurable, projectConfigurable: parent id, id, name); the configurable builds its UI, usually with the Kotlin UI DSL bound to properties | ShowSettingsUtil.showSettingsDialog(project, id) | “Reset” per page; modified pages marked in the tree (unconfirmed); Apply, OK, Cancel | Modal |
| GNOME Settings | A sidebar of panels (Network, Bluetooth, Displays, Sound, Power, Multitasking, Appearance, Apps, Notifications, Search, Online Accounts, Sharing, Mouse & Touchpad, Keyboard, Color, Printers, Accessibility, Privacy & Security, System), sub-pages pushed inside a panel | At the top of the sidebar: panels by keywords | System or user | Panels are built in; the libadwaita bricks are finite: preferences page, group, action row, switch row, combo row, spin row, entry row, expander row | gnome-control-center <panel> | None per row | A window |
| macOS System Settings | A sidebar with search, a pane of grouped inset lists, sub-pages pushed inside | Top of the sidebar, highlights the matching pane | System or user | Third-party panes (legacy .prefPane) | x-apple.systempreferences:<pane>?<anchor> | None per row | A window |
| Windows Settings | A left list of categories (System, Bluetooth & devices, Network, Personalization, Apps, Accounts, Time & language, Gaming, Accessibility, Privacy & security, Windows Update); pages with a breadcrumb and sub-pages; setting cards and expanders | Top of the left list | System or user | Built in | ms-settings:<page> | None per row | A window |
2.2 Tasks and wizards
| App | Shape | Steps | Validation | Summary | Run | Resume, cancel |
|---|---|---|---|---|---|---|
| Lightroom Classic import | One full page: a top strip read left to right (source, then Copy as DNG, Copy, Move or Add, then destination), sources on the left, the grid in the middle, panels on the right (File Handling, File Renaming, Apply During Import, Destination), presets at the bottom; a compact mode | Implied by the strip; one page | Inline (no photos ticked: Import disabled) | The bottom bar’s counts | Background, a bar at the top left | Cancel the background task |
| Lightroom Classic export | A dialog: presets on the left (Lightroom’s, the user’s, plug-ins’), collapsible sections on the right (Export Location, File Naming, File Settings, Image Sizing, Output Sharpening, Metadata, Watermarking, Post-Processing); plug-ins add sections | One page | Inline | None | Background | Cancel |
| Capture One import | One page: a source browser, thumbnails, panels (Import To, Backup To, Naming, Metadata, Adjustments) | One page | Inline | None | Background | Cancel |
| macOS Migration Assistant | A wizard: how to transfer, from which source, a code to compare, what to transfer (a checklist with sizes), progress with time left, done | Linear, with Back | Per step (the source must answer) | The checklist with sizes | Long, progress and time left | Cancellable; restart from the start (unconfirmed) |
| GNOME Initial Setup | A wizard: language, keyboard, privacy, time zone, online accounts, about you, password, ready | Linear, Back and Next in the header bar, some skippable | Per step | None, “Ready to go” | Short | Not resumable |
| Windows installers (MSI, WiX, Inno Setup) | A wizard: welcome, licence, destination, components, Ready to install (Inno’s memo of every choice), installing, finish | Linear, Back, Next, Cancel | Per step (disk space, a path) | A dedicated step | Progress, then a finish page with “Launch” | Cancel rolls back (MSI) |
| VS Code walkthroughs | Declared (contributes.walkthroughs): steps with media, each completed by an event (onCommand, onSettingChanged, onView) | Non-linear, a checklist | By the completion events | None | Commands | Progress kept per user |
| JetBrains New Project | A list of generators on the left, a form on the right, more steps for some | Next, Previous | Per step | None | Short | No |
| JSON Forms (EclipseSource) | A UI schema over a JSON Schema: layouts (vertical, horizontal, group) and Categorization, rendered as tabs or as a stepper (variant: stepper) from the same schema; rules show, hide, enable, disable on a condition | The categories | The schema’s | None | None | None |
| react-jsonschema-form | A JSON Schema plus a UI schema (ui:widget, ui:order, ui:help, ui:options); a registry of widgets, fields and templates; custom widgets by name; validation by a pluggable validator; conditional parts by dependencies and if/then | One page | Schema plus custom validation | None | None | None |
| Qt property browser, KConfigXT | Qt’s: property managers (the model), editor factories per type (widget kinds), browsers (tree, group box, button: the layout). KDE’s: a .kcfg file declares entries, a dialog binds widgets named kcfg_<name>, Defaults and modified state come for free | One page | Per type | None | None | None |
2.3 Patterns
- Two axes are common, and the horizontal one is never the same thing. darktable, Lightroom and Capture One put families on top tabs and groups under them; VS Code puts the value scope (User, Workspace) on top and families on the left. The owner’s direction is the first: families on top. The value scope then needs another place (section 3.4).
- Settings in the OS and in the big IDEs are search-first: a search field at the top of the navigation (GNOME, macOS, Windows, JetBrains) or of the page (VS Code). Photo tools have none. Every search shows the results in place, not as a list of links.
- Library settings apart from app settings. Lightroom’s two dialogs, Capture One’s catalogue and session, JetBrains’ IDE and project. Two dialogs is the known complaint; one surface with a scope marker is the modern answer (VS Code, JetBrains’ marker).
- The best extension models are declarative. VS Code renders every extension’s settings from JSON Schema; darktable renders Lua’s; Lightroom’s SDK gives a host vocabulary. Blender and JetBrains let plug-ins draw, and their preferences look like a dozen apps glued together.
- A finite brick set is a known, good thing. libadwaita (action, switch, combo, spin, entry, expander rows inside groups inside pages) and WinUI’s setting cards and expanders build all of GNOME’s and Windows’ settings from about eight bricks.
- Deep links exist wherever settings are a page (VS Code, GNOME, macOS, Windows), and are the way a health finding or an error message sends the person to the fix.
- Modified markers and per-row reset are rare outside VS Code and darktable, and loved where they exist. egui-pop already has per-row reset.
- Import and export in photo tools are one page, never a wizard (Lightroom, Capture One), because people import daily. Wizards are for what happens once (first launch, migration, an installer), and their common shape is fixed: steps on the side or as a header, Back and Next, a “Ready” summary, a run with progress, a finish page with follow-ups.
- One schema, two renderings. JSON Forms renders the same categories as tabs or as a stepper. That is the answer to “wizard or single page” for import: the steps are declared once; the shell chooses.
3. The model: a declarative form tree
3.1 The tree
Every node has an id (stable, never translated, unique among its
siblings), a title and optional description (translated through the
strings catalogue, as settings are today), keywords for search, an
icon (from the icon vocabulary), an order, a when clause (shown when
it holds; the existing when language) and an enabled clause (greyed
with its reason otherwise). A node’s path is its ids joined by /.
| Kind | Holds | Renders as | Notes |
|---|---|---|---|
| app | scopes | the administration shell (section 5.1) | One per application; plugins add to it. |
| scope | sections | a top-level entry of the left tree (a tab on top until 2026-11-12) | Settings, Storage, Backup… (section 6). |
| section | groups and nodes | an entry of the left panel, and the page shown | One level of nesting below (sub-sections), no deeper. |
| group | nodes | a heading and a block on the page, collapsible | Listed under the active section in the left panel as anchors. |
| field | a value | a row: label, control, help, modified marker, reset | Its kind is one of the bricks (section 4.1). Bound to the store or to a task’s draft. |
| action | a command and its arguments | a button (primary, secondary or danger) or a link | Confirmation optional; busy while its job runs. |
| status | a read-out | a row: label, value, tone, last updated | Read from a read-only command or a provider; refreshed on events. |
| list and table | records | a list of record rows, or a data table | Row actions, row fields, add and remove, selection, an empty state (section 3.3). |
| task | inputs, a run command, results | a page with a footer (presets, totals, Cancel, the run verb) | The unit Import and Export are made of. |
| wizard and step | steps, each a form | a stepper and a page per step, or all steps on one page | Section 5.3. |
| widget | a registered kind and its options | whatever the kind draws, in a row or a block | The declared exception: the file browser, the key-chord editor (section 4.3). |
| page | a draw function | the plugin’s own drawing, in a focus scope and a fault boundary | Today’s SettingsPage, kept as a declared exception, counted and listed by the inspector. |
A section’s page is generated from its children in order. Nothing in the tree says how many columns or pixels; the framework lays out, the kit paints.
3.2 Bindings
To the store. A field binds to a value path. A setting keeps its
path, settings/<id>, and its descriptor; the field adds what the
descriptor lacks:
field id: "destinationDays"
bind: setting "health.destinationDays" # descriptor from the declaration
scopes: [app] # where it may be set (3.4)
kind: number # default: from the descriptor's type
help: "A backup disk not seen for longer is a warning."
restart: false
A field may declare its own descriptor instead (a task’s input, a record’s row field). Its value then lives in the task’s draft (3.5) or the record (3.3), not in the settings.
To commands. An action is a command id and an argument template.
${field} takes a field’s value from the same form, ${row.<key>} a
record’s, ${selection} the selected records’ ids. The command’s
CommandSpec gives the title, icon, keys and when when the action does
not set them, so an action and the palette entry are the same thing.
action id: "backupNow" command: "library.backupNow" style: primary
confirm: none busy: job "backup"
A status binds to a read_only command and a JSON pointer into its
answer, or to a provider registered in Rust; refresh names the event
kinds after which it is read again (job.finished, vault.*,
storage.volume.*) and a period. Statuses are never polled per frame.
3.3 Records: lists and tables
A list or table names a record source: a read-only command returning
an array of objects (compute.list, plugin.list), or a provider
registered in Rust (the volume registry). It declares:
- the key of a record (its id) and its title and subtitle fields (a list) or columns (a table: key, title, kind, width hint, sortable);
- row fields: fields bound to a record’s key, written through a
command (
storage.volume.set {"volume": ${row.id}, "name": ...}), shown inline or in a details pane under the row (an expander row); - row actions (each an action with
${row.*}), a primary one run by Enter or a double click, and bulk actions on the selection; - add (a command, often with a form) and remove (a command, with a confirmation), when the source allows them;
- a tone per row from a field (a finding’s level, a volume offline);
- an icon cell per row from a field: a state said by a symbol, its reason in the tooltip (a node offline, asleep, refused);
- an empty state (a message and an action: “No backup disk yet. Add one…”);
- group by a field (findings by level, volumes online then offline).
Rendering goes through egui-pop-views (list, table) and list items, so
virtualisation, keyboard and the kit come for free.
3.4 Value scopes: app, library, workspace
Every field says where its value may be set: app (this person on this
machine), library (the open library, shared by everyone using it) and
workspace (the open workspace’s own files). A run override (a command
line --set) is a fourth origin, shown, never edited.
| Here | egui-pop today | Helios today (helios-config) |
|---|---|---|
app | the settings store (settings/<id>) | global (and user, which follows the person on every machine) |
library | none | project |
workspace | the keymap’s workspace layer | the workspace’s files (import source, export settings, keys) |
| run, shown only | none | run |
Helios’s concerns map: machine to app only, project to app and
library, user to app (and workspace where it makes sense). egui-pop
needs a layered store for settings (a library and a workspace layer above
the user’s), which the keymap already has: that is a model change, the
first slice’s.
A row shows where its value comes from (a small origin tag:
library, workspace, run; nothing for the default) and its reset
takes back the value of the layer shown. A field settable in several
scopes has a menu in its row, “Set for: this app, this library, this
workspace” (JetBrains’ marker and VS Code’s “Also modified in”, without
VS Code’s top tabs, which the families took).
3.5 Tasks
A task is a form whose values are a draft, not settings: its fields’
values live under tasks/<task>/draft in the store (per library, so
“the last used” is remembered where it makes sense) until it runs. It
declares:
- its inputs (fields, lists, widgets);
- its presets: named drafts (Default, the user’s, a plugin’s), with Save as, Rename, Delete; the brick is the task’s footer menu;
- its run: a command with the draft as arguments (
library.importFileswithpathsand the choices) and a verb (“Import 248 photos”); - its totals: statuses computed from the draft (count, size, space left on the destination);
- its results: what the job’s end returns (counts, a record list of what failed or was skipped) and follow-ups (actions: “Show in library”, “Back up now”, “Eject the card”, “Open folder”).
The draft is the command’s arguments: an agent runs the same task by the
command alone, with dry_run where the command has it. The form is only
a way to fill the arguments.
3.6 Hooks
Hooks are Rust functions registered by name (HookId, as the alter
hooks) and named by the manifest. They compute; they never draw.
| Hook | Signature, in words | Used for |
|---|---|---|
validate | (the form’s values) to diagnostics per field and for the form | A pattern that does not parse; the destination not writable; Next disabled with the reason. Field-level checks the descriptor can say (range, capacity, path kind) need no hook. |
transform | stored value to shown value, and back | A byte budget shown in GB; a list of globs stored as one text. |
choices | (the form’s values) to choices with labels and hints | Destinations among the volumes with a backup role; presets; GPU devices. |
preview | (the form’s values) to a text or a small record | The example path and file name from the first ticked photo; “Copies to: Backup A, Backup B”. |
confirm | (the action and the form) to a confirmation or none | “Forget this volume? 1,204 photos lose their location.” Danger style, Cancel focused. |
status | (none) to a value and a tone | What a read-only command cannot give cheaply. |
records | (none) to records | A source with no command. |
The when and enabled clauses cover “shown or enabled when” without a
hook: they read the form’s values as context keys (form.copy == true).
3.7 Manifests
A manifest is what one owner (the app or a plugin) contributes: nodes, each placed by its parent’s path, plus the hooks and widget kinds it registers. It is data with names: Rust builders produce it, and it serialises to JSON so an out-of-process plugin can send it and an agent can read it.
// Rust builders: the same shape as SettingsPage and Form today.
ctx.admin(
Manifest::new(1)
.section("backup/strategy", "Strategy", |s| {
s.field(Field::setting(STRATEGY_COPIES))
.field(Field::setting(STRATEGY_OFFSITE))
.status(Status::command("Last backup", "backup.status", "/last"))
.action(Action::command("library.backupNow").primary())
})
.section("storage/volumes", "Volumes", |s| {
s.table(Table::provider("volumes", VOLUMES)
.column("name", "Name").column("free", "Free")
.row_field(Field::text("name", "Name").write("storage.volume.set"))
.row_action(Action::command("storage.volume.forget").danger()))
}),
)?;
- Versioned:
Manifest::new(1), the format’s version; a manifest of a newer version than the framework is refused and reported (ADR 0003), one of an older version is read through a migration (ADR 0008’s way). - Tolerant of new bricks: an item whose
nodethis version does not know reads asItem::Unknown(kept as written);Manifest::checkreports it (admin-unknown-node) and leaves it out, so the rest of the page still shows. A known node that does not read is still an error. - Owned (ADR 0004): a plugin’s nodes leave with it; a node placed under a path that does not exist lands in the plugin’s own section of the Plugins scope, with a diagnostic.
- Altered by alter hooks, as the settings entries are today
(
Hook::admin): reorder, regroup, hide. - Checked when the application resolves its declarations: every bound setting exists, every command exists, every hook and widget kind is registered, every id is unique among its siblings. A failure is a diagnostic and the node is left out, never a panic.
- Seen by agents: an
admincollector gives the resolved tree, and the inspector counts the custom pages and widgets (the exceptions).
3.8 Ordering
Tree::merge places the sections of every manifest in their scope, once
for all, after each merge:
- Anchors first choice. A section says where it goes relative to
another, whichever manifest declares it:
after: "storage/volumes"orbefore: …(the builder’ss.after("storage/volumes"); an id alone,after: "volumes", means a section of the same scope). An anchor resolves once every manifest is merged, so it may name a section of a manifest merged later; two sections anchored after the same one keep their declared order, andafterwins overbefore. - Without an anchor, the key is (rank, the manifest’s registration
rank, the position in the manifest). The rank is the section’s explicit
orderif it has one (s.order(n), ororderin the JSON), else its position among its manifest’s sections of the same scope. Before, it was the position among all the manifest’s sections, so inserting a section in one scope shifted the numbers of the manifest’s sections in every other scope and moved them among another manifest’s; now an insert moves nothing outside its own scope and manifest. The builder leavesorderat 0 (no explicit order); the generated settings pages number theirs, and the settings window’s pages sit at 1000 and after, Advanced at 2000, so the existing pages keep their places. - No silent tie. Two manifests giving sections of one scope the same
explicit, non-zero
orderare still placed in registration order, with anadmin-order-tiediagnostic naming both. An anchor naming no section of the scope (or a cycle of anchors) leaves its section at the end of its scope, with anadmin-unknown-anchordiagnostic.Tree::order_diagnosticsgives them; the admin service logs each once, when it first shows, and keeps it with the manifests’ diagnostics.
Until 0.24 a section’s order was its index in its own manifest and the
sections of all manifests were sorted together by it: inserting a section
in one manifest moved another manifest’s sections that happened to share
the number.
4. The standard bricks
The list is closed: adding a brick is a decision in this note, not in a plugin.
4.1 Field kinds
| Kind | Value | Renders like | From today’s descriptor |
|---|---|---|---|
toggle | bool | a switch at the row’s end | Bool |
number | int or float | a slider and a field when a soft range is given, a spin field otherwise; unit, step, coarse step | Float, Int |
choice | one of n | a segmented control (up to 3, icons allowed), radio rows (4 or 5, with a hint each), a drop-down (6 and more), decided by the framework | Choice |
multi | some of n | check rows, or chips past 6 | new (a list of choices) |
text | text | a single-line field; a pattern with a preview hook; capacity | Text |
long-text | text | a multi-line field | Text with lines |
path | a path | a field and Browse (egui-pop’s folder or file chooser) | Text with a path hint |
list | values | an editable list of entries (add, remove, reorder): globs, folders | Floats, Ints, a list of texts (new) |
colour | a colour | a swatch and a picker popover | new |
keys | a key chord | the chord, captured by pressing it; conflicts said | the shortcuts editor’s capture, as a field |
note | text, read-only | a line of text, its icon before it when its meta has one; left out of the wizard’s summary, never required | new (Field::note): its draft value, so the host can set it once the form is open (a count); empty, its title |
Eleven kinds: ten take input, the note only says something (what the
form will also do). A date, a secret and a slider over a curve are not in the
list until something needs them.
4.2 Layout and display bricks
| Brick | Renders like |
|---|---|
page | A section’s page: its title, its description, its groups; scrolls; the modified count and “Reset section” in its header. |
group | A heading, an optional description, its rows in an inset box; collapsible. |
row | Label and help on the start side, the control on the end side; the modified marker before the label (a bar on the start side, as VS Code); the origin tag; the reset button on hover and focus; the field’s diagnostics under it. Every field, status and action is a row. |
callout | A message with a tone (info, success, warning, danger) and an optional action, at the top of a page or group. |
status | A row whose control is a value with a tone, a badge, a meter (used of total) or a relative time (“2 days ago”). |
action | A button: primary (one per page at most), secondary, danger; or a link in a row. |
record list | List items with a title, subtitle, trailing value, tone, row actions; an expander for row fields. |
record table | egui-pop’s data table with sorting, selection, row actions, a details pane. Its cells: text, a meter (a share with its words), an icon (a registry icon, its tone, its reason as tooltip and accessible name). |
stepper | The wizard’s steps: on the left panel in the admin shell, as a header strip in a narrow window. |
footer | A task’s bar: presets menu, totals, Cancel, the run verb. |
progress | A job’s bar, “n of m”, the item, time left, Cancel, the log toggle (the jobs centre’s row). |
results | Counts with tones, a record list of what failed or was skipped, follow-up actions. |
empty | An empty state: a message, an illustration-free icon, an action. |
4.3 Registered widget kinds
A widget kind is registered in Rust (ctx.widget_kind(id, kind)) with
its value type and its options schema; the manifest places it like any
node. It must take part in Tab order, accessibility, search (by its
keywords) and reset. The ones the inventory needs:
| Kind | For |
|---|---|
file-browser | Import’s contents: One file browser, many views as a widget kind (its view modes, file source and thumbnail provider), its value the ticked entries. |
source-list | Import’s sources: cards and cameras mounted, recent folders, favourites, “Choose a folder…”. Could be a record list with a provider; kept as a candidate kind until the first slice shows it cannot. |
shortcuts | The shortcuts editor: every command with its keys, capture, conflicts, layer. |
gestures | The pointer gestures and their pad. |
theme-editor | Today’s theme editor page. |
font-picker | The family picker with its live preview. |
Everything else in section 6 fits the bricks.
4.4 Kit components
New kit components, in the kit’s vocabulary (component.state.term),
each based on an existing one where it can be:
admin-tab, based ontab: the scope tabs (icon above or before the label),selectedfor the current scope;admin-nav-item, based onlist-item: the left panel’s entries,selectedfor the page shown, a muted count of modified values;form-group: the inset box of a group (fill,border-*,radius,padding-*);form-row: a row (padding-*,hover,focus), withindicator-color,indicator-sizeandindicator-side: leftas the modified marker (stateselectedwhile modified, so a kit restyles it with data);form-origin: the origin tag, based on the indicators’ pill;callout, with the four tones;wizard-step, based onadmin-nav-item:rest(to do),selected(current),active(done),disabled(not reachable yet), and a tone for an invalid step.
The bricks never set a colour or a size of their own: what is not a kit token comes from the theme’s tokens.
5. Surfaces
5.1 The administration app
+--------------------------------------------------------------------------+
| [gear] General [brush] Interface [kbd] Input [lib] Library [disk] |
| Storage [shield] Backup [chip] Hardware [puzzle] Plugins [heart] |
| Health [list] Jobs [code] Developer [search......] |
+------------------+-------------------------------------------------------+
| Strategy 2 | Strategy Reset section |
| Copies | +---------------------------------------------------+ |
| Destinations | | | Verified copies [ 2 ] | |
| Status | | Off site required [on ] | |
| Cards | | When [After each import v] | |
| Snapshots | +---------------------------------------------------+ |
| | Last backup 2 days ago (warning) |
| | [ Back up now ] |
+------------------+-------------------------------------------------------+
- Horizontal axis: the scopes as tabs with an icon and a label; past the window’s width the labels go first (icons only, the label as a tooltip and accessible name), then an overflow menu.
- Vertical axis: the left panel lists the scope’s sections; under the page shown, its groups as anchors; a muted count of modified values per entry.
- The page: generated from the section’s nodes.
- Full page, two modes (Q1):
- overlay: a layer over the whole main window (above the workbench, below the toasts), the workbench kept as it was; Escape or the close button returns; not a modal dialog of fixed size;
- window: a separate system window (an egui viewport) with the frame’s title bar, which goes full screen with F11 as the main one;
- a “Pop out” button in the overlay moves it to a window, keeping the place; the mode used last is remembered.
- Applying: settings apply live, as today, with the settings’ undo
history (
Ctrl+Zwhile the focus is in the app) and per-row reset; tasks apply only when run.
5.2 Standalone task surfaces: Import and Export
Import and Export are task surfaces: the same shell without the
scope tabs, opened by their own entry points (Ctrl+Shift+I,
Ctrl+Shift+E, a card’s toast, a drop), as an overlay or a window like
the app. Their left panel is the task’s steps; their footer is the task’s
footer. Their defaults and presets also appear in the app’s “Import and
export” scope, as plain sections (the same manifest nodes, placed twice:
a node may be mounted in more than one place, its path being the
first).
5.3 The wizard kit
The contract.
wizard id, title, icon
draft: per library | per app | none
steps: [step...]
summary: auto | custom nodes
run: command, verb, cancellable: never | until <phase> | always
results: nodes, follow-ups
rendering: steps | page | ask (Q4)
step id, title, description
nodes: fields, lists, widgets, statuses, callouts
validate: hook (optional; descriptors' own checks always run)
when: clause (the step exists only when it holds)
optional: bool (Skip is offered)
done_when: clause (for a checklist-like wizard)
Behaviour.
- Navigation: Back, Next, Skip (optional steps), and the stepper on the left: any step already reached can be gone back to by a click; later steps are greyed until the ones before are valid. Next is greyed with the first reason when the step is not valid (the diagnostic under the field, and in Next’s tooltip).
- Validation per step: descriptors’ checks, then the step’s hook, run when a value changes (debounced) and when Next is pressed.
- Summary: generated from the steps’ fields (label and value as shown, grouped by step), each group with “Change” going back to its step; or custom nodes. The run verb is on this step (“Import 248 photos”).
- Run: the command runs as a job; the step shows the job’s progress
brick and its log. Cancel is offered only while the declared
cancellablephase lasts (an import cancels between files; a vault migration only before it writes); leaving the surface does not cancel, the job stays in the jobs centre and the surface can be reopened on it. - Results: counts, the records that failed or were skipped, and the follow-ups.
- Resumable: the draft is kept as it changes (per library by default); reopening a wizard with a draft offers “Continue where you left” or “Start again”. A run that was interrupted resumes if its command does (import skips what it already imported).
- Deep links:
admin.open {"path": "import/choices"}opens the task on that step; a step that is not reachable yet opens the first invalid one before it, with its reason. - Searchable: steps and their fields are in the search, as sections and fields are.
- Two renderings of one wizard:
steps(one step per page, the stepper on the left) andpage(every step as a column or a group on one page, Lightroom’s import). The run, summary and results are the same.
Import onto the kit.
| Step | Nodes | Today |
|---|---|---|
| Sources | source-list (cards, cameras, recent, favourites, Choose a folder) | the left column |
| Contents | file-browser (by capture day, ticks, “New only”, RAW+JPEG as one), status: count and size ticked | the middle column |
| Copy or add | choice: Copy into the library, Add where they are | top of the choices |
| Destination (when copying) | path (Into), choice (layout by date), preview hook (example path) | Into |
| Names (when copying) | choice of pattern presets, text (custom pattern), preview hook (example name) | Name |
| Options | choice (duplicates: skip, keep, ask), toggle (darktable edits), group “More” (metadata, time offset) | Duplicates, darktable edits, More |
| Backup (when a strategy exists; optional) | choice (back up after import), status (the destinations plugged in) | new, from the backup strategy and Capture One’s “Backup To” |
| Summary | auto; totals (photos, size, space left on the destination) | the footer’s totals |
| Run | library.importFiles with the draft; progress; cancellable between files | the import job |
| Results | imported, duplicates, skipped, warnings; follow-ups: Show in library, Back up now, Eject the card | a toast, the Duplicates and Log panels |
Presets are the task’s: Default, saved ones, Save as, Delete, as the footer has today.
Export onto the kit.
| Step | Nodes |
|---|---|
| Photos | status (the selection, else the images shown, and their count); choice (which) |
| Destination | path, choice (subfolder by date or none), choice (existing files: skip, overwrite, number) |
| File | choice (format), number (quality), choice (bit depth), choice (colour space) |
| Size | choice (original, long edge, megapixels), number |
| Names | pattern, preview hook |
| Metadata | multi (what to keep), toggle (remove location) |
| After | choice (nothing, open folder) |
| Summary, Run, Results | a parent job and one per image; failed ones as records with their reason; follow-up Open folder |
Plugins add export steps or groups (a format plugin adds its options to
File) by placing nodes under export/file.
Other wizards.
- Backup setup: copies, destinations (a record list of volumes with a backup role, “Mark this disk…”), off site, when; summary; run: the first backup.
- First launch: language, theme, library location (new or existing), “Bring a darktable library” (optional, leads to the migration), backup strategy (optional), summary.
- darktable migration: find
library.db(path, detected candidates as choices), what to bring (multi: film rolls, tags, ratings and labels, edits as versions, styles), a dry run as a status, summary, run with progress (cancellable until it writes), results with what was left out and why. - Health fixes: a finding whose fix needs choices opens a short
wizard (“Plug in Backup A, then back up”: wait for the disk as a step
whose
done_whenis the disk mounted; runlibrary.backupNow).
5.4 Search, deep links, keyboard, accessibility, the last place
- Search covers every scope at once: node titles, descriptions,
keywords, setting ids, current values of choices, record titles of
small sources (volumes, plugins), steps and their fields. Typing
replaces the left panel with the hits grouped by scope and section, and
the page with the matching rows from every section, each under a
breadcrumb (
Backup › Strategy), editable in place (VS Code’s way). Filters:@modified,@scope:library,@id:,@plugin:. Every section, field and task is also a palette entry (“Settings: Verified copies”, “Open: Storage › Volumes”). - Deep links:
admin.open {"path": "backup/strategy/copies"}; a setting id alone ({"key": "health.destinationDays"}) resolves to its first place; a record ({"path": "storage/volumes", "record": "<id>"}) scrolls to and selects it;{"mode": "window"}picks the mode. The application’s link scheme takes the same path (helios://admin/backup/strategy).app.settingsandapp.settings.pagebecome aliases. Health fixes, toasts and error messages send the person to a place this way. - Keyboard:
Ctrl+,opens the app on the last place;Ctrl+F(or typing anywhere outside a field) goes to search;Ctrl+PageDownandCtrl+PageUpmove between scopes;Ctrl+TabandCtrl+Shift+Tabtoo; F6 cycles the regions (tabs, left panel, page, footer); arrows inside the left panel;Alt+LeftandAlt+Rightgo back and forward through places; Escape clears the search, then closes the overlay. A wizard:Alt+NNext,Alt+BBack, Enter on the summary runs. - Accessibility: the scopes are a tab list, the left panel a tree, each row a labelled control whose description carries its help, its origin and “modified”; statuses are live regions polite; a wizard step says “Step 3 of 7, Names”. The test kit’s “every interactive node has a name” covers every generated page for free.
- The last place: the scope, section, scroll and search per surface, kept with the interface’s state; a task’s draft per library; the mode (overlay or window) and the window’s place.
6. Information architecture for Helios
Scopes in order, their icon, their sections, and what goes there. Value
scopes in brackets where not app. “(w)” is a registered widget kind,
“(page)” a custom page, “(new)” a GUI for something with none today.
- General (gear)
- Language and region:
appearance.language. - Startup:
library.default(the library opened), open the last workspace. - Notifications:
notifications.desktop,notifications.jobs,appearance.toast_corner. - Tips:
tips.off, the tips list with a switch per plugin. - About: version, licences,
logs.reveal.
- Language and region:
- Interface (brush)
- Theme:
appearance.theme_preference,theme.select(choice),appearance.accent_color, Theme editor (w),theme.exportMerged. - Text and size:
appearance.text_size,appearance.interface_zoom,appearance.font_ui,appearance.font_mono(w: font picker). - Window:
window.frame,window.bar_in_fullscreen,menus.icons,dialogs.movable,dialogs.closable,appearance.focus,appearance.scroll_bars. - Workbench:
workbench.panel_alignment,workbench.side_bar_position,interface.panels.queue_when_empty,interface.graph.zoom(new: no GUI today). - Profiles: a record list (
profile.use,profile.import,profile.export) [workspace]. - Experimental:
interface.experimental.workshops(needs a restart).
- Theme:
- Input (keyboard)
- Shortcuts (w: shortcuts) [app, workspace].
- Keymap packages: a record list (
keymap.package,keymap.package.remove) (new). - Pointer and wheel:
input.pointer_profile,input.wheel_device,input.wheel_speed,input.slider_wheel,input.image_double_click, Gestures (w).
- Library (books)
- Library: status (path, size, photo count),
library.openFolder,library.default,library.db, catalogue integrity (status andvault.integrity). - Workspaces: a record list of recent workspaces (
workspace.open,workspace.new), templates (workspace.saveAsTemplate),workspace.importParts,workspace.reset[workspace]. Editing the network stays in the workbench. - Image map:
system.map.exclude,system.map.defaults,system.map.record,system.map.limit,system.map.keepMissing(new). - Decisions:
project.decisions.mode[library] (new). - History:
system.workflow.keep_days[library] (new).
- Library: status (path, size, photo count),
- Storage (disk)
- Volumes: a record table from the volume registry (name, kind,
capacity, free, roles, off site, RAID, node, last seen, photos), row
fields, “Mark this disk…” (confirm hook),
library.storage’svolumeas a deep link to a record. - Caches:
system.cache.budget,system.cache.share,system.cache.thumbnails(new).
- Volumes: a record table from the volume registry (name, kind,
capacity, free, roles, off site, RAID, node, last seen, photos), row
fields, “Mark this disk…” (confirm hook),
- Backup (shield)
- Strategy: copies, destinations (choices hook over the volumes), off site, when [library]; “Set up backups…” (the backup wizard).
- Status: photos short of copies, unverified copies, last backup,
library.backupNow. - Destinations:
health.destinationDays, the destination volumes with last seen. - Cards: cards safe to format.
- Catalogue snapshots (new, when built): a record list (date, size, where copied), “Snapshot now”, “Restore…” (confirm), how many kept.
- Import and export (arrow in and out)
- Import: open Import (the task), default copy or add, the import source [workspace], darktable edits.
- Import presets: a record list (rename, delete, set default).
- Import sources: favourites and recent folders.
- Importers: the plugins’ importers (
library.importWith). - Export: open Export (the task), the workspace’s export settings [workspace].
- Export presets: a record list.
- Migration: “Bring a darktable library…” (the wizard).
- Hardware (chip)
- GPU and compute: a record table (
compute.list: device, role, budget, speed, enabled), row actions (compute.enable,compute.disable,compute.role,compute.budget),compute.probe,compute.benchmark(a job), routing (compute.route), remote nodes (compute.remote) (new). - Display:
display.wide-gamut-preview, its status (what the window got and why). - Workers:
system.scheduler.workers,system.ai.calls,system.events.journal(new).
- GPU and compute: a record table (
- Plugins (puzzle)
- Installed: a record table (
plugin.list: name, version, enabled, permissions), row actions (plugin.enable,plugin.disable), row fields (permissions:plugin.grant,plugin.revoke) (new). - Each plugin: a section of its own for the nodes it places nowhere else.
- Installed: a record table (
- Health (heart)
- Findings: a record list grouped by level, row actions “Fix…” (its command or wizard) and “Ignore”; “Check now”.
- Ignored: a record list with “Show again”.
- Checks: the registered checks and their last run.
- Jobs (list) (Q3)
- Running and recent: the jobs centre as a record table with Cancel, Retry, the log.
- Journal:
system.events.journal, retention.
- Developer (code)
developer.devtools,developer.agentSocket,developer.log_level,developer.show_keys,logs.reveal; the debug bridge’s state as statuses. Shown when devtools are on, or by search.
Standalone task surfaces: Import and Export. Wizards: backup setup, first launch, darktable migration, health fixes.
What stays in the workbench: the viewport, the graph and its node
editing, the darkroom, the library grid and culling (ratings, flags,
labels, stacks: vault.*, library.stacks.*), the Parameters, Modules
and Masks panels, macros and workshops (macro.*, workshop.*), the
Queue panel, the live Jobs panel.
7. Migration
Each slice ships on its own, with its gallery page and snapshots, and removes what it replaces.
- The model and the shell, on today’s settings.
- egui-pop: the tree, bindings and manifest types in
egui-pop-model(no egui); the shell, the bricks and their kit components inegui-pop-api(Q8), replacing the settings window. The generated sections become nodes under scopes (a default placement from the id’s prefix,appearance.*to Interface,input.*to Input…), alter hooks keep working.SettingsPagebecomes thepagenode unchanged; the shortcuts editor, gestures and fonts become widget kinds.app.settingsandapp.settings.pagebecome aliases ofadmin.open. Overlay and window modes. Search, deep links, the last place. - The layered settings store (library and workspace layers), behind the
same
AppHandle::setting. - Helios: declares its scopes, and the sixteen
helios-configsettings through a bridge (concern to value scopes, therunlayer as an origin), so they get a GUI for the first time.
- egui-pop: the tree, bindings and manifest types in
- Storage and Health. The volume table with row fields, the strategy
form, the statuses and “Back up now”; the findings list with Fix and
Ignore; their hand-drawn windows removed.
library.storageandhelp.healthopen their sections. The status bar badge’s click opens Health. - The wizard kit, then Export, then Import. The kit with the summary, run and results; Export first (small, already a Form, no new widget kind); then Import, which needs the file browser as a widget kind (the file browser design’s slices first) and the source list. The import window’s code maps onto the steps table in 5.3; its presets and remembered choices become the task’s draft and presets.
- The rest. Plugins, Hardware, keymap packages, profiles, Jobs, Developer; then the backup setup, the first launch and the darktable migration wizards; catalogue snapshots when the vault has them.
The file browser relates in one way only: it is a registered widget
kind (file-browser), its value the entries ticked, its options the
view modes allowed, the file source and the thumbnail provider. The
import task gives it a source over the ticked sources and Helios’s
thumbnail provider; nothing in the file browser knows about forms.
8. Open questions
Q1. Overlay or window by default.
- A. Overlay of the main window, with “Pop out” to a window; the mode used last remembered.
- B. A separate window by default (Blender, GNOME, macOS, Windows).
- C. Overlay for the settings app, window for the task surfaces (an import runs beside the library).
- Recommended: A. It works the same on every platform and in the web build, keeps one window for people on a laptop, and the window is one click away; remembering the last mode serves people with two screens.
Q2. Tabs on top or a sidebar for the scopes.
- A. Tabs with icons on top, sections in the left panel (the owner’s two axes; darktable, Lightroom, Capture One).
- B. One sidebar, scopes as headings and sections under them (macOS, GNOME, Windows).
- C. An icon rail on the far left for the scopes, the sections panel beside it (VS Code’s activity bar).
- Recommended: A, as directed; twelve scopes fit as icon and label on a 1280-point window, icons alone below that.
Q3. Where jobs live.
- A. Live jobs stay in the workbench (the Jobs panel and the status bar’s popover); the app’s Jobs scope holds history, retention and the journal.
- B. Only the workbench; no Jobs scope.
- C. Only the app; the status bar’s item opens it.
- Recommended: A. A running export is followed beside the photos; what ran last week is administration.
Q4. Import as a wizard or a single page by default.
- A. One page (Lightroom, Capture One: today’s three columns, the steps as columns), “Guided” switching to steps, remembered.
- B. Steps by default.
- C. Steps for the first import of a library, one page after.
- Recommended: A. Photographers import daily and every photo tool they know is one page; the same manifest gives the guided mode for free, and the first launch wizard leads into it.
Q5. The manifest’s format.
- A. Rust builders only.
- B. A data file (TOML or RON) per owner, hooks named.
- C. Rust builders producing a serialisable manifest; out-of-process plugins send the same manifest as JSON (or TOML in their package).
- Recommended: C. In-process code keeps types and compile errors; Helios’s plugins are out-of-process binaries and must send data; agents read the same JSON.
Q6. Where search sits.
- A. At the top of the left panel (GNOME, macOS, Windows, JetBrains).
- B. In the scope tab row, at its end, searching every scope (always visible).
- C. At the top of the page (VS Code).
- Recommended: B. The search covers every scope, so it belongs above the scopes, not inside one; the palette also lists every section and field.
Q7. When values apply.
- A. Live, with undo and per-row reset, everywhere (today’s settings).
- B. Apply, OK and Cancel per page (JetBrains, Lightroom).
- C. Live for settings and records; only on run for tasks and wizards.
- Recommended: C. It is what egui-pop does today for settings, and a task’s choices are its arguments.
Q8. Where the framework lives.
- A. Model in
egui-pop-model, shell and bricks inegui-pop-api, replacingsettings_windowandsettings_pages. - B. A new L4 crate,
egui-pop-forms, on the API, with the settings window moved into it. - C. As A, with the record bricks in
egui-pop-views. - Recommended: A. The settings window, the dialogs’ Form and the
pages are in the API crate today; a new crate would move every
egui_pop::api::settings_*path for no gain. The record bricks useegui-pop-viewsthrough the facade, as the file browser does.
Q9. How a field set in several value scopes shows it.
- A. An origin tag on the row and a “Set for” menu (JetBrains’ marker).
- B. Scope tabs inside the page (VS Code’s User and Workspace).
- C. Separate sections per value scope (“This library”, “This workspace”).
- Recommended: A. The top tabs are the families; few fields have more than one value scope.
Q10. The command namespace and the app’s name.
- A.
admin.*(admin.open), titled “Settings” in menus withCtrl+,. - B.
settings.*, titled “Settings”. - C.
admin.*, titled “Settings and tools”. - Recommended: A. People look for “Settings” (every OS calls it so); the id says it holds more than settings.
9. Sources
- Blender: Preferences, Add-on preferences.
- darktable: Preferences, Lua preferences, Import.
- Lightroom Classic: Preferences, Catalog settings, Import photos, Export, SDK.
- Photoshop: Preferences.
- Capture One: Preferences, Importing images.
- VS Code: User and workspace settings, Contribution points: configuration, walkthroughs.
- JetBrains: Settings, Settings guide for plugins.
- GNOME: Settings, libadwaita preferences widgets, Initial Setup.
- macOS: System Settings, Migration Assistant.
- Windows: Launch the Settings app (
ms-settings:), Settings cards (Windows Community Toolkit), Inno Setup wizard pages, WiX dialogs. - Declarative forms: JSON Forms, UI schema and categorization, react-jsonschema-form, Qt property browser, KConfigXT.
Moving a floating panel vs docking it
Status: design note, decided and built (study and decision 2026-11-17; built in egui-pop 0.13, workbench.md). A plain drag of a floating panel only moves it; the dock modifier (Ctrl, Cmd on macOS) shows the drop targets and docks (option A, section 4). A is egui-pop’s default, not a fixed rule: the mode is a declared option an application picks the default of, and a user setting.
The problem: while a floating panel (a palette, alone or in a group) is dragged, every side or bottom area under the pointer, every closed area’s edge and every other palette is a drop target. A user who only wants to move the panel cannot avoid them: let go over a target, the panel docks or joins a group.
Contents:
- How other applications tell moving from docking
- Modifier keys per platform, and conflicts
- What egui-pop and egui_stack do today
- Options, and the decision
- The setting, the gesture, the bus
- Discoverability: the hint while dragging
- Implementation
- References
1. How other applications tell moving from docking
| Application | Plain drag of a floating window | Docking | Modifier |
|---|---|---|---|
| Visual Studio | shows the guide diamond; let go over an arrow, it docks [VS1] | plain drag | Ctrl held: moves without docking [VS1] (same since VS 6 [VS2]) |
| JetBrains IDEs | a floating tool window moves as a window | the View Mode menu (Dock Pinned, Undock, Float, Window) [JB1]; the tool window buttons drag between the bars [JB2] | none |
| Photoshop (and Bridge, the same panel system) | drop zones highlight while a panel is dragged; let go over one, it docks [AD1] | plain drag | Ctrl (Windows) / Cmd (macOS) held: no docking, the panel floats where let go [AD1] [AD2] |
| Lightroom Classic | no floating panels: the panels sit in fixed side groups | none by drag | none |
| Blender | no floating editors; areas split, join and swap from a corner drag [BL1] | joining and replacing by dragging a corner into another area | Ctrl: swap two areas; Shift: duplicate into a new window [BL1] |
| GNOME | a window moves; dragged to the top edge it maximizes, to a side it tiles [GN1] | (edge tiling) | Super + drag moves a window from anywhere in it [GN1] |
| KDE Plasma | a window moves; the screen edges quick-tile | custom tiles only with Shift held while dragging [KD1] | users ask for the reverse too (Shift to suppress) [KD2] |
| Windows 11 | a window moves; dragged to the top, the snap layouts show [MS1] | snap | a setting turns the snap layouts on drag off [MS1] |
| egui_dock / egui_stack | a floating window (an egui::Window) moves by its frame, no targets | only a dragged tab (or a tab bar) shows the drop overlay [ED1] | none; the overlay’s feel has timings (max_preference_time) but no dwell to arm it [ED1] |
Two families:
- Plain drag docks, a modifier suppresses (option B below): Visual Studio, Photoshop and the Adobe panel system.
- Plain drag moves, docking is a separate act (option A): KDE’s custom tiles (Shift to snap), JetBrains (a menu), egui_dock (a different handle: the tab, not the window frame).
Nobody arms docking by resting on a target (option C); window managers use an edge and a short delay for tiling, not for docking.
2. Modifier keys per platform, and conflicts
- Ctrl on Windows and Linux, Cmd on macOS. egui’s
Modifiers::COMMANDand egui-pop’s keymap (which reads Cmd asCtrlon macOS) already give this. On macOS, Ctrl + click is the secondary click: Ctrl must not be the dock key there; Cmd is (Photoshop’s choice too). - Alt is taken on Linux: Xfce moves windows with Alt + drag, KWin
could (it defaults to Meta now), and GNOME uses Super
(
docs/design/pointer-gestures.md, section 5). Alt + drag would move the whole application window instead of the panel. Super and Meta are the window manager’s. So Alt, Super and Meta are out. - Shift is free on a palette’s band, but KDE uses Shift + drag of a window for its tiles; using it inside the application would teach the opposite of the desktop’s own Shift.
- Ctrl inside egui-pop: no binding uses Ctrl with a drag on a
palette’s band or a tab. Ctrl + drag is bound elsewhere, on other
surfaces:
gesture.sections.pull(Ctrl + drag on a section boundary, Cmd on macOS), the timeline’s pan, the Photoshop profile’s zoom box on a canvas, finer steps on sliders and scrub fields. None of them is a palette band, so the dock key on a band conflicts with none. Keyboard chords starting with Ctrl (Ctrl+K and others) are key presses, not a drag: no conflict either. - GNOME’s “Locate pointer” (an accessibility option) answers a lone Ctrl press and release; held during a drag, it does nothing.
- The web: Ctrl + drag in a browser drags a link or an image; the canvas takes the pointer first, as it does for every drag.
The modifier is read live, every pass of the drag, as Visual Studio and Photoshop do: pressed or released mid-drag, the targets show or go.
3. What egui-pop and egui_stack do today
A floating panel (crate::palettes, in egui-pop-api). A palette or
a group is dragged by its band (follow), a member by its own band or
a tab (follow_member). Each pass of the drag:
- the panel moves live, snapped to the workbench’s edges and to the
other palettes within the
palette.magnettoken, clamped inside; join_targetlooks for another palette under the pointer (top quarter: above; bottom quarter: below; middle: as a tab) and keeps aGroupHint;paint_hintsdraws the group hint, andpublish_hint(workbench) draws the dock hint, with the ghost of the panel’s tab, when the workbench’sdock_atfinds a side or bottom area under the pointer, or a closed area within the magnet’s width of the edges.
Let go, the order is fixed: a group hint joins (palette.group), else
an area docks (palette.dock, the whole group as tabs), else the panel
moves (palette.move) or comes out of its group (palette.ungroup).
No modifier is read. A palette snapped to the window’s edge sits within
the magnet’s width of a closed area’s edge, which is where dock_at
docks: the very spot the snap brings it to. The test
a_palette_is_dragged_by_its_band_snaps_and_docks_on_an_area
(crates/egui-pop-api/tests/it/palettes.rs) asserts that a plain drag
over the bottom area docks.
A docked tab (egui_stack’s DockArea in the workbench’s
DockSpace). Dragging a tab always shows the zones (OverlayType::Zones
painted by egui_stack, the panel’s refusal from DropVerdict); let go
in the main window, the areas take it (workbench.move). A tab drag
has no “move only” meaning: it is the docking gesture.
A whole tab group (#474, dragged by the empty part of its tab
bar). The same as a tab: zones in the main window; let go over a
detached window it joins it; let go outside every window it opens a
window of its own (workbench.detach with group).
A detached OS window (workbench.detach). The system moves it:
by its decorations, or by egui-pop’s own title bar through
ViewportCommand::StartDrag, which hands the move to the window
manager. egui-pop sees none of it, so moving it never docks. Its panels
dock back with workbench.attach, on closing the window, or by
dragging their tabs out of it. A tab or a group dragged across windows
goes through the drag session of bus::drag (pop.drag.start,
pop.drag.drop, drag.dropped, drag.refused); a detached window is a
drop target of it.
egui_stack’s own floating windows are off:
TabViewer::allowed_in_windows returns false in the workbench
(detached panels get OS windows instead).
So the problem is the floating panel alone: it is the only drag whose two meanings, moving and docking, share one gesture.
4. Options, and the decision
- A. A plain drag only moves; the dock modifier shows the targets and docks. Decided (owner, 2026-11-17), egui-pop’s default.
- B. A plain drag docks; the modifier suppresses docking. Visual Studio’s and Photoshop’s way; kept as a mode for applications and profiles that follow them.
- C. Docking arms only after the pointer rests on a target for a delay (around half a second). Kept as a mode for touch and pen, where no modifier is at hand.
Why A by default: moving a palette is the frequent act and docking the rare one, so the frequent act should be the one that cannot go wrong; the targets never flash during a move; a palette snapped to an edge stays floating; and it is the KDE desktop’s own model (a plain drag moves, a held key snaps into tiles). B keeps the trap for whoever does not know the key. C slows docking and still docks a user who pauses over a target.
What the modes cover: the drag of a floating panel’s band, a member’s band and a floating tab, for both kinds of target (an area to dock in, another palette’s group to join). Snapping to edges and palettes and anchoring stay on a plain drag: they are part of moving. Docked tabs, tab groups and detached windows keep their behaviour (section 3): their drag has one meaning.
Per profile
A profile named after an application behaves like it
(docs/design/pointer-gestures.md, section 6):
| Pointer profile | Mode | Why |
|---|---|---|
| Document (the default) | A | egui-pop’s default |
| darktable | A | darktable has no floating panels |
| Photoshop | B | Photoshop docks on a plain drag, Ctrl / Cmd keeps it floating |
| Lightroom Classic | A | no floating panels; A is the safe default |
| Blender / node editors | A | Blender has no floating editors |
| Trackpad | A | the modifier key is at hand on a laptop; C is for touch |
An application such as a Visual Studio-like editor picks B as its default; a touch-first application picks C.
5. The setting, the gesture, the bus
The setting: input.dock_drag, a choice in egui-pop’s value
store, beside the other pointer settings:
| Value | Meaning |
|---|---|
profile | the pointer profile’s mode (the default value) |
modifier-docks | A: a plain drag moves, the dock keys dock |
modifier-floats | B: a plain drag docks, the dock keys keep it floating |
dwell | C: docking arms after resting on a target |
The pointer profile document gains options.dock_drag (the three
modes), as it has slider_wheel; a profile without it reads A. The
application picks its default with a builder option (dock_drag on the
app builder, as pointer_profile is), which sets the setting’s
default; the user changes it in the settings, like any other. A change
is said once on the bus as pop.settings.changed, and the palettes read
the mode in force from the setting, as the pointer options are read.
The gesture: gesture.workbench.dock, a pointer gesture in the
keymap’s default layer (as gesture.sections.pull is), bound to
Ctrl+PrimaryDrag (Cmd on macOS through the keymap’s mapping). Its
keys are the dock keys in A and the keys that keep a panel floating in
B; C does not read it. The user rebinds it in the shortcuts editor; a
user binding survives a profile change, as for the other gestures.
The bus: nothing per pass (the drag’s painting is ADR 0029’s
per-frame exception). What lands is already on the bus and stays so:
palette.move, palette.dock, palette.group, palette.ungroup
steps and their palette.moved, palette.docked, palette.grouped,
palette.ungrouped events, which hooks can veto as today. The drop
hint an agent reads (AppHandle::drop_hint, palettes::group_hint,
the workbench collector, overlay_rects) gains whether the targets
are armed, so a test or an agent sees “over the bottom area, not
armed” without a pixel.
6. Discoverability: the hint while dragging
While a floating panel is dragged, a one-line hint shows in the status bar, or under the pointer when the application has no status bar, worded after the mode and the keys bound to the gesture (a rebind changes the text):
| Mode | Keys not held | Keys held |
|---|---|---|
| A | “Hold Ctrl to dock” (only while a target is under the pointer) | “Release Ctrl to move only” |
| B | “Hold Ctrl to move without docking” (only while a target is under the pointer) | none |
| C | “Rest here to dock” (over a target, while the delay runs) | none |
The text names the keys as the keymap prints them on the platform
(Cmd on macOS). Under A the targets stay hidden until the keys are
held, so the hint is the only sign that docking exists: it shows
whenever the pointer is over a place the panel could dock in or join,
armed or not. The band’s menu gains Dock in (left, right, bottom)
for a pointer with no keyboard, running palette.dock.
7. Implementation
One ticket in egui-pop, title: Floating windows: a plain drag moves, Ctrl docks.
- Model (egui-pop-model,
pointer): aDockDragchoice (modifier-docks,modifier-floats,dwell) in the profile’soptions(A when absent; Photoshop’s profile gets B), thegesture.workbench.dockgesture spec bound toCtrl+PrimaryDragin every shipped profile. - Setting (egui-pop-api,
pointer):input.dock_drag(profile, then the three modes), its default from a new builder optiondock_drag, read with the other pointer options. - Palettes (
palettes.rs,followandfollow_member; workbench’spublish_hint): each pass, compute armed from the mode, the gesture’s keys held now and, for C, how long the pointer has rested on the same target (a dwell of 500 ms, a constant). Not armed: noGroupHint, no dock hint drawn, and the drop is a move (palette.moveorpalette.ungroup). Armed: today’s behaviour. Snapping and anchoring are unchanged. - Hint: the status bar line of section 6 (strings in egui-pop’s
catalogue), and
armedinDropHintandGroupHint. - The band’s menu: Dock in Left / Right / Bottom (
palette.dock). - Docs:
docs/workbench.mdand the palettes module’s docs; a changeset (egui-pop-apiandegui-pop-model, minor: the default drag behaviour changes).
Headless test (kittest, crates/egui-pop-api/tests/it/palettes.rs,
default features):
- mode A, default: a palette’s band dragged over the bottom area and
let go stays floating (
palette.moved, nopalette.docked), anddrop_hintreports the area not armed during the drag; the same drag with Ctrl held (the harness’s modifiers) docks it (palette.docked); Ctrl pressed only mid-drag, before the release, docks too; Ctrl released before the release does not; - a palette dropped on another palette’s middle joins it only with Ctrl; snapped to the start edge with a plain drag, it stays floating;
- mode B (
input.dock_drag=modifier-floats): the plain drag docks, the drag with Ctrl stays floating; - mode C (
dwell): a drag passing over the area without stopping stays floating; one resting on it past the delay (the harness’s clock) docks; - the setting changed is said once as
pop.settings.changed; the Photoshop profile with the setting atprofilegives B; - the existing
a_palette_is_dragged_by_its_band_snaps_and_docks_on_an_areaand the grouping tests hold Ctrl where they dock or join.
8. References
- [VS1] Microsoft, “Customize window layouts in Visual Studio”, Dock windows: https://learn.microsoft.com/en-us/visualstudio/ide/customizing-window-layouts-in-visual-studio
- [VS2] Microsoft, Visual Studio 6.0, “Working with Floating or Docking Windows”: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa266154(v=vs.60)
- [JB1] JetBrains, IntelliJ IDEA, “Tool window view modes”: https://www.jetbrains.com/help/idea/viewing-modes.html
- [JB2] JetBrains, IntelliJ IDEA, “Tool windows”: https://www.jetbrains.com/help/idea/tool-windows.html
- [AD1] Adobe, Bridge, “Adjust panels” (the panel system Photoshop shares): https://helpx.adobe.com/uk/bridge/desktop/workspaces-and-panels/adjust-panels.html
- [AD2] Adobe Community, Photoshop, “Docking toolbars” (Cmd / Ctrl keeps a panel from docking): https://community.adobe.com/t5/photoshop-ecosystem-discussions/docking-toolbars/m-p/10427950
- [BL1] Blender Manual, “Areas”: https://docs.blender.org/manual/en/latest/interface/window_system/areas.html
- [GN1] GNOME Help, “Maximize and unmaximize a window”: https://help.gnome.org/users/gnome-help/stable/shell-windows-maximize.html.en
- [KD1] KDE bug 464810, “Windows should only snap to custom tiling when Shift is pressed, not regular tiles”: https://bugs.kde.org/show_bug.cgi?id=464810
- [KD2] KDE bug 491909, “Swap tiling manager shift key so that it disables using tiling manager when pressed”: https://bugs.kde.org/show_bug.cgi?id=491909
- [MS1] Microsoft Support, “Snap your windows”: https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241
- [ED1] egui_stack 0.25 (egui_dock’s continuation),
OverlayFeelandTabViewer::allowed_in_windows: https://docs.rs/egui_stack/0.25.12/egui_stack/
Wide gamut on Wayland: tagging the image
Research note, 2026-10-13. Versions: egui and eframe 0.36, egui-wgpu
0.36.2, wgpu 30.0.1, winit 0.30.13, wayland-client 0.31,
wayland-protocols 0.32.13 (wp_color_management_v1, staging, features
client and staging), Mesa main (26.x). “Unverified” marks what was
inferred and not run on a machine.
The problem
An application asks the viewport for a wide target, for example BT.2020
primaries with a 2.2 power (bt2020 + gamma22, an encoding every
compositor with colour management can map to its screen). Today the
screen stays sRGB, for three reasons:
ColorSpacemirrors wgpu’s surface colour spaces, which have no BT.2020 with gamma 2.2;DisplayTarget::is_supportedrefuses it andeffective()draws sRGB.- Nothing tags a surface: eframe configures every window 8-bit sRGB, winit binds no colour-management object, egui-wgpu takes no colour space.
- The output’s preferred image description is never read.
Two paths can tell the compositor how the image is encoded.
(a) A subsurface for the image, tagged through the protocol
The viewport’s image goes to a wl_subsurface of the window, with its
own wgpu surface; the subsurface is tagged with
wp_color_management_surface_v1.set_image_description. The interface
stays on the window’s surface, sRGB, untouched.
- A wgpu surface on a
wl_surfacewe own: yes. eframe hands out the window’s raw handles (CreationContextimplementsHasWindowHandleandHasDisplayHandle): winit’swl_displayandwl_surface. winit links libwayland (wayland-backend’sclient_system), soBackend::from_foreign_displaygives a wayland-client connection sharing winit’s socket, andObjectId::from_ptra proxy for winit’s surface. On a private event queue, our events never reach winit. We create awl_surface, make it a subsurface of winit’s, and give wgpu a handle pointing at it (winit’s display, our surface):Instance::create_surfacewithRenderState::instance, the device eframe opened. The Vulkan WSI only needs awl_surface, no shell role. Creating a handle from raw pointers isunsafe, so it lives in a crate of its own, as the Win32 layer does. - Position and size. The subsurface sits below the window’s
surface (
place_below(parent)), and the viewport punches a hole in the interface where the image is: its paint callback writes transparent black over the image rectangle. egui’s overlays, menus and tooltips are drawn after, over the hole, so they stay above the image. Below has a second gain: the subsurface may be larger than the hole, so its rectangle is snapped outwards to whole logical pixels (set_positiontakes integers) and the overflow hides under the interface. The buffer is in physical pixels;wp_viewportermaps it to the logical size (fractional scales), elseset_buffer_scalefor an integer scale. Both are double-buffered state applied with the subsurface’s commit (the WSI’s present) and, in synchronised mode, with the parent’s. The hole needs a window with an alpha channel: egui-wgpu configures a premultiplied surface only when the viewport is built transparent (ViewportBuilder::with_transparent(true)), and winit then sets no opaque region. On an opaque window the hole would show black, so the path refuses it and says why. - Input. The subsurface gets an empty input region: pointer and touch go to winit’s surface wherever the image is. (The parent’s input region covers its whole surface, transparent pixels included, so the hole does not leak input either.)
- Frame synchronisation. Subsurfaces start synchronised: their
commits are cached until the parent commits. egui-wgpu calls the paint
callbacks’
preparebefore it acquires the window’s texture; the viewport renders the image there, submits, flushes its own requests (position, scale, image description) and presents the subsurface, then egui presents the window: both land in the same compositor frame. The subsurface’s swapchain usesMailbox(elseImmediate), notFifo: a synchronised subsurface gets its frame callbacks only once the parent commits, and a FIFO present waiting for them could stall the frame (unverified, avoided rather than measured). - The collision. The protocol allows one
wp_color_management_surface_v1perwl_surface; a second is the fatalsurface_existserror. Mesa’s Wayland WSI (25.1 and later) makes one on every swapchain’s surface it decides to colour-manage (wsi_common_wayland.c,needs_color_surface): for any colour space but pass-through, and forSRGB_NONLINEARtoo when the compositor announces thesrgbprimaries and thesrgbtransfer function to a version 1 client (Mesa binds the manager at version 1). It then sets no description for sRGB, but the slot is taken. wgpu exposes no pass-through colour space. So:- on KWin, sway (wlroots) and Weston, which do not announce the
srgbtransfer, the image surface configuredSrgbthrough wgpu is ours to tag; - on GNOME (Mutter) and Hyprland, which announce it to version 1 clients, Mesa takes the slot: tagging ourselves would kill the connection. There the image surface uses a colour space the WSI declares instead (Display P3 on both, scRGB on Hyprland), through wgpu’s capabilities of the image surface. The rule is read from the compositor’s own announcements (we bind at version 1 too), whatever the driver: a driver that does not tag (NVIDIA’s, older Mesa) loses nothing but the self-tagging on GNOME and Hyprland. An environment variable turns self-tagging off for a driver that tags beyond Mesa’s rule.
- on KWin, sway (wlroots) and Weston, which do not announce the
- The output’s description.
get_surface_feedbackon winit’s surface is not exclusive (it lives beside Mesa’s colour surface);get_preferredandget_informationgive the primaries, transfer and luminances the compositor prefers for the window, andpreferred_changedsays when it moves to another screen.
Cost: a Linux-only module (the connection, the subsurface lifecycle, the description, the feedback), a second pipeline for the image surface’s format and a hole pipeline, and a transparent window. No upstream change.
(b) The swapchain’s colour space
wgpu 30 configures a surface in a colour space
(SurfaceConfiguration::color_space), and Mesa maps it to the protocol.
- Mesa’s mapping (
colorspace_mapping[]):SRGB_NONLINEAR(srgb + srgb TF),DISPLAY_P3_NONLINEAR(display_p3 + srgb TF),EXTENDED_SRGB_LINEAR(srgb + ext_linear, needsextended_target_volume),DISPLAY_P3_LINEAR,BT709_LINEAR,BT709_NONLINEAR(bt1886),BT2020_LINEAR(bt2020 + ext_linear),HDR10_ST2084(pq),HDR10_HLG,ADOBERGB_LINEAR; a colour space is offered only when the compositor announces its primaries and TF. Always the perceptual intent, no luminances. - No BT.2020 with gamma 2.2: Vulkan has no such colour space. The
nearest,
BT2020_LINEAR, is dropped by wgpu-hal (its conversion keeps sRGB, extended sRGB linear and nonlinear, Display P3, HDR10 PQ and HLG). And thesrgbTF Mesa asks for is not announced by KWin, sway or Weston, so Display P3 is offered only on GNOME and Hyprland. - It tags the whole window, interface included. egui-wgpu picks the
format itself (
Rgba8UnormorBgra8Unorm) and configures wgpu’s default colour space;WgpuConfigurationhas no field for either, so a library over eframe cannot choose. Were it chosen, egui’s renderer writes sRGB-encoded values to every non-*Srgbformat (fs_main_gamma_framebuffer), so the interface would be wrong on any colour space but sRGB and extended sRGB. Raw access through wgpu-hal does not help: the swapchain is egui-wgpu’s.
Recommendation: (a)
- It needs no upstream change, where (b) needs egui-wgpu to take a format and colour space and to encode the interface for them, a change a library cannot ship on eframe.
- It carries the encoding asked for (BT.2020, gamma 2.2) on KWin, sway and Weston, which no Vulkan colour space can, and falls back to what the WSI offers on the image surface elsewhere (Display P3 on GNOME and Hyprland).
- Only the image is tagged; the interface stays the sRGB egui draws faithfully.
What it costs: a transparent window; one image surface per viewport,
under its own window’s surface (the main window’s handles come from
eframe’s creation context, another window’s from egui-pop’s runner,
image_surface::set_window_source, or the application,
install_window; an immediate viewport’s, such as a detached panel’s,
paired by the runner or the host’s loop through runner::host);
a guess at the driver’s rule for the colour surface, conservative and
switchable off. The swapchain path stays the long-term one for HDR of the
whole window, once egui-wgpu takes a colour space (see
upstream.md).
The negotiation
egui_pop_viewport::image_surface::negotiate decides, from plain data,
what the image surface gets, so it is tested headless with fake
capabilities:
| Situation | Image drawn in | Reason given |
|---|---|---|
| not Wayland (X11, Windows, macOS) | sRGB, on the window | not a Wayland window |
no wp_color_manager_v1, or no subcompositor | sRGB, on the window | the compositor has no colour management (or no subsurfaces) |
| an opaque window | sRGB, on the window | the image surface needs a transparent window |
| sRGB wanted | sRGB, on the window | none |
parametric, the wanted primaries and TF announced, and no srgb + srgb | wanted, tagged by us (TargetSource::Tagged) | none |
| otherwise, a WSI colour space of the image surface carries more than sRGB | it (TargetSource::Wsi) | what it lacks of the wanted, if anything |
| otherwise | sRGB, on the window | why each step failed |
The protocol names a target by named primaries (srgb, display_p3,
bt2020) and a named TF (srgb, gamma22, ext_linear, st2084_pq,
hlg); custom primaries are not tagged.
Checking it on a screen
No wide-gamut Wayland session is available to automation: the
negotiation is tested headless, the rest is checked by hand on a
colour-managed compositor, as
viewport.md describes (the gallery
with --wide-gamut, WAYLAND_DEBUG, helios doctor display).
Sources
- Protocol: wayland-protocols
staging/color-management/color-management-v1.xml(https://gitlab.freedesktop.org/wayland/wayland-protocols), as bound by thewayland-protocolscrate 0.32. - Mesa:
src/vulkan/wsi/wsi_common_wayland.con main (https://gitlab.freedesktop.org/mesa/mesa):colorspace_mapping,wsi_wl_display_determine_colorspaces,needs_color_surface,wsi_wl_swapchain_update_colorspace, the manager bound at version 1. - wgpu-hal 30.0.1
vulkan/conv.rs(the colour spaces it keeps); egui-wgpu 0.36.2lib.rs,winit.rs(format, alpha mode, the order ofprepareand the window’s present),renderer.rs(output encoding). - Compositors’ announcements: KWin
src/wayland/colormanagement_v1.cpp, Muttersrc/wayland/meta-wayland-color-management.c, wlrootstypes/wlr_color_management_v1.c, Hyprlandsrc/protocols/ColorManagement.cpp, Westonlibweston/color-lcms/color-lcms.c. - darktable’s Wayland preview (its pull request 22491, read only): a subsurface below a toolkit surface with a hole, presented from shared memory, tagged BT.2020 + gamma 2.2.
Logo
egui-pop.svg is egui-pop’s logo, 512 by 512.
It is drawn from egui’s own icon, crates/egui_demo_lib/data/icon.svg:
- the hexagon and its cross are that icon’s path, unchanged;
- the hexagon is filled with pink and cream twisted stripes;
- a black rim, a third of a branch of the cross wide, cuts a stick that runs along the diagonal and out of the square.
egui-pop-badge.svg is the README’s badge, after egui’s own: our logo where egui’s icon sits, egui’s wordmark unchanged in white, and “-pop” in the logo’s pink. Its p and o are cut from egui’s g: the p is the g mirrored with its stem taken down to the descender, the o is the g’s bowl and its mirror image.
egui’s icon and wordmark (egui-logo.svg) are used under egui’s licence, MIT OR Apache-2.0, Copyright (c) 2018-2021 Emil Ernerfeldt emil.ernerfeldt@gmail.com.
































































































































































































































































































