Skip to content

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

Description

@mayfieldiv

Problem

The / Substring Filter matches only a PR's title and author
(filter_matches in src/app/pr_list.rs:58pr.title and pr.author). The
v1 PRD (#1, user story 11) specifies full-text search across title, description,
author, reviewers, labels, PR number (e.g. #5543), and changed file paths.
Today a user can't narrow by label, reviewer, PR number, or a path that appears
in the diff.

Approach

Broaden filter_matches to test the needle against, in addition to title/author:

  • labelspr.labels (already on the model; rendered in the summary panel).
  • PR number — match #<number> and bare <number> against pr.number.
  • reviewers / requested reviewers — from enrichment when present.
  • description (body) — when the PR body is loaded.
  • changed file paths — when files enrichment is present.

Fields that depend on enrichment (body, reviewers, files) only contribute once
that data has streamed in; the filter must stay a cheap synchronous predicate
over already-fetched data (no fetch triggered by typing). Keep it
case-insensitive with the needle lowercased once per relayout, as today.

Consider whether a bare numeric needle should match PR numbers loosely
(substring) or only as an exact #N token — exact-token avoids "1" matching
every PR containing "1" in a path. Recommend: #N exact-token match for numbers,
substring for everything else.

Acceptance Criteria

  • / filter narrows by label, reviewer/requested-reviewer, PR number, body
    text, and changed file path, in addition to title and author.
  • Enrichment-dependent fields contribute only when loaded; typing never
    triggers a fetch.
  • #5543 matches PR 5543; numeric matching does not spuriously match numbers
    embedded in unrelated fields (per the chosen number-match rule).
  • filter_matches stays a pure predicate; table-driven tests cover each new
    field plus the no-match and empty-needle cases.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions