fix: message viewer performance degradation on expanded rows during streaming#2235
Merged
jvorcak merged 1 commit intorelease-2.8from Feb 20, 2026
Merged
Conversation
… editor remounting The subComponent prop passed to DataTable was an inline arrow function, causing React to treat it as a new component type on every MobX-triggered re-render. During gRPC streaming searches, each arriving message triggered a re-render that unmounted and remounted all expanded Monaco editors, leading to 21+ seconds of scripting on protobuf-schema topics. - Wrap subComponent, onCopyKey, onCopyValue in useCallback for stable refs - Memoize JSON.stringify in KowlJsonView to avoid redundant serialization - Remove dead expandedKeys/toggleRecordExpand code from pre-DataTable era
7635a4c to
d6b8842
Compare
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.
Summary
subComponentidentity inMessageTableusinguseCallback— prevents React from unmounting/remounting all expanded Monaco editors on every MobX-triggered re-render during gRPC streamingautomaticLayoutwith a single debouncedResizeObserverper editor — eliminates cascading layout recalculations and fixes existing Safari infinite loopJSON.stringifyinKowlJsonViewto skip redundant serialization on re-rendersexpandedKeys,toggleRecordExpand) left over from the pre-DataTable migrationRoot cause
MessageTableis a MobXobserverthat re-renders on every message push during gRPC streaming search. ThesubComponentprop was an inline arrow function, so each re-render created a new function reference.DataTableuses this as a React component type — when the reference changes, React treats it as a different component, unmounting the old tree and mounting a new one for every expanded row. Each cycle destroys and recreates Monaco editor instances, causing 21+ seconds of pure scripting on protobuf-schema topics.Verified with Playwright