summaryrefslogtreecommitdiffstatshomepage
path: root/frontend/src/lib/toolbar
diff options
context:
space:
mode:
authorWolfgang Müller2025-02-20 15:24:42 +0100
committerWolfgang Müller2025-02-20 19:51:39 +0100
commit8e9aa5f6286a15c818a47344fc80964f5288bb52 (patch)
treeb3ef187daff345eeb918ab07900cc1c4185c53e4 /frontend/src/lib/toolbar
parentc6bf35aea63969b90463d6e70cb02ed61e4e3270 (diff)
downloadhircine-8e9aa5f6286a15c818a47344fc80964f5288bb52.tar.gz
frontend: Allow filtering for orphaned associations
With the association count filters in place we may now also allow the user to filter for associations that do not have a matching counterparts (artists without a comic, for example).
Diffstat (limited to 'frontend/src/lib/toolbar')
-rw-r--r--frontend/src/lib/toolbar/FilterOrphaned.svelte24
1 files changed, 24 insertions, 0 deletions
diff --git a/frontend/src/lib/toolbar/FilterOrphaned.svelte b/frontend/src/lib/toolbar/FilterOrphaned.svelte
new file mode 100644
index 0000000..7e79be1
--- /dev/null
+++ b/frontend/src/lib/toolbar/FilterOrphaned.svelte
@@ -0,0 +1,24 @@
+<script lang="ts">
+ import { page } from '$app/state';
+ import { BasicFilterContext, NamespaceFilterContext } from '$lib/Filter.svelte';
+ import { accelerator } from '$lib/Shortcuts';
+ import Orphan from '$lib/icons/Orphan.svelte';
+
+ let { filter }: { filter: BasicFilterContext | NamespaceFilterContext } = $props();
+ let orphaned = $derived(filter.include.orphan.value);
+
+ const toggle = () => {
+ filter.include.orphan.value = !orphaned;
+ filter.apply(page.url.searchParams);
+ };
+</script>
+
+<button
+ class:toggled={orphaned}
+ class="btn-slate"
+ title="Filter orphaned"
+ onclick={toggle}
+ use:accelerator={'r'}
+>
+ <Orphan {orphaned} />
+</button>