Skip to content

type: choose where text lands and read the caret - #137

Merged
hexuria merged 1 commit into
mainfrom
feat/type-placement-caret
Nov 29, 2026
Merged

hexuria merged 1 commit into
mainfrom
feat/type-placement-caret

Conversation

@hexuria

@hexuria hexuria commented Nov 29, 2026

Copy link
Copy Markdown
Owner

Closes #136

Summary

type can now place text at a caret or selection instead of only appending, replace types over one occurrence through the widget edit path, and editable nodes/read-backs expose marker-notation view plus character-offset caret and selection. Assertions can check all three in one predicate, and semantic/virtual cursor keys cover Left, Right, Home, and End.

Public API

  • type accepts at (marker notation), before/after with one-based nth, start, end, and replace_all; omission keeps the released append-at-end behavior.
  • New replace op and CLI/MCP command selects one occurrence of old and types new over it through the widget edit path.
  • Editable UiNodes and type/replace read-backs report view, caret, and selection; caret_selection and text_placement are public hello.features capabilities.
  • assert and wait_until accept view in marker notation.
  • key accepts Left, Right, Home, and End.
  • Recipes and the JSON schema carry the same placement, replacement, and view fields.

Verification

  • cargo test --workspace: 753 passed, 0 failed (44 suites).
  • cargo fmt --all -- --check: pass.
  • cargo clippy --workspace --exclude todo --all-targets -- -D warnings: pass.
  • Feature-matrix clippy (--all-features, recipe default, CLI --no-default-features, CLI --features jev): pass.
  • examples/recipes/todo-text-editing.json: 31 steps pass on headless and the real macOS desktop todo host.
  • examples/recipes/todo-text-editing-virtual.json: 31 steps pass through virtual delivery on the real macOS desktop todo host.

Host plugs that consume the published crate need the follow-up named in the issue after this API is released.

Add marker-notation placements, replace, caret/selection read-back, view assertions, and cursor movement keys. Cover semantic and virtual delivery in the todo host and document the protocol and recipes.
@hexuria
hexuria merged commit a61f77c into main Nov 29, 2026
9 checks passed
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.

type: choose where text lands (append, prepend, insert, replace) and read the caret and selection

1 participant