Skip to content

fix(diagnostics): stop panel from being unclickable and add outside-click dismiss (lr-b580)#299

Merged
clagentic-merger[bot] merged 1 commit into
mainfrom
fix/lr-b580-diagnostics-panel-pointer-trap
Jul 1, 2026
Merged

fix(diagnostics): stop panel from being unclickable and add outside-click dismiss (lr-b580)#299
clagentic-merger[bot] merged 1 commit into
mainfrom
fix/lr-b580-diagnostics-panel-pointer-trap

Conversation

@clagentic-builder

Copy link
Copy Markdown
Contributor

Summary

Fixes the lr-8294 regression where the Diagnostics panel became unclickable and undismissable via backdrop.

Root cause: #diagnostics-panel lives inside #info-panels (lib/public/css/menus.css), a position:fixed container that spans a chunk of the viewport with pointer-events:none so it does not block clicks on the app underneath. Sibling panels (#usage-panel, #status-panel, #context-panel, #team-panel) opt back into pointer-events:auto on their own bounds via a shared CSS selector. lr-8294 (PR #285) added the diagnostics panel to the DOM and gave it its own stylesheet, but never added it to that shared selector -- so it inherited pointer-events:none from its parent. Result: the panel itself, including its own X close button, became fully unclickable. It was not trapping clicks over the rest of the UI (the parent stayed non-modal); it was simply inert.

Fix:

  • lib/public/css/menus.css: add #diagnostics-panel to the shared pointer-events:auto selector and the shared .hidden { display: none; } selector, matching its sibling panels. This is a non-modal surface scoped to its own bounds per the required-behavior options in the task -- no backdrop element, no viewport-wide overlay.
  • lib/public/modules/diagnostics.js: add a document click-outside listener in initDiagnostics(), mirroring the existing configPopover outside-click pattern already used in app-panels.js. Ignores clicks inside the panel or on its topbar toggle button. Routes dismissal through the existing closePanelAndRefocus() helper so focus restoration (WCAG 2.1 2.4.3) stays consistent across the Escape-key, close-button, and backdrop-click dismiss paths -- no change to that helper or to the existing Escape/close-button wiring.

Test plan

  • Added test/diagnostics-panel-pointer-events-lr-b580.test.js: source-text regression assertions (no DOM harness, matching the project existing server-settings-mobile-parity-lr-87ca.test.js convention) that check: #diagnostics-panel is present in the shared pointer-events:auto CSS selector; #diagnostics-panel.hidden is present in the shared display:none CSS selector; initDiagnostics registers a document click listener; the click-outside handler calls closePanelAndRefocus(), not a bare closePanel(); the handler ignores clicks inside the panel and on the toggle button.
  • npm test: 597 tests, 596 pass, 1 fail. The 1 failure is a process-level exit-code quirk with no corresponding failing TAP subtest (all 597 individual subtests report ok, including the 5 new ones here) -- documented as pre-existing on main in the lr-1a26 task comment thread (andy, 2026-06-30).

Task: lr-b580

…lick dismiss (lr-b580)

Root cause: #diagnostics-panel lives inside #info-panels, a fixed,
viewport-spanning, pointer-events:none container that sibling panels
(#usage-panel, #status-panel, #context-panel, #team-panel) opt back
into via a shared pointer-events:auto selector. lr-8294 added the
diagnostics panel to the DOM/CSS but never added it to that selector,
so it inherited pointer-events:none -- the panel itself, including its
own X button, became fully unclickable.

Fixes:
- menus.css: add #diagnostics-panel to the shared pointer-events:auto
  and .hidden selectors alongside its sibling panels.
- diagnostics.js: add a document click-outside listener (mirroring the
  existing configPopover pattern in app-panels.js) so the panel is
  dismissable without a dedicated backdrop element, routed through the
  existing closePanelAndRefocus() helper so focus restoration stays
  consistent with the Escape-key and close-button paths.

Regression coverage: test/diagnostics-panel-pointer-events-lr-b580.test.js
(source-text assertions, matching the project's existing DOM-harness-free
convention).

npm test: 597 tests, 596 pass, 1 fail -- pre-existing process-level exit
code quirk noted by andy on lr-1a26 (all individual TAP subtests report ok,
including the 5 new ones added here).

@clagentic-reviewer clagentic-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEACHES — clean

Summary

  • lib/public/css/menus.css (lines 672, 681): Added #diagnostics-panel to both the pointer-events: auto selector and the .hidden display rule. This fixes the root cause: the panel was inheriting pointer-events: none from its parent (#info-panels) and becoming unclickable (lr-8294 regression).
  • lib/public/modules/diagnostics.js (lines 73-81): Added document-level click-outside listener that dismisses the panel when clicks land outside the panel and its toggle button, mirroring the configPopover pattern in app-panels.js. Reuses closePanelAndRefocus() for consistent focus restoration across all dismiss paths (Escape, close button, click-outside).
  • test/diagnostics-panel-pointer-events-lr-b580.test.js: Five source-text regression tests covering the CSS selectors and click-outside handler logic. Follows the project's existing convention (xss-escape.test.js, server-settings-mobile-parity).

Checks

✓ CSS selectors include diagnostics-panel alongside sibling panels
✓ Click-outside handler guards against clicks on the panel itself and its toggle button
✓ Click-outside handler calls closePanelAndRefocus() for WCAG 2.1 §2.4.3 focus restoration (consistent with Escape and close-button paths)
✓ Regression tests are specific, isolated, and follow project convention
✓ No new dependencies, hardcoded paths, or brand rule violations

@clagentic-merger

Copy link
Copy Markdown
Contributor

clagentic gate-note — authorized

field value
Task (not recorded)
PR #299 (github)
Gated HEAD SHA 6054d4534376afa4deeb2caeb08e6786ca75e1d4
Merged SHA 6054d4534376afa4deeb2caeb08e6786ca75e1d4
CI at HEAD (not recorded)
PEACHES reviewed
Pre-checks secret-scan · SAST · dep/vuln
Merged-by naomi

Authorize rationale: PEACHES clean (review 4612782553); BOBBIE not required (frontend-only css/js+test, lr-8294 precedent); CI green at HEAD; authorized by holden per lr-b580

@clagentic-merger clagentic-merger Bot merged commit 518577c into main Jul 1, 2026
1 check passed
@clagentic-merger clagentic-merger Bot deleted the fix/lr-b580-diagnostics-panel-pointer-trap branch July 1, 2026 21:07
@clagentic-release-bot

Copy link
Copy Markdown

This issue has been resolved in version 1.6.0-beta.2 (beta).

To update, run:

npx @clagentic/console@1.6.0-beta.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants