Skip to content

input: Cover UI workflows and fix disabled focus and vertical selection - #3256

Merged
huacnlee merged 5 commits into
mainfrom
test/input-ui-coverage
Sep 26, 2026
Merged

huacnlee merged 5 commits into
mainfrom
test/input-ui-coverage

Conversation

@huacnlee

@huacnlee huacnlee commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Expand Input, Textarea and Editor interaction regressions from 82 to 159 UI cases, with an operation matrix and a single local gate: script/test-input. The aim is to replace the routine manual editing tour with reproducible assertions and make this suite an example for future component UI tests.

Coverage includes typing/replacement, character/word/line/document/page movement, forward/reverse selection, Unicode and CRLF, pointer/word/paragraph selection, drag autoscroll, clipboard, Undo/Redo, validation and masks, readonly/disabled transitions, focus/lifecycle, wrapping/resizing, pairs/indentation, folding, multi-cursor editing, search/replace, deterministic completion/code-action/inline/definition providers, and IME protocol transitions on all three controls. Assertions inspect text together with selections, caret geometry, focus, history or host callbacks as appropriate.

Production fixes exposed by the tests

  • Preserve disabled Input pointer protection, document-edge selection, preferred columns after horizontal selection/Alt-click/offscreen navigation, and visual-row affinity through Shift-End followed by Down or Shift-Down.
  • Clamp drag selection to laid-out text while autoscroll reveals subsequent rows, instead of immediately selecting to EOF.
  • Cancel stale completion/inline requests on editing, Escape, blur, protection changes and popup acceptance.
  • Report the IME selection direction correctly and prevent canceled preedit from merging surrounding typing into one Undo transaction.
  • Preserve replacement-field focus when its mode change echoes through overlay synchronization.
  • Make the existing GoToDefinition action query its provider without requiring prior hover. Separate explicit navigation from hover cancellation; reject superseded responses and responses after text/caret/focus changes. No new default keybinding.

The runtime changes are limited to these paths. No public API signatures change. The existing press helper correction pairs key-down/up and avoids simulated IME text injection for Enter/Tab; its regressions remain included.

The branch starts from main after #3253 and does not depend on #3254's accessibility behavior. It also carries the isolated gallery-fixture CI correction shared with #3254: materialize registered surfaces in separate frames without changing production execution budgets.

Verification (Linux)

  • script/test-input: 536 passed, comprising Base 300, Component 44, Input UI 159, focus 4, keyboard helpers 16, touch selection 13; no failures or ignored cases in the selected runs.
  • All 17 Kit interaction targets: 270 passed (includes the Input/focus/helper/touch cases above).
  • cargo clippy -p gpui-kit --features test-support,assets --test input --test input_focus --test interactions --test touch_selection --locked -- --deny warnings: passed.
  • Scoped rustfmt, bash -n script/test-input, and git diff --check: passed.
  • Five independent review/test scopes were used. Observed failing cases were corrected and rerun; tests retain explicit blur observation, distinct clipboard sentinels and controlled provider responses rather than incidental cancellation/reset steps.

The existing CI matrix runs the relevant targets on Linux, macOS and Windows. Results for the new head must be checked before merging.

Review gate and boundaries

See crates/kit/tests/input/README.md for the operation matrix, fixtures, exact commands and instructions for adding a failing regression for each changed interaction. For ordinary editing changes, use that regression plus the full gate and platform CI.

This covers repeatable interaction contracts, not every possible document/configuration/event ordering. Composition tests call the public ElementInputHandler bridge for mounted controls; they do not drive a real OS input method or the platform-installed handler. Native IME/candidate windows, accessibility dispatch, clipboard/menu adapters and pixel rendering retain their relevant platform checks. The in-flight completion disposal fixture is inactive because TestPlatform retains the active window's input handler after removal; it does not certify active-window platform disposal.

Unicode movement preserves the existing scalar-boundary contract; grapheme movement, regex search, duplicate/move-line commands and Shift-Page selection are not introduced by these tests.

AI assistance

Implementation, tests, documentation and review were assisted by OpenAI Codex.

@huacnlee
huacnlee marked this pull request as ready for review September 26, 2026 16:03
@huacnlee
huacnlee merged commit 40ac007 into main Sep 26, 2026
12 checks passed
@huacnlee
huacnlee deleted the test/input-ui-coverage branch September 26, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant