Skip to content

fix(search): Enables moving cursor position in input - #26

Open
adamcbrewer wants to merge 3 commits into
typecraft-dev:mainfrom
adamcbrewer:feat/25-query-cursor-editing
Open

adamcbrewer wants to merge 3 commits into
typecraft-dev:mainfrom
adamcbrewer:feat/25-query-cursor-editing

Conversation

@adamcbrewer

@adamcbrewer adamcbrewer commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Left and Right don't move the query cursor because the launcher draws plain text and appends every character. Correcting the middle of a calculation means deleting everything after it.

Change

Uses a native Qt text input for root search, submenu searches and aliases. Arrow keys, Home/End, selection and deletion work at the cursor, and long queries scroll as it moves. Launcher shortcuts, result navigation, search history and action-panel input keep their existing behaviour.

The input also keeps upstream's argument pills and popups, with focus restored to the query when they close. Clipboard paste inserts at the cursor or replaces the selection.

For example, typing 12+34, pressing Left twice and inserting 5 now gives 12+534.

Fixes #25. Related to #23, which also changes launcher input.

Testing

  • OMA_CAST_QML_RUNNER=/usr/bin/qs node --test tests/*.test.js: 148 passed; one optional native search-helper integration test skipped because the binary wasn't built locally. Includes the native Qt suite with 9 editing cases.
  • Qt 6 QML lint and launcher parse checks, plugin manifest validation, Bash syntax and whitespace checks passed.
  • Regression coverage includes cursor-aware paste, popup focus, navigation bindings and resetting input composition while cancelling pending searches on hide.
  • Full launcher loaded cleanly in an isolated Quickshell process with a mock backend.

The installed desktop plugin points to another checkout and wasn't reloaded. Live fcitx5/ibus composition hasn't been checked.

Uses a native text input so queries can be corrected in place while keeping launcher navigation and shortcuts.

Fixes typecraft-dev#25
)

Keeps cursor editing alongside upstream command arguments, popups and clipboard paste (typecraft-dev#27). Pasted text respects the query cursor and selection.

Refs typecraft-dev#25, typecraft-dev#27
cpreston321 added a commit to cpreston321/oma-cast that referenced this pull request Oct 26, 2026
…ueries

The query is now a native TextInput, so typing moves out of handleKey.
Resolution: keep the fork's guard against popping an empty quicklink
form on Backspace, and cap the input at a script prompt's maxLength
(setQuery refuses longer text, which the field would otherwise show).

typecraft-dev#21 and typecraft-dev#26 both added tests/launcher-input.test.js. It is now typecraft-dev#26's,
with the editor helpers its alias test routes through; typecraft-dev#21's numpad
tests move to tests/launcher-keypad.test.js, where printable numpad keys
in the query now pass through to the native input.
@adamcbrewer adamcbrewer changed the title Enables cursor editing in launcher queries fix(search): Enables moving cursor position in input Oct 29, 2026
Keeps input composition reset alongside upstream search cancellation and updates paste tests for panels loaded on demand.

Refs typecraft-dev#25
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.

Bug: Left and Right arrow keys don't move the query cursor

1 participant