Skip to content

feat: enable search on batches#827

Merged
Kevin Loftus (kevin-loftus-dept) merged 1 commit into
developmentfrom
feat/egv-198-batch-name-search
Jul 6, 2026
Merged

feat: enable search on batches#827
Kevin Loftus (kevin-loftus-dept) merged 1 commit into
developmentfrom
feat/egv-198-batch-name-search

Conversation

@kevin-loftus-dept

@kevin-loftus-dept Kevin Loftus (kevin-loftus-dept) commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Title*

Enable batch name search on Data Collections Samples tab

Type of Change*

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

Description

The Samples tab search on the Data Collections page previously filtered only on sample Name. Users could not find samples by batch, even though samples are grouped visually by batch in the UI.

This change extends search to also match batch tag names (Kind === 'batch'). When a query matches a batch name, all samples in that batch are shown. When it matches a sample name, only that sample is shown (existing behavior). Search remains case-insensitive and uses substring matching.

Implementation details:

  • Added filterSamplesBySearch() to packages/front-end/src/app/utils/data-collections-filters.ts as a pure, unit-testable helper (same pattern as existing filters in that file).
  • Wired the helper into EGSamplesTab.vue and EGSampleTagSidebar.vue so the main sample list and left-rail tag chip counts stay in sync.
  • Updated search input copy: placeholder is now "Search by sample ID or batch…" and the screen-reader label mentions batches.

No backend or API changes — samples and tags are already loaded client-side on the page.

Testing*

  • Added 9 unit tests for filterSamplesBySearch in packages/front-end/test/app/utils/data-collections-filters.test.ts, covering:
    • Empty/whitespace query
    • Sample name substring match (case-insensitive)
    • Batch name match returning all samples in the batch
    • Case-insensitive batch matching
    • Unbatched samples matching only on their own name
    • Standard tags not treated as batch matches
    • No-match empty result
  • Ran pnpm exec jest test/app/utils/data-collections-filters.test.ts — all 19 tests pass.

Manual verification recommended:

  • Search a sample ID → only matching sample(s) appear
  • Search a batch name → entire batch section appears with all member samples
  • Confirm left-rail tag chip counts update when batch search narrows the set
  • Clear search → full list restored

Impact

  • Behavior: Users can now discover samples by batch name from the existing search bar.
  • Performance: Negligible — same client-side filter pattern as before, with a small additional pass over batch tags per keystroke.
  • Dependencies: None added.
  • Scope: Front-end only; no OpenAPI, CDK, or database changes.

Additional Information

The previous placeholder said "Search by sample ID or tag…" but standard tag name search was never implemented. This PR updates the placeholder to reflect what is actually searchable (sample ID and batch).

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.

@diegomayorga-dept diegomayorga-dept left a comment

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.

LGTM

@kevin-loftus-dept Kevin Loftus (kevin-loftus-dept) merged commit 26d438c into development Jul 6, 2026
4 checks passed
@kevin-loftus-dept Kevin Loftus (kevin-loftus-dept) deleted the feat/egv-198-batch-name-search branch July 6, 2026 19:50
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