Skip to content

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

Description

@jschick04

Context

Follow-up from PR #658 review (comment #658 (comment)) and the review-panel discussion. Filed separately because it is a pre-existing transient, orthogonal to that comment's fix (which gated the wasted rescan while highlight-tie is unarmed).

Problem

HistogramPane.RefreshTieFilters refreshes _tieHighlightFilters synchronously, but the histogram data (_baseData, including GroupHighlightMasks) is only replaced when a background scan completes. On a disarm transition (highlight-tie was armed, now unarmed - e.g. the user clears the last highlight color, or the eligible filter count crosses 31), StartScan launches a plain (mask-free) scan but does not clear _baseData synchronously. Until that scan publishes:

  • _baseData.GroupHighlightMasks still holds the armed masks (ordinals into the previous eligible filter list), while
  • _tieHighlightFilters has already been reassigned to the new (unarmed) filter set.

Any re-render in that window (ResolveGroupHighlight / GroupColorClass, gated on GroupHighlightMasks is not null) maps the stale mask ordinals through the new filter list, so a sub-frame flash of stale / mis-mapped group-highlight styling (and the corresponding ARIA text) can appear before the plain scan settles.

Scope / severity

  • Transient and self-healing: the in-flight plain scan publishes mask-free data and the glitch clears.
  • Pre-existing: present before PR Expand histogram timeline dimensions and category display #658; not introduced by the arm-gated-rescan change in e63db05 (that change actually shortens the window by not cancel-restarting the disarm scan).
  • Visual / accessibility only; no data-correctness impact.

Suggested fix

On a disarm transition, synchronously invalidate the tied display data before the async scan - e.g. clear _baseData.GroupHighlightMasks (or suppress the highlight render path) the moment wasArmed && !willArm, rather than waiting for the plain scan to publish.

Suggested test

Publish armed data, stall the disarm plain scan, issue the disarm edit, and assert the render does not surface stale masks (no histogram-cat-hl, no stale ResolveGroupHighlight mapping) before the scan completes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions