Skip to content

Fix stale highlight-tie masks and ARIA briefly rendered during async disarm#667

Merged
jschick04 merged 1 commit into
mainfrom
jschick/histogram-highlight-tie-disarm
Jul 24, 2026
Merged

Fix stale highlight-tie masks and ARIA briefly rendered during async disarm#667
jschick04 merged 1 commit into
mainfrom
jschick/histogram-highlight-tie-disarm

Conversation

@jschick04

Copy link
Copy Markdown
Collaborator

Closes #659.

Problem

The scenario histogram's highlight-tie refresh (HistogramPane.RefreshTieFilters) reassigns _tieHighlightFilters synchronously, but the histogram data (_baseData, including GroupHighlightMasks) is only replaced when a background scan completes. On a disarm transition (the last highlight color is cleared, or the eligible filter count crosses 31), the mask-free scan does not clear _baseData synchronously, so a re-render in the gap maps the old armed mask ordinals through the new (unarmed) filter list -- briefly flashing stale or mis-mapped group-highlight styling and the corresponding ARIA. Transient, self-healing, visual/accessibility only.

Fixes

  • Synchronous mask invalidation. On the RefreshTieFilters rescan branch, clear _baseData.GroupHighlightMasks immediately (via with { ... = null }) so the render is mask-free until the correct masks republish. Covers disarm and an armed reconfigure whose eligible-list reorder remaps the old ordinals.
  • Cached-ARIA refresh. The assertive live region caches a bin announcement that embeds the highlight description. A shared RefreshBinAnnouncement() helper now re-derives it on every highlight change (both the rescan and non-rescan paths of RefreshTieFilters), so a disarm, plan change, or color-only edit does not leave the live region announcing a stale highlight after the cursor is dismissed.
  • Mask-restore race. StartScan bumped the scan epoch only after its zero-viewport early return, so a queued armed-scan publication could restore the just-cleared masks (a color-only disarm keeps the same predicate plan key, so the epoch bump is what supersedes it). The epoch is now bumped before the early return, and the publish path rechecks the cancellation token.

Testing

bUnit coverage in HistogramPaneTests:

  • Disarm clears GroupHighlightMasks synchronously (viewport pinned to 0 so no background scan can publish and mask the result).
  • The cached bin announcement is refreshed on both the rescan (disarm) and non-rescan (color-only edit) paths.
  • A zero-viewport StartScan still bumps the scan epoch.

Full-solution build: 0 warnings / 0 errors. UI unit tests: 1190/1190.

Copilot AI review requested due to automatic review settings July 24, 2026 02:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Addresses a transient UI/accessibility glitch in the histogram highlight-tie feature where stale group-highlight masks (and related ARIA/live-region text) could briefly render during an async disarm/reconfigure window.

Changes:

  • Synchronously invalidates HistogramData.GroupHighlightMasks on highlight-tie rescan-triggering transitions to prevent stale/mis-mapped highlight styling during the async gap.
  • Centralizes and consistently refreshes the cached assertive live-region bin announcement on all highlight changes.
  • Fixes a scan-epoch supersede edge case by bumping _scanEpoch even when StartScan early-returns for a zero-size viewport, and tightens publish cancellation checks.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/EventLogExpert.UI/LogTable/Histogram/HistogramPane.razor.cs Clears highlight masks synchronously during rescan transitions, refreshes cached bin announcement consistently, and hardens scan supersede/publish cancellation behavior.
tests/Unit/EventLogExpert.UI.Tests/LogTable/Histogram/HistogramPaneTests.cs Adds bUnit coverage for synchronous mask invalidation, cached-ARIA refresh behavior, and the zero-viewport scan-epoch bump.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…disarm (#659)

The scenario histogram's highlight-tie refresh reassigned _tieHighlightFilters
synchronously but replaced _baseData (and its GroupHighlightMasks) only when a
background scan completed. On a disarm transition the mask-free scan did not
clear _baseData synchronously, so a render in the gap mapped the old armed mask
ordinals through the new (unarmed) filter list, briefly flashing stale or
mis-mapped group-highlight styling and ARIA.

Fixes:
- Invalidate the stale GroupHighlightMasks synchronously on the rescan branch of
  RefreshTieFilters (covering disarm and an armed reconfigure whose eligible-list
  reorder remaps the old ordinals), so the render is mask-free until the correct
  masks republish.
- Refresh the cached assertive-region bin announcement (which embeds the
  highlight description) on every highlight change via a shared helper, so a
  disarm, plan change, or color-only edit does not leave the live region
  announcing a stale highlight after the cursor is dismissed.
- Bump the scan epoch before StartScan's zero-viewport early return and recheck
  the cancellation token when publishing, so a queued armed-scan publication
  cannot restore the just-cleared masks (a color-only disarm keeps the same
  predicate plan key, so the epoch bump is what supersedes it).

Adds bUnit coverage for the synchronous mask clear (viewport pinned so no scan
publishes), the cached-announcement refresh on both the rescan and non-rescan
paths, and the zero-viewport epoch bump.
Copilot AI review requested due to automatic review settings July 24, 2026 03:16
@jschick04
jschick04 force-pushed the jschick/histogram-highlight-tie-disarm branch from 96630c2 to 0b07793 Compare July 24, 2026 03:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@jschick04
jschick04 marked this pull request as ready for review July 24, 2026 03:21
@jschick04
jschick04 requested a review from a team as a code owner July 24, 2026 03:21

@ryanriesMSFT ryanriesMSFT 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.

🍆

@jschick04
jschick04 merged commit 39af0f0 into main Jul 24, 2026
8 checks passed
@jschick04
jschick04 deleted the jschick/histogram-highlight-tie-disarm branch July 24, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Histogram: stale highlight-tie masks briefly rendered during async disarm transition

3 participants