Files
ARCADIA-Studio/harness/experiments/palette-readability-20260913/palette-readonly-correction-source-handoff-20260913.md
T

5.7 KiB

Read-only input selection correction: source handoff

Correction to the palette foundation handoff, prompted by the P2 finding in the independent review. Root owns issue #26, integration and execution. No compiler, native UI, Gitea or root tracked edit was performed by this worker.

  • Worktree: .local/palette-foundation-20260912
  • Branch: codex/palette-foundation-956atf-20260912
  • Preserved parent commit: 02c2f6f46e57cf2cb00c2df789fbbad6caf973e7
  • Separate correction: 87133b9d7b7fcd71dd7ea87485d0eed8d6edaaa2
  • Status immediately after commit: clean.

Confirmed problem and correction

Installed Iced text_input mouse/keyboard handlers allow selection and copying without on_input. Its draw Range branch paints selection even in Disabled status; only the caret branch suppresses disabled caret painting. Hosted address, bearer-token and query fields actually use on_input_maybe(None) while busy. The earlier test comment claiming disabled selection was unavailable was wrong. The stock Disabled value is MUTED, whose selected pair with INPUT_SELECTION is approximately 2.068170:1.

New style::selectable_input starts from the actual Iced default style and changes only value to INK when Status is Disabled. The three Hosted conditional input constructions now use it. Existing backgrounds, borders, placeholders, selection fill, callbacks, secure masking, submit handling and lifecycle remain unchanged. In particular, the bearer token's existing secure-input copy restriction is not relaxed.

This restores approximately 4.684305:1 for value/selection while retaining the existing distinct read-only surface. It does not change the shared secondary role or secondary-button colors. Enabled conditional-input styles retain the default value INK and existing surfaces. The source-editor S2 style/formatter is untouched.

The original seven-test handoff's disabled-selection exemption is superseded by this correction. Its historical source remains preserved in 02c2f6f; it must not be used as an acceptance argument.

Test source and verification status

Performed: actual Iced source inspection, source formatting with rustfmt --edition 2024 --config skip_children=true, and git diff --check; both commands exited 0. Git commit succeeded. Compilation and every Rust test remain unrun.

There are now 10 declared style tests, including these three additions:

  • conditional_input_styles_preserve_readonly_selected_value_contrast: resolves the production adapter for Active/Hovered/Focused/Disabled; checks normal and selected text plus visible range; verifies that surface/border/placeholder are inherited.
  • ordinary_editable_editor_styles_keep_their_own_selected_value_readable: covers the actual default editor Active/Hovered/Focused outputs independently of S2. It does not assert a contract for unused no-action editor states.
  • readonly::mounted_readonly_input_keeps_selection_copy_and_readable_paint: mounts the real Iced text input with the same conditional-callback/style path as Hosted, using the production WGPU headless renderer. It sends mouse focus and keyboard Select All, exercises an initially read-only field and an enabled field submitted then rebuilt read-only using the same widget identity and UI cache, copies the actual selected Unicode value, attempts typing/backspace without a callback, and copies again to verify value/selection preservation. It requires no mutation messages, observes actual Disabled style resolution, and checks real selection-fill and dark-glyph pixels within the rendered range. Specified-color contrast checks are kept separate from antialiased pixel identification.

The prior default-input test now retains the stock Disabled selected pair as an explicit negative control, not an exemption. The regression test invokes the production adapter and real widget; it does not manufacture private focus/cursor state, disable selection, or clear the selection to evade the failure. It is a widget-level Hosted-pattern fixture, not an App/network submission test; the actual Enter-to-busy Hosted workflow remains in native acceptance.

After integration and serialized compiler authorization, the targeted command remains:

cargo test --locked -p oa-desktop --bin arcadia-studio style::tests -- --nocapture

Require an exact listing/count of ten selected tests and successful completion. The WGPU test needs the same supported headless environment as existing mounted/render tests. No execution result is inferred from source review or formatting.

Scope and remaining evidence

Only four files change in this correction. No global secondary-pair change, lexer/editor lifecycle change, canvas edit or dependency change. Default scrollbar coverage was not expanded; the independent review's already-passing arithmetic remains scoped rather than claiming exhaustive widget coverage. Native focus, syntax scanability, physical-monitor behavior, empty/newline-only source selection geometry and other foundation limitations remain as previously documented.

Parent was given the exact correction identity to wake nested_call_design for independent source review before integrated gates. That review and all executable results are pending at this handoff.

File under the worktree SHA-256
crates/oa-desktop/src/style.rs 28b9527137d03850b617e3c248828e8111743e3b2d0ca8def31d8f381889ddd2
crates/oa-desktop/src/style/tests.rs b771d9656beafc1489ecef5e97d9b006ac385f77933930c42769cc35ca8ddffe
crates/oa-desktop/src/style/tests/readonly.rs 6097ab8984ce61c90fc725c01c758391a30009004f0b1d42a4ebf4fd8b4106d9
crates/oa-desktop/src/hosted/view.rs 862180b048e6ae28fa188aa889ab5b584061604c7cd7670ab83ec4dbf8c9ae91