Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

LR-BEHAV-TEXTFIELD: say what Ctrl+V needs and how fields are keyed

Nathaniel Ledford3b1e72902ad7
diff --git a/crates/ui-egui/src/text_field.rs b/crates/ui-egui/src/text_field.rs
index a93444479..49bf0530b 100644
--- a/crates/ui-egui/src/text_field.rs
+++ b/crates/ui-egui/src/text_field.rs
@@ -2,8 +2,12 @@
//! Select All; Esc gives back the text from before the edit; Return or leaving the field ends the
//! edit; optionally everything is selected when it takes focus, for fields that are retyped whole.
//!
-//! Standalone: it knows nothing of the app. The caller owns the text and learns how an edit ended
-//! from [`TextFieldResponse::ending`]; what an ending means (save, apply, close) is the caller's.
+//! It knows nothing of the app's documents or commands, only the UI's plumbing (the automation
+//! registry, translations, shortcut labels). The caller owns the text and learns how an edit
+//! ended from [`TextFieldResponse::ending`]; what an ending means (save, apply, close) is the
+//! caller's. Each field's widget id is unique on screen: its state is keyed by it.
+//!
+//! New text boxes use it rather than `egui::TextEdit`.
//!
//! The keyboard's ⌘X / ⌘C / ⌘V / ⌘A and undo are egui's own, and the app's shortcuts step aside
//! while a field has focus (`shortcuts::handle`, the native menu's `yields_to_text`).
diff --git a/docs/mcp.md b/docs/mcp.md
index a6b69a264..d217fd4eb 100644
--- a/docs/mcp.md
+++ b/docs/mcp.md
@@ -132,7 +132,7 @@ Tools taking `id` make that photo active first; without it they act on the activ
| `screenshot {maxSize?, format?, path?}` | The app window as an image, after pending renders finish |
| `inspect_ui` | View, panel, window/image rects, selection, status |
| `set_ui {state}` | Merge UI state, e.g. `{"view": "detail"}` |
-| `list_widgets {filter?}` / `click {widget \| x,y, count?}` | Widgets by automation id; real egui clicks |
+| `list_widgets {filter?}` / `click {widget \| x,y, count?, button?}` | Widgets by automation id; real egui clicks (`button: "right"` right-clicks) |
| `press_key {key, cmd?, shift?, alt?}` / `type_text {text}` | Keyboard input (shortcuts) |
| `clipboard {action, text?}` | Cut, copy or paste in the focused text field (⌘X / ⌘C / ⌘V; refused when none has the focus; cut and copy write the system clipboard); `inspect_ui` → `copied` is what was copied |
| `pointer_gesture {events}` | Gestures in normalized image coordinates (brush strokes, gradients, crop handles) |
diff --git a/docs/parity.md b/docs/parity.md
index 0a33304bd..65898037d 100644
--- a/docs/parity.md
+++ b/docs/parity.md
@@ -651,7 +651,7 @@ From `06-shortcuts.md` part 1. Evidence is our binding; conflicts are explained
| KEY-GRID | Grid — G | P0 | ✅ | `cmd:view.gridToggle`, `cmd:view.photoGrid` | G toggles Photo Grid ↔ Square Grid |
| KEY-INFO | Info — I | P0 | ✅ | `cmd:panel.info` | |
| KEY-KEYWORDS | Keywords — K | P0 | ✅ | `cmd:panel.keywords` | |
-| KEY-CLIPBOARD | Copy / paste edit settings — ⌘C / ⌘V | P0 | ✅ | `cmd:develop.copy`, `cmd:develop.paste`, `crates/ui-egui/src/shortcuts.rs` (`matches`) | ⌘X has nothing to cut outside text fields; on Windows and Linux, where the windowing layer sends Ctrl+C / Ctrl+V as clipboard events rather than key presses, those run the shortcuts too |
+| KEY-CLIPBOARD | Copy / paste edit settings — ⌘C / ⌘V | P0 | ✅ | `cmd:develop.copy`, `cmd:develop.paste`, `crates/ui-egui/src/shortcuts.rs` (`matches`) | ⌘X has nothing to cut outside text fields; on Windows and Linux, where the windowing layer sends Ctrl+C / Ctrl+V as clipboard events rather than key presses, those run the shortcuts too (⇧Insert pastes plainly); there Ctrl+V only arrives while the system clipboard holds text (egui-winit drops it otherwise), so with an empty clipboard Paste Settings needs the menu |
| KEY-UNDOREDO | Undo / redo — ⌘Z / ⇧⌘Z | P0 | ✅ | `cmd:edit.undo`, `cmd:edit.redo` | |
| KEY-MINIMIZE | Minimize — ⌘M | P1 | ✅ | `apps/lightcraft/src/native_menu.rs` | native Window ▸ Minimize |
| KEY-AUTO | Auto — ⇧A | P0 | ✅ | `cmd:develop.auto` | |
diff --git a/docs/whats-new.md b/docs/whats-new.md
index 2aa850f8b..2b6912407 100644
--- a/docs/whats-new.md
+++ b/docs/whats-new.md
@@ -5,8 +5,9 @@
### Text fields
- Right-click Search Photos, a slider's typed value or the name field under unnamed faces for Cut, Copy, Paste and
Select All. Esc in them gives back the text from before you started typing. More fields will follow.
-- On Windows and Linux, Ctrl+C / Ctrl+V outside a text field copy and paste edit settings again, and ⇧Ctrl+V opens
- Paste Selected Settings.
+- On Windows and Linux, Ctrl+C outside a text field copies edit settings and Ctrl+V pastes them (⇧Ctrl+V: Paste
+ Selected Settings). Ctrl+V only reaches LightCraft while the system clipboard holds text; otherwise use Edit ▸ Paste Edit
+ Settings.
### Masking
- Drag anywhere inside the selected radial gradient's ellipse to move it, including rotated