feat(studio): Support searching for fileset file select - #1151
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
📝 WalkthroughWalkthroughChangesThe PR adds a shared React Hook Form fileset selector with workspace filtering, server-side search, purpose filtering, pagination, grouping, loading states, and custom rendering. Dataset and Studio components now use the shared selector. Fileset selector migration
Sequence Diagram(s)sequenceDiagram
participant User
participant FilesetSearchableSelect
participant useFilesetSearch
participant filesListFilesets
User->>FilesetSearchableSelect: Enter search or open selector
FilesetSearchableSelect->>useFilesetSearch: Apply workspace, search, and purpose filters
useFilesetSearch->>filesListFilesets: Request fileset page
filesListFilesets-->>useFilesetSearch: Return paginated filesets
useFilesetSearch-->>FilesetSearchableSelect: Provide sorted results and loadMore
FilesetSearchableSelect-->>User: Render selectable filesets
User->>FilesetSearchableSelect: Select fileset
FilesetSearchableSelect-->>User: Emit selected FilesetOutput
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/packages/common/src/components/FilesetSearchableSelect/index.tsx`:
- Around line 69-81: Update the fileset option construction near options and
handleChange so each rendered option retains its corresponding fileset,
including custom values from renderOption. Resolve the selected fileset by
matching the change value against the stored option.value, then pass that
fileset to onChange instead of matching getEntityReference(fileset).
- Around line 14-37: Update FilesetSearchableSelectFormFieldProps and
FilesetSearchableSelectProps to use interface declarations instead of type
aliases, preserving their existing fields and generic constraint. Add an
explicit return type to the FilesetSearchableSelect component.
In
`@web/packages/common/src/components/FilesetSearchableSelect/useFilesetSearch.test.tsx`:
- Line 7: Use type-only imports for FilesetOutput in
web/packages/common/src/components/FilesetSearchableSelect/useFilesetSearch.test.tsx:7-7,
web/packages/common/src/components/UploadModal/DatasetUploader/Select.tsx:12-14,
and
web/packages/common/src/components/UploadModal/DatasetUploader/Select.test.tsx:7-14.
In Select.tsx, also import FC as a type; in Select.test.tsx, split
UploadModalState into a type-only import while preserving any runtime imports.
In
`@web/packages/common/src/components/FilesetSearchableSelect/useFilesetSearch.ts`:
- Around line 61-97: Expose the error state from useFilesetSearch by returning
the useInfiniteQuery error, then update the FilesetSearchableSelect component to
render a failure message when filesListFilesets rejects instead of “No filesets
found”; update Select.test.tsx to assert the failure message. Apply changes in
web/packages/common/src/components/FilesetSearchableSelect/useFilesetSearch.ts
(lines 61-97),
web/packages/common/src/components/FilesetSearchableSelect/index.tsx (lines
63-100), and
web/packages/common/src/components/UploadModal/DatasetUploader/Select.test.tsx
(lines 138-146).
- Around line 61-81: Update the useInfiniteQuery queryKey in useFilesetSearch to
include pageSize, ensuring caches differ when the filesListFilesets request size
changes. Add a regression test covering separate cache behavior for different
pageSize values.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 0ed5446e-0f80-47a0-a8d8-bbeee9cfd0dd
📒 Files selected for processing (8)
web/packages/common/src/components/FilesetSearchableSelect/index.tsxweb/packages/common/src/components/FilesetSearchableSelect/useFilesetSearch.test.tsxweb/packages/common/src/components/FilesetSearchableSelect/useFilesetSearch.tsweb/packages/common/src/components/UploadModal/DatasetUploader/Select.test.tsxweb/packages/common/src/components/UploadModal/DatasetUploader/Select.tsxweb/packages/studio/src/components/ColumnConfigPanel/SeedDatasetConfig.tsxweb/packages/studio/src/routes/DeploymentsListRoute/CreateDeploymentSidePanel/FilesetSearchableSelect.tsxweb/packages/studio/src/routes/DeploymentsListRoute/CreateDeploymentSidePanel/WorkspaceSourceFields.tsx
💤 Files with no reviewable changes (1)
- web/packages/studio/src/routes/DeploymentsListRoute/CreateDeploymentSidePanel/FilesetSearchableSelect.tsx
|
5972896 to
7550a1d
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@web/packages/common/src/components/FilesetSearchableSelect/useFilesetSearch.ts`:
- Around line 50-51: Validate pageSize in useFilesetSearch before the API
request, requiring an integer between 1 and 100 inclusive to match the API’s
page_size limit. Ensure the request uses only this validated value, and add
boundary tests covering 1, 100, and invalid values outside the range or
non-integers.
In `@web/packages/common/src/components/UploadModal/DatasetUploader/Select.tsx`:
- Around line 59-90: Update handleDatasetSelect to track the active fileset
request and ignore any success or error completion that no longer matches the
current selection. When selecting NEW_DATASET_VALUE or another dataset,
invalidate the prior request and clear SET_FETCHING as needed; only the latest
request may dispatch SET_FILES, SET_ERRORS, or finish fetching.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: a6714ea1-3846-4d09-bd01-3075c12c2974
📒 Files selected for processing (8)
web/packages/common/src/components/FilesetSearchableSelect/index.tsxweb/packages/common/src/components/FilesetSearchableSelect/useFilesetSearch.test.tsxweb/packages/common/src/components/FilesetSearchableSelect/useFilesetSearch.tsweb/packages/common/src/components/UploadModal/DatasetUploader/Select.test.tsxweb/packages/common/src/components/UploadModal/DatasetUploader/Select.tsxweb/packages/studio/src/components/ColumnConfigPanel/SeedDatasetConfig.tsxweb/packages/studio/src/routes/DeploymentsListRoute/CreateDeploymentSidePanel/FilesetSearchableSelect.tsxweb/packages/studio/src/routes/DeploymentsListRoute/CreateDeploymentSidePanel/WorkspaceSourceFields.tsx
💤 Files with no reviewable changes (1)
- web/packages/studio/src/routes/DeploymentsListRoute/CreateDeploymentSidePanel/FilesetSearchableSelect.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
- web/packages/studio/src/routes/DeploymentsListRoute/CreateDeploymentSidePanel/WorkspaceSourceFields.tsx
- web/packages/studio/src/components/ColumnConfigPanel/SeedDatasetConfig.tsx
- web/packages/common/src/components/UploadModal/DatasetUploader/Select.test.tsx
- web/packages/common/src/components/FilesetSearchableSelect/index.tsx
7550a1d to
e411942
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
e411942 to
ebad0b2
Compare
Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae <steramae@nvidia.com>
ebad0b2 to
e278556
Compare
Signed-off-by: Sean Teramae steramae@nvidia.com
Summary by CodeRabbit
New Features
Bug Fixes
Tests