feat(session-ui): collapsible JSON tree view for raw messages in context panel - #38298
Open
jiong-nba wants to merge 3 commits into
Open
feat(session-ui): collapsible JSON tree view for raw messages in context panel#38298jiong-nba wants to merge 3 commits into
jiong-nba wants to merge 3 commits into
Conversation
…ext panel Replace the flat File-based JSON display in the context panel with a recursive collapsible tree viewer. Top-level nodes (depth < 2) are expanded by default; deeper nodes are collapsed with a chevron toggle. - Reactive parsing via createMemo + Show keyed - Syntax coloring using existing --syntax-* theme variables - String escaping for \n, \r, \t, quotes, backslashes - aria-expanded on toggle buttons - Graceful fallback to raw text on parse failure Closes anomalyco#38288
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
…ccessibility - Replace createMemo + Show keyed with createStore + reconcile so streaming updates patch the tree in place without resetting user expand/collapse state - Fire onRendered on every contents change via createEffect(on(...)) instead of only on initial mount - Add aria-label to toggle buttons for screen reader support - Use explicit valid flag instead of truthiness to correctly handle root-level primitive JSON values (false, 0, "", null)
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.
Issue for this PR
Closes #38288
Type of change
What does this PR do?
The raw messages section in the context panel rendered each message as a flat JSON text block via the
Filecomponent. Deeply nested structures were hard to scan.This PR replaces that with a recursive collapsible tree viewer (
JsonViewer). Each object/array node gets a chevron toggle; nodes at depth < 2 start expanded somessageandpartsfields are immediately visible. Parsing is wrapped increateMemowith<Show keyed>so the tree rebuilds reactively when parts stream in. Strings are escaped (\n,\", etc.) and syntax-colored using the existing--syntax-*theme variables. Invalid JSON falls back to plain text.No new dependencies. The old
File+checksumimport is removed since it is no longer needed here.How did you verify your code works?
Ran the app dev server (
bun devinpackages/appagainst a local backend), opened a session, expanded the context panel → Raw messages, and confirmed:Screenshots / recordings
N/A — pure UI behavior change, no visual mockup.
Checklist