-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Filter by Tags option (#50)
* Improve sorting performance and code readability * Add Filter by Tags option
- Loading branch information
Showing
9 changed files
with
123 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<script lang="ts"> | ||
import { | ||
filterOptions, | ||
finished, | ||
sessions, | ||
settings, | ||
tags | ||
} from '@/lib/stores'; | ||
$: tagsFilter = $settings.tagsFilter; | ||
$: if (tagsFilter !== '__all__' && finished && !$tags[tagsFilter]) | ||
settings.changeSetting('tagsFilter', '__all__'); | ||
</script> | ||
|
||
<select | ||
name="tagsFilter" | ||
id="tagsFilter" | ||
class="min-w-[11rem] rounded-md bg-neutral-3 p-1 text-center text-xs" | ||
bind:value={$filterOptions.tagsFilter} | ||
on:change={(ev) => { | ||
settings.changeSetting('tagsFilter', ev.currentTarget.value); | ||
}} | ||
> | ||
<option value="__all__">All ({$sessions?.length ?? 0})</option> | ||
{#each Object.keys($tags) as tag} | ||
<option value={tag}>{tag} ({$tags[tag]})</option> | ||
{/each} | ||
</select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters