Commit 0f56bf0
feat: export pipeline, branded report, files panel merge
Export UX:
- ExportMenu (new) collapses each chart's four export icons (PNG / Small PNG /
Copy image / CSV) into one "Export ▾" dropdown. Two variants: bordered for
chart panels, ghost (borderless) for sidebar header.
- New "Small PNG (≤50 KB)" export per chart: scales the chart canvas down
iteratively until the encoded blob fits the byte budget. Toast reports the
actual size on success.
- Global "Export report" lives in the sidebar header utility row now (was a
loose toolbar above the chart grid). Dropdown gives Copy to clipboard /
Download as PNG.
- Defensive fixes for browser quirks: download anchor is appended to DOM
before .click(), blob URL revocation is deferred 4 s, and an explicit toast
warns when no charts are loaded or clipboard API is unavailable.
Report generation (utils/chartExport.js):
- Branded header band with blue→violet→indigo gradient, diagonal stripe
overlay, white logo mark, and timestamp.
- Files strip showing the actual file names (mono font).
- Cards per chart with drop shadow, rounded corners, and a per-section accent
bar (blue for main, violet for comparisons, indigo for combined view).
- Stats table under each chart: file color swatch + min/max/mean/last/n with
zebra striping and tabular-mono numerics. "last" column is emphasized.
- Charts grouped into sections (Main / Comparisons / Combined view) with a
section header bar — labels translated.
- Chart titles come from the components themselves (e.g. "Loss", "Grad Norm")
instead of internal IDs (was: "metric-0", "metric-comp-1").
- ChartContainer exposes copyReport/downloadReport via useImperativeHandle
so the sidebar can drive them without lifting all chart state.
Sidebar header utility row:
- Icon-only buttons replaced with icon + text buttons grouped by purpose:
row 1 = Export report / Settings / Shortcuts; row 2 = language toggle /
Theme (with current mode label) / GitHub.
- ThemeToggle gains a showLabel prop that renders "System" / "Light" / "Dark"
next to the cycling icon.
FilesPanel (new):
- Combines FileUpload and FileList into one card. Empty state shows the large
drop zone; otherwise a compact drop strip lives above the list.
- Clear-all trash icon in the card header wipes every loaded file in one
click (parsing config + display preferences untouched).
Default chart config:
- Downsampling defaults to off so small logs render every point. Users opt in
via Settings → Performance when handling large runs.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 6db9e7b commit 0f56bf0
9 files changed
Lines changed: 1245 additions & 150 deletions
File tree
- public/locales
- en
- zh
- src
- components
- utils
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
9 | 21 | | |
10 | 22 | | |
11 | 23 | | |
| |||
30 | 42 | | |
31 | 43 | | |
32 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
33 | 50 | | |
34 | 51 | | |
35 | 52 | | |
| |||
40 | 57 | | |
41 | 58 | | |
42 | 59 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
46 | 74 | | |
47 | 75 | | |
48 | 76 | | |
| |||
225 | 253 | | |
226 | 254 | | |
227 | 255 | | |
228 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
229 | 263 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
9 | 21 | | |
10 | 22 | | |
11 | 23 | | |
| |||
30 | 42 | | |
31 | 43 | | |
32 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
33 | 50 | | |
34 | 51 | | |
35 | 52 | | |
| |||
40 | 57 | | |
41 | 58 | | |
42 | 59 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
46 | 74 | | |
47 | 75 | | |
48 | 76 | | |
| |||
225 | 253 | | |
226 | 254 | | |
227 | 255 | | |
228 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
229 | 263 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | | - | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
140 | 145 | | |
141 | 146 | | |
142 | 147 | | |
| |||
456 | 461 | | |
457 | 462 | | |
458 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
459 | 470 | | |
460 | 471 | | |
461 | 472 | | |
| |||
642 | 653 | | |
643 | 654 | | |
644 | 655 | | |
645 | | - | |
646 | | - | |
647 | | - | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
648 | 692 | | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
678 | 705 | | |
679 | 706 | | |
680 | 707 | | |
681 | | - | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
682 | 717 | | |
683 | 718 | | |
684 | 719 | | |
| |||
692 | 727 | | |
693 | 728 | | |
694 | 729 | | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | 730 | | |
704 | 731 | | |
705 | 732 | | |
| |||
888 | 915 | | |
889 | 916 | | |
890 | 917 | | |
| 918 | + | |
891 | 919 | | |
892 | 920 | | |
893 | 921 | | |
| |||
0 commit comments