refactor(ime): replace manual wire assembly with MessageBuilder/push_msg and add structured logging - #28
Merged
Conversation
…sh_msg and add tracing Replace the open-coded extend_from_slice + (len << 16) | opcode wire assembly with the existing MessageBuilder::build_message helper wrapped in a push_msg helper. MessageBuilder produces byte-identical wire output, so this is a behavior-neutral refactor. Add structured log::trace/debug/info instrumentation to every IME handler to make the host<->guest event flow observable. This lays the groundwork (shared helpers + logging) for the follow-up IME correctness fixes without changing any protocol behavior.
Author
|
Split from #27 to make review manageable. This PR is the behavior-neutral foundation (MessageBuilder refactor + logging). The follow-up PRs (core IME correctness, then the backspace heuristic) are being prepared and will each link back here. |
This was referenced Jul 8, 2026
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.
This is PR 1 of a stacked series (split from #27 for reviewability). It is a behavior-neutral refactor with zero protocol changes.
Every instance of the open-coded Wayland wire-format assembly pattern:
is replaced with a single call:
MessageBuilder::build_messageproduces byte-identical output, so this is behavior-neutral.Also adds structured
log::trace/debug/infoinstrumentation to every IME-related handler in bothtext_input.rsandkeyboard.rsso the host↔guest event flow is observable in logs.Next in the stack
set_preedit_region/confirm_preedithandlers,commit_statefix, activation state machine