Repository navigation
Import samplesheets from remote storage - #145
PaulNewling wants to merge 1 commit into
Conversation
The samplesheet picker used the local-only file dialog. Route it through PlFileDialog and the prerun import, the same path the metadata import uses: a samplesheetUploadHandle field (with a migration step), a prerun import, and a samplesheetFile output read by the UI. The metadata and samplesheet imports now share one composable.
| } = useUploadedTableImport({ | ||
| getHandle: () => app.model.data.samplesheetUploadHandle, | ||
| setHandle: (handle) => { | ||
| app.model.data.samplesheetUploadHandle = handle; | ||
| }, | ||
| getFile: () => app.model.outputs.samplesheetFile, |
There was a problem hiding this comment.
Sheet reaches the wrong dataset
Every SyncDatasetDialog watches the same pending samplesheet without recording which dataset requested it. If a user selects a remote sheet on dataset A and opens dataset B before it finishes loading, B opens the import dialog. Matching group labels can then apply A's samples and barcodes to B.
Keep the requesting dataset with the pending import, or clear it when the requesting view closes.
Knowledge Base Used: Import dialogs and composables
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/dialogs/SyncDatasetDialog.vue
Line: 69-74
Comment:
**Sheet reaches the wrong dataset**
Every `SyncDatasetDialog` watches the same pending samplesheet without recording which dataset requested it. If a user selects a remote sheet on dataset A and opens dataset B before it finishes loading, B opens the import dialog. Matching group labels can then apply A's samples and barcodes to B.
Keep the requesting dataset with the pending import, or clear it when the requesting view closes.
**Knowledge Base Used:** [Import dialogs and composables](https://app.greptile.com/-/switch-tenant?tenant=milaboratories&next=%2Fcustom-context%2Fknowledge-base%2Fplatforma-open%2Fsamples-and-data%2F-%2Fdocs%2Fimport-dialogs-and-composables.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| const fileBytes = computed(() => { | ||
| const file = source.getFile(); | ||
| if (!file) return undefined; | ||
| return reactiveFileContent.getContentBytes(file.handle).value; |
There was a problem hiding this comment.
Oversized sheets are read first
The samplesheet path now requests file contents before enforcing DEFAULT_MAX_FILE_SIZE. The removed local picker checked the size first. An oversized table now reaches the content reader before being rejected, adding avoidable download and memory costs.
Check the exported file's size before calling getContentBytes, and keep the byte-length check as a fallback.
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/composables/useUploadedTableImport.ts
Line: 29-32
Comment:
**Oversized sheets are read first**
The samplesheet path now requests file contents before enforcing `DEFAULT_MAX_FILE_SIZE`. The removed local picker checked the size first. An oversized table now reaches the content reader before being rejected, adding avoidable download and memory costs.
Check the exported file's size before calling `getContentBytes`, and keep the byte-length check as a fallback.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
The multiplexed FASTQ samplesheet picker used
lsDriver.showOpenSingleFileDialog, which only sees local files. It now goes throughPlFileDialog, the same path the metadata import already uses, so a samplesheet can come from any configured storage.Changes
samplesheetUploadHandleinBlockData, projected intoprerunArgs, with aV20261123migration step. NewsamplesheetFileoutput. It is a plain output, not retentive, so it returns toundefinedbetween imports and re-picking the same file still opens the dialog.samplesheetUploadHandleand exports it assamplesheetFile.useUploadedTableImportcomposable, used by both the metadata and samplesheet imports.SyncDatasetDialogopensPlFileDialogand clears the handle on import or cancel. The now-unused local-onlyimportTableis removed fromuseTableImport.metadataUploadHandle, becauseSyncDatasetDialogis also mounted on the Metadata page, and a shared handle would open both import modals.Test plan
pnpm run build:dev-remote(typecheck + tengo check)wf.test.tsagainst a backend (output expectation updated withsamplesheetFile)Do not merge until a pending samplesheet stays tied to the dataset that requested it.
Fix with agent prompt
Summary
Samplesheet selection now uses
PlFileDialogand the pre-run workflow, allowing local and remote files.Important touched types:
BlockDataV20261123: the new saved-state shape. Adds optionalsamplesheetUploadHandle.BlockData: the current saved-state type. Now points toBlockDataV20261123.BlockPrerunArgs: the fields sent to the pre-run workflow. Now includessamplesheetUploadHandle.UploadedTableSource: the new contract for reading and clearing a selected handle and getting its exported file.BlockOutputs: the model's inferred outputs. Gains the plainsamplesheetFileoutput.TableImportOptions: the removed options type for the local-only picker.Verification: source review only. Tests and desktop capture were not run; dependencies and the Platforma desktop backend were unavailable.
Reviews (1) · Last reviewed commit: "Import samplesheets from remote storage" · Reviewed by Greptile