fix(web): address review feedback on the monitoring column (#1616)

- ResizeHandle: clear the `resizing-col` body class on unmount so a drag
  interrupted by the handle unmounting (narrow past the breakpoint / disconnect)
  can't leave page-wide user-select:none / col-resize applied.
- Embedded monitor column now shows the full unfiltered stream instead of
  silently mirroring the full-size screen's live filter (the column has no
  filter control to explain an empty/partial list).
- MonitoringControls: give the SegmentedControl an aria-label ("Monitoring
  screen") so the tab group has an accessible name.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
cliffhall 2026-07-08 19:41:00 -04:00
commit 9b76272ad1
5 changed files with 124 additions and 11 deletions

View file

@ -215,15 +215,26 @@ export function HistoryListPanel({
const [pinnedOpen, setPinnedOpen] = useState(true);
const [historyOpen, setHistoryOpen] = useState(true);
const filteredEntries = useMemo(() => {
// `.filter()` returns a fresh array, so sorting in-place is safe.
// Embedded column: show the full stream (no filter sidebar to explain a
// mirrored filter). See LogStreamPanel (#1616). `.filter()` returns a fresh
// array, so sorting in-place is safe.
const sorted = entries
.filter((e) =>
matchesFilters(e, searchText, visibleDirections, methodFilter),
.filter(
(e) =>
embedded ||
matchesFilters(e, searchText, visibleDirections, methodFilter),
)
.sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime());
if (sortDirection === "newest-first") sorted.reverse();
return sorted;
}, [entries, searchText, visibleDirections, methodFilter, sortDirection]);
}, [
entries,
searchText,
visibleDirections,
methodFilter,
sortDirection,
embedded,
]);
const pinnedEntries = useMemo(
() => filteredEntries.filter((e) => pinnedIds.has(e.id)),

View file

@ -80,13 +80,16 @@ export function LogStreamPanel({
}: LogStreamPanelProps) {
const viewportRef = useScrollMemory("logs-stream");
const filteredEntries = useMemo(() => {
// `.filter()` returns a fresh array, so sorting in-place is safe.
// The embedded column has no filter sidebar, so it shows the full stream
// rather than mirroring the full-size screen's live filter with no visible
// control to explain it (#1616). `.filter()` returns a fresh array, so
// sorting in-place is safe.
const sorted = entries
.filter((e) => matchesFilters(e, filterText, visibleLevels))
.filter((e) => embedded || matchesFilters(e, filterText, visibleLevels))
.sort((a, b) => a.receivedAt.getTime() - b.receivedAt.getTime());
if (sortDirection === "newest-first") sorted.reverse();
return sorted;
}, [entries, filterText, visibleLevels, sortDirection]);
}, [entries, filterText, visibleLevels, sortDirection, embedded]);
return (
<PanelContainer>

View file

@ -33,6 +33,20 @@ describe("MonitoringControls", () => {
expect(screen.queryByRole("radio", { name: "Network" })).toBeNull();
});
it("gives the tab switcher an accessible name", () => {
const { container } = renderWithMantine(
<MonitoringControls
tabs={TABS}
value="Logs"
onChange={vi.fn()}
onClose={vi.fn()}
/>,
);
expect(
container.querySelector('[aria-label="Monitoring screen"]'),
).not.toBeNull();
});
it("marks the active tab as selected", () => {
renderWithMantine(
<MonitoringControls

View file

@ -39,6 +39,7 @@ export function MonitoringControls({
value={value}
onChange={onChange}
data={tabs}
aria-label="Monitoring screen"
/>
<CloseButton aria-label="Close monitoring column" onClick={onClose} />
</ControlsBar>

View file

@ -98,13 +98,17 @@ export function NetworkStreamPanel({
}: NetworkStreamPanelProps) {
const viewportRef = useScrollMemory("network-stream");
const filteredEntries = useMemo(() => {
// `.filter()` returns a fresh array, so sorting in-place is safe.
// Embedded column: show the full stream (no filter sidebar to explain a
// mirrored filter). See LogStreamPanel (#1616). `.filter()` returns a fresh
// array, so sorting in-place is safe.
const sorted = entries
.filter((e) => matchesFilters(e, filterText, visibleCategories))
.filter(
(e) => embedded || matchesFilters(e, filterText, visibleCategories),
)
.sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime());
if (sortDirection === "newest-first") sorted.reverse();
return sorted;
}, [entries, filterText, visibleCategories, sortDirection]);
}, [entries, filterText, visibleCategories, sortDirection, embedded]);
const hasEntries = entries.length > 0;
const hasResults = filteredEntries.length > 0;