Conversation
📝 WalkthroughWalkthroughWrapped the input, button and description in a form using on:submit|preventDefault to trigger search; the Search button is now type="submit", enabling Enter-key submission while preserving labels, placeholder and existing search logic. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
web/src/routes/dashboard/+page.svelte (1)
10-10: Inconsistent import path with.d.tsextension.The import uses
'$lib/api/api.d.ts'with the explicit.d.tsextension, whereas all other files in this PR import from'$lib/api/api'without the extension. This inconsistency could cause issues if the module structure changes.♻️ Suggested fix
-import type { MetaDataProviderSearchResult } from '$lib/api/api.d.ts'; +import type { MetaDataProviderSearchResult } from '$lib/api/api';🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@web/src/routes/dashboard/`+page.svelte at line 10, Update the type import to use the module path without the explicit .d.ts extension to match other files: replace the import of MetaDataProviderSearchResult from '$lib/api/api.d.ts' with an import from '$lib/api/api' (keep it as a type import). Locate the import statement referencing MetaDataProviderSearchResult in +page.svelte and adjust the module specifier only; do not change the imported symbol name or its usage elsewhere.web/src/routes/dashboard/movies/add-movie/+page.svelte (1)
42-42: Consider removing the redundant type cast.The
client.GET('/api/v1/movies/search', ...)andclient.GET('/api/v1/movies/recommended')endpoints already returnMetaDataProviderSearchResult[]according to the OpenAPI schema (seeapi.d.tslines 3206-3236 and 3238-3268). The explicit cast is unnecessary as TypeScript should infer the correct type.♻️ Proposed simplification
if (data && data.length > 0) { - results = data as MetaDataProviderSearchResult[]; + results = data; } else {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@web/src/routes/dashboard/movies/add-movie/`+page.svelte at line 42, The assignment includes a redundant type cast to MetaDataProviderSearchResult[]; remove the explicit cast and let TypeScript infer the type from the client.GET('/api/v1/movies/search', ...) and client.GET('/api/v1/movies/recommended') responses — replace "results = data as MetaDataProviderSearchResult[];" with "results = data;" (keeping the existing results variable and ensuring it’s typed appropriately where declared) so the code relies on the OpenAPI-generated types instead of an unnecessary assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@web/src/routes/dashboard/`+page.svelte:
- Line 10: Update the type import to use the module path without the explicit
.d.ts extension to match other files: replace the import of
MetaDataProviderSearchResult from '$lib/api/api.d.ts' with an import from
'$lib/api/api' (keep it as a type import). Locate the import statement
referencing MetaDataProviderSearchResult in +page.svelte and adjust the module
specifier only; do not change the imported symbol name or its usage elsewhere.
In `@web/src/routes/dashboard/movies/add-movie/`+page.svelte:
- Line 42: The assignment includes a redundant type cast to
MetaDataProviderSearchResult[]; remove the explicit cast and let TypeScript
infer the type from the client.GET('/api/v1/movies/search', ...) and
client.GET('/api/v1/movies/recommended') responses — replace "results = data as
MetaDataProviderSearchResult[];" with "results = data;" (keeping the existing
results variable and ensuring it’s typed appropriately where declared) so the
code relies on the OpenAPI-generated types instead of an unnecessary assertion.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 1cd11b30-7c0f-4771-9eb0-44da8f219dde
📒 Files selected for processing (32)
web/package.jsonweb/src/lib/api/api.d.tsweb/src/lib/components/add-media-card.svelteweb/src/lib/components/delete-media-dialog.svelteweb/src/lib/components/download-dialogs/download-custom-dialog.svelteweb/src/lib/components/download-dialogs/download-movie-dialog.svelteweb/src/lib/components/download-dialogs/download-season-dialog.svelteweb/src/lib/components/download-dialogs/download-selected-episodes-dialog.svelteweb/src/lib/components/download-dialogs/download-selected-seasons-dialog.svelteweb/src/lib/components/download-dialogs/file-path-suffix-selector.svelteweb/src/lib/components/download-dialogs/select-file-path-suffix-dialog.svelteweb/src/lib/components/import-media/import-candidates-dialog.svelteweb/src/lib/components/import-media/suggested-media-card.svelteweb/src/lib/components/library-combobox.svelteweb/src/lib/components/nav/user-details.svelteweb/src/lib/components/recommended-media-carousel.svelteweb/src/lib/components/torrents/edit-torrent-dialog.svelteweb/src/lib/components/torrents/torrent-table.svelteweb/src/lib/components/user-data-table.svelteweb/src/lib/utils.tsweb/src/routes/dashboard/+layout.svelteweb/src/routes/dashboard/+page.svelteweb/src/routes/dashboard/movies/+page.svelteweb/src/routes/dashboard/movies/[movieId=uuid]/+page.svelteweb/src/routes/dashboard/movies/add-movie/+page.svelteweb/src/routes/dashboard/notifications/+page.svelteweb/src/routes/dashboard/settings/+page.svelteweb/src/routes/dashboard/tv/+page.svelteweb/src/routes/dashboard/tv/[showId=uuid]/+page.svelteweb/src/routes/dashboard/tv/[showId=uuid]/[SeasonId=uuid]/+page.svelteweb/src/routes/dashboard/tv/add-show/+page.svelteweb/src/routes/login/+page.svelte
📜 Review details
🔇 Additional comments (34)
web/src/routes/dashboard/notifications/+page.svelte (1)
9-13: LGTM!The type import refactoring from nested
components['schemas']['Notification']to directNotificationtype import is clean and consistent with the broader PR pattern. The variable type annotations are correctly updated.web/src/lib/components/delete-media-dialog.svelte (1)
2-2: LGTM!The type import refactoring correctly uses
PublicMovie | PublicShowwhich matches the API response types. This is consistent with the broader migration to explicit public type exports.Also applies to: 17-17
web/src/lib/components/nav/user-details.svelte (1)
3-4: LGTM!Clean type import refactoring from nested schema reference to direct
UserReadtype. The context type annotation is correctly updated.web/src/lib/components/download-dialogs/download-season-dialog.svelte (1)
13-13: LGTM!The type import refactoring correctly uses the direct
Showtype import. The component accessesshow.idandshow.seasonswhich are present in theShowschema.Also applies to: 20-20
web/src/lib/components/download-dialogs/download-custom-dialog.svelte (2)
10-10: LGTM!Type import refactoring is consistent with the PR-wide migration to direct type exports.
Also applies to: 17-17
110-127: Good implementation for Enter key submission.Wrapping the input and button in a
<form>withon:submit|preventDefault={search}is the correct approach to enable Enter key submission whilst preventing page reload. The button'stype="submit"ensures it triggers form submission.web/src/lib/components/download-dialogs/select-file-path-suffix-dialog.svelte (1)
5-5: LGTM!The type import refactoring to
Movie | Showis appropriate. These types share the common fields needed for the file path suffix selection functionality.Also applies to: 13-13
web/src/lib/components/torrents/edit-torrent-dialog.svelte (1)
4-4: LGTM!The type import refactoring correctly uses direct
MovieTorrent | RichSeasonTorrentimports. The component accessestorrent.imported,torrent.torrent_id, andtorrent.torrent_titlewhich are common to both types.Also applies to: 14-14
web/package.json (1)
15-15: No issues found with theopenapi-typescriptCLI flags.Both
--root-typesand--root-types-no-schema-prefixare supported in openapi-typescript v7.x and are correctly configured to export root-level type aliases without the "Schema" prefix. The script usage is valid.web/src/lib/components/torrents/torrent-table.svelte (1)
10-10: LGTM! Clean type refactoring.The migration from
components['schemas']['...']to direct type imports (MovieTorrent,RichSeasonTorrent,UserRead) improves code readability and maintains type safety. The changes are consistent with the broader refactoring pattern across the codebase.Also applies to: 25-25, 31-31, 33-33
web/src/lib/components/download-dialogs/download-selected-seasons-dialog.svelte (1)
8-8: LGTM!Clean type import refactoring consistent with the broader pattern across the codebase.
Also applies to: 19-19
web/src/routes/dashboard/tv/add-show/+page.svelte (1)
15-15: LGTM!Type refactoring is consistent with the codebase-wide migration to direct type imports.
Also applies to: 20-20, 43-43
web/src/routes/login/+page.svelte (1)
4-5: LGTM!Clean type refactoring using direct
AuthMetadataimport.web/src/lib/components/download-dialogs/download-movie-dialog.svelte (1)
8-8: LGTM!Consistent type refactoring to use direct
Movieimport.Also applies to: 15-15
web/src/routes/dashboard/tv/+page.svelte (1)
11-11: LGTM!Type refactoring consistent with the codebase pattern.
Also applies to: 17-17
web/src/routes/dashboard/settings/+page.svelte (1)
11-11: LGTM!Clean type refactoring with explicit
UserReadtyping throughout.Also applies to: 13-16
web/src/lib/api/api.d.ts (1)
1721-1763: These type aliases are auto-generated by the--root-types --root-types-no-schema-prefixflags in your openapi script and are correct. No action required.web/src/lib/utils.ts (1)
7-7: LGTM!The type import and parameter signature updates correctly align with the broader refactoring to use explicit public type exports (
Show,Movie) instead of nested schema paths. This improves readability without changing runtime behaviour.Also applies to: 113-113
web/src/lib/components/download-dialogs/file-path-suffix-selector.svelte (1)
5-5: LGTM!The type import and prop signature updates are consistent with the parent component (
select-file-path-suffix-dialog.svelte) which passesMovie | Showtyped media, and withsaveDirectoryPreviewinutils.tswhich expects the same types.Also applies to: 13-13
web/src/routes/dashboard/tv/[showId=uuid]/[SeasonId=uuid]/+page.svelte (1)
7-7: LGTM!The type imports and variable declarations are correctly updated to use explicit public types (
PublicEpisodeFile,Season,Show), aligning with the broader type refactoring effort.Also applies to: 14-16
web/src/routes/dashboard/tv/[showId=uuid]/+page.svelte (1)
10-10: LGTM!The type imports and variable declarations are correctly updated to use explicit public types (
PublicShow,RichShowTorrent,UserRead). The usage oftorrents.torrentson line 356 is consistent withRichShowTorrentbeing a wrapper object containing atorrentsarray.Also applies to: 30-32
web/src/lib/components/download-dialogs/download-selected-episodes-dialog.svelte (1)
8-8: LGTM!The type import and prop signature updates are consistent with the
SelectFilePathSuffixDialogcomponent which acceptsMovie | Showfor itsmediaprop.Also applies to: 19-19
web/src/lib/components/user-data-table.svelte (1)
13-13: LGTM!The type import and variable declarations are correctly updated to use the explicit
UserReadtype, maintaining consistency with the broader type refactoring effort.Also applies to: 15-18
web/src/lib/components/library-combobox.svelte (1)
11-11: LGTM!The type imports, prop signature, and type casts are correctly updated to use explicit public types (
PublicShow,PublicMovie,LibraryItem). The usage is consistent with parent components in dashboard pages.Also applies to: 18-18, 24-24, 34-36, 45-45
web/src/routes/dashboard/+page.svelte (1)
13-13: LGTM!The type annotations and casts for
recommendedShowsandrecommendedMoviesare correctly updated to use the explicitMetaDataProviderSearchResulttype.Also applies to: 16-16, 21-21, 25-25
web/src/lib/components/import-media/suggested-media-card.svelte (1)
5-5: LGTM!The type import refactoring from
components['schemas']['MetaDataProviderSearchResult']to the directMetaDataProviderSearchResulttype alias is clean and consistent with the broader codebase refactor.Also applies to: 11-11
web/src/routes/dashboard/movies/add-movie/+page.svelte (2)
15-15: LGTM on type refactoring.The import and variable typing changes are consistent with the broader type alias refactoring across the codebase.
Also applies to: 20-20, 42-42
96-100: LGTM on Enter key submission feature.The implementation correctly handles submitting the search on Enter:
- Checks for
e.key === 'Enter'- Guards against duplicate submissions with
!isSearching- Calls the same
search(searchTerm)function as the buttonThis matches the PR objective and provides good UX parity with the button.
web/src/routes/dashboard/+layout.svelte (1)
10-10: LGTM!The type refactoring from
components['schemas']['MediaImportSuggestion']to the directMediaImportSuggestiontype alias is consistent with the codebase-wide refactoring pattern.Also applies to: 13-14
web/src/routes/dashboard/movies/+page.svelte (1)
9-9: LGTM!The type import and context variable typing changes are consistent with the broader refactoring to use direct type aliases.
Also applies to: 17-17
web/src/routes/dashboard/movies/[movieId=uuid]/+page.svelte (1)
8-8: LGTM!The import and variable typing changes correctly use the direct type aliases (
PublicMovie,PublicMovieFile,UserRead) instead of the nestedcomponents['schemas']['...']references.Also applies to: 20-22
web/src/lib/components/import-media/import-candidates-dialog.svelte (1)
6-6: LGTM!The type refactoring is consistent throughout the component—import, prop type, and function parameter all correctly use
MetaDataProviderSearchResultdirectly.Also applies to: 19-19, 26-26
web/src/lib/components/add-media-card.svelte (1)
7-7: LGTM!The type import and prop typing changes correctly use the direct
MetaDataProviderSearchResulttype alias, consistent with the broader refactoring.Also applies to: 12-13
web/src/lib/components/recommended-media-carousel.svelte (1)
6-6: LGTM!The type import and prop typing changes are consistent with the codebase-wide refactoring to use direct type aliases instead of nested schema references.
Also applies to: 14-14
e030121 to
4a3bc06
Compare
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
web/src/lib/components/download-dialogs/download-custom-dialog.svelte (1)
109-127: Preserve the original spacing after wrapping this in a form.Line 109 still owns the
grid ... gap-1.5layout, but the new<form>at Line 110 is now the only grid item. That means the label, input row, and helper text no longer get the previous gap spacing, so this change also tweaks the dialog layout.🎯 Suggested diff
- <div class="grid w-full items-center gap-1.5"> - <form on:submit|preventDefault={search}> + <div class="w-full"> + <form class="grid items-center gap-1.5" on:submit|preventDefault={search}>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@web/src/lib/components/download-dialogs/download-custom-dialog.svelte` around lines 109 - 127, The form you added became the single child of the outer div with class "grid w-full items-center gap-1.5", so the Label, Input row and helper <p> are no longer separate grid items and the gap spacing is lost; fix by applying the grid and gap classes to the <form> itself (e.g. give the form "grid w-full items-center gap-1.5") so the Label, the div containing <Input bind:value={queryOverride} ...> and the helper paragraph are grid children and spacing is preserved while keeping the existing bindings and submit handler (search) and Button disabled={isLoading}.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@web/src/lib/components/download-dialogs/download-custom-dialog.svelte`:
- Around line 109-127: The form you added became the single child of the outer
div with class "grid w-full items-center gap-1.5", so the Label, Input row and
helper <p> are no longer separate grid items and the gap spacing is lost; fix by
applying the grid and gap classes to the <form> itself (e.g. give the form "grid
w-full items-center gap-1.5") so the Label, the div containing <Input
bind:value={queryOverride} ...> and the helper paragraph are grid children and
spacing is preserved while keeping the existing bindings and submit handler
(search) and Button disabled={isLoading}.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d0d8824b-2732-4526-b56a-2e92bb3d76bc
📒 Files selected for processing (1)
web/src/lib/components/download-dialogs/download-custom-dialog.svelte
Simple fix to allow pressing
enteron custom search dialog in addition to the "Search" button.Checklist:
npm run lintnpm run formatSummary by CodeRabbit