Skip to content

Conversation

@lkwhite
Copy link
Member

@lkwhite lkwhite commented Nov 7, 2025

When searching for read IDs in "Read" mode, references containing matching reads now automatically expand to show the filtered results. This improves UX by eliminating the need to manually click each reference group to see which reads matched the search query.

The fix adds auto-expansion logic in rebuildItemsList():

  • Detects read search mode with active search text
  • Auto-expands references that have matching reads
  • Preserves manual expansion state when not searching
  • Only displays filtered (matching) reads within expanded groups

This change is isolated to the display logic and maintains backward compatibility with existing search and expansion behavior.

Changes Made
File: src/views/components/squiggy-reads-core.tsx:745-747

Added auto-expansion logic for references when searching for reads:

// Auto-expand references with matching reads in read search mode
const shouldAutoExpand = searchMode === 'read' && searchText && filteredReads.length > 0;
const isExpanded = shouldAutoExpand || expandedReferences.has(referenceName);
How It Works
Before: When searching for read IDs, the UI would show:

Search: "abc123"
▶ tRNA-Ala-AGC-1 (2 reads) ← Collapsed, user must click to see reads
▶ tRNA-Gly-GCC-1 (1 read) ← Collapsed, user must click to see reads
After: References automatically expand to show matching reads:

Search: "abc123"
▼ tRNA-Ala-AGC-1 (2 reads)
→ abc123_read1
→ abc123_read2
▼ tRNA-Gly-GCC-1 (1 read)
→ xyz_abc123
Behavior
Read search mode + active search → Auto-expands references with matches
No search text → Uses manual expansion state only
Reference search mode → Uses manual expansion state only
Filtered results → Only matching reads are shown (already working)
Testing
The extension compiled successfully with no errors. The change is minimal and isolated to the display logic, so it should be safe.

When searching for read IDs in "Read" mode, references containing
matching reads now automatically expand to show the filtered results.
This improves UX by eliminating the need to manually click each
reference group to see which reads matched the search query.

The fix adds auto-expansion logic in rebuildItemsList():
- Detects read search mode with active search text
- Auto-expands references that have matching reads
- Preserves manual expansion state when not searching
- Only displays filtered (matching) reads within expanded groups

This change is isolated to the display logic and maintains backward
compatibility with existing search and expansion behavior.
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.44%. Comparing base (a7c74e9) to head (c78afb8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #129   +/-   ##
=======================================
  Coverage   78.44%   78.44%           
=======================================
  Files          27       27           
  Lines        4235     4235           
  Branches      813      813           
=======================================
  Hits         3322     3322           
  Misses        913      913           
Components Coverage Δ
Core Logic ∅ <ø> (∅)
Plotting ∅ <ø> (∅)
GUI ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

4 participants