Added a "Hide all visible" button

It hides the opportunities the filters show that aren't hidden already,
after asking for confirmation with their count. Those the filters leave
out keep their marks, so clearing the filters shows them as before.

The backend has no bulk route, so each opportunity is hidden with its
own request. The rows go at once; every mark change is now saved at
most six at a time (lib/concurrency.ts), so hundreds of requests aren't
sent together. Any that fail are shown again, with one toast for them
all.
This commit is contained in:
bwilliams committed 2026-10-19 09:47:49 +01:00
1 parent b1cc9745ba
commit b8244da2e5
7 files changed
+205 -10

No files matched your search

+12
View File
@@ -26,6 +26,10 @@ interface Props {
onRetryClassifications: () => void;
shown: number;
total: number;
/** How many of the opportunities shown aren't hidden already. */
hideable: number;
/** Hides every opportunity shown. */
onHideAll: () => void;
}
const toggleChip =
@@ -98,6 +102,14 @@ export function FilterPanel(props: Props): JSX.Element {
>
Clear filters
</button>
<button
type="button"
class={buttonQuiet}
onClick={() => props.onHideAll()}
disabled={props.hideable === 0}
>
Hide all visible
</button>
</div>
{/* Animating grid rows from 0fr to 1fr collapses to the content's real height. */}