Commit Graph

1 Commits

Author SHA1 Message Date
Joseph Doherty 3eb7df74eb fix(ui): clear page-scoped detail state on paging where no keyed detail exists
Gating the detail modal/drawer on a held id rather than on the row resolving
(d14e0ee4) made it the surface's own job to clear that id when navigation
invalidates page-scoped state. ParkedMessages and ConfigurationAuditLog did not,
so paging away from an open row left the surface mounted on a notice it could
never recover from — reachable only by paging back.

The criterion is per-surface and comes down to whether the modal has content of
its own:

  ParkedMessages, ConfigurationAuditLog — no keyed detail fetch; content resolves
  from the loaded page alone. An entry paged out of view can never resolve again,
  so these must clear on paging. They already cleared it on Search/OnSiteChanged
  for the same reason, and clear _selectedIds on paging for the same reason
  again; paging was simply missed.

  NotificationReport, SiteCallsReport — fetch detail by id, so the modal still
  shows real content after its row leaves the page. These deliberately do NOT
  clear on paging and are unchanged.

Clearing on an explicit navigation action is user intent, not a resolve-driven
unmount, so this cannot reopen the handler-disposal race that d14e0ee4 closed.

PageScopedDetailStateTests covers all three paging entry points and records the
criterion so the next reader can tell why two surfaces clear and two do not. Run
against both clears reverted, all three fail; restored, all three pass.
CentralUI.Tests 994/994, solution build 0/0.

Also corrects two comments in ParkedMessages left stale by d14e0ee4 — they still
described the drawer as self-closing when a row stops resolving, which is the
behaviour that change deliberately removed.
2026-08-11 06:17:18 -04:00