feat(ui): add inline search to issues, activity, and PR views#189
feat(ui): add inline search to issues, activity, and PR views#189
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds 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 Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR adds inline text search to the Issues, ActivityFeed, and MyPRs list views. Each component adds a controlled Confidence Score: 5/5Safe 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.
|
| 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]
Reviews (3): Last reviewed commit: "fix: address PR review comments" | Re-trigger Greptile
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
src/components/Issues/Issues.test.tsxsrc/components/MyPRs/MyPRs.test.tsxsrc/components/MyPRs/MyPRs.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/Issues/Issues.test.tsx
Summary
Validation
npx vitest run src/components/Issues/Issues.test.tsx src/components/ActivityFeed/ActivityFeed.test.tsx src/components/MyPRs/MyPRs.test.tsxnpm run lintnpm run buildCloses #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.
@tanstack/react-query+listRepos.Written for commit b30399b. Summary will update on new commits.
Summary by CodeRabbit
New Features
Tests