Skip to content

[WIP] feat: group file with same name and add new popover functionality#770

Open
diegomayorga-dept wants to merge 3 commits into
developmentfrom
feat/egv-150-group-files-by-same-name
Open

[WIP] feat: group file with same name and add new popover functionality#770
diegomayorga-dept wants to merge 3 commits into
developmentfrom
feat/egv-150-group-files-by-same-name

Conversation

@diegomayorga-dept
Copy link
Copy Markdown
Contributor

Title*

Group paired-read FASTQ files into one sample card/row in Data Collections

Type of Change*

  • New feature
  • Bug fix
  • Documentation update
  • Refactoring
  • Hotfix
  • Security patch
  • UI/UX improvement

Description

In the Data Collections explorer, every S3 object rendered as its own card / table row. Multi-lane paired-read samples therefore showed up as 2–8 separate "samples" — e.g. WI-Jan-2024-S005_L001_R1, _L001_R2, _L002_R1, _L002_R2 appeared as four cards instead of one. This obscured the sample-level view lab users care about.

This PR collapses all files that share a sample base name into one display unit per sample:

  • New utility getSampleGroupId() (packages/front-end/src/app/utils/data-collections-to-sample-sheet.ts) extracts a sample id from <sample>(_L<digits>)?_R[12](_<set>)?.f(ast)?q[.gz], collapsing all lanes of a sample. It reuses the existing getFileNameWithoutExt and is case-insensitive. Non-paired files (.txt, .fasta, index reads _I1/_I2, etc.) return null and stay as solo cards.
  • Explorer (packages/front-end/src/app/components/EGDataCollectionsExplorer.vue): introduces an internal DisplayGroup type and buildDisplayGroups(); each batch section now carries groups. Cards and table rows iterate groups. Grouping is scoped per S3 folder so identically-named samples in different folders don't merge.
    • Card label = sample id; meta shows N files for groups (file size unchanged for solos).
    • Selection, drag-and-drop, and lasso operate atomically on all keys in a group; checkbox is tri-state (all / partial / none).
    • Tags shown are the union across the group; status counts, "X samples" header, and "Select all (N)" count groups; expiry is the soonest across the group; the permanent lock shows for any-permanent with "Some files…" tooltip text when partial.
  • Analysis history popover (packages/front-end/src/app/components/EGFileAnalysisHistoryTooltip.vue): additive groupFiles prop renders a new "Files (N)" section between the header and Analysis History, listing each file's type pill (FASTQ/FASTA/Other) + filename + size. Run usages are deduped by RunId across the group. Single-file callers are unchanged.
  • Removed the now-dead toggleKey emit and its parent handler in EGDataCollectionsPage.vue, since card/row clicks now toggle whole groups via update:selectedKeys.

Testing*

  • Unit tests — new packages/front-end/test/app/utils/data-collections-sample-grouping.test.ts with 9 cases for getSampleGroupId: multi-lane, single-lane, no trailing set number, .fq/.fq.gz extensions, case-insensitive _r1_, non-paired files (null), index reads _I1/_I2 (null), lane-without-direction (null), and lane-in-sample-name preservation. All 4 utils suites pass (35 tests).
  • Type check — production source (.ts/.vue) emits no new TypeScript errors. Lint clean on the touched .ts files.
  • Manual E2E — seed a lab with a 4-file multi-lane sample (S005), a 2-file single-lane pair (S006), and a non-paired file (notes.txt); confirm 3 cards ("4 files", "2 files", file size), group select/lasso/drag-tag operate on all keys, popover "Files (N)" section renders, partial-permanent lock + tooltip, and the table view mirrors card behavior.

Impact

  • UI-only change to the Data Collections explorer and its analysis popover; no API, schema, or backend changes.
  • Parent (EGDataCollectionsPage) data shape (visibleFiles and the per-key maps) is unchanged; only the internal rendering and the now-removed toggleKey event differ.
  • No new dependencies.

Additional Information

  • Grouping rule confirmed with design: all lanes of a sample collapse into one card; card meta shows just N files (no date — "Jan-2024" in the mockup was part of the test filename).
  • Edge-case decisions: tags = union (not intersection); batch = primary key's batch with first-non-null fallback (no "mixed" marker in v1); permanent = lock shown if any file in the group is permanent.

Checklist*

  • No new errors or warnings have been introduced.
  • All tests pass successfully and new tests added as necessary.
  • Documentation has been updated accordingly.
  • Code adheres to the coding and style guidelines of the project.
  • Code has been commented in particularly hard-to-understand areas.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Everything looks great except for some odd changes in the laboratory-service.ts log calls.


public queryByLaboratoryId = async (laboratoryId: string): Promise<Laboratory> => {
const logRequestMessage = `Query Laboratory by LaboratoryId=${laboratoryId} request`;
const logRequestMessage = `11234Query Laboratory by LaboratoryId=${laboratoryId} request`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think these 11234 and 123 changes in this file may have been left in by mistake, can you remove them?

@diegomayorga-dept diegomayorga-dept changed the title feat: group file with same name and add new popover functionality [WIP] feat: group file with same name and add new popover functionality Jun 4, 2026
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.

2 participants