Skip to content

feat(repo): enhance PR discovery with persistent shareable search filters#1033

Merged
anderdc merged 4 commits into
entrius:testfrom
carlh7777:feat/repo-pr-table-search
May 22, 2026
Merged

feat(repo): enhance PR discovery with persistent shareable search filters#1033
anderdc merged 4 commits into
entrius:testfrom
carlh7777:feat/repo-pr-table-search

Conversation

@carlh7777
Copy link
Copy Markdown
Contributor

Summary

Adds URL-backed search to the repository PR table with multi-term AND filtering and persistent, shareable query state.

Users

  • Search by PR title, PR number, merged date, and optional score-style clauses
  • Press Enter to pin multiple terms with AND matching
  • Share or reopen the URL to restore the exact filtered view

Product

  • Search state persists across refreshes and direct links
  • Improves reproducibility and collaboration with shareable filtered views

Engineering

  • Centralized filtering/search helpers in src/utils/prTable.ts
  • Integrated searchable table UI in RepositoryPRsTable.tsx

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Screenshots

Before

image

After

gorec-2026-05-11-05-51-53.webm

Checklist

  • New components are modularized/separated where sensible
  • Uses predefined theme (e.g. no hardcoded colors)
  • Responsive/mobile checked
  • Tested against the test API
  • npm run format and npm run lint:fix have been run
  • npm run build passes
  • Screenshots included for any UI/visual changes

@xiao-xiao-mao xiao-xiao-mao Bot added the enhancement New feature or request label May 11, 2026
@ventura-oss
Copy link
Copy Markdown
Contributor

Skipping in this review pass — the branch is 13 commits behind test and the diff against current test is far larger than the stated change (28 files, +1406/-1594, vs. the described 2-file search-filter addition). Merging in the current state would silently revert recent fixes including:

Please rebase onto current origin/test so the diff reflects only the PR-table search/filter feature, and we'll re-review.

@carlh7777 carlh7777 force-pushed the feat/repo-pr-table-search branch from b6fafce to 110eddf Compare May 13, 2026 11:36
@carlh7777
Copy link
Copy Markdown
Contributor Author

Hi @ventura-oss

Rebased onto the latest origin/test and force-pushed the branch. The PR diff should now be limited to the PR-table search/filter changes only.

@carlh7777 carlh7777 force-pushed the feat/repo-pr-table-search branch 2 times, most recently from 4c1ad51 to 141a9e1 Compare May 14, 2026 08:18
@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 15, 2026

fix conflicts

@carlh7777 carlh7777 force-pushed the feat/repo-pr-table-search branch from 141a9e1 to ed4c852 Compare May 15, 2026 21:57
@carlh7777
Copy link
Copy Markdown
Contributor Author

Hi @anderdc fixed conflicts

Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

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

Scope this down to the search feature, and tighten a few spots before merge.

Drop — unrelated to PR-table search:

  • The useMemo/useCallback wrapping of columns (RepositoryPRsTable.tsx:364), filterButtons (:315), and handleSort (:249) — columns content is unchanged, it's pure relocation/re-indent churn. The getRepoPrAuthor/getRepoPrGithubId module consts only exist to feed those memo deps; they go too.
  • The alpha(...)/TEXT_OPACITY'text.tertiary' swap in the empty-state message (RepositoryPRsTable.tsx:757) — unrelated theme cleanup.

Fix:

  • RepositoryPRsTable.tsx:198-212 — the pipeline hand-rolls the author filter (byStatus.filter((pr) => pr.author === authorFilter), :207), and again in prsForStatusTabCounts (:186). filterPrs already takes an author option — pass author: authorFilter === AUTHOR_FILTER_ALL ? null : authorFilter and drop both manual .filter calls.
  • RepositoryPRsTable.tsx:209-211 — committed and draft terms run as two separate filterPrsBySearchTerms passes. Collapse to one: filterPrsBySearchTerms(byAuthor, [...committedPrQRaw, draftSearch], true) — it already trims and skips empty terms.
  • RepositoryPRsTable.tsx:199 — filterPrs(allPRs ?? [], { statusFilter: filter, searchQuery: '', includeNumber: true }): allPRs is always an array, and with searchQuery: '' the function returns before includeNumber is read. Reduce to filterPrs(allPRs, { statusFilter: filter }).
  • RepositoryPRsTable.tsx:68-74 — every member of REPO_PR_TABLE (bodyMaxHeight, titleCellMaxWidth, chipLabelMaxWidth, searchMaxWidthSm, scrollbarGutter) is referenced exactly once. Inline each value at its use site and drop the object. Keep chipLabelSx — that one is genuinely shared.
  • prTable.ts:70-76 — SCORE_OP_MAP is an identity map and the op === undefined branch in parsePrSearchQuery is unreachable: the regex capture (?:>=|<=|>|<|=) already constrains m[1] to those five operators. Drop the map; cast m[1] directly.

Minor: SCORE_TOKEN_RE (prTable.ts:78) is a /g regex used for a single .exec, which is why the manual lastIndex reset is needed — a non-global regex removes that footgun.

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 17, 2026

Fix conflicts.

@carlh7777 carlh7777 force-pushed the feat/repo-pr-table-search branch from ed4c852 to c36418d Compare May 17, 2026 14:30
@carlh7777
Copy link
Copy Markdown
Contributor Author

Hi @anderdc

Addressed all requested search-scope cleanup items, removed the unrelated memo/theme churn, simplified the filtering/search pipeline, inlined one-off table constants, cleaned up the score query parsing logic, and resolved the remaining merge conflicts.

@carlh7777 carlh7777 force-pushed the feat/repo-pr-table-search branch 2 times, most recently from bec286e to 49fa3cc Compare May 19, 2026 04:53
@carlh7777 carlh7777 force-pushed the feat/repo-pr-table-search branch from 49fa3cc to b045dd5 Compare May 19, 2026 05:05
@carlh7777
Copy link
Copy Markdown
Contributor Author

Hi @anderdc

rebased and resolved conflicts

image

Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

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

Scoping this down — the search box is worth having, but most of the diff is bolt-on the table doesn't need.

Keep:

  • A single-term, live search box — filters the PR table by title, repository, PR number, and merged date as you type. Local component state, no URL params.
  • The author-scoped status tab counts (All/Open/Merged/Closed badges narrowing to the selected author).

Drop:

  • Multi-term pinning — the Enter-to-pin behavior, the prQ URL params, and the "Active filters:" chip row.
  • The score > / >= / < query DSL — parsePrSearchQuery, ScorePredicate, matchesScorePredicate, matchesPrSearchTerm, filterPrsBySearchTerms, formatScorePredicateLabel, and the unused scoreMatch field.
  • The prStatus URL-param migration — leave the status filter on useSessionStoredState.
  • "Clear all" and the "N of M" header count — both only exist to service the pinning.
  • The relocation of handleSort and the if (isLoading) early-return — move them back, it's pure churn.

@carlh7777
Copy link
Copy Markdown
Contributor Author

Hi @anderdc

Scoped this down as requested and removed the extra search/filter complexity. Also resolved conflicts and cleaned up the remaining churn.

@anderdc anderdc merged commit 688365a into entrius:test May 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants