Skip to content

feat(traces): add fold/unfold toggle button to JSON panels#1

Closed
micookie2 wants to merge 1 commit into
mainfrom
feat/traces-fold-toggle
Closed

feat(traces): add fold/unfold toggle button to JSON panels#1
micookie2 wants to merge 1 commit into
mainfrom
feat/traces-fold-toggle

Conversation

@micookie2
Copy link
Copy Markdown
Owner

@micookie2 micookie2 commented May 14, 2026

Summary

  • Add a fold/unfold toggle button next to each JSON panel title (Raw Request, Raw Response, etc.) on the Traces page
  • Clicking fold collapses all nested JSON levels while keeping the outermost { } visible
  • Clicking again unfolds everything
  • Useful for quickly inspecting top-level keys in large JSON payloads (e.g. prompt structure) without scrolling through deeply nested content

Changes

  • Added editorRef to AccordionPanel to hold the Monaco Editor instance via onMount
  • Added handleToggleFold: calls editor.foldAll then unfolds line 1 to keep the root object open
  • Toggle button uses Minimize2/Maximize2 icons to indicate current state

Test plan

  • Open the Traces page and click on a trace to view details
  • Click the fold button next to Raw Request title — inner JSON should collapse, outermost { } stays visible
  • Click again — all JSON should unfold
  • Verify the copy button still works correctly

Add a toggle button next to each accordion panel title (Raw Request,
Raw Response, etc.) that folds all nested JSON while keeping the
outermost object visible. Clicking again unfolds everything.
@micookie2 micookie2 closed this May 21, 2026
@micookie2 micookie2 deleted the feat/traces-fold-toggle branch May 21, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant