openpencil/crates/openpencil-shell-native
Kayshen-X cf5b300714 fix(variables): commit row focus on every state-mutating shortcut
Codex re-review on 3891ea07 BLOCKed 8 more bypass paths.

Fix them in three groups:

1. input_active() (widget_host/input.rs:13) now includes
   variable_row_focus, so apply_copy / apply_cut / apply_paste /
   apply_select_all / apply_reorder (which already gate on
   input_active) automatically block while a row is focused —
   no need for per-method commits.

2. State-mutating shortcuts that DON'T gate on input_active() get
   explicit `commit_variable_row_focus_if_any()` at the top:
   - apply_undo / apply_redo / apply_group / apply_ungroup
     (shortcuts.rs:55–104)
   - apply_toggle_code_panel (shortcuts.rs:122)
   - apply_toggle_agent_settings (shortcuts.rs:132)
   - apply_set_tool (shortcuts.rs:144)
   - apply_boolean_op (widget_host.rs:338)
   - apply_delete (keyboard.rs:149) — special: pops a char from
     the variable draft instead of falling through to selection
     delete, matching the apply_backspace behavior

3. Desktop entry points in main.rs that bypass apply_press AND
   the shortcut methods (Cmd+S / Cmd+O / Cmd+Shift+S / Cmd+Shift+P):
   call new `commit_variable_row_focus_if_any_pub()` proxy on
   the host before persistence::handle_*.

The proxy is exposed because the internal helper is
`pub(in crate::widget_host)`.

377 shell-core tests still pass.
2026-05-15 02:49:12 +08:00
..
examples refactor(shell): promote inspector_window to openpencil-desktop binary crate 2026-05-10 19:50:10 +08:00
notes feat(shell-native): Step 1a Task 4 — basic_window demo + acceptance + Phase C Gate 2026-05-05 22:39:00 +08:00
src fix(variables): commit row focus on every state-mutating shortcut 2026-05-15 02:49:12 +08:00
tests refactor(shell-native): finish v19.4 cleanup — drop orphan event/ + stale test 2026-05-08 22:03:34 +08:00
Cargo.toml docs(shell-native): correct stale Cargo.toml comment about Invariant 2 2026-05-10 10:17:10 +08:00