Skip to content

armgit / klad

Public Imported from GitHub
0

A drawing app built for agent/human collaboration

Rust

Brush is its own panel, next to Colour

Indicode BVc3d0b30eff43
diff --git a/crates/app/src/commands.rs b/crates/app/src/commands.rs
index 94316fd..719f392 100644
--- a/crates/app/src/commands.rs
+++ b/crates/app/src/commands.rs
@@ -112,6 +112,7 @@ pub enum Cmd {
HideDock,
LayersPane,
ToolPane,
+ BrushPane,
InspectorPane,
NotesPane,
HistoryPane,
@@ -491,7 +492,7 @@ use Repeat as R;
use Trigger as T;
impl Cmd {
- pub const ALL: [Cmd; 164] = [
+ pub const ALL: [Cmd; 165] = [
Cmd::Brush,
Cmd::Eraser,
Cmd::Fill,
@@ -600,6 +601,7 @@ impl Cmd {
Cmd::HideDock,
Cmd::LayersPane,
Cmd::ToolPane,
+ Cmd::BrushPane,
Cmd::InspectorPane,
Cmd::NotesPane,
Cmd::HistoryPane,
@@ -1634,13 +1636,22 @@ impl Cmd {
),
Cmd::ToolPane => spec(
"panel.tool",
- "colour and brush panel",
+ "colour panel",
icon::PALETTE,
G::Panels,
T::None,
R::No,
"show or hide it in the dock",
),
+ Cmd::BrushPane => spec(
+ "panel.brushes",
+ "brush panel",
+ icon::BRUSH,
+ G::Panels,
+ T::None,
+ R::No,
+ "show or hide it in the dock",
+ ),
Cmd::InspectorPane => spec(
"panel.inspector",
"layer settings panel",
@@ -2242,7 +2253,8 @@ impl Cmd {
Cmd::HideAll => "Hide panels",
Cmd::HideDock => "Hide dock",
Cmd::LayersPane => "Layers",
- Cmd::ToolPane => "Colour and brush",
+ Cmd::ToolPane => "Colour",
+ Cmd::BrushPane => "Brush",
Cmd::InspectorPane => "Layer settings",
Cmd::NotesPane => "Notes",
Cmd::HistoryPane => "History",
@@ -2566,6 +2578,7 @@ pub const MENUS: [Menu; 9] = [
Run(Cmd::HideDock),
Line,
Run(Cmd::ToolPane),
+ Run(Cmd::BrushPane),
Run(Cmd::LayersPane),
Run(Cmd::InspectorPane),
Run(Cmd::NotesPane),
diff --git a/crates/app/src/editor.rs b/crates/app/src/editor.rs
index 0b408e5..dbcf604 100644
--- a/crates/app/src/editor.rs
+++ b/crates/app/src/editor.rs
@@ -2675,7 +2675,7 @@ impl Editor {
fn shaped(&self) -> Result<(String, BrushDef)> {
let base = self.brushes.def(&self.brush).ok_or_else(|| {
anyhow!(
- "the brush {} is not there any more: pick another one in the colour and brush panel",
+ "the brush {} is not there any more: pick another one in the brush panel",
self.brush
)
})?;
diff --git a/crates/app/src/editor/commands.rs b/crates/app/src/editor/commands.rs
index 588417f..c592b6b 100644
--- a/crates/app/src/editor/commands.rs
+++ b/crates/app/src/editor/commands.rs
@@ -377,6 +377,7 @@ impl Editor {
Cmd::HideDock => !layout.dock,
Cmd::LayersPane => layout.dock && layout.is_open(Pane::Layers),
Cmd::ToolPane => layout.dock && layout.is_open(Pane::Tool),
+ Cmd::BrushPane => layout.dock && layout.is_open(Pane::Brush),
Cmd::InspectorPane => layout.dock && layout.is_open(Pane::Inspector),
Cmd::NotesPane => layout.dock && layout.is_open(Pane::Notes),
Cmd::HistoryPane => layout.dock && layout.is_open(Pane::History),
@@ -832,6 +833,7 @@ impl Editor {
}
Cmd::LayersPane => self.pane(Pane::Layers),
Cmd::ToolPane => self.pane(Pane::Tool),
+ Cmd::BrushPane => self.pane(Pane::Brush),
Cmd::InspectorPane => self.pane(Pane::Inspector),
Cmd::NotesPane => self.pane(Pane::Notes),
Cmd::HistoryPane => self.pane(Pane::History),
diff --git a/crates/app/src/editor/options.rs b/crates/app/src/editor/options.rs
index 3f744d6..07badda 100644
--- a/crates/app/src/editor/options.rs
+++ b/crates/app/src/editor/options.rs
@@ -203,7 +203,7 @@ impl Editor {
});
})
.response
- .hint("the brush; the colour and brush panel shows them with a sample stroke");
+ .hint("the brush; the brush panel shows them with a sample stroke");
if let Some(id) = picked {
self.pick(&id);
}
diff --git a/crates/app/src/editor/panels.rs b/crates/app/src/editor/panels.rs
index a88f9d9..402ae2f 100644
--- a/crates/app/src/editor/panels.rs
+++ b/crates/app/src/editor/panels.rs
@@ -501,6 +501,7 @@ impl Editor {
fn panel_checks(&mut self, ui: &mut egui::Ui) {
[
Cmd::ToolPane,
+ Cmd::BrushPane,
Cmd::LayersPane,
Cmd::InspectorPane,
Cmd::NotesPane,
@@ -610,9 +611,8 @@ impl Editor {
fn pane_body(&mut self, ui: &mut egui::Ui, pane: Pane) -> Result<()> {
match pane {
- Pane::Tool => {
- self.colour_panel(ui)?;
- ui.separator();
+ Pane::Tool => self.colour_panel(ui),
+ Pane::Brush => {
self.brush_tiles(ui);
Ok(())
}
diff --git a/crates/app/src/layout.rs b/crates/app/src/layout.rs
index 915cb60..79050de 100644
--- a/crates/app/src/layout.rs
+++ b/crates/app/src/layout.rs
@@ -15,6 +15,7 @@ pub const CANVAS_MIN: Vec2 = Vec2::new(320.0, 200.0);
#[serde(rename_all = "lowercase")]
pub enum Pane {
Tool,
+ Brush,
Layers,
Inspector,
Notes,
@@ -24,7 +25,8 @@ pub enum Pane {
impl Pane {
pub fn title(self) -> &'static str {
match self {
- Pane::Tool => "Colour and brush",
+ Pane::Tool => "Colour",
+ Pane::Brush => "Brush",
Pane::Layers => "Layers",
Pane::Inspector => "Layer settings",
Pane::Notes => "Notes for the agent",
@@ -34,7 +36,8 @@ impl Pane {
pub fn min_body(self) -> f32 {
match self {
- Pane::Tool => 160.0,
+ Pane::Tool => 230.0,
+ Pane::Brush => 80.0,
Pane::Layers => 130.0,
Pane::Inspector => 110.0,
Pane::Notes => 60.0,
@@ -44,7 +47,8 @@ impl Pane {
fn default_body(self) -> f32 {
match self {
- Pane::Tool => 360.0,
+ Pane::Tool => 260.0,
+ Pane::Brush => 150.0,
Pane::Layers => 240.0,
Pane::Inspector => 220.0,
Pane::Notes => 90.0,
@@ -88,6 +92,7 @@ impl Default for Layout {
numbers: false,
panes: [
(Pane::Tool, false),
+ (Pane::Brush, false),
(Pane::Layers, false),
(Pane::Inspector, false),
(Pane::Notes, true),
@@ -110,11 +115,20 @@ impl Layout {
pub fn repaired(mut self) -> Self {
let known: Vec<Pane> = self.panes.iter().map(|p| p.pane).collect();
self.panes.dedup_by_key(|p| p.pane);
- Layout::default()
- .panes
- .into_iter()
- .filter(|p| !known.contains(&p.pane))
- .for_each(|p| self.panes.push(p));
+ let order = Layout::default().panes;
+ order
+ .iter()
+ .enumerate()
+ .filter(|(_, p)| !known.contains(&p.pane))
+ .for_each(|(i, p)| {
+ let after = i
+ .checked_sub(1)
+ .and_then(|k| self.panes.iter().position(|q| q.pane == order[k].pane));
+ match after {
+ Some(k) => self.panes.insert(k + 1, p.clone()),
+ None => self.panes.push(p.clone()),
+ }
+ });
self.panes
.iter_mut()
.for_each(|p| p.body = p.body.max(p.pane.min_body()));
@@ -245,17 +259,17 @@ mod tests {
fn panes_fit_the_dock_and_the_last_one_takes_what_is_left() {
let layout = Layout::default();
let bodies = layout.bodies(1200.0);
- assert_eq!(bodies.len(), 5);
- let used: f32 = bodies.iter().map(|(_, b)| b.unwrap_or(0.0)).sum::<f32>() + 5.0 * TITLE;
+ assert_eq!(bodies.len(), 6);
+ let used: f32 = bodies.iter().map(|(_, b)| b.unwrap_or(0.0)).sum::<f32>() + 6.0 * TITLE;
assert!((used - 1200.0).abs() < 0.01, "{used}");
- assert_eq!(bodies[3], (Pane::Notes, None));
- assert!(bodies[2].1.unwrap() > Pane::Inspector.default_body());
- let small = layout.bodies(560.0);
+ assert_eq!(bodies[4], (Pane::Notes, None));
+ assert!(bodies[3].1.unwrap() > Pane::Inspector.default_body());
+ let small = layout.bodies(800.0);
small.iter().filter_map(|(p, b)| b.map(|b| (p, b))).for_each(|(p, b)| {
assert!(b >= p.min_body() - 0.01, "{p:?} {b}");
});
- let used: f32 = small.iter().map(|(_, b)| b.unwrap_or(0.0)).sum::<f32>() + 5.0 * TITLE;
- assert!((used - 560.0).abs() < 0.01);
+ let used: f32 = small.iter().map(|(_, b)| b.unwrap_or(0.0)).sum::<f32>() + 6.0 * TITLE;
+ assert!((used - 800.0).abs() < 0.01);
let tiny = layout.bodies(200.0);
assert!(tiny.iter().all(|(p, b)| b.is_none_or(|b| b == p.min_body())));
}
@@ -265,7 +279,7 @@ mod tests {
let mut layout = Layout::default();
layout.toggle(Pane::Layers);
assert!(!layout.is_open(Pane::Layers));
- assert_eq!(layout.bodies(900.0).len(), 4);
+ assert_eq!(layout.bodies(900.0).len(), 5);
layout.toggle(Pane::Notes);
layout.toggle(Pane::Notes);
assert!(layout.is_open(Pane::Notes) && !layout.pane(Pane::Notes).unwrap().collapsed);
@@ -321,7 +335,7 @@ mod tests {
)
.unwrap()
.repaired();
- assert_eq!(old.panes.len(), 5);
+ assert_eq!(old.panes.len(), 6);
assert_eq!(old.panes[0].pane, Pane::Layers);
assert_eq!(old.panes[0].body, Pane::Layers.min_body());
}
diff --git a/crates/app/src/settings.rs b/crates/app/src/settings.rs
index 6b33b00..739296c 100644
--- a/crates/app/src/settings.rs
+++ b/crates/app/src/settings.rs
@@ -251,7 +251,7 @@ mod tests {
assert_eq!(settings.ui_scale, 1.25);
assert_eq!(settings.documents, ["/w/a.klad"]);
assert_eq!(settings.layout.dock_width, 400.0);
- assert_eq!(settings.layout.panes.len(), 5);
+ assert_eq!(settings.layout.panes.len(), 6);
assert_eq!(settings.layout.panes[0].pane, crate::layout::Pane::Layers);
fs::remove_dir_all(&dir).unwrap();
}
diff --git a/docs/DESIGN.md b/docs/DESIGN.md
index 46d5901..e894f9b 100644
--- a/docs/DESIGN.md
+++ b/docs/DESIGN.md
@@ -435,9 +435,9 @@ Scripts are any language that prints edit ops as JSON lines into `klad apply`. G
## The editor
- Canvas: pan, zoom, rotate; pen pressure, tilt and eraser end; 120 Hz on Apple Silicon. The window around the canvas is a neutral grey (`theme::SURROUND`), so colours read true.
-- Layout (M4 batch 1): a tool strip on the left (the tools with their key letter, undo and redo, and at its foot the document and panels menus, the command palette, numbers and settings; the strip only has the height between the menu bar and the timeline, so when both groups do not fit its buttons shrink from 36 to 28 pt, then the foot folds into one menu pinned at the bottom, and last the tools scroll, never overlapping; each size is measured as it is drawn, so the choice does not flicker); a dock on the right holding panes (colour and brush, layers, layer settings (`Pane::Inspector` in code), notes for the agent, history), each with a title row that folds it, closes it and, dragged at its top edge, resizes the pane above; the timeline along the bottom, resizable and foldable to its toolbar; a status line under everything. Panes share the dock's height: they keep the sizes the user gave them, the last open one takes what is left, and when they do not fit they shrink towards their minimums and scroll inside (`layout::Layout::bodies`). Tab hides every panel but the status line, shift Tab the dock. Which panels are open, the dock's width, the timeline's height and each pane's size are kept in the user's settings (`layout`) and restored, clamped to the window. Pen calibration lives in the settings modal (cmd ,); the performance numbers in a numbers window that can stay open over the canvas.
+- Layout (M4 batch 1): a tool strip on the left (the tools with their key letter, undo and redo, and at its foot the document and panels menus, the command palette, numbers and settings; the strip only has the height between the menu bar and the timeline, so when both groups do not fit its buttons shrink from 36 to 28 pt, then the foot folds into one menu pinned at the bottom, and last the tools scroll, never overlapping; each size is measured as it is drawn, so the choice does not flicker); a dock on the right holding panes (colour, brush, layers, layer settings (`Pane::Inspector` in code), notes for the agent, history), each with a title row that folds it, closes it and, dragged at its top edge, resizes the pane above; the timeline along the bottom, resizable and foldable to its toolbar; a status line under everything. Panes share the dock's height: they keep the sizes the user gave them, the last open one takes what is left, and when they do not fit they shrink towards their minimums and scroll inside (`layout::Layout::bodies`). Tab hides every panel but the status line, shift Tab the dock. Which panels are open, the dock's width, the timeline's height and each pane's size are kept in the user's settings (`layout`) and restored, clamped to the window. Pen calibration lives in the settings modal (cmd ,); the performance numbers in a numbers window that can stay open over the canvas.
- Commands (M4 batch 1): every editor action is a `Cmd` in one list (`commands.rs`): an id (`tool.brush`, `drawing.new`, kept in settings), a name in plain words, a Phosphor icon, a group, its keys or the hold that triggers it, whether a held key repeats it, and a line on what it does. Keys, the strip, panel buttons, the timeline's buttons and context menu, and the palette all run commands through `Editor::invoke`, which first asks `can_run` (a reason when it cannot, shown as a refusal) and remembers the last twelve run. A key matches only with exactly its modifiers (shift K is not K); key repeats run commands that repeat (`=`, `[`, cmd Z) and frame steps only once the frame on screen caught up. cmd K opens the palette: type to filter (name start, then a key, a word, a substring, the letters in order, the group; hyphens ignored, so "inb" finds in-between), arrows and Return run, rows grey out with the reason, recent commands first; `?` opens it too. Every control has a hover hint after 0.35 s (from its command where there is one) and is at least 24 pt high; a test walks every control of every panel and window to keep it so.
-- Tool options and selections (M4 batch 2): a bar over the canvas holds the active tool's settings (brush: picker, size, opacity, flow, and a "more" menu for hardness, lightest size, curve, taper, stabiliser and smoothing; fill: reference, gap, tolerance, grow, opacity; strokes: cut at the lasso edge, select all; points: corner, smooth, simplify, make it a path). The strip shows the eraser while the eraser brush or the pen's eraser end is on, and two colours (the current one over the second; X or a click swaps them; picking a colour from a swatch, the hex field or the eyedropper makes the old one the second). cmd alt drag sideways on the canvas sizes the brush (doubling every 120 pt), the circle staying where the drag began. H flips the view left-right (the view's mappings and the GPU matrix mirror; the document does not change); the status line's zoom takes a click for 100% and a double-click to fit, its rotation a click to turn upright. A selection bar sits under (or over) the selection's box: for strokes flips, quarter turns, recolour, thinner, thicker, opacity, copy, paste, duplicate in place, delete, deselect; for a shape flips (sx or sy negated and its rotation mirrored), quarter turns, fill with the colour and outline in the colour (rectangles, ellipses, paths and text: `fill`, or `stroke.paint`, or a new `stroke` at the pen's width when it had none; Edit > Shape; `klad set <id> fill=...` is the CLI form), duplicate in place (an `add` of the node without ids, above it), delete, deselect; for points corner, smooth, nudges, delete. Arrows nudge strokes, a shape or points by 1 px, 10 px with shift. Strokes select across layers (M5 batch 2 round 1): cmd or shift click on rows in the layers panel adds paint layers to the active one (marked with a blue edge); S then lassos, clicks and selects all on all of them, and the selection (one part per layer) moves, turns, scales, flips, recolours, cuts at the lasso edge, copies and deletes as one edit, each layer's marks staying on their layer. A selection on several layers moves as one edit, each layer previewed while it is dragged; copies of several layers paste back into their own layers, a copy of one layer into the active one. The strip's panels button lists the five panels and the timeline with a tick each, so a closed panel always has a way back. U draws rectangles and ellipses on a vector layer (shift for a square or circle, alt from the centre, rounded corners for rectangles; fill, outline and width shared with the pen, the fill in the first colour and the outline in the second, as for the pen's paths) as `rect` and `ellipse` nodes. Mirror painting (the brush bar's "mirror" and its axis) paints every stroke's mirror image as it is drawn, in a second stroke buffer landed after the first, and commits both as plain marks in one history step. Handles are drawn at 12 pt and hit within 12 pt (`grab`); a press becomes a drag once it has moved 3 pt on screen, so a tap that wobbles selects and does not move; shapes whose rotation is a quarter turn get edge handles too (`lift::stretched` scales their own axis). Pen events that arrive while a point edit is being written are held and replayed in order after it. The colour and brush pane shows the palette (swatches drag to reorder; the x in a hovered swatch's corner, or a right-click, removes it), recent colours, size presets and the brushes as tiles, each with a sample stroke drawn by `klad-brush` once per brush definition.
+- Tool options and selections (M4 batch 2): a bar over the canvas holds the active tool's settings (brush: picker, size, opacity, flow, and a "more" menu for hardness, lightest size, curve, taper, stabiliser and smoothing; fill: reference, gap, tolerance, grow, opacity; strokes: cut at the lasso edge, select all; points: corner, smooth, simplify, make it a path). The strip shows the eraser while the eraser brush or the pen's eraser end is on, and two colours (the current one over the second; X or a click swaps them; picking a colour from a swatch, the hex field or the eyedropper makes the old one the second). cmd alt drag sideways on the canvas sizes the brush (doubling every 120 pt), the circle staying where the drag began. H flips the view left-right (the view's mappings and the GPU matrix mirror; the document does not change); the status line's zoom takes a click for 100% and a double-click to fit, its rotation a click to turn upright. A selection bar sits under (or over) the selection's box: for strokes flips, quarter turns, recolour, thinner, thicker, opacity, copy, paste, duplicate in place, delete, deselect; for a shape flips (sx or sy negated and its rotation mirrored), quarter turns, fill with the colour and outline in the colour (rectangles, ellipses, paths and text: `fill`, or `stroke.paint`, or a new `stroke` at the pen's width when it had none; Edit > Shape; `klad set <id> fill=...` is the CLI form), duplicate in place (an `add` of the node without ids, above it), delete, deselect; for points corner, smooth, nudges, delete. Arrows nudge strokes, a shape or points by 1 px, 10 px with shift. Strokes select across layers (M5 batch 2 round 1): cmd or shift click on rows in the layers panel adds paint layers to the active one (marked with a blue edge); S then lassos, clicks and selects all on all of them, and the selection (one part per layer) moves, turns, scales, flips, recolours, cuts at the lasso edge, copies and deletes as one edit, each layer's marks staying on their layer. A selection on several layers moves as one edit, each layer previewed while it is dragged; copies of several layers paste back into their own layers, a copy of one layer into the active one. The strip's panels button lists the six panels and the timeline with a tick each, so a closed panel always has a way back. U draws rectangles and ellipses on a vector layer (shift for a square or circle, alt from the centre, rounded corners for rectangles; fill, outline and width shared with the pen, the fill in the first colour and the outline in the second, as for the pen's paths) as `rect` and `ellipse` nodes. Mirror painting (the brush bar's "mirror" and its axis) paints every stroke's mirror image as it is drawn, in a second stroke buffer landed after the first, and commits both as plain marks in one history step. Handles are drawn at 12 pt and hit within 12 pt (`grab`); a press becomes a drag once it has moved 3 pt on screen, so a tap that wobbles selects and does not move; shapes whose rotation is a quarter turn get edge handles too (`lift::stretched` scales their own axis). Pen events that arrive while a point edit is being written are held and replayed in order after it. The colour pane shows the picker and the palette (swatches drag to reorder; the x in a hovered swatch's corner, or a right-click, removes it) and recent colours; the brush pane (its own since 2026-11-08, Kevin: "make brush its own palette, like colour and layers") the size presets and the brushes as tiles, each with a sample stroke drawn by `klad-brush` once per brush definition. A saved layout without a pane gets it after the pane it follows by default.
- First start (S8.7, `start.rs`, `editor/first.rs`, `klad_core::samples`): until the settings say `welcomed` (set when any drawing opens, or by "Not now"), the start window opens with a welcome offering first steps. First steps make `first steps.klad` (1280 by 800 on paper, one paint layer) in the drawings folder and open it with a small window of three steps that tick as they happen: a brush stroke is saved, a fill is saved, the request for an agent is copied (a sentence with the drawing's path asking the agent to read `klad skill`, render the drawing and add a shadow; "install the klad command" sits next to it). Help > First steps opens and closes the window on any drawing. The checklist is the editor's alone: it teaches the hands on the canvas, and an agent's first steps are `klad skill`. Revisit the third step when klad is an MCP server (S8.10). Under the recent drawings the start window shows the samples: the drawings `samples/shipped.json` names (name, bundle, a line on what it shows), each a card with its thumbnail and that line; a click copies it into the drawings folder without its `.cache` (`samples::copy`, `<name>.klad` or `<name> 2.klad`) and opens the copy, so a sample is never changed. `klad samples` lists the same set and `--copy <name> [--into folder]` copies one (default the current folder). Samples are found like the fonts: `KLAD_SAMPLES`, then `samples/` next to the binary, `../Resources/samples`, `../share/klad/samples`, and a source checkout's `samples/` up to five folders above the binary (where they exist after `just samples`; a sample not built is left out). `packaging/samples.sh` puts them in every build: it builds any that are missing with that build's `klad` (through the sample's `build.sh`, `PYTHON` naming the interpreter), copies them without caches, and renders each one's `<name>.thumb.png` next to it at 336 px, so the start window never renders into the app (a thumbnail outside the bundle is used as it is; only recent drawings' `.cache/thumb.png` are remade when the drawing changes). `app.sh` puts them in `Resources/samples`, `archive.sh` in the archive's `samples/` and the AppImage's `usr/share/klad/samples`; the six weigh about 4 MB.
- Messages and problem reports (S8.8, `report.rs`): a message says what happened and what to do next ("nothing to fill there: click inside closed lines, or raise the gap so small openings close"); a refusal names the step that makes the command possible. Errors that mean klad itself went wrong (an invariant broken, a picture missing that should be there) are `report::Bug`s: the editor says "something went wrong inside klad (what), everything up to your last edit is saved; Help > Report a problem copies what an issue needs" instead of the bare detail; a job whose CLI crashed reads the same, and a job that failed says "<job> did not finish: <the CLI's reason>". Every error message, job failure and crash of the editor or the CLI is appended to `klad.log` next to the settings (`KLAD_LOG` overrides it; past 512 KB the older half goes), one dated line each. Help > Report a problem opens a window with the report as it will be copied: klad's version and where it ran, the system (macOS version, the Linux distribution, Windows' version, and the processor), a place for what happened, the drawing's size, the last 40 messages and the last 40 lines of the log, with the home folder written as `~` and the drawing's folder as `<the drawing's folder>`. "include the drawing" zips the drawing without its cache next to it (`<name> for a report.zip`, stored entries, written by klad itself) and the report names the file to attach; "copy the report" copies it and "open klad's issues" opens GitHub. Nothing is sent by klad. `klad report [--drawing <bundle>]` prints the same report from the command line (version, system, log, the drawing zipped).
- Menus (S8.6, `commands::MENUS`, `menus.rs`): one list of menus holds every command but the holds (pan, zoom, the eyedropper, flipping, rolling, the parallax preview and sizing on the canvas, which are gestures), so the menus, the palette and the keys stay one list; a test fails when a command is in no menu or in two. The menus, in order: File (new, open, recent, close; import; export; the path and the command line tool), Edit (undo; copy, paste, duplicate, delete; selecting; Transform, Strokes and Points submenus), Tools (the tools, the brush, the colours), Layer (new, duplicate, rename, group, delete; show, lock, clip, lock alpha; Mask and Shape generators submenus, paint over; refill and gaps), Frame (stepping, drawings, holds and moves, inserting and removing frames), Animation (playback, onion skin, exposure, Selected frames and Clip submenus, the checks across frames), View (zoom, rotation, flip, the reference), Window (the panels, the message log, numbers) and Help. Each command has a short menu label (`Cmd::menu`: "Show", "Clip to layer below", "Export…"), since the menu says what it acts on, while the palette and hints keep the longer names; "…" marks a command that opens a window. Items show one key each (Backspace for delete); toggles show a tick, except commands that open a window; a command that cannot run now is greyed out (its reason is the palette's). A test keeps labels unique in each menu and under 30 characters. On macOS the list becomes the system menu bar (`menus::install`, rebuilt when the keys or the recent drawings change): an app menu with About, Settings, Services, hide and Quit, then the list, whose Window menu also gets the system's Minimize, Zoom and Bring all to front (it is the app's windows menu). Items target one Objective-C object (`KladMenuTarget`, `define_class!`) whose `kladRun:` queues the command for the next frame (the editor runs it through `Editor::invoke` as any key would) and whose `validateMenuItem:` reads a snapshot of what is off and on that the app refreshes every 0.4 s. The item keys are shown but not claimed: the object is each menu's delegate and answers no to `menuHasKeyEquivalent:forEvent:target:action:`, so a key still reaches the editor's own dispatch (which knows holds, repeats and text fields) and nothing runs twice; only the app menu's own keys (cmd , cmd Q cmd H) and Window's cmd M are AppKit's. On Windows and Linux (and in tests) the same list is an egui menu bar over the window, hidden with the panels (Tab). File > Open recent lists the last ten drawings; File > Close the drawing (cmd W, refused while a job runs) goes back to the start window, where only new, open, recent and quit run. Settings and Quit sit in the app menu on macOS and in Edit and File elsewhere; About (with the licences) is in Help everywhere and also in the macOS app menu.