From 50382955542587c318ea63dd9b71692c95a4a096 Mon Sep 17 00:00:00 2001 From: Hugh Kaznowski Date: Sat, 5 Sep 2026 18:48:59 +0100 Subject: [PATCH] Collapse sections by clicking their title bar (ticket 006) Alerts, Metrics, Params, and Dashboards now toggle collapsed state when their header row is clicked, instead of requiring a dedicated collapse button. The chevron (CollapseToggle) becomes a purely visual, non-focusable indicator for these sections; HelpIcon and PopOutButton now stop propagation so they keep working without also collapsing the section. The log viewer's toggle (App.tsx/FilterBar) keeps its dedicated button, since that row is a filter toolbar with an editable input rather than a plain title bar, so CollapseToggle's onToggle prop stays available for that case. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o --- tickets/006-collapse-via-title-bar-click.md | 8 ---- webapp/src/components/Alerts.tsx | 19 +++++++-- webapp/src/components/CollapsibleSection.tsx | 41 +++++++++++++++++++- webapp/src/components/Dashboards.tsx | 25 +++++++++--- webapp/src/components/HelpIcon.tsx | 5 ++- webapp/src/components/Metrics.tsx | 20 ++++++++-- webapp/src/components/Params.tsx | 20 ++++++++-- 7 files changed, 113 insertions(+), 25 deletions(-) delete mode 100644 tickets/006-collapse-via-title-bar-click.md diff --git a/tickets/006-collapse-via-title-bar-click.md b/tickets/006-collapse-via-title-bar-click.md deleted file mode 100644 index d155273..0000000 --- a/tickets/006-collapse-via-title-bar-click.md +++ /dev/null @@ -1,8 +0,0 @@ -# Collapse sections by clicking title bar instead of a dedicated button - -Instead of having collapse buttons on the main view components/categories, clicking the title bars should collapse them. - -## Acceptance criteria -- Clicking a section's title bar toggles its collapsed/expanded state. -- Dedicated collapse buttons are removed (or repurposed as a visual indicator only, e.g. a chevron, without being the sole click target). -- Title bar remains usable for any other existing interactions (if any) without conflicting with the collapse click. diff --git a/webapp/src/components/Alerts.tsx b/webapp/src/components/Alerts.tsx index 4dd4fcd..260bc45 100644 --- a/webapp/src/components/Alerts.tsx +++ b/webapp/src/components/Alerts.tsx @@ -9,7 +9,13 @@ import { type AlertRule, type CompareOp, } from '../lib/api' -import { CollapseToggle, sectionHeaderClassName, sectionHeaderLeftClassName, useSectionCollapsed } from './CollapsibleSection' +import { + CollapseToggle, + handleSectionHeaderKeyDown, + sectionHeaderInteractiveClassName, + sectionHeaderLeftClassName, + useSectionCollapsed, +} from './CollapsibleSection' import { HelpIcon } from './HelpIcon' import { queryInputClassName } from './FilterBar' @@ -231,13 +237,20 @@ export function Alerts() { return (
-
+
setCollapsed(!collapsed)} + onKeyDown={handleSectionHeaderKeyDown(() => setCollapsed(!collapsed))} + >
Alerts
- setCollapsed(!collapsed)} /> +