Skip to content

Commit 1e87f5c

Browse files
authored
fix: key search results so there are no duplicates (#152)
## Summary Noticed that the search was behaving weird and there were sometimes duplicates in the list when typing. This is because the `{#each}` block was not keyed. ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced rendering performance of search results in the navigation bar. - Conditional disabling of command items based on entity names for improved interactivity. - Improved visibility control for the command dialog. - **Bug Fixes** - Maintained consistent error handling and event management for keyboard shortcuts. - **Documentation** - Updated type definitions for exported properties in the navigation bar component. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent ecfafbf commit 1e87f5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frontend/src/lib/components/NavigationBar/NavigationBar.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
{/if}
199199
{:else}
200200
<CommandGroup heading={`Search for "${input}"`}>
201-
{#each searchResults as entity}
201+
{#each searchResults as entity (entity.name)}
202202
<!-- todo: enable this once we have data for all joins -->
203203
<CommandItem
204204
disabled={entity.name !== 'risk.user_transactions.txn_join'}

0 commit comments

Comments
 (0)