Commit debe26f
fix(ui+tray): tool quarantine diff as side-by-side before/after (#391)
* fix(ui): show tool diff as side-by-side before/after for changed tools
The quarantine panel previously rendered the current description as a
plain paragraph and, below it, a single diff box that mixed added,
removed, and same tokens — making it look like the same text was being
shown twice with random green highlights. Split the diff into two
labelled boxes so each side only renders its own words: the "Before
(approved)" box shows the previous description (with any removed words
highlighted red), and the "After (current)" box shows the new
description (with added words highlighted green). The plain paragraph
is suppressed when a diff is available so the current text is not
duplicated above the "After" box.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(tray/macos): mirror web before/after word-diff in ServerDetailView
Bring the macOS tray's Tool Quarantine diff in line with the web UI's
new before/after layout. Previously the tray stacked a red "minus"
box above a green "plus" box containing the raw old/new text, which
gave no hint about which specific words actually changed. Now the
diff section renders two labelled boxes ("Before (approved)" and
"After (current)") built from a longest-common-subsequence word diff;
each side only shows its own words with removals/additions
highlighted inside their respective boxes via AttributedString
background color.
Ports the same LCS used in ServerDetail.vue (split-on-whitespace
tokens, backtrack to build parts, merge consecutive parts of the same
kind). Adds ToolDiffTests covering identical inputs, empty sides, the
real gcore short→docstring expansion, and reconstruction invariants.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(ui+tray): refine tool diff to character level inside changed words
The word-level diff highlighted the entire differing token — so
"1 April" → "8 April" lit up the whole "1"/"8" tokens, and more
insidiously "version-1.2.3" → "version-1.2.4" lit up the entire
version string. Now we do a two-pass diff: word-level LCS for coarse
alignment, then for each adjacent (removed, added) pair we refine
with a character-level LCS. The result highlights only the
characters that actually changed (a single "1" vs "8", or "3" vs "4"
inside a version token), while large docstring expansions continue
to highlight cleanly at the word level because they have no paired
removed run to refine against.
Includes a safety cap (`maxChars = 1500`) that falls back to the raw
removed/added pair when a run is too long, so the O(N×M) char-level
dp table can never blow up on giant payloads.
Ports the refined algorithm to both ServerDetail.vue and
ServerDetailView.swift and extends ToolDiffTests with coverage for
"1 April" → "8 April", "version-1.2.3" → "version-1.2.4", and the
long-run safeguard.
Verified live in Chrome against hugginface/hf_doc_search (the real
"1 April" → "8 April" case): only one char is highlighted on each
side (`removedTexts: ["1"]`, `addedTexts: ["8"]`).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ui+tray): stable ordering in server/session lists + rename dashboard section
Three related UI stability fixes:
1. **Stable server order across API polls.** `Runtime.GetAllServers`
iterates the Supervisor StateView's `map[string]*ServerStatus`, which
has non-deterministic iteration order in Go. Every poll returned the
same servers in a different order, so filtered views like the tray's
"Servers Needing Attention" shuffled every few seconds (a server
would be first, then third, then second). Sort by name at the end of
GetAllServers — stable alphabetical, deterministic across polls.
2. **Stable Recent Sessions order.** `Runtime.GetRecentSessions` relied
on BBolt cursor order (newest-started-first by storage key). The
tray's dashboard then deduped by client name and re-sorted by tool
call count — which is zero for all sessions, so the final order came
from `Dictionary.values` iteration and reshuffled each poll. Sort in
the backend by `LastActivity` desc (break ties by ID), and replace
the tray's tool-count sort with `lastActive` desc + tool-count +
session ID as tiebreakers. Dashboard now shows sessions top-to-bottom
by actual recency.
3. **Dashboard "Recent Tool Calls" → "Recent Activity".** The section
filtered `recentActivity` down to tool_call/internal_tool_call types
only, so users without any indexed tool calls saw "No tool calls
recorded" despite having plenty of real activity (security scans,
tool quarantine changes, OAuth events). Rename the section, widen
the filter to all activity types except low-signal system events
(`system_start`, `system_stop`), and rename the column header from
"Tool" to "Event".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(tray/macos): keep sidebar intact when activity detail panel opens
The Activity Log used an inner `HSplitView` for its list + detail layout,
nested inside the main window's `NavigationSplitView`. When the detail panel
expanded on row click, the inner HSplitView's width demands competed with the
outer sidebar column and collapsed it below its minimum — so the sidebar's
"Dashboard / Servers / Activity Log / …" labels got truncated or hidden.
Replace `HSplitView` with a plain `HStack` that renders the detail pane only
when an entry is selected, tighten the list's fixed column widths a few pts
so the list + detail + sidebar all fit at the default 800pt window width,
and add a close (X) button in the detail header for an explicit dismissal
affordance.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Code <noreply@anthropic.com>1 parent b85e7db commit debe26f
6 files changed
Lines changed: 508 additions & 87 deletions
File tree
- frontend/src/views
- internal/runtime
- native/macos/MCPProxy
- MCPProxyTests
- MCPProxy/Views
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
359 | 373 | | |
360 | 374 | | |
361 | 375 | | |
| |||
952 | 966 | | |
953 | 967 | | |
954 | 968 | | |
955 | | - | |
956 | | - | |
957 | | - | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
958 | 976 | | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | 977 | | |
963 | | - | |
964 | 978 | | |
965 | 979 | | |
966 | | - | |
| 980 | + | |
967 | 981 | | |
968 | 982 | | |
969 | 983 | | |
970 | 984 | | |
971 | 985 | | |
972 | 986 | | |
973 | 987 | | |
974 | | - | |
975 | | - | |
| 988 | + | |
976 | 989 | | |
977 | | - | |
978 | | - | |
979 | 990 | | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
984 | 994 | | |
985 | | - | |
| 995 | + | |
986 | 996 | | |
987 | 997 | | |
988 | | - | |
| 998 | + | |
989 | 999 | | |
990 | 1000 | | |
991 | 1001 | | |
| 1002 | + | |
| 1003 | + | |
992 | 1004 | | |
993 | | - | |
994 | | - | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
995 | 1016 | | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
1000 | 1023 | | |
1001 | | - | |
| 1024 | + | |
1002 | 1025 | | |
1003 | 1026 | | |
| 1027 | + | |
| 1028 | + | |
1004 | 1029 | | |
1005 | | - | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1006 | 1057 | | |
1007 | 1058 | | |
1008 | 1059 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1103 | 1103 | | |
1104 | 1104 | | |
1105 | 1105 | | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
1106 | 1115 | | |
1107 | 1116 | | |
1108 | 1117 | | |
| |||
1797 | 1806 | | |
1798 | 1807 | | |
1799 | 1808 | | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
1800 | 1819 | | |
1801 | 1820 | | |
1802 | 1821 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | | - | |
95 | | - | |
96 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | | - | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
148 | | - | |
| 150 | + | |
149 | 151 | | |
150 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
151 | 157 | | |
152 | 158 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
159 | 167 | | |
160 | 168 | | |
161 | 169 | | |
| |||
184 | 192 | | |
185 | 193 | | |
186 | 194 | | |
187 | | - | |
| 195 | + | |
188 | 196 | | |
189 | 197 | | |
190 | 198 | | |
| |||
489 | 497 | | |
490 | 498 | | |
491 | 499 | | |
492 | | - | |
| 500 | + | |
493 | 501 | | |
494 | 502 | | |
495 | 503 | | |
| |||
695 | 703 | | |
696 | 704 | | |
697 | 705 | | |
| 706 | + | |
698 | 707 | | |
699 | 708 | | |
700 | 709 | | |
| |||
830 | 839 | | |
831 | 840 | | |
832 | 841 | | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
833 | 854 | | |
834 | 855 | | |
835 | 856 | | |
| |||
Lines changed: 33 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
489 | | - | |
490 | | - | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
491 | 502 | | |
492 | 503 | | |
493 | 504 | | |
| |||
558 | 569 | | |
559 | 570 | | |
560 | 571 | | |
561 | | - | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
562 | 583 | | |
563 | 584 | | |
564 | | - | |
565 | | - | |
566 | | - | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
567 | 590 | | |
568 | 591 | | |
569 | 592 | | |
570 | | - | |
| 593 | + | |
571 | 594 | | |
572 | 595 | | |
573 | 596 | | |
574 | 597 | | |
575 | 598 | | |
576 | 599 | | |
577 | 600 | | |
578 | | - | |
| 601 | + | |
579 | 602 | | |
580 | 603 | | |
581 | 604 | | |
| |||
591 | 614 | | |
592 | 615 | | |
593 | 616 | | |
594 | | - | |
| 617 | + | |
595 | 618 | | |
596 | 619 | | |
597 | 620 | | |
| |||
0 commit comments