Search results should show reads in expanded reference context - #129
Draft
lkwhite wants to merge 1 commit into
Draft
Search results should show reads in expanded reference context#129lkwhite wants to merge 1 commit into
lkwhite wants to merge 1 commit into
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
jayhesselberth
force-pushed
the
claude/work-in-progress-011CUt2g3dbvmTSkBoS7P7Wd
branch
from
March 3, 2026 22:05
c78afb8 to
b100f4b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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():
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.