Unify text input handling and bump WASM ABI to 0.25.0#24
Open
Unify text input handling and bump WASM ABI to 0.25.0#24
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WASM ABI 0.25.0: unify text input handling, fix GUI IME, and rename clipboard paste command
Summary
This PR does two related pieces of work:
TextInputsemantic path.kasane:plugin@0.25.0and renames clipboard paste fromPastetoPasteClipboard.The immediate user-visible result is that GUI IME now works correctly, text-producing inputs are routed consistently, and clipboard paste is clearly separated from committed text input.
Problem
Before this change:
Preeditwas discarded, so composing text was not visible.Paste, even though its meaning had narrowed to host clipboard insertion.Design
The main design decisions are:
Preeditas GUI-local runtime state, not editor truth.TextInput(String), notKeyEvent.Scope
This PR includes:
TextInputsemantics.0.25.0.Key Changes
IME / GUI
kasane-gui.WindowEvent::Imehandling out of generic input conversion.Preeditas an overlay.set_ime_cursor_area(...).cursor_rangefor active segment/caret display.Core Input Model
InputEvent::TextInput(String).TextInputwhen a text target is active.Commands / Event Loop
Command::InsertText(String)as the semantic command.InsertTextto KakouneKeys(...)only at the host boundary.Plugin / Surface Routing
Clipboard Paste / ABI
pastetopaste-clipboard.kasane:plugin@0.25.0.Important Behavioral Changes
PasteClipboard.Migration
For plugin authors upgrading from ABI
0.24.0:abi_version = "0.25.0"inkasane-plugin.toml.kasane-plugin-sdk = "0.4".Command::PastetoCommand::PasteClipboard.paste_clipboard()..wasm.Committed text input and bracketed paste payloads do not use
PasteClipboard.Notable Fix During Rollout
While validating the ABI bump, bundled
pane_manager.wasmwas still exportingkasane:plugin/plugin-api@0.24.0. That stale artifact caused bundled discovery failures and extra diagnostics. This PR replaces it with the rebuilt0.25.0artifact and adds a regression test for manifest-path loading.Tests Run
cargo test -p kasane-gui --libcargo test -p kasane-tui --libcargo test -p kasane-core state::tests::update -- --nocapturecargo test -p kasane-core state::tests::input -- --nocapturecargo test -p kasane-core event_loop::tests::surface -- --nocapturecargo test -p kasane-core event_loop::tests::dispatch -- --nocapturecargo test --manifest-path kasane-plugin-sdk/Cargo.toml -- --nocapturecargo test -p kasane-wasm --lib -- --nocaptureReview Guide
Suggested review order:
kasane-guikasane-core/src/inputkasane-core/src/state/update.rskasane-core/src/plugin/*kasane-core/src/surface/*kasane-core/src/event_loop/*kasane-wasm/wit/plugin.witkasane-wasm/src/convert/*Focus questions:
Preeditownership correctly isolated to the GUI layer?TextInputnow the right semantic boundary for committed text?PasteClipboardnow semantically narrow and well-separated?Risk Areas
Docs Updated
README.mddocs/plugin-development.mddocs/using-plugins.mdkasane-plugin-sdk/README.md