Skip to content

Modal ESC audit: every popup closes on Escape; nested popups close only the topmost layer #535

Description

@NotYuSheng

Problem

We have not systematically verified Escape-key behaviour across the app's popups. Two requirements:

  1. Every popup/modal closes on ESC — SGDS Modals generally do this via onHide, but some of ours may not wire onHide, or use static backdrops, or are custom panels (not SGDS Modal) with no key handling at all.
  2. Nested popups: ESC closes only the topmost layer — e.g. NodeDetails in monitor mode is itself a modal; from it you can open EntityDetailModal (nested IP drill-down), the evidence-model explainer modal, or AdjudicationPanel's add-evidence modal (tp-nested-modal + raised z-index). Pressing ESC there must dismiss just that top layer, not the whole stack.

Known nesting surfaces to check

  • NodeDetails (modal-in-modal in monitor mode) → nested EntityDetailModal (nestedIp)
  • NodeDetails → evidence-model explainer Modal (evidenceInfoOpen, tp-nested-modal)
  • AdjudicationPanel → add-evidence Modal (raised zIndex prop for monitor mode)
  • EntityDetailModal sections that spawn further modals
  • Any non-SGDS custom popups (search for role="dialog", fixed-position panels)

Acceptance criteria

  • Inventory all popups (SGDS Modal + custom) and confirm each closes on ESC
  • With two+ layers open, ESC closes only the topmost; repeated ESC unwinds the stack one layer at a time
  • No layer is closed by an ESC that was consumed by a child (no double-close)

Why deferred

NodeDetails.tsx is mid-refactor (classification-axes evidence redesign); doing the ESC audit concurrently would conflict. Pick this up after that lands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditAudit taskuxUser experience

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions