Commit db218b9
feat: dark mode with light/dark/system toggle (#178)
* feat: add dark mode with light/dark/system toggle
- Add `themeSlice` to Zustand store with `themeMode: 'light' | 'dark' | 'system'`
persisted to localStorage; cycles light → dark → system on click
- `MainLayout` applies `data-theme` attribute to `<html>`, listens to
`prefers-color-scheme` in system mode for live OS-level updates
- Header toggle button shows `bi-sun` / `bi-moon-stars` / `bi-circle-half`
with tooltip describing the current mode and next action
- Define `--tp-*` CSS token set in `index.css`; dark block placed after
`:root` so it correctly wins the cascade
- Override all SGDS `--sgds-*` component-local variables directly on the
component selector (card, table, list-group, modal, dropdown, nav-tabs,
popover, pagination, input-group-text) — inheriting from `html` is not
sufficient because SGDS re-declares them locally
- Add `tp-stream-pane`, `tp-stat-box`, `tp-code-inline`, `tp-payload-pre`
utility classes replacing hardcoded `bg-light` in JSX
- Fix `bg-light`, `bg-white`, `text-dark`, `sticky-top` Bootstrap utilities
and alert-danger readability in dark mode
- `ndpi-reference.html` gains a `prefers-color-scheme: dark` media query
that flips its own CSS variable set
- `captureNetworkDiagrams` temporarily sets `data-theme="light"` before
screenshotting so PDF reports always render in light mode
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: address dark mode PR review comments
- Remove duplicate alert-danger override (earlier block shadowed by later one)
- Remove redundant tp-* dark overrides from sgds-overrides.css (index.css
variables already handle these; also resolves tp-payload-pre inconsistency)
- Remove hardcoded backgroundColor in SessionTab body pre so tp-stream-pane
CSS class takes effect correctly
- Fix NetworkGraph darkMode to reactively listen to prefers-color-scheme
in system mode instead of reading it once on render
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent b41fbc7 commit db218b9
File tree
21 files changed
+659
-87
lines changed- frontend
- public
- src
- assets/styles
- components
- analysis
- AnalysisSummary
- ProtocolBreakdown
- common
- Layout
- ScrollableTable
- conversation
- ConversationFilterPanel
- SessionTab
- network
- NetworkControls
- NetworkGraph
- NodeDetails
- upload
- FileList
- FileUploadZone
- UploadProgress
- features/report
- pages
- FilterGenerator
- NetworkDiagram
- store
- slices
21 files changed
+659
-87
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
26 | 41 | | |
27 | 42 | | |
28 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
25 | 54 | | |
26 | 55 | | |
27 | 56 | | |
| |||
31 | 60 | | |
32 | 61 | | |
33 | 62 | | |
34 | | - | |
| 63 | + | |
| 64 | + | |
35 | 65 | | |
36 | 66 | | |
37 | 67 | | |
| |||
50 | 80 | | |
51 | 81 | | |
52 | 82 | | |
53 | | - | |
| 83 | + | |
54 | 84 | | |
55 | 85 | | |
56 | 86 | | |
57 | | - | |
58 | | - | |
| 87 | + | |
| 88 | + | |
59 | 89 | | |
60 | 90 | | |
61 | 91 | | |
| |||
67 | 97 | | |
68 | 98 | | |
69 | 99 | | |
70 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
71 | 103 | | |
72 | 104 | | |
73 | 105 | | |
| |||
79 | 111 | | |
80 | 112 | | |
81 | 113 | | |
82 | | - | |
| 114 | + | |
83 | 115 | | |
84 | 116 | | |
85 | 117 | | |
| |||
99 | 131 | | |
100 | 132 | | |
101 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
102 | 157 | | |
103 | 158 | | |
104 | 159 | | |
| |||
0 commit comments