Skip to content

feat(ui): add inline search to issues, activity, and PR views#189

Merged
mpiton merged 3 commits intomainfrom
feat/issue-177-inline-search
Apr 9, 2026
Merged

feat(ui): add inline search to issues, activity, and PR views#189
mpiton merged 3 commits intomainfrom
feat/issue-177-inline-search

Conversation

@mpiton
Copy link
Copy Markdown
Owner

@mpiton mpiton commented Apr 9, 2026

Summary

  • add inline text filters to Issues, Activity, and My PRs list views
  • compose text filtering with the existing state/type filters and visible navigation state
  • add targeted tests for title/repo/label/author matching and combined filtering behavior

Validation

  • npx vitest run src/components/Issues/Issues.test.tsx src/components/ActivityFeed/ActivityFeed.test.tsx src/components/MyPRs/MyPRs.test.tsx
  • npm run lint
  • npm run build

Closes #177


Summary by cubic

Add inline search to Issues, Activity, and My PRs so users can filter by title, author, repo (org/repo), message, and labels. Search composes with existing filters, updates navigation and counts, and scrolls the Issues and My PRs lists to the top on change; closes #177.

  • New Features
    • Issues: search title, author, repo full name, and labels; works with Open/Closed; nav and counts reflect filtered items; scrolls to top on search.
    • My PRs: search title, author, repo full name, and labels; works with Open/Merged; nav reflects filtered items; scrolls to top on search/tab change.
    • Activity: search actor, repo full name, and message; composes with the type filter; looks up repo names via @tanstack/react-query + listRepos.
    • Tests: added unit tests for field matching, repo name lookup, and combined filters.

Written for commit b30399b. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Added client-side search inputs to Activity feed, Issues, and My PRs (searches title/author/repo/labels/actor/message).
    • UI counts, navigation, and visible lists reflect filtered results.
    • Lists now auto-scroll to top when switching tabs or changing a search query.
  • Tests

    • New tests covering search and filter interactions across Activity feed, Issues, and My PRs.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3a48717b-486f-453b-af32-760fc5165859

📥 Commits

Reviewing files that changed from the base of the PR and between cf827bd and b30399b.

📒 Files selected for processing (4)
  • src/components/ActivityFeed/ActivityFeed.test.tsx
  • src/components/ActivityFeed/ActivityFeed.tsx
  • src/components/MyPRs/MyPRs.test.tsx
  • src/components/MyPRs/MyPRs.tsx
✅ Files skipped from review due to trivial changes (1)
  • src/components/ActivityFeed/ActivityFeed.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/MyPRs/MyPRs.tsx

📝 Walkthrough

Walkthrough

Adds inline search inputs and client-side filtering to ActivityFeed, Issues, and MyPRs. Each component normalizes a search query and matches it against relevant fields (actor/repo/message for Activity; title/author/repo/labels for Issues and MyPRs). Components that need repo names call useQuery(listRepos) to build a repo id → fullName map. Tests updated/added to exercise multi-field search and interactions with existing tab/type filters.

Changes

Cohort / File(s) Summary
ActivityFeed Search
src/components/ActivityFeed/ActivityFeed.tsx, src/components/ActivityFeed/ActivityFeed.test.tsx
Adds searchQuery state, normalizes queries, fetches repos via useQuery(listRepos) to build repoMap, and further filters activities by actor / repo fullName / message. Renders a type="search" input; tests mock useQuery and assert message/repo/actor search and interaction with type filters.
Issues Search
src/components/Issues/Issues.tsx, src/components/Issues/Issues.test.tsx
Adds searchQuery and normalizedQuery, re-runs scroll-to-top effect on query change, filters issues by title/author/resolved repo name/labels, adjusts visible counts and navigation registration to reflect filtered results, and adds a type="search" input. Tests drive successive searches and assert filtered visibility.
MyPRs Search & repo resolution
src/components/MyPRs/MyPRs.tsx, src/components/MyPRs/MyPRs.test.tsx
Introduces searchQuery/normalizedQuery, computes matchingPrs by title/author/labels/repo fullName (via useQuery(listRepos)repoMap), updates visible lists/counts/navigation to reflect filtered PRs, scroll-to-top on tab/query changes, and adds search input. Tests mock repos and validate multi-field filtering across tabs.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐇 I hop through lines and nibble each name,
A query in paw, I play the search game.
Repo, author, message — I sniff them all true,
I pull out the match and bring it to you.
✨ Hoppy finds and tiny code cheers! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat(ui): add inline search to issues, activity, and PR views' directly and concisely summarizes the main change across all modified files.
Linked Issues check ✅ Passed All coding requirements from issue #177 are met: search inputs added to Issues, Activity, and MyPRs; search matches specified fields (title, author, repo, labels); filters compose with existing controls; navigation reflects filtered results; lists scroll on filter change.
Out of Scope Changes check ✅ Passed All changes are in-scope: modifications to ActivityFeed, Issues, and MyPRs components and their tests align with issue #177; no unrelated changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/issue-177-inline-search

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 9, 2026

Greptile Summary

This PR adds inline text search to the Issues, ActivityFeed, and MyPRs list views. Each component adds a controlled <input type="search">, resolves repoId → fullName via a shared useQuery(["repos"]) + repoMap pattern, and composes the text filter with existing state/type filters. The count shown in SectionHead and the keyboard-navigation items both update to reflect the filtered set.

Confidence Score: 5/5

Safe to merge — all three components implement the search pattern consistently and the previously flagged repoId/UUID issue in MyPRs is now correctly fixed.

No P0 or P1 findings remain. The repo-map resolution pattern is correctly applied in all three components, tests are well-targeted and use realistic fixtures, and the scroll-reset and nav-item update behaviors work as intended.

No files require special attention.

Vulnerabilities

No security concerns identified. Search filtering is purely client-side string matching; no user input is rendered as HTML or passed to backend queries.

Important Files Changed

Filename Overview
src/components/Issues/Issues.tsx Adds search input, repo-map resolution, and scroll-reset useEffect; implementation is consistent and correct.
src/components/MyPRs/MyPRs.tsx Adds search input with correct repoId → fullName resolution via repoMap; fixes the UUID-vs-full-name issue flagged in a prior review.
src/components/ActivityFeed/ActivityFeed.tsx Adds search input filtering by actor, repo full name, and message; composes correctly with the existing type/mention filter.
src/components/Issues/Issues.test.tsx Adds targeted tests for title, author, repo-name, and label filtering; virtualizer and useQuery are properly mocked.
src/components/MyPRs/MyPRs.test.tsx Tests now use repoId: "repo-2" with a matching mock repo, correctly validating the full-name resolution path.
src/components/ActivityFeed/ActivityFeed.test.tsx Adds tests for actor/repo/message search and combined type+text filtering; useQuery mock correctly wired up in beforeEach.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Input: items + searchQuery + tab/filter] --> B[normalizedQuery = trim + lowercase]
    B --> C{normalizedQuery empty?}
    C -- yes --> D[matchingItems = all items]
    C -- no --> E[Resolve repoId via repoMap]
    E --> F["Match any of: title, author, repoFullName, labels/message"]
    F --> D
    D --> G[Apply state/type filter\nopen/closed/merged or type/mention]
    G --> H[visible items]
    H --> I[Render list + update SectionHead count + navItems]
    H --> J[useEffect: scroll to top on query or tab change]
Loading

Reviews (3): Last reviewed commit: "fix: address PR review comments" | Re-trigger Greptile

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/components/Issues/Issues.test.tsx">

<violation number="1" location="src/components/Issues/Issues.test.tsx:130">
P2: This test does not verify that non-matching issues are excluded for the author/repo/label filter cases, so it can pass despite incorrect filtering behavior.</violation>
</file>

<file name="src/components/MyPRs/MyPRs.tsx">

<violation number="1" location="src/components/MyPRs/MyPRs.tsx:54">
P2: Use repository full name for search matching instead of raw `repoId`; filtering on internal IDs prevents repo slug/name queries from finding PRs when IDs are UUIDs.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/components/MyPRs/MyPRs.test.tsx (1)

116-155: Cover the merged-tab composition path too.

This test only exercises text filtering on the default open tab. If the tab === "merged" path regresses, the suite still passes because search and state filtering are never asserted together here.

🧪 Small addition to cover the missing path
     await user.clear(input);
     await user.type(input, "ux");
     expect(screen.getByText("Refine search interaction")).toBeInTheDocument();
     expect(screen.queryByText("Open PR one")).not.toBeInTheDocument();
+
+    await user.clear(input);
+    await user.type(input, "merged");
+    await user.click(screen.getByRole("button", { name: /merged/i }));
+    expect(screen.getByText("Merged PR one")).toBeInTheDocument();
+    expect(screen.queryByText("Refine search interaction")).not.toBeInTheDocument();
   });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/MyPRs/MyPRs.test.tsx` around lines 116 - 155, Add a test
variation that exercises the "merged" tab path in MyPRs: render MyPRs with the
tab prop set to "merged" (e.g., render(<MyPRs prs={[openPr1, labeledPr,
mergedPr1]} tab="merged" onOpen={onOpen} />)), ensure mockUseQuery still returns
repos, then drive the same text-filter interactions against the placeholder
input and assert that only merged PRs matching the query (like "Refine search
interaction" / author "alice" / repo "console" / label "ux") are present while
non-merged results (e.g., "Open PR one") are not; this ensures the composition
where tab === "merged" is covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/MyPRs/MyPRs.tsx`:
- Around line 47-71: The list does not reset scroll when filters change
(searchQuery or tab), so add a ref to the scrolling container (e.g., listRef)
and a useEffect that runs when searchQuery and tab (or matchingPrs) change and
sets listRef.current.scrollTop = 0 (or calls scrollTo({ top: 0 })) to scroll the
results back to the top; locate the UI list that renders visible and attach the
ref, then create the effect near where searchQuery/visible/tab are defined to
ensure the view resets on filter changes.

---

Nitpick comments:
In `@src/components/MyPRs/MyPRs.test.tsx`:
- Around line 116-155: Add a test variation that exercises the "merged" tab path
in MyPRs: render MyPRs with the tab prop set to "merged" (e.g., render(<MyPRs
prs={[openPr1, labeledPr, mergedPr1]} tab="merged" onOpen={onOpen} />)), ensure
mockUseQuery still returns repos, then drive the same text-filter interactions
against the placeholder input and assert that only merged PRs matching the query
(like "Refine search interaction" / author "alice" / repo "console" / label
"ux") are present while non-merged results (e.g., "Open PR one") are not; this
ensures the composition where tab === "merged" is covered.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 68b5d76d-884f-4259-86d1-2383013a8cc8

📥 Commits

Reviewing files that changed from the base of the PR and between 2cd1270 and cf827bd.

📒 Files selected for processing (3)
  • src/components/Issues/Issues.test.tsx
  • src/components/MyPRs/MyPRs.test.tsx
  • src/components/MyPRs/MyPRs.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/Issues/Issues.test.tsx

@mpiton mpiton merged commit 6987e80 into main Apr 9, 2026
6 of 7 checks passed
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.

feat(ui): add inline search/filter to Issues, Activity, and PR list views

1 participant