A drawing app built for agent/human collaboration
Rust
The tool strip never overlaps itself on a short window
Indicode BV70935c51150c
diff --git a/Cargo.lock b/Cargo.lockindex f08ae66..e865a55 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -1744,7 +1744,7 @@ dependencies = [[[package]]name = "klad-app"-version = "0.1.0"+version = "0.1.1"dependencies = ["anyhow","block2 0.6.2",@@ -1773,7 +1773,7 @@ dependencies = [[[package]]name = "klad-brush"-version = "0.1.0"+version = "0.1.1"dependencies = ["anyhow","bytemuck",@@ -1789,7 +1789,7 @@ dependencies = [[[package]]name = "klad-cli"-version = "0.1.0"+version = "0.1.1"dependencies = ["anyhow","clap",@@ -1815,7 +1815,7 @@ dependencies = [[[package]]name = "klad-core"-version = "0.1.0"+version = "0.1.1"dependencies = ["anyhow","half",@@ -1827,7 +1827,7 @@ dependencies = [[[package]]name = "klad-render"-version = "0.1.0"+version = "0.1.1"dependencies = ["anyhow","bytemuck",diff --git a/Cargo.toml b/Cargo.tomlindex a1a189a..5cec737 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -3,7 +3,7 @@ resolver = "3"members = ["crates/*"][workspace.package]-version = "0.1.0"+version = "0.1.1"edition = "2024"license-file = "LICENSE"repository = "https://github.com/klad-app/klad"diff --git a/crates/app/src/editor.rs b/crates/app/src/editor.rsindex 666dc0b..0b6b7b1 100644--- a/crates/app/src/editor.rs+++ b/crates/app/src/editor.rs@@ -622,6 +622,8 @@ pub(crate) struct Editor {bones: bones::BoneTool,first: first::FirstSteps,report_drawing: bool,+ strip_tools: [f32; 2],+ strip_foot: [f32; 2],key_ease: klad_core::keys::Ease,bindings: crate::commands::Bindings,capturing: Option<Cmd>,@@ -792,6 +794,8 @@ impl Editor {bones: bones::BoneTool::default(),first: first::FirstSteps::default(),report_drawing: false,+ strip_tools: [570.0, 480.0],+ strip_foot: [186.0, 166.0],key_ease: klad_core::keys::Ease::Linear,bindings: crate::commands::Bindings::default(),capturing: None,diff --git a/crates/app/src/editor/panels.rs b/crates/app/src/editor/panels.rsindex 9e6a209..2ba7a5b 100644--- a/crates/app/src/editor/panels.rs+++ b/crates/app/src/editor/panels.rs@@ -233,29 +233,103 @@ impl Editor {fn strip(&mut self, ui: &mut egui::Ui) {ui.spacing_mut().item_spacing.y = 4.0;- ui.vertical_centered(|ui| {- ui.add_space(6.0);- STRIP_TOOLS.iter().for_each(|cmd| {- let r = self.command_sized(ui, *cmd, None, 20.0, vec2(36.0, 36.0));- self.key_letter(ui, r.rect, *cmd);- });- ui.add_space(4.0);- self.colour_pair(ui);- ui.separator();- [Cmd::Undo, Cmd::Redo].iter().for_each(|cmd| {- self.command_sized(ui, *cmd, None, 18.0, vec2(36.0, 32.0));+ let column = ui.max_rect().x_range();+ let gap = ui.spacing().item_spacing.y;+ let height = ui.available_height();+ let fits = |size: usize| self.strip_tools[size] + self.strip_foot[size] + 2.0 * gap <= height;+ let small = !fits(0);+ let folded = small && !fits(1);+ let size = usize::from(small);+ let (tool, other, icons) = match small {+ true => (vec2(36.0, 28.0), vec2(36.0, 28.0), (16.0, 15.0)),+ false => (vec2(36.0, 36.0), vec2(36.0, 32.0), (20.0, 18.0)),+ };+ let foot_now = match folded {+ true => other.y + 6.0 + gap,+ false => self.strip_foot[size],+ };+ egui::ScrollArea::vertical()+ .id_salt("strip")+ .max_height((height - foot_now - gap).max(0.0))+ .auto_shrink([false, true])+ .scroll_bar_visibility(egui::scroll_area::ScrollBarVisibility::AlwaysHidden)+ .scroll_source(egui::scroll_area::ScrollSource {+ drag: egui::scroll_area::DragScroll::Never,+ ..egui::scroll_area::ScrollSource::default()+ })+ .show(ui, |ui| {+ let drawn = ui+ .vertical_centered(|ui| {+ ui.add_space(6.0);+ STRIP_TOOLS.iter().for_each(|cmd| {+ let r = self.command_sized(ui, *cmd, None, icons.0, tool);+ self.key_letter(ui, r.rect, *cmd);+ });+ ui.add_space(4.0);+ self.colour_pair(ui);+ ui.separator();+ [Cmd::Undo, Cmd::Redo].iter().for_each(|cmd| {+ self.command_sized(ui, *cmd, None, icons.1, other);+ });+ })+ .response+ .rect+ .height();+ self.strip_measured(size, Some(drawn), None, ui.ctx());});- });- ui.with_layout(Flow::bottom_up(Align::Center), |ui| {+ let below = egui::Rect::from_x_y_ranges(column, ui.available_rect_before_wrap().y_range());+ let foot = UiBuilder::new().max_rect(below).layout(Flow::bottom_up(Align::Center));+ ui.scope_builder(foot, |ui| {ui.add_space(6.0);+ if folded {+ self.strip_more(ui, other, icons.1);+ return;+ }[Cmd::Settings, Cmd::Numbers, Cmd::Palette].iter().for_each(|cmd| {- self.command_sized(ui, *cmd, None, 18.0, vec2(36.0, 32.0));+ self.command_sized(ui, *cmd, None, icons.1, other);});- self.panels_menu(ui);- self.document_menu(ui);+ self.panels_menu(ui, other, icons.1);+ self.document_menu(ui, other, icons.1);+ self.strip_measured(size, None, Some(ui.min_rect().height()), ui.ctx());});}+ fn strip_measured(&mut self, size: usize, tools: Option<f32>, foot: Option<f32>, ctx: &egui::Context) {+ let changed = |was: f32, now: Option<f32>| now.filter(|n| (n - was).abs() > 0.5);+ if let Some(t) = changed(self.strip_tools[size], tools) {+ self.strip_tools[size] = t;+ ctx.request_repaint();+ }+ if let Some(f) = changed(self.strip_foot[size], foot) {+ self.strip_foot[size] = f;+ ctx.request_repaint();+ }+ }++ fn strip_more(&mut self, ui: &mut egui::Ui, size: egui::Vec2, glyph: f32) {+ let button = egui::Button::new(RichText::new(icon::MORE).size(glyph)).min_size(size);+ egui::containers::menu::MenuButton::from_button(button)+ .ui(ui, |ui| {+ self.document_entries(ui);+ ui.separator();+ self.panel_checks(ui);+ ui.separator();+ [+ (Cmd::Palette, "find a command"),+ (Cmd::Numbers, "numbers"),+ (Cmd::Settings, "settings"),+ ]+ .into_iter()+ .for_each(|(cmd, label)| {+ if self.command_button(ui, cmd, Some(label)).clicked() {+ ui.close();+ }+ });+ })+ .0+ .hint("the drawing, the panels, find a command, numbers and settings, in one menu while the window is this short");+ }+fn menu_bar(&mut self, ui: &mut egui::Ui) {commands::MENUS.iter().for_each(|m| {ui.menu_button(m.title, |ui| self.menu_items(ui, m.items))@@ -315,8 +389,8 @@ impl Editor {}}- fn document_menu(&mut self, ui: &mut egui::Ui) {- let button = egui::Button::new(RichText::new(icon::FILE).size(18.0)).min_size(vec2(36.0, 32.0));+ fn document_menu(&mut self, ui: &mut egui::Ui, size: egui::Vec2, glyph: f32) {+ let button = egui::Button::new(RichText::new(icon::FILE).size(glyph)).min_size(size);let name = self.scene.bundle@@ -324,33 +398,41 @@ impl Editor {.file_stem().map_or_else(String::new, |s| s.to_string_lossy().to_string());egui::containers::menu::MenuButton::from_button(button)- .ui(ui, |ui| {- ui.label(RichText::new(&name).strong());- ui.separator();- [- (Cmd::NewDocument, "new drawing"),- (Cmd::OpenDocument, "open"),- (Cmd::OpenRecent, "recent"),- (Cmd::Export, "export"),- (Cmd::AddFont, "add a font"),- (Cmd::CopyPath, "copy path"),- (Cmd::InstallCommand, "install the klad command"),- (Cmd::ReportProblem, "report a problem"),- (Cmd::About, "about and licences"),- ]- .into_iter()- .for_each(|(cmd, label)| {- if self.command_button(ui, cmd, Some(label)).clicked() {- ui.close();- }- });- })+ .ui(ui, |ui| self.document_entries(ui)).0.hint(format!("{name}: new, open, recent drawings, export, fonts, copy its path"));}+ fn document_entries(&mut self, ui: &mut egui::Ui) {+ let name = self+ .scene+ .bundle+ .root+ .file_stem()+ .map_or_else(String::new, |s| s.to_string_lossy().to_string());+ ui.label(RichText::new(&name).strong());+ ui.separator();+ [+ (Cmd::NewDocument, "new drawing"),+ (Cmd::OpenDocument, "open"),+ (Cmd::OpenRecent, "recent"),+ (Cmd::Export, "export"),+ (Cmd::AddFont, "add a font"),+ (Cmd::CopyPath, "copy path"),+ (Cmd::InstallCommand, "install the klad command"),+ (Cmd::ReportProblem, "report a problem"),+ (Cmd::About, "about and licences"),+ ]+ .into_iter()+ .for_each(|(cmd, label)| {+ if self.command_button(ui, cmd, Some(label)).clicked() {+ ui.close();+ }+ });+ }+fn about_panel(&mut self, ui: &mut egui::Ui) {static LINES: std::sync::OnceLock<Vec<&'static str>> = std::sync::OnceLock::new();let lines = LINES.get_or_init(|| klad_core::notices::NOTICES.lines().collect());@@ -403,24 +485,25 @@ impl Editor {});}- fn panels_menu(&mut self, ui: &mut egui::Ui) {- let button = egui::Button::new(RichText::new(icon::SIDEBAR).size(18.0)).min_size(vec2(36.0, 32.0));+ fn panel_checks(&mut self, ui: &mut egui::Ui) {+ [+ (Cmd::ToolPane, Pane::Tool),+ (Cmd::LayersPane, Pane::Layers),+ (Cmd::InspectorPane, Pane::Inspector),+ (Cmd::NotesPane, Pane::Notes),+ (Cmd::HistoryPane, Pane::History),+ ]+ .into_iter()+ .for_each(|(cmd, pane)| {+ self.command_check(ui, cmd, pane.title());+ });+ self.command_check(ui, Cmd::Timeline, "timeline");+ }++ fn panels_menu(&mut self, ui: &mut egui::Ui, size: egui::Vec2, glyph: f32) {+ let button = egui::Button::new(RichText::new(icon::SIDEBAR).size(glyph)).min_size(size);egui::containers::menu::MenuButton::from_button(button)- .ui(ui, |ui| {- [- (Cmd::ToolPane, Pane::Tool),- (Cmd::LayersPane, Pane::Layers),- (Cmd::InspectorPane, Pane::Inspector),- (Cmd::NotesPane, Pane::Notes),- (Cmd::HistoryPane, Pane::History),- ]- .into_iter()- .for_each(|(cmd, pane)| {- self.command_check(ui, cmd, pane.title());- });- ui.separator();- self.command_check(ui, Cmd::Timeline, "timeline");- })+ .ui(ui, |ui| self.panel_checks(ui)).0.hint("the panels: tick one to show it, untick to close it");}diff --git a/crates/app/src/editor/ui_tests.rs b/crates/app/src/editor/ui_tests.rsindex a540da1..1a98215 100644--- a/crates/app/src/editor/ui_tests.rs+++ b/crates/app/src/editor/ui_tests.rs@@ -139,6 +139,78 @@ fn audit(h: &Harness<'static, Editor>, what: &str) -> usize {found.len()}+#[test]+fn the_strip_shrinks_then_folds_its_foot_when_the_window_is_short() {+ let path = sample("strip");+ let in_strip = |h: &Harness<'static, Editor>, glyph: &str| {+ h.query_all_by_label(glyph)+ .map(|n| n.rect())+ .find(|r| r.center().x < layout::STRIP)+ };+ let tall = harness(editor(&path), vec2(1280.0, 1400.0));+ let (brush, redo) = (+ in_strip(&tall, theme::icon::BRUSH).unwrap(),+ in_strip(&tall, theme::icon::REDO).unwrap(),+ );+ let file = in_strip(&tall, theme::icon::FILE).expect("a tall window shows the document menu");+ let settings = in_strip(&tall, theme::icon::SETTINGS).unwrap();+ assert_eq!(brush.height(), 36.0);+ assert!(+ file.top() > redo.bottom() + 40.0,+ "a tall window keeps a gap: {redo:?} {file:?}"+ );+ assert!(+ settings.bottom() > tall.state().canvas_rect.bottom() - 20.0,+ "the foot sits at the bottom"+ );+ assert!(+ (settings.center().x - brush.center().x).abs() < 1.0,+ "one column: {brush:?} {settings:?}"+ );+ drop(tall);+ let smaller = harness(editor(&path), vec2(1280.0, 1100.0));+ let (brush, redo) = (+ in_strip(&smaller, theme::icon::BRUSH).unwrap(),+ in_strip(&smaller, theme::icon::REDO).unwrap(),+ );+ let file = in_strip(&smaller, theme::icon::FILE).expect("first the buttons get smaller");+ assert!(brush.height() < 36.0 && brush.height() >= theme::TARGET, "{brush:?}");+ assert!(file.top() >= redo.bottom(), "nothing overlaps: {redo:?} {file:?}");+ drop(smaller);+ let medium = harness(editor(&path), vec2(1280.0, 1000.0));+ assert!(in_strip(&medium, theme::icon::FILE).is_none(), "then the foot folds");+ let more = in_strip(&medium, theme::icon::MORE).expect("one menu holds the foot");+ let (brush, redo) = (+ in_strip(&medium, theme::icon::BRUSH).unwrap(),+ in_strip(&medium, theme::icon::REDO).unwrap(),+ );+ assert!(+ more.top() >= redo.bottom(),+ "nothing overlaps or hides: {redo:?} {more:?}"+ );+ assert!(+ (more.center().x - brush.center().x).abs() < 1.0,+ "one column: {brush:?} {more:?}"+ );+ drop(medium);+ let mut short = harness(editor(&path), vec2(1280.0, 700.0));+ let more = in_strip(&short, theme::icon::MORE).unwrap();+ let brush = in_strip(&short, theme::icon::BRUSH).unwrap();+ assert!(+ more.bottom() <= short.state().canvas_rect.bottom() + 1.0 && more.top() > brush.bottom(),+ "last the tools scroll, and the menu stays in view: {brush:?} {more:?}"+ );+ short.get_by_role_and_label(Role::Button, theme::icon::MORE).click();+ short.run_steps(2);+ short.get_by_label_contains("settings").click();+ short.run_steps(2);+ assert!(+ short.state().windows.settings,+ "the folded menu runs the foot's commands"+ );+ let _ = std::fs::remove_dir_all(&path);+}+#[test]fn every_control_is_pen_sized_and_has_a_hover_hint() {let path = sample("audit");@@ -1775,7 +1847,13 @@ fn a_closed_panel_comes_back_from_the_strip() {h.state_mut().invoke(Cmd::InspectorPane).unwrap();h.run_steps(2);assert!(!h.state().settings.layout.is_open(Pane::Inspector));- h.get_by_role_and_label(Role::Button, theme::icon::SIDEBAR).click();+ let folded = h.query_by_label(theme::icon::SIDEBAR).is_none();+ let menu = if folded {+ theme::icon::MORE+ } else {+ theme::icon::SIDEBAR+ };+ h.get_by_role_and_label(Role::Button, menu).click();h.run_steps(2);h.get_by_role_and_label(Role::CheckBox, Pane::Inspector.title()).click();h.run_steps(3);diff --git a/crates/app/src/home.rs b/crates/app/src/home.rsindex b9f4655..ff0779a 100644--- a/crates/app/src/home.rs+++ b/crates/app/src/home.rs@@ -417,6 +417,11 @@ mod tests {}}+ fn document_menu<'a>(h: &'a Harness<'static, Home>) -> egui_kittest::Node<'a> {+ h.query_by_label(theme::icon::FILE)+ .unwrap_or_else(|| h.get_by_label(theme::icon::MORE))+ }+fn opened(h: &Harness<'static, Home>) -> PathBuf {h.state().editor@@ -653,7 +658,7 @@ mod tests {[&b, &dir.join("third.klad"), &a].map(|p| p.display().to_string()));h.state_mut().editor.as_mut().unwrap().wants = None;- h.get_by_label(theme::icon::FILE).click();+ document_menu(&h).click();h.run_steps(2);h.get_by_label(&format!("{} copy path", theme::icon::COPY)).click();h.run_steps(1);@@ -725,7 +730,7 @@ mod tests {let mut first = home(&dir, &[]);first.open(&egui::Context::default(), &path).unwrap();let mut h = harness(first);- h.get_by_label(theme::icon::FILE).click();+ document_menu(&h).click();h.run_steps(2);assert!(h.query_by_label(&format!("{} install the klad command", theme::icon::DOWNLOAD))diff --git a/crates/app/src/opened.rs b/crates/app/src/opened.rsindex ef0a06e..e270cc6 100644--- a/crates/app/src/opened.rs+++ b/crates/app/src/opened.rs@@ -1,15 +1,17 @@+use std::cell::RefCell;use std::path::PathBuf;-use std::sync::Mutex;-static QUEUE: Mutex<Vec<PathBuf>> = Mutex::new(Vec::new());+thread_local! {+ static QUEUE: RefCell<Vec<PathBuf>> = const { RefCell::new(Vec::new()) };+}#[cfg(any(target_os = "macos", test))]pub fn push(path: PathBuf) {- QUEUE.lock().unwrap_or_else(|e| e.into_inner()).push(path);+ QUEUE.with(|q| q.borrow_mut().push(path));}pub fn take() -> Option<PathBuf> {- std::mem::take(&mut *QUEUE.lock().unwrap_or_else(|e| e.into_inner())).pop()+ QUEUE.with(|q| std::mem::take(&mut *q.borrow_mut())).pop()}#[cfg(target_os = "macos")]diff --git a/docs/DESIGN.md b/docs/DESIGN.mdindex d903e48..caec31c 100644--- a/docs/DESIGN.md+++ b/docs/DESIGN.md@@ -1,4 +1,4 @@-_Last updated: 2026-11-06 17:46_+_Last updated: 2026-11-06 18:35_# klad: design@@ -433,7 +433,7 @@ 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 settings, numbers and the command palette); a dock on the right holding panes (colour and brush, layers, inspector, 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 window (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 and brush, layers, inspector, 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 window (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, 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 drags as its outline (no GPU lift) and lands on release; 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`); shapes whose rotation is a quarter turn get edge handles too (`lift::stretched` scales their own axis). Pen events that arrive while a shape move or 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.- 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.