Skip to content

Import samplesheets from remote storage - #145

Draft
PaulNewling wants to merge 1 commit into
mainfrom
feat/samplesheet-remote-files
Draft

PaulNewling wants to merge 1 commit into
mainfrom
feat/samplesheet-remote-files

Conversation

@PaulNewling

@PaulNewling PaulNewling commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

The multiplexed FASTQ samplesheet picker used lsDriver.showOpenSingleFileDialog, which only sees local files. It now goes through PlFileDialog, the same path the metadata import already uses, so a samplesheet can come from any configured storage.

Changes

  • Model: new samplesheetUploadHandle in BlockData, projected into prerunArgs, with a V20261123 migration step. New samplesheetFile output. It is a plain output, not retentive, so it returns to undefined between imports and re-picking the same file still opens the dialog.
  • Workflow: the prerun imports samplesheetUploadHandle and exports it as samplesheetFile.
  • UI: the metadata import logic moves into a shared useUploadedTableImport composable, used by both the metadata and samplesheet imports. SyncDatasetDialog opens PlFileDialog and clears the handle on import or cancel. The now-unused local-only importTable is removed from useTableImport.
  • The samplesheet gets its own handle rather than sharing metadataUploadHandle, because SyncDatasetDialog is 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)
  • model and UI unit tests
  • wf.test.ts against a backend (output expectation updated with samplesheetFile)
  • Desktop: import a samplesheet from a remote storage and from a local file on a multiplexed FASTQ dataset; re-import the same file; cancel

RetriggerView in GreptileConfidence Score: 4/5

Do not merge until a pending samplesheet stays tied to the dataset that requested it.

Fix All in Claude CodeFindings

  1. P1 Sheet reaches the wrong dataset ▶
  2. P2 Oversized sheets are read first ▶
Fix with agent prompt
### Issue 1
ui/src/dialogs/SyncDatasetDialog.vue:69-74
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.

### Issue 2
ui/src/composables/useUploadedTableImport.ts:29-32
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.

Summary

Samplesheet selection now uses PlFileDialog and the pre-run workflow, allowing local and remote files.

  • Multiplexed FASTQ samplesheets can come from any storage the file picker offers.

Important touched types:

  • BlockDataV20261123: the new saved-state shape. Adds optional samplesheetUploadHandle.
  • BlockData: the current saved-state type. Now points to BlockDataV20261123.
  • BlockPrerunArgs: the fields sent to the pre-run workflow. Now includes samplesheetUploadHandle.
  • UploadedTableSource: the new contract for reading and clearing a selected handle and getting its exported file.
  • BlockOutputs: the model's inferred outputs. Gains the plain samplesheetFile output.
  • 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

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.
@PaulNewling

Copy link
Copy Markdown
Contributor Author

@greptileai

Comment on lines +69 to +74
} = useUploadedTableImport({
getHandle: () => app.model.data.samplesheetUploadHandle,
setHandle: (handle) => {
app.model.data.samplesheetUploadHandle = handle;
},
getFile: () => app.model.outputs.samplesheetFile,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Fix in Claude Code

Comment on lines +29 to +32
const fileBytes = computed(() => {
const file = source.getFile();
if (!file) return undefined;
return reactiveFileContent.getContentBytes(file.handle).value;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Fix in Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant