-
-
Notifications
You must be signed in to change notification settings - Fork 4
Fix new eslint errors #1844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix new eslint errors #1844
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThis change enforces Svelte ESLint rules by removing temporary disables for specific linting rules and systematically adds keyed each-blocks to Svelte templates throughout the frontend and viewer codebases. Minor updates to configuration files and a few string literal replacements are also included, with no changes to public APIs. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–25 minutes Assessment against linked issues
Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
GitHub's auto-rebase is basing off the wrong commit due to when I opened this PR vs. when the "bump NPM versions" PR was merged. Will rebase manually (and correctly). |
Sourcemaps are always on in Svelte 5, no need to enable them explicitly. We'll leave the line in the config file, commented out, in case anyone wonders about it.
This was caught by the svelte/no-useless-mustaches rule
The two remaining svelte/no-useless-mustaches errors were auto-fixed by the eslint rule.
FW Lite UI (frontend/viewer) will be next
8b0ac1f
to
eebaaac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (10)
frontend/svelte.config.js (1)
6-9
: Drop the stale commented-out optionLeaving legacy config lines around clutters the file. Since Svelte 5 always emits sourcemaps, you can remove the line entirely rather than commenting it out.
- // enableSourcemap: true // Sourcemaps are always on in Svelte 5, no need to enable them explicitly
frontend/viewer/src/lib/sandbox/EditorSandbox.svelte (1)
79-80
: Scope the ESLint disable to a single lineA file-wide
eslint-disable
can mask future genuine issues. Prefer the next-line variant so only the immediately-following markup is exempt.-<!-- eslint-disable svelte/no-useless-mustaches - This is a sandbox, we don't need translations --> +<!-- eslint-disable-next-line svelte/no-useless-mustaches -- sandbox needs static mustaches -->frontend/src/routes/+error.svelte (1)
12-14
: Consider using index-based key for better uniqueness.While using
path
as the key works for most cases, URL segments can potentially be duplicated (e.g.,/admin/users/admin
would have "admin" twice), which could cause rendering issues.Consider using the index for a more reliable key:
- {#each page.url.pathname.split('/').slice(1) as path (path)} + {#each page.url.pathname.split('/').slice(1) as path, index (index)} <PageBreadcrumb>{path}</PageBreadcrumb> {/each}frontend/viewer/src/lib/activity/ActivityView.svelte (1)
112-112
: Consider using a more stable key than the object reference.Using the entire
change
object as a key relies on object identity, which may not be stable across re-renders. If the change objects get recreated, Svelte will unnecessarily recreate DOM elements.If the change objects have a unique identifier property, use that instead:
-{#each visibleItems as change (change)} +{#each visibleItems as change (change.id)}If no unique property exists and the array order is stable, consider using the index:
-{#each visibleItems as change (change)} +{#each visibleItems as change, i (i)}frontend/src/lib/components/TrainTracks.svelte (2)
116-116
: Consider using a more stable key for the curves iteration.Using the curve object itself as a key won't provide optimization benefits since new curve objects are created on each render. Consider using a stable identifier based on the path indices.
- {#each curves as curve (curve)} + {#each curves as curve, i (i)}Or even better, use the path data that generates the curve:
- {#each curves as curve (curve)} + {#each paths as path, i (path)} + <path fill="none" stroke={curves[i].color} stroke-width="1.5" d={curves[i].d} />
119-119
: Consider using a more stable key for the svgDots iteration.Using the dot object itself as a key won't provide optimization benefits since new dot objects are created on each render. Consider using the circle index or a combination of row/col.
- {#each svgDots as c (c)} + {#each svgDots as c, i (i)}Or use the underlying circle data:
- {#each svgDots as c (c)} + {#each circles as circle, i (circle)} + <circle cx={svgDots[i].x} cy={svgDots[i].y} r={circleSize} fill={svgDots[i].color} stroke="none" style="" />frontend/src/lib/layout/Breadcrumbs/Breadcrumbs.svelte (1)
12-12
: Verify that breadcrumb objects provide stable keys.Using the crumb object itself as a key is appropriate only if the breadcrumb objects maintain stable identities across renders. If new objects are created frequently, consider using a more stable identifier.
If breadcrumbs have stable IDs or paths, use those instead:
- {#each $crumbs as crumb (crumb)} + {#each $crumbs as crumb (crumb.id || crumb.path)}Otherwise, the current approach is acceptable if the Element objects are stable references.
frontend/viewer/src/lib/DictionaryEntry.svelte (1)
133-133
: Consider key stability for sentence iteration.Using the sentence object as a key may not provide optimization benefits if sentence objects are recreated on each render. If sentences have stable identifiers or the array order is stable, consider using the index or a stable property.
- {#each example.sentences as sentence, j (sentence)} + {#each example.sentences as sentence, j (j)}However, if sentence objects maintain stable references, the current approach is acceptable.
frontend/viewer/src/project/browse/SortMenu.svelte (1)
45-47
: Address the TODO comment for unused prop.The
autoDirection
prop is currently unused and marked with a TODO comment. Consider either implementing its usage or removing it to reduce technical debt.Would you like me to help determine how
autoDirection
should be used based on the component's functionality, or should this prop be removed?frontend/viewer/src/lib/sandbox/Sandbox.svelte (1)
325-337
: Consider collapsing the four nearly-identical loops to reduce duplicationThe two variant loops and the two size loops differ only in whether they render an
icon
and could be merged to cut repetition and keep the markup in one place. This keeps maintenance light when button props change.-{#each variants as variant (variant)} - <Button loading={buttonsLoading} {variant}>{variant} button</Button> -{/each} -{#each variants as variant (variant)} - <Button loading={buttonsLoading} {variant} icon="i-mdi-auto-fix"></Button> -{/each} +{#each variants as variant (variant)} + <Button loading={buttonsLoading} {variant}>{variant} button</Button> + <Button loading={buttonsLoading} {variant} icon="i-mdi-auto-fix"/> +{/each} - -{#each sizes as size (size)} - <Button loading={buttonsLoading} {size}>Size: {size}</Button> -{/each} -{#each sizes as size (size)} - <Button loading={buttonsLoading} {size} icon="i-mdi-auto-fix"/> -{/each} +{#each sizes as size (size)} + <Button loading={buttonsLoading} {size}>Size: {size}</Button> + <Button loading={buttonsLoading} {size} icon="i-mdi-auto-fix"/> +{/each}Functionality stays the same, ESLint remains satisfied, and the markup is ~40 % shorter.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (54)
frontend/eslint.config.js
(0 hunks)frontend/src/lib/components/HgLogView.svelte
(1 hunks)frontend/src/lib/components/ProjectList.svelte
(1 hunks)frontend/src/lib/components/Projects/ProjectConfidentialityFilterSelect.svelte
(1 hunks)frontend/src/lib/components/Projects/ProjectFilter.svelte
(1 hunks)frontend/src/lib/components/Projects/ProjectTable.svelte
(1 hunks)frontend/src/lib/components/Projects/WritingSystemList.svelte
(1 hunks)frontend/src/lib/components/TrainTracks.svelte
(1 hunks)frontend/src/lib/components/Users/UserFilter.svelte
(3 hunks)frontend/src/lib/components/Users/UserProjects.svelte
(1 hunks)frontend/src/lib/components/Users/UserTable.svelte
(1 hunks)frontend/src/lib/forms/DisplayLanguageSelect.svelte
(1 hunks)frontend/src/lib/forms/ProjectTypeSelect.svelte
(1 hunks)frontend/src/lib/forms/RadioButtonGroup.svelte
(1 hunks)frontend/src/lib/forms/UserTypeSelect.svelte
(1 hunks)frontend/src/lib/forms/UserTypeahead.svelte
(1 hunks)frontend/src/lib/layout/Breadcrumbs/Breadcrumbs.svelte
(1 hunks)frontend/src/routes/(authenticated)/admin/AdminTabs.svelte
(1 hunks)frontend/src/routes/(authenticated)/admin/EditUserAccount.svelte
(1 hunks)frontend/src/routes/(authenticated)/authorize/+page.svelte
(2 hunks)frontend/src/routes/(authenticated)/org/[org_id]/BulkAddOrgMembers.svelte
(3 hunks)frontend/src/routes/(authenticated)/org/[org_id]/OrgMemberTable.svelte
(1 hunks)frontend/src/routes/(authenticated)/org/[org_id]/OrgTabs.svelte
(1 hunks)frontend/src/routes/(authenticated)/org/list/+page.svelte
(1 hunks)frontend/src/routes/(authenticated)/project/[project_code]/AddOrganization.svelte
(1 hunks)frontend/src/routes/(authenticated)/project/[project_code]/AddPurpose.svelte
(1 hunks)frontend/src/routes/(authenticated)/project/[project_code]/BulkAddProjectMembers.svelte
(3 hunks)frontend/src/routes/(authenticated)/project/create/+page.svelte
(2 hunks)frontend/src/routes/(unauthenticated)/register/+page.svelte
(1 hunks)frontend/src/routes/+error.svelte
(1 hunks)frontend/src/routes/email/tester/[email protected]
(1 hunks)frontend/svelte.config.js
(1 hunks)frontend/viewer/eslint.config.js
(0 hunks)frontend/viewer/src/home/HomeView.svelte
(1 hunks)frontend/viewer/src/home/Server.svelte
(1 hunks)frontend/viewer/src/home/ServersList.svelte
(1 hunks)frontend/viewer/src/lib/DictionaryEntry.svelte
(3 hunks)frontend/viewer/src/lib/activity/ActivityView.svelte
(1 hunks)frontend/viewer/src/lib/components/reorderer/reorderer-item-list.svelte
(1 hunks)frontend/viewer/src/lib/entry-editor/EntryOrSensePicker.svelte
(1 hunks)frontend/viewer/src/lib/entry-editor/ItemList.svelte
(1 hunks)frontend/viewer/src/lib/entry-editor/ItemListItem.svelte
(1 hunks)frontend/viewer/src/lib/entry-editor/NewEntryDialog.svelte
(1 hunks)frontend/viewer/src/lib/i18n/LocalizationPicker.svelte
(1 hunks)frontend/viewer/src/lib/sandbox/EditorSandbox.svelte
(1 hunks)frontend/viewer/src/lib/sandbox/Sandbox.svelte
(2 hunks)frontend/viewer/src/lib/utils/url.svelte.ts
(3 hunks)frontend/viewer/src/project/ProjectDropdown.svelte
(1 hunks)frontend/viewer/src/project/browse/EntryView.svelte
(1 hunks)frontend/viewer/src/project/browse/SortMenu.svelte
(2 hunks)frontend/viewer/src/project/browse/ViewPicker.svelte
(1 hunks)frontend/viewer/src/stories/editor/misc/entry-picker.stories.svelte
(1 hunks)frontend/viewer/src/stories/editor/misc/reorderer.stories.svelte
(1 hunks)frontend/viewer/src/stories/primitives/button.stories.svelte
(1 hunks)
💤 Files with no reviewable changes (2)
- frontend/eslint.config.js
- frontend/viewer/eslint.config.js
🧰 Additional context used
🧠 Learnings (40)
📓 Common learnings
Learnt from: hahn-kev
PR: sillsdev/languageforge-lexbox#1537
File: frontend/viewer/src/SvelteUxProjectView.svelte:151-153
Timestamp: 2025-03-12T06:32:08.277Z
Learning: When reviewing PRs where files have been moved or code has been relocated from one file to another, focus the review on actual modifications to the code rather than raising issues about pre-existing code patterns that were simply relocated.
Learnt from: rmunn
PR: sillsdev/languageforge-lexbox#1836
File: frontend/viewer/src/lib/components/audio/AudioDialog.svelte:25-25
Timestamp: 2025-07-22T09:19:37.386Z
Learning: In the sillsdev/languageforge-lexbox project, when file size limits or other constants need to be shared between C# backend and TypeScript frontend code, prefer exposing them through Reinforced.Typings type generation rather than hardcoding the values separately. This ensures consistency and prevents discrepancies when values change.
Learnt from: hahn-kev
PR: sillsdev/languageforge-lexbox#1612
File: frontend/viewer/src/lib/entry-editor/DeleteDialog.svelte:39-52
Timestamp: 2025-04-18T10:33:51.961Z
Learning: Svelte 5 uses standard HTML attribute syntax for event handlers (e.g., `onclick={handler}`) instead of the Svelte-specific directive syntax (e.g., `on:click={handler}`) used in previous versions.
Learnt from: hahn-kev
PR: sillsdev/languageforge-lexbox#1612
File: frontend/viewer/src/lib/entry-editor/DeleteDialog.svelte:39-52
Timestamp: 2025-04-18T10:33:51.961Z
Learning: Svelte 5 uses standard HTML attribute syntax for event handlers (e.g., `onclick={handler}`) instead of the Svelte-specific directive syntax (e.g., `on:click={handler}`) used in previous versions.
frontend/svelte.config.js (3)
Learnt from: hahn-kev
PR: #1612
File: frontend/viewer/src/lib/entry-editor/DeleteDialog.svelte:39-52
Timestamp: 2025-04-18T10:33:51.961Z
Learning: Svelte 5 uses standard HTML attribute syntax for event handlers (e.g., onclick={handler}
) instead of the Svelte-specific directive syntax (e.g., on:click={handler}
) used in previous versions.
Learnt from: hahn-kev
PR: #1612
File: frontend/viewer/src/lib/entry-editor/DeleteDialog.svelte:39-52
Timestamp: 2025-04-18T10:33:51.961Z
Learning: Svelte 5 uses standard HTML attribute syntax for event handlers (e.g., onclick={handler}
) instead of the Svelte-specific directive syntax (e.g., on:click={handler}
) used in previous versions.
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
frontend/src/lib/forms/RadioButtonGroup.svelte (3)
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
Learnt from: hahn-kev
PR: #1710
File: frontend/viewer/src/project/browse/BrowseView.svelte:17-19
Timestamp: 2025-05-27T06:18:33.852Z
Learning: The NewEntryButton component in frontend/viewer/src/project/NewEntryButton.svelte already internally checks features.write permission and conditionally renders based on write access, so external disabled props are not needed.
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
frontend/src/lib/components/Projects/ProjectTable.svelte (2)
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
frontend/viewer/src/project/browse/ViewPicker.svelte (2)
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
frontend/viewer/src/project/browse/EntryView.svelte (2)
Learnt from: hahn-kev
PR: #1710
File: frontend/viewer/src/project/browse/BrowseView.svelte:17-19
Timestamp: 2025-05-27T06:18:33.852Z
Learning: The NewEntryButton component in frontend/viewer/src/project/NewEntryButton.svelte already internally checks features.write permission and conditionally renders based on write access, so external disabled props are not needed.
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
frontend/viewer/src/lib/sandbox/EditorSandbox.svelte (2)
Learnt from: hahn-kev
PR: #1710
File: frontend/viewer/src/project/browse/BrowseView.svelte:17-19
Timestamp: 2025-05-27T06:18:33.852Z
Learning: The NewEntryButton component in frontend/viewer/src/project/NewEntryButton.svelte already internally checks features.write permission and conditionally renders based on write access, so external disabled props are not needed.
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
frontend/viewer/src/lib/entry-editor/ItemList.svelte (2)
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
frontend/viewer/src/project/ProjectDropdown.svelte (1)
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
frontend/src/routes/email/tester/[email protected] (1)
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
frontend/viewer/src/lib/i18n/LocalizationPicker.svelte (4)
Learnt from: hahn-kev
PR: #1827
File: frontend/viewer/src/lib/i18n/LocalizationPicker.svelte:12-15
Timestamp: 2025-07-17T05:09:27.809Z
Learning: In Svelte 5, the bind:value syntax supports patterns like bind:value={() => $locale, l => setLanguage(l)}
where the comma operator is used to specify both the getter and setter functions. This is valid syntax in Svelte 5 and does not cause compilation errors, contrary to what traditional JavaScript comma operator behavior might suggest.
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
Learnt from: hahn-kev
PR: #1827
File: frontend/viewer/src/lib/i18n/LocalizationPicker.svelte:12-15
Timestamp: 2025-07-17T05:09:27.809Z
Learning: In Svelte 5, the bind:value directive supports function binding syntax where you can pass two functions separated by a comma: bind:value={getter, setter}
. For example, bind:value={() => $locale, l => setLanguage(l)}
is valid syntax where the first function is the getter and the second is the setter. This is not a JavaScript comma operator issue - it's a specific Svelte 5 compiler feature for two-way binding.
frontend/viewer/src/lib/components/reorderer/reorderer-item-list.svelte (3)
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
frontend/src/routes/(authenticated)/admin/EditUserAccount.svelte (1)
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
frontend/viewer/src/lib/entry-editor/EntryOrSensePicker.svelte (1)
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
frontend/src/routes/(authenticated)/project/[project_code]/AddPurpose.svelte (1)
Learnt from: hahn-kev
PR: #1710
File: frontend/viewer/src/project/browse/BrowseView.svelte:17-19
Timestamp: 2025-05-27T06:18:33.852Z
Learning: The NewEntryButton component in frontend/viewer/src/project/NewEntryButton.svelte already internally checks features.write permission and conditionally renders based on write access, so external disabled props are not needed.
frontend/viewer/src/home/HomeView.svelte (1)
Learnt from: hahn-kev
PR: #1710
File: frontend/viewer/src/project/browse/BrowseView.svelte:17-19
Timestamp: 2025-05-27T06:18:33.852Z
Learning: The NewEntryButton component in frontend/viewer/src/project/NewEntryButton.svelte already internally checks features.write permission and conditionally renders based on write access, so external disabled props are not needed.
frontend/src/lib/components/Users/UserProjects.svelte (2)
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
frontend/viewer/src/stories/editor/misc/entry-picker.stories.svelte (2)
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
frontend/viewer/src/lib/DictionaryEntry.svelte (2)
Learnt from: hahn-kev
PR: #1710
File: frontend/viewer/src/project/browse/BrowseView.svelte:17-19
Timestamp: 2025-05-27T06:18:33.852Z
Learning: The NewEntryButton component in frontend/viewer/src/project/NewEntryButton.svelte already internally checks features.write permission and conditionally renders based on write access, so external disabled props are not needed.
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
frontend/src/lib/forms/DisplayLanguageSelect.svelte (3)
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
Learnt from: hahn-kev
PR: #1827
File: frontend/viewer/src/lib/i18n/LocalizationPicker.svelte:12-15
Timestamp: 2025-07-17T05:09:27.809Z
Learning: In Svelte 5, the bind:value syntax supports patterns like bind:value={() => $locale, l => setLanguage(l)}
where the comma operator is used to specify both the getter and setter functions. This is valid syntax in Svelte 5 and does not cause compilation errors, contrary to what traditional JavaScript comma operator behavior might suggest.
frontend/src/lib/components/Projects/ProjectConfidentialityFilterSelect.svelte (1)
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
frontend/viewer/src/lib/entry-editor/ItemListItem.svelte (1)
Learnt from: hahn-kev
PR: #1710
File: frontend/viewer/src/project/browse/BrowseView.svelte:17-19
Timestamp: 2025-05-27T06:18:33.852Z
Learning: The NewEntryButton component in frontend/viewer/src/project/NewEntryButton.svelte already internally checks features.write permission and conditionally renders based on write access, so external disabled props are not needed.
frontend/src/lib/forms/UserTypeSelect.svelte (1)
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
frontend/src/routes/(authenticated)/admin/AdminTabs.svelte (2)
Learnt from: myieye
PR: #1758
File: frontend/viewer/src/project/browse/BrowseView.svelte:78-85
Timestamp: 2025-06-18T09:23:29.799Z
Learning: In Svelte Tabs components, using on:change
event handler would cause popups to close when users navigate with arrow keys, which creates poor UX. The user myieye prefers the current activation mode over activationMode="manual"
and considers arrow key popup closing to be "too eager" behavior.
Learnt from: myieye
PR: #1758
File: frontend/viewer/src/project/browse/BrowseView.svelte:78-85
Timestamp: 2025-06-18T09:23:29.799Z
Learning: For keyboard accessibility in TabsList components, myieye implements Enter key handlers on the TabsList rather than relying on change events that would interfere with arrow key navigation.
frontend/viewer/src/project/browse/SortMenu.svelte (5)
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
Learnt from: hahn-kev
PR: #1710
File: frontend/viewer/src/project/browse/BrowseView.svelte:17-19
Timestamp: 2025-05-27T06:18:33.852Z
Learning: The NewEntryButton component in frontend/viewer/src/project/NewEntryButton.svelte already internally checks features.write permission and conditionally renders based on write access, so external disabled props are not needed.
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
Learnt from: hahn-kev
PR: #1827
File: frontend/viewer/src/lib/i18n/LocalizationPicker.svelte:12-15
Timestamp: 2025-07-17T05:09:27.809Z
Learning: In Svelte 5, the bind:value directive supports function binding syntax where you can pass two functions separated by a comma: bind:value={getter, setter}
. For example, bind:value={() => $locale, l => setLanguage(l)}
is valid syntax where the first function is the getter and the second is the setter. This is not a JavaScript comma operator issue - it's a specific Svelte 5 compiler feature for two-way binding.
Learnt from: hahn-kev
PR: #1827
File: frontend/viewer/src/lib/i18n/LocalizationPicker.svelte:12-15
Timestamp: 2025-07-17T05:09:27.809Z
Learning: In Svelte 5, the bind:value syntax supports patterns like bind:value={() => $locale, l => setLanguage(l)}
where the comma operator is used to specify both the getter and setter functions. This is valid syntax in Svelte 5 and does not cause compilation errors, contrary to what traditional JavaScript comma operator behavior might suggest.
frontend/viewer/src/lib/activity/ActivityView.svelte (1)
Learnt from: myieye
PR: #1758
File: frontend/viewer/src/project/browse/BrowseView.svelte:78-85
Timestamp: 2025-06-18T09:23:29.799Z
Learning: In Svelte Tabs components, using on:change
event handler would cause popups to close when users navigate with arrow keys, which creates poor UX. The user myieye prefers the current activation mode over activationMode="manual"
and considers arrow key popup closing to be "too eager" behavior.
frontend/src/lib/forms/UserTypeahead.svelte (3)
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
Learnt from: myieye
PR: #1758
File: frontend/viewer/src/project/browse/BrowseView.svelte:78-85
Timestamp: 2025-06-18T09:23:29.799Z
Learning: In Svelte Tabs components, using on:change
event handler would cause popups to close when users navigate with arrow keys, which creates poor UX. The user myieye prefers the current activation mode over activationMode="manual"
and considers arrow key popup closing to be "too eager" behavior.
frontend/src/routes/(authenticated)/org/[org_id]/OrgTabs.svelte (2)
Learnt from: myieye
PR: #1758
File: frontend/viewer/src/project/browse/BrowseView.svelte:78-85
Timestamp: 2025-06-18T09:23:29.799Z
Learning: In Svelte Tabs components, using on:change
event handler would cause popups to close when users navigate with arrow keys, which creates poor UX. The user myieye prefers the current activation mode over activationMode="manual"
and considers arrow key popup closing to be "too eager" behavior.
Learnt from: myieye
PR: #1758
File: frontend/viewer/src/project/browse/BrowseView.svelte:78-85
Timestamp: 2025-06-18T09:23:29.799Z
Learning: For keyboard accessibility in TabsList components, myieye implements Enter key handlers on the TabsList rather than relying on change events that would interfere with arrow key navigation.
frontend/viewer/src/lib/utils/url.svelte.ts (1)
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
frontend/viewer/src/stories/primitives/button.stories.svelte (1)
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
frontend/viewer/src/home/Server.svelte (1)
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
frontend/src/lib/components/ProjectList.svelte (2)
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
frontend/src/lib/components/Projects/ProjectFilter.svelte (2)
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
frontend/viewer/src/stories/editor/misc/reorderer.stories.svelte (2)
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
frontend/src/lib/components/HgLogView.svelte (2)
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
frontend/src/lib/forms/ProjectTypeSelect.svelte (2)
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
frontend/src/lib/components/TrainTracks.svelte (1)
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
frontend/src/lib/components/Projects/WritingSystemList.svelte (1)
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
frontend/src/lib/components/Users/UserFilter.svelte (2)
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
Learnt from: myieye
PR: #1758
File: frontend/viewer/src/project/browse/BrowseView.svelte:78-85
Timestamp: 2025-06-18T09:23:29.799Z
Learning: In Svelte Tabs components, using on:change
event handler would cause popups to close when users navigate with arrow keys, which creates poor UX. The user myieye prefers the current activation mode over activationMode="manual"
and considers arrow key popup closing to be "too eager" behavior.
frontend/viewer/src/lib/sandbox/Sandbox.svelte (4)
Learnt from: hahn-kev
PR: #1757
File: frontend/viewer/src/lib/components/field-editors/multi-select.svelte:130-136
Timestamp: 2025-06-18T05:13:00.591Z
Learning: In frontend/viewer/src/lib/components/field-editors/multi-select.svelte, the computeCommandScore function from 'bits-ui' handles empty filter strings appropriately and does not hide all options when the filter is empty, contrary to initial analysis assumptions.
Learnt from: hahn-kev
PR: #1841
File: frontend/viewer/src/project/browse/filter/OpFilter.svelte:10-17
Timestamp: 2025-07-24T03:26:59.388Z
Learning: In Svelte 5, reactive statements use $derived()
instead of the Svelte 4 $:
syntax. For example, to make an array reactive to translation changes, use const ops = $derived([...])
instead of $: ops = [...]
.
Learnt from: hahn-kev
PR: #1710
File: frontend/viewer/src/project/browse/BrowseView.svelte:17-19
Timestamp: 2025-05-27T06:18:33.852Z
Learning: The NewEntryButton component in frontend/viewer/src/project/NewEntryButton.svelte already internally checks features.write permission and conditionally renders based on write access, so external disabled props are not needed.
Learnt from: myieye
PR: #1802
File: frontend/viewer/src/project/NewEntryButton.svelte:36-36
Timestamp: 2025-07-04T17:00:57.368Z
Learning: In this codebase, $props.id()
(Svelte rune) automatically returns a unique identifier per component instance, so components using it do not require an explicit id
prop from parents.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build FW Lite and run tests
🔇 Additional comments (52)
frontend/src/routes/(unauthenticated)/register/+page.svelte (1)
16-17
: URL literal looks goodSwitching from a template literal to a normal string is fine and avoids unnecessary back-ticks.
frontend/src/routes/(authenticated)/project/[project_code]/AddOrganization.svelte (1)
56-58
: Correct use of keyed each blockAdding
(org.id)
provides a stable key and eliminates the ESLint warning—nice catch.frontend/viewer/src/home/HomeView.svelte (1)
191-192
: Literal string for href is fineConsistent with other updates; no concerns.
frontend/viewer/src/project/browse/EntryView.svelte (1)
71-71
: LGTM! Proper localization of accessibility label.The change correctly replaces the hardcoded "Toggle pinned" string with a localized version using the
$t
template literal, improving accessibility for non-English users.frontend/src/routes/(authenticated)/project/[project_code]/AddPurpose.svelte (1)
71-71
: LGTM! Consistent localization of submit button text.The change correctly replaces the hardcoded "Add Purpose" string with a localized version, maintaining consistency with other internationalized strings in the component.
frontend/src/lib/forms/ProjectTypeSelect.svelte (1)
28-28
: LGTM! Proper key addition for each block.The change correctly adds
(type)
as the key for the each block iteration. Since thetypes
array contains uniqueProjectType
enum values, usingtype
as the key is appropriate and will help Svelte efficiently track DOM updates.frontend/viewer/src/lib/i18n/LocalizationPicker.svelte (1)
31-31
: LGTM! Proper key addition for language iteration.The change correctly adds
(lang)
as the key for the each block iterating over language entries. Using the language code as the key is appropriate since it's unique and will help Svelte efficiently track the dropdown menu items.frontend/src/routes/(authenticated)/admin/AdminTabs.svelte (1)
27-27
: LGTM! Proper key addition for admin tabs iteration.The change correctly adds
(tab)
as the key for the each block iterating overadminTabs
. Since the array contains unique string values ('projects', 'users'), usingtab
as the key is appropriate and will help Svelte efficiently track the tab elements.frontend/src/lib/forms/RadioButtonGroup.svelte (1)
42-42
: LGTM! Appropriate key choice for radio button iteration.Using
button.value
as the key is perfect since radio button values should be unique within a group, providing stable DOM tracking for Svelte.frontend/viewer/src/lib/entry-editor/ItemList.svelte (1)
23-23
: LGTM! Reasonable key choice for generic item list.Using the entire
item
object as the key is appropriate for this generic component, as it relies on object identity for DOM tracking when specific unique properties aren't known.frontend/src/lib/forms/UserTypeSelect.svelte (1)
25-25
: LGTM! Excellent key choice for user type options.Using the
value
(UserType) as the key is perfect since these are unique identifiers (admin, nonAdmin, guest) that provide stable DOM tracking for the select options.frontend/src/lib/components/HgLogView.svelte (1)
139-139
: LGTM! Perfect key choice for version control log entries.Using
log.node
as the key is ideal since it represents a unique changeset identifier in the version control system, providing stable DOM tracking for the log table rows.frontend/src/routes/email/tester/[email protected] (1)
135-135
: LGTM! Appropriate key choice for email template dropdown.Using the entire
frontend/viewer/src/lib/entry-editor/NewEntryDialog.svelte (1)
104-106
: LGTM!Using the error message as the key is appropriate since error messages are typically unique, and duplicate messages would represent the same validation issue anyway.
frontend/viewer/src/lib/utils/url.svelte.ts (3)
1-1
: LGTM!Proper import of SvelteURL from svelte/reactivity to comply with ESLint rules.
42-42
: LGTM!Correctly replaced native URL constructor with SvelteURL for reactive URL handling in the QueryParamState class.
98-98
: LGTM!Proper use of SvelteURL instead of native URL constructor for reactive URL parsing.
frontend/viewer/src/home/ServersList.svelte (1)
58-67
: LGTM!Using
status.server.id
as the key is ideal since server IDs are unique and stable, allowing Svelte to efficiently track and update Server components during re-renders.frontend/viewer/src/lib/entry-editor/EntryOrSensePicker.svelte (1)
218-233
: LGTM!Using
sense.id
as the key is perfect since sense IDs are unique database identifiers that remain stable across re-renders, enabling efficient DOM updates when the senses list changes.frontend/src/routes/(authenticated)/authorize/+page.svelte (2)
33-33
: LGTM! Appropriate key selection for OAuth scopes.Using the scope string itself as the key is correct since OAuth scopes are unique identifiers.
56-56
: LGTM! Correct key usage for object entries.Using the key from
Object.entries()
as the each-block key is appropriate since object keys are inherently unique.frontend/src/routes/(authenticated)/org/[org_id]/OrgTabs.svelte (1)
37-37
: LGTM! Tab values make excellent keys.Using the tab string value as the key is perfect since the tab identifiers (
'projects'
,'members'
, etc.) are unique and stable.frontend/src/lib/forms/DisplayLanguageSelect.svelte (1)
28-28
: LGTM! Locale codes are ideal keys.Using the locale string (e.g., 'en', 'es', 'fr') as the key is correct since locale codes are unique identifiers.
frontend/viewer/src/project/browse/ViewPicker.svelte (1)
33-33
: LGTM! Using view.id as key is correct.Using
view.id
provides stable unique keys for the view objects, which is the standard pattern for objects with id properties.frontend/src/routes/(authenticated)/project/create/+page.svelte (2)
242-242
: Excellent use of stable keys.Using
org.id
as the key is the correct approach for keyed each-blocks, providing stable unique identifiers for efficient DOM updates.
303-303
: Excellent use of stable keys.Using
proj.id
as the key is the correct approach for keyed each-blocks, providing stable unique identifiers for efficient DOM updates.frontend/viewer/src/lib/DictionaryEntry.svelte (3)
96-97
: Well-documented ESLint disable.The ESLint disable comment clearly explains the intentional use of mustaches for whitespace preservation, which is a legitimate use case.
106-107
: Well-documented ESLint disable.The ESLint disable comment clearly explains the intentional use of mustaches for whitespace preservation, which is a legitimate use case.
128-129
: Well-documented ESLint disable.The ESLint disable comment clearly explains the intentional use of mustaches for inserting an empty string, which is a legitimate use case for precise whitespace control.
frontend/src/routes/(authenticated)/org/list/+page.svelte (1)
152-152
: LGTM! Proper keyed each block implementation.The addition of
(org.id)
as the key for the each block is correct and follows Svelte best practices. Using the unique organization ID enables efficient DOM updates when the list changes.frontend/viewer/src/project/browse/SortMenu.svelte (1)
81-81
: LGTM! Keyed each block implementation is correct.Using the entire
option
object as the key works correctly for Svelte's keying system. SincesortOptions
contains distinct objects with differentfield
anddir
combinations, this provides stable keys for efficient DOM updates.frontend/src/lib/components/Users/UserProjects.svelte (1)
76-76
: LGTM! Proper keyed each block implementation.The addition of
(proj.id)
as the key is correct and follows Svelte best practices. Using the unique project ID enables efficient DOM updates when the projects list changes.frontend/src/lib/components/Projects/ProjectTable.svelte (1)
58-58
: LGTM! Proper keyed each block implementation.The addition of
(project.id)
as the key is correct and follows Svelte best practices. Using the unique project ID enables efficient DOM updates when the projects list changes.frontend/viewer/src/stories/editor/misc/entry-picker.stories.svelte (1)
46-46
: LGTM! Proper keyed each block implementation.The addition of
(selected.entry.id)
as the key is correct and follows Svelte best practices. Using the unique entry ID enables efficient DOM updates when the selected entry history changes.frontend/src/routes/(authenticated)/org/[org_id]/OrgMemberTable.svelte (1)
61-61
: LGTM! Proper keyed each block implementation.The addition of
(member.id)
as the key correctly fixes the ESLint warning and improves DOM update efficiency by providing Svelte with a unique identifier for each organization member.frontend/viewer/src/stories/editor/misc/reorderer.stories.svelte (1)
39-39
: LGTM! Appropriate key for primitive values.Using
(item)
as the key is correct here since the items appear to be unique string values. This is particularly important for a reorderer story where proper DOM tracking is essential for testing reordering functionality.frontend/src/lib/components/Projects/ProjectFilter.svelte (1)
101-101
: LGTM! Correct key selection for filter objects.Using
(filter.key)
as the key is appropriate since it provides a unique identifier for each filter type, ensuring proper DOM updates when active filters change.frontend/src/routes/(authenticated)/admin/EditUserAccount.svelte (1)
148-148
: LGTM! Appropriate key for feature flags.Using
(flag)
as the key is correct for the feature flags iteration since flags are unique string identifiers. This ensures proper checkbox state management when the feature flags list changes.frontend/viewer/src/project/ProjectDropdown.svelte (1)
110-110
: LGTM! Proper key for project objects.Using
(project.id)
as the key is correct since it provides a unique identifier for each project in the dropdown, ensuring proper DOM updates and selection state management.frontend/viewer/src/lib/components/reorderer/reorderer-item-list.svelte (1)
44-44
: LGTM! Appropriate key choice for reorderer component.Using
item
as the key is correct for a reorderer component since it provides stable identity for list items regardless of their position changes, which is essential for proper DOM updates during reordering operations.frontend/src/lib/components/Projects/WritingSystemList.svelte (1)
16-16
: LGTM! Correct key choice for writing systems.Using
ws.tag
as the key is appropriate since writing system tags are unique, stable identifiers that won't change when other properties are updated.frontend/src/lib/components/Users/UserTable.svelte (1)
33-33
: LGTM! Optimal key choice for user entities.Using
user.id
as the key is ideal since user IDs are unique, stable database identifiers that provide optimal DOM diffing performance.frontend/src/routes/(authenticated)/org/[org_id]/BulkAddOrgMembers.svelte (1)
113-113
: LGTM! Appropriate key choice for bulk operation results.Using
user.username
as the key is suitable for these bulk operation result lists since usernames are unique identifiers and the primary field being used in the bulk add context.Also applies to: 128-128, 142-142
frontend/src/lib/components/Projects/ProjectConfidentialityFilterSelect.svelte (1)
24-24
: LGTM! Appropriate key choice for option entries.Using
value
as the key is correct since the confidentiality values (true, false, unset) are unique, stable identifiers for the options.frontend/viewer/src/home/Server.svelte (1)
103-103
: LGTM! Appropriate key choice for project iteration.Using
project.id
as the key is correct since it provides a unique identifier for each project in the list, improving Svelte's rendering efficiency during updates.frontend/src/routes/(authenticated)/project/[project_code]/BulkAddProjectMembers.svelte (1)
147-147
: LGTM! Consistent and appropriate key choice for user iterations.Using
user.username
as the key across all three user list iterations (addedMembers
,createdMembers
,existingMembers
) is correct since usernames are unique identifiers and the primary data being displayed.Also applies to: 162-162, 176-176
frontend/viewer/src/stories/primitives/button.stories.svelte (1)
33-33
: LGTM! Appropriate keys for button variants and sizes.Using the
variant
andsize
strings as keys is correct since these are unique values from the button configuration. This properly satisfies the eslint requirement for keyed each blocks in the Storybook stories.Also applies to: 41-41, 49-49, 57-57
frontend/src/lib/components/ProjectList.svelte (1)
17-17
: LGTM! Consistent project key usage.Using
project.id
as the key is appropriate and consistent with other project list components in the codebase. This provides stable, unique identification for efficient DOM updates.frontend/src/lib/components/Users/UserFilter.svelte (2)
58-58
: LGTM! Appropriate key choice for filter iteration.Using
filter.key
as the key is correct since it uniquely identifies each filter type and is already being used in the conditional logic within the loop.
57-57
: Minor formatting improvements.The whitespace adjustments around the snippet blocks improve code readability without affecting functionality.
Also applies to: 79-79, 82-82, 100-100
frontend/viewer/src/lib/sandbox/Sandbox.svelte (1)
194-201
:selectedEntryHistory
loop correctly keyedUsing
selected.entry.id
as the key satisfies thesvelte/require-each-key
rule and guarantees a stable identity for each rendered row. No further action needed.frontend/src/lib/forms/UserTypeahead.svelte (1)
136-140
: Key addition looks goodSwitching to
{#each filteredResults as user, idx (user.id)}
provides a stable key without affecting theidx
variable used for highlighting. Good fix for the ESLint rule.
In a few places, like when iterating over strings from a URL path, we can't 100% guarantee that they will be unique, so it's better to use the index as the key. This can result in unnecessary re-renderings, but this is better than the result that would happen if a Svelte #each block ended up with the same key pointing at multiple items in the #each. And there won't be many re-renderings in most of these cases, as they are not things that change frequently (if at all) in the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the lint report says theres 2 each blocks that were missed
It's not reporting that when I run it in my branch. Must be something that just got merged into |
Yes, the two new lint errors were from a branch that got merged into |
Fixes #1843.