Skip to content

Classify Done: the annotated-only filters vanish when the list is empty, trapping the user #271

Description

@Chouffe

What

On /classify/done, filtering down to zero results makes the Result, FP types, Smoke types and Certainty filters disappear from the FilterPopover — the four filters most likely to have caused the empty list. There's no way to loosen the filter that emptied the page except "Reset all" or reloading.

The popover header reads More filters (2) on the empty state and More filters (6) when rows are present.

Why

SequencesPage renders two FilterPopovers, and they gate those four props differently:

  • src/pages/SequencesPage.tsx:304-307 (empty-state branch) — showModelAccuracy={defaultProcessingStage === 'annotated'}, same for the other three.
  • src/pages/SequencesPage.tsx:452-455 (populated branch) — showModelAccuracy={isAnnotatedView}, same for the other three.

isAnnotatedView is stageFilterIncludes(defaultProcessingStage, 'annotated') (:53), which handles both a bare stage and an array. The raw === 'annotated' comparison does not: SequencesPageWrapper passes ALL_CLASSIFIED_STAGES — the array ['seq_annotation_done', 'annotated'] (src/utils/processingStage.ts:184) — so the comparison is always false on the Done list and the four filters never render there.

The prop is typed ProcessingStageFilter (:40), i.e. it legitimately holds a stage or an array, so === 'annotated' is a type-safe expression that is simply wrong for half the domain. TypeScript won't catch it.

Repro

  1. Go to /classify/done with rows present, open Filters → More filters — six widgets, including Result.
  2. Set Result to one with no matches (or any filter combination yielding zero rows).
  3. The empty state renders; reopen Filters → More filters — two widgets. Result is gone, and so is the way to undo the filter that emptied the list.

Fix

Use isAnnotatedView in the empty-state branch too (:304-307), matching :452-455. The two FilterPopover call sites have drifted; passing one shared props object would stop them drifting again.

Notes

Pre-existing and independent of #270 (which restyles the Result filter) — the old <select> disappeared the same way. Found while verifying #270 in a browser.

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