Commit 1f4b3b6
refactor: centralise duplicate frontend helpers (#197)
* refactor: extract shared network filter and label utilities
Move duplicated edge-filter logic into applyNetworkFilters() in
networkService.ts and duplicated filter-label building into
buildActiveFilterLabels() in constants.ts. Both AnalysisPage and
NetworkDiagramPage now call the shared helpers, eliminating the
divergence risk flagged in review.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: centralise duplicate helpers across frontend
- parseDateTime: remove copy in timelineService, import from dateUtils
- formatBytes: remove copies in NetworkDiagramPage + ComparePage, import from utils/formatters
- toggleSet: remove copies in NetworkDiagramPage + ComparePage, export from network/constants
- edgeMatchesLegendKey: remove copy in ComparePage, import from networkService
- applyNetworkFilters: remove inline filter block in ComparePage, call shared helper (hiddenSources pre-filter kept inline as it is compare-specific)
- confidenceLevel + buildDeviceSignals: remove copies in both classification popups, export from utils/deviceType
- useClickOutside: new shared hook in utils/, replaces duplicate useEffect in both classification popups
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: address UI and LLM error handling issues
- Fix LLM connection errors being swallowed by generic 500 handler by re-throwing LlmException and ContextLengthExceededException directly in StoryService
- Show friendly LLM unreachable message on frontend for non-502 LLM errors
- Hide Device Type filter section when no device-classified nodes are present
- Hide Node Types section when no node/device types are present
- Remove nav-tabs underline on Analysis page
- Fix card header corners not rounding in dark mode with overflow: hidden
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use Set for IP filter node lookup and tighten LLM error check
- Replace O(N×E) fe.some() loop with a Set-based lookup for IP filter
node visibility in applyNetworkFilters
- Remove overly broad substring matching for LLM errors in StoryPage;
rely solely on HTTP 502 now that backend correctly propagates LlmException
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 67fc0ca commit 1f4b3b6
15 files changed
Lines changed: 307 additions & 350 deletions
File tree
- backend/src/main/java/com/tracepcap/story/service
- frontend/src
- assets/styles
- components
- common
- DeviceClassificationPopup
- NodeClassificationPopup
- conversation/ConversationFilterPanel
- network/NetworkControls
- features
- network
- services
- timeline/services
- pages
- Analysis
- Compare
- Conversation
- NetworkDiagram
- utils
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
216 | 218 | | |
217 | 219 | | |
218 | 220 | | |
| 221 | + | |
| 222 | + | |
219 | 223 | | |
220 | 224 | | |
221 | 225 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| |||
Lines changed: 5 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 16 | | |
40 | 17 | | |
41 | 18 | | |
42 | 19 | | |
43 | 20 | | |
44 | 21 | | |
45 | 22 | | |
46 | | - | |
| 23 | + | |
47 | 24 | | |
48 | 25 | | |
49 | 26 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 27 | + | |
59 | 28 | | |
60 | 29 | | |
61 | 30 | | |
| |||
Lines changed: 5 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 25 | | |
32 | 26 | | |
33 | 27 | | |
| |||
42 | 36 | | |
43 | 37 | | |
44 | 38 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 39 | | |
63 | 40 | | |
64 | 41 | | |
| |||
80 | 57 | | |
81 | 58 | | |
82 | 59 | | |
83 | | - | |
| 60 | + | |
84 | 61 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 62 | + | |
94 | 63 | | |
95 | 64 | | |
96 | 65 | | |
| |||
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
666 | 668 | | |
667 | 669 | | |
668 | 670 | | |
| 671 | + | |
669 | 672 | | |
670 | 673 | | |
671 | 674 | | |
| |||
676 | 679 | | |
677 | 680 | | |
678 | 681 | | |
679 | | - | |
| 682 | + | |
680 | 683 | | |
681 | 684 | | |
682 | 685 | | |
683 | | - | |
| 686 | + | |
684 | 687 | | |
685 | 688 | | |
686 | 689 | | |
| |||
699 | 702 | | |
700 | 703 | | |
701 | 704 | | |
| 705 | + | |
702 | 706 | | |
703 | 707 | | |
704 | 708 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
| 368 | + | |
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
86 | 139 | | |
87 | 140 | | |
88 | 141 | | |
| |||
0 commit comments