Skip to content

Broaden PR list filtering across loaded metadata - #103

Open
mayfieldiv wants to merge 3 commits into
mainfrom
agent/filter-enriched-pr-fields
Open

Broaden PR list filtering across loaded metadata#103
mayfieldiv wants to merge 3 commits into
mainfrom
agent/filter-enriched-pr-fields

Conversation

@mayfieldiv

@mayfieldiv mayfieldiv commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • broaden the / Substring Filter to match labels, requested and submitted reviewers, loaded PR descriptions, and loaded changed-file paths
  • retain fetched descriptions as searchable enrichment and relayout active filters when body or file data arrives
  • keep filter editing entirely in-memory, including the initial / key, with no enrichment fetches
  • preserve the existing PR-number behavior already present on main
  • document the expanded Substring Filter domain term

Why

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 -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-targets --all-features — 707 passed
  • real TUI validation in the shared manual-test herdr tab for label, reviewer, changed-path, and loaded-description queries
  • final two-axis review: 0 Standards findings, 0 Spec findings

Note

Broaden PR list substring filtering to match enrichment fields loaded at runtime

  • The substring filter in pr_list.rs now matches labels, requested reviewers, review authors, changed file paths, and PR descriptions, in addition to title, author, and PR number.
  • A contains_case_insensitive helper centralizes case-insensitive matching across all filterable fields.
  • Enrichment in model.rs gains a descriptions cache so PR body text fetched by the detail view is available to the filter without re-fetching.
  • The list relayouts automatically when files or PR details arrive, so an active filter re-applies immediately against newly loaded data.
  • Typing in the filter never triggers network fetches; file fetches only occur when the filter editor closes.

Macroscope summarized ff1664c.

@mayfieldiv
mayfieldiv marked this pull request as ready for review July 31, 2026 05:41
Copilot AI review requested due to automatic review settings July 31, 2026 05:41
@augmentcode

augmentcode Bot commented Jul 31, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Expands the Open PR List “Substring Filter” so it can match across more already-loaded PR metadata without triggering new network requests.

Changes:

  • Extends substring matching to include label names and requested reviewers stored directly on each PR row.
  • Adds enrichment-backed matching for submitted reviewers, changed-file paths (once files are loaded), and PR descriptions fetched for the detail view.
  • Caches fetched PR description bodies in Enrichment so they remain searchable after leaving the detail view.
  • Triggers relayout when files or descriptions arrive so an active filter starts matching immediately as enrichment streams in.
  • Ensures opening/typing in the filter remains purely in-memory (no implicit just-in-time file fetches).
  • Updates docs/tests to reflect the broadened filter domain and new behavior.

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 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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.

Comment thread src/app/pr_list.rs
Comment thread src/app/update.rs
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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 ReviewsArrived message can make a PR visible and selected via refresh_blockers()/relayout(), but that reducer arm returns no command and never runs maybe_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))

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.

Filter: broaden / search to labels, reviewers, PR number, body, file paths

2 participants