Files
ARCADIA-Studio/harness/experiments/text-workspace-initial-review-20260913/departure-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

3.6 KiB
Raw Blame History

Departure selection correction: independent static review

PASS — no remaining production blocker found in the bounded correction. Read-only review of the formatted C:/ar-text-9e8r6t source; no builds, tests or native actions performed. This does not establish runtime/native acceptance.

The helper in source_navigation/selection.rs is constrained to the inspected Iced graphics editor. iced_graphics-0.14.0/src/text/editor.rs:315–339 collapses Move(Left) to effective selection start. cosmic-text-0.15.0/src/edit/editor.rs:494–523 copies selected lines joined by exactly one LF, so LF count and trailing UTF-8 byte length reconstruct the effective end without substring search. None/empty selections remain untouched. Unequal raw endpoint direction is retained; coincident Word/Line endpoints restore a Normal range with active cursor at its end. Only selected bytes are temporarily copied.

The five App call sites capture once after admission and reuse the result. app.rs::SourceFile rejects current/missing files before capture. app/source_symbols.rs::source_symbol_jump validates destination before capture/history insertion; Back checks session, membership, generation and cursor, then uses the captured current range for a changed active origin. app.rs::jump_to_source prepares coordinates only from a loaded target before capture. Find focus-only restoration remains nonmutating.

app.rs::create_source_file performs fallible preparation first. It preserves the outgoing canonical cursor, uses the undisplayed entry buffer's own saved cursor during its edit, then saves the current workspace cursor on the final switch. It does not attach stale outgoing Content coordinates to the intermediate entry. An entry changed by include insertion is outside the unchanged-origin selection promise.

Seven helper tests cover directional Unicode Normal ranges, repeated words, semantic Word/Line expansion, multiline LF/CRLF, final empty-line endpoint and absent/empty selections, with direct replacement equivalence and lossy-raw controls. Four App regressions cover file/definition-Back roundtrips, rejected/no-op/cancelled navigation, changed active Back and creation. The review found one fixture issue: move_to(..., selection: None) does not clear an existing selection. Parent corrected the changed-active edit setup with explicit MoveLeft and an exact one-character byte assertion. The invalid-creation control also now reselects real Line mode before asserting preservation. Both corrections were read back after formatting.

Limitations: restoring selected bytes does not retain Word/Line drag-extension mode, interior click point or affinity. The new tests supplement existing query/focus guards; they do not prove full native interaction or unreviewed editor-rebuild paths. The unchanged raw-clock operation already has an isolated two-pass cancellation test in source_navigation/interaction/tests.rs:131.

Final reviewed input hashes

  • crates/oa-desktop/src/source_navigation/selection.rs — 11,322 bytes; SHA-256 b0279456fafaca54880b61b970839a55d8affde6c6f9e24d86cb99bb41c388d6.
  • crates/oa-desktop/src/source_navigation.rs — 4,049 bytes; SHA-256 3e5a1753140fc50e4d3833bf6fcf572b8d387aa1c8a8af85d3b5fcde7026ffbc.
  • crates/oa-desktop/src/app/source_symbols.rs — 21,421 bytes; SHA-256 d81914a553114d85452d973a1edb175843d27154b3f9b9fc4cbc5049d423abe4.
  • crates/oa-desktop/src/app/source_symbols/tests.rs — 80,389 bytes; SHA-256 00cbacdd0af98858b5e74608720bd8251719c9926569a65a0ad777a40f1744c9.
  • crates/oa-desktop/src/app.rs — 223,048 bytes; SHA-256 75ef46ef2789b32c5837ee33dfdc303eaba013ba75767138e4a19ba5113bc6ba.