Broaden PR list filtering across loaded metadata - #103
Conversation
🤖 Augment PR SummarySummary: Expands the Open PR List “Substring Filter” so it can match across more already-loaded PR metadata without triggering new network requests. Changes:
Technical Notes: Filtering stays case-insensitive via a shared helper, and enrichment matching is read-only over cached data to avoid initiating fetches. 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
🟡 Not ready to approve
Filter-editor Esc/Enter can close the editor and change selection via relayout without running the normal JIT file-fetch step, potentially leaving the summary panel out of sync until another keypress.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR expands the Open PR List / substring filter so it can match across already-loaded metadata beyond title/author, including labels, requested/submitted reviewers, changed-file paths, and fetched PR bodies, while ensuring filter editing stays in-memory and does not trigger enrichment fetches.
Changes:
- Extend substring matching to PR labels and requested reviewers, plus enrichment-backed reviewers/files/bodies once they arrive.
- Cache fetched PR bodies in enrichment so they remain searchable after leaving the detail view.
- Trigger relayout when files/body enrichment arrives so active filters immediately reflect newly loaded data.
File summaries
| File | Description |
|---|---|
| src/github/rest.rs | Updates label documentation to reflect that label names participate in filtering. |
| src/app/update/tests/filter.rs | Adds tests covering new filter domains and verifies filter typing doesn’t trigger enrichment fetches. |
| src/app/update/tests/detail.rs | Renames a test to align with the “must not reopen detail” behavior expectation. |
| src/app/update.rs | Prevents filter open/typing from implicitly triggering JIT enrichment fetches; relayouts on files/body arrivals. |
| src/app/pr_list/tests.rs | Updates PrList::relayout call sites to pass the new enrichment-matching predicate. |
| src/app/pr_list.rs | Broadens filter predicate to include labels/requested reviewers and delegates enrichment matching via callback. |
| src/app/msg.rs | Updates PRDetailArrived documentation to note retention of body as searchable enrichment. |
| src/app/model.rs | Adds enrichment description cache and implements enrichment-backed filter matching. |
| CONTEXT.md | Documents the expanded “Substring Filter” domain definition. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 2
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Typing keeps its per-keystroke fetch suppression, but Esc/Enter now run the just-in-time files fetch so the summary panel doesn't sit on the Loading placeholder until an unrelated keypress.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/app/model.rs:210
- When an already-applied reviewer filter currently has no matches, a
ReviewsArrivedmessage can make a PR visible and selected viarefresh_blockers()/relayout(), but that reducer arm returns no command and never runsmaybe_fetch_selected_files. The newly selected PR’s summary can therefore remain on the files placeholder until another keypress. After processing review arrivals, trigger the deduplicated files fetch when the filter is not being edited (editing must remain fetch-free), and cover the applied-filter/no-results transition.
self.reviews.get(&key).is_some_and(|reviews| {
reviews
.iter()
.any(|review| contains_case_insensitive(&review.user, needle))
Summary
/Substring Filter to match labels, requested and submitted reviewers, loaded PR descriptions, and loaded changed-file paths/key, with no enrichment fetchesmainWhy
Closes #78.
The filter predicate previously had access only to fields stored directly on the list PR. Reviews, descriptions, and changed paths live in streamed enrichment, so they could not contribute even after GitHub data had already arrived.
Impact
Users can now narrow the Open PR List by the full set of already-loaded PR text without triggering network activity. Enrichment-backed fields begin contributing as soon as their data streams in. Pasted worktree paths still match by PR number, while similarly shaped changed-file paths also remain searchable.
Validation
cargo fmt -- --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-targets --all-features— 707 passedmanual-testherdr tab for label, reviewer, changed-path, and loaded-description queriesNote
Broaden PR list substring filtering to match enrichment fields loaded at runtime
contains_case_insensitivehelper centralizes case-insensitive matching across all filterable fields.Enrichmentin model.rs gains adescriptionscache so PR body text fetched by the detail view is available to the filter without re-fetching.Macroscope summarized ff1664c.