fix(messaging): reduce composer recomposition and typing jank#6318
Draft
jeremiah-k wants to merge 2 commits into
Draft
fix(messaging): reduce composer recomposition and typing jank#6318jeremiah-k wants to merge 2 commits into
jeremiah-k wants to merge 2 commits into
Conversation
…omposition Replace the full List<Node> dependency in MessageInput with a stable MentionCandidate projection (id, longName, shortName) derived via derivedStateOf. Telemetry, position, lastHeard, and other high-frequency Node changes leave MentionCandidate structurally identical, preventing OutputTransformation recreation and platform input-connection churn. Replace the IntelliJ GFM parser on the live TextField transformation path with a bounded regex-based inline-markdown scanner (bold, italic, strikethrough, code only). The full parser remains available for rendered message bubbles via InlineMarkdown.kt. The existing Node import is preserved for MessageListPaged (full node list at render time) and NodeDetails navigation events.
Remove the duplicate mention-matching implementations and cache normalized candidate fields so each keystroke performs one query normalization instead of repeatedly lowercasing every node identity field. Evaluate candidates through a lazy sequence and stop once the bounded suggestion list is full. Keep the helper and live-markdown span surfaces internal so common tests can exercise the production hot path without expanding the public API. Add regression coverage for case-insensitive mention matching, stable ordering and limits, live inline-style parsing, exact draft debounce timing, and synchronous draft clearing.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Overview
This reduces message-composer recomposition and per-keystroke work, particularly on active meshes where node telemetry changes frequently and inline Markdown is enabled.
The composer previously received full
Nodeobjects, so telemetry-only node updates could invalidate the input subtree even when no mention-visible identity data had changed. The live editor also performed more text processing and state persistence than necessary during rapid typing.This keeps the existing Markdown wire format and user-visible behavior while narrowing the composer’s reactive inputs and making the typing path bounded.
Changes
Nodecomposer inputs with lightweight mention candidates containing only ID, long name, and short name.Nodeand candidate matching implementations.SavedStateHandleby 300 ms during rapid typing.onCleared()draft write.Validation
Added focused coverage for:
Existing messaging tests continue to cover raw Markdown transmission, mention completion, formatting behavior, send handling, and draft restoration.
Scope
This change is limited to the message-composer hot path. It does not change transport, database, node-identity, or application-lifecycle behavior.