Commit 7a50be1
authored
feat(traces): add fold/unfold toggle button to JSON panels (#396)
## 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 correctly1 parent e261096 commit 7a50be1
1 file changed
Lines changed: 34 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
562 | 564 | | |
563 | 565 | | |
564 | 566 | | |
| 567 | + | |
| 568 | + | |
565 | 569 | | |
566 | 570 | | |
567 | 571 | | |
| |||
573 | 577 | | |
574 | 578 | | |
575 | 579 | | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
576 | 599 | | |
577 | 600 | | |
578 | 601 | | |
| |||
584 | 607 | | |
585 | 608 | | |
586 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
587 | 617 | | |
588 | 618 | | |
589 | 619 | | |
| |||
605 | 635 | | |
606 | 636 | | |
607 | 637 | | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
608 | 641 | | |
609 | 642 | | |
610 | 643 | | |
| |||
0 commit comments