Files
ARCADIA-Studio/harness/experiments/text-workspace-initial-review-20260913/focus-selection-review.md
T
sorokin.oleg.edu 2df7f580aa Make the Text workspace compact and preserve editing context
Replace the oversized header and reference rail with stable editor slots and a retained supporting drawer. Bind diagnostic, result and menu actions to their original publication and visit; preserve effective selections on navigation and dismiss Actions, Find and the drawer one surface per Escape.

Retain exact Windows source captures, eight final gates (871 desktop passes), independent reviews, native selection/rename/recovery trials and the original failures. All 526 tested inputs and staged evidence were byte-checked before commit. Combined preview integration and packaging remain with issue 27; Linux remains paused.
2026-09-12 22:00:36 -07:00

24 lines
4.0 KiB
Markdown

# Find focus-only correction: independent static review
**PASS — no actionable production correctness finding within the bounded delta.** Review uses the immutable `focus-selection-candidate-1` copies, not the parent's transient worktree during its planned old-controller red run. Candidate manifest sizes/hashes verified. No builds, tests, GUI actions or source edits performed.
`restore_source_editor_focus` still admits only available navigation and an exact live cursor, then creates the same fresh reveal ticket with interaction/raw clock/snapshot/path. Clearing `source_jump` is an explicit focus-only intent. `source_viewport` retains every existing guard, consumes the admitted ticket, and mutates Content only when a genuine Some(cursor) navigation request exists. Existing guarded_focus still rechecks raw input at operation execution and requires one current editor target and no foreign focused widget. Focus-only restoration neither reconstructs Content nor roundtrips the lossy Word/Line cursor representation.
The unchanged intentional-navigation branch still validates exact cursor, moves to it and optionally selects the line; invalid cursor returns before focus. Other production jump-clearing paths inspected also revoke reveal through source_interaction/reset, or are behind the generic interaction invalidation. Thus the new None case does not turn a cancelled navigation request into a valid focus request.
The four new tests address the actual prior evaluator blind spot: semantic selection() and typed replacement bytes, rather than equal flattened Cursor endpoints. They use real mounted mouse double/triple click actions, Find input focus, actual Close button, captured Escape input with explicitly injected existing bridge message, and the actual guarded widget operation. Word and line controls plus the deliberately lossy old cursor roundtrip discriminate the native failure. Accepted Document identity/history remain unchanged while draft bytes receive the replacement.
Evidence limits are accurately disclosed: the CPU-mounted Content is distinct from App's renderer-typed Content; the initial hit-tested caret is copied before semantic selection, and subsequent actual selection/edit actions are relayed to App. Production GPU layout/scroll, full Ctrl+F subscription and the Escape subscription bridge are not end-to-end covered by this fixture. Native replay remains necessary. Debug-only test cfg is consistent with existing shared `views::source_tests::FontLayout`; it does not claim release-profile testing.
The new later-raw-input case also reopens Find (new interaction target ID and foreign focus), so by itself it does not isolate raw-clock rejection. This is a limitation, not an uncovered production change: existing unchanged `source_navigation/interaction/tests.rs::focus_rechecks_clock_between_inspection_and_application_and_missing_target_is_inert` isolates clock invalidation between operation passes, while the new test exercises the complete newer-Find refusal scenario. Explicit navigation test directly queues a reveal after resetting Content, so it supplements rather than replaces existing navigation query/reveal regressions.
Parent's old-production/new-regression red run, corrected green/full gates and fresh native replay are outstanding evidence at review time. No native acceptance is claimed.
## Bound inputs
- `crates/oa-desktop/src/app/source_symbols.rs`: 21062 bytes; SHA-256 `aa4f1423e759fdeaf7815d656b40189be176f4e8659f3da50debb5d85ed3af6c`
- `crates/oa-desktop/src/app/text_workspace.rs`: 21658 bytes; SHA-256 `723ccc8b31c0e2ea8d34841359bf5df086ef866b2bf5c65eefce276c20015bb0`
- `crates/oa-desktop/src/app/text_workspace/focus_selection_tests.rs`: 15091 bytes; SHA-256 `074dd8e281b5bf08baffc1667024007c742472bc0a72b2fdb6b1823478824e44`
- Attempt-4 archived original `app/source_symbols.rs`: 20674 bytes; SHA-256 `1fb3709bb973e7dcfbcde56054d028e47d770a62f3b7c8b6fac411543a234b7b`
- Historical attempt-4 input ZIP SHA-256 `e1e566295bbbd6c1d571f7c8908b7344397293496481790f0f8dacab7eba5366`.