pyronear / pyronear/pyro-annotator
Classify Done: the annotated-only filters vanish when the list is empty, trapping the user
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 2
Description
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
- Go to
/classify/donewith rows present, open Filters → More filters — six widgets, including Result. - Set Result to one with no matches (or any filter combination yielding zero rows).
- 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/pages/SequencesPage.tsx by comparing the empty-state FilterPopover props at lines 304-307 with the populated branch at 452-455, and inspect isAnnotatedView at line 53. Check src/utils/processingStage.ts:184 for the array-valued Done stage. Done means /classify/done still shows all six widgets after filters produce zero rows, allowing the emptying filter to be loosened.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100