feat(explorer): add "My Issues only" filter to Issues tab#144
feat(explorer): add "My Issues only" filter to Issues tab#144blinkeye-lcm wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a "My Issues only" toggle: client filter state and UI, ChangesMy Issues Filter Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
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 unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: lockfile failed supply-chain policy check. Run Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/api/repos/`[owner]/[name]/issues/route.ts:
- Around line 132-135: The query logic allows state='mine' with a missing/empty
mineLogin, which results in no author or state filter and returns unintended
results; update both places that check state === 'mine' (the block that builds
where/args using mineLogin and the stateOnlyWhere clause) to defensively handle
a missing mineLogin by adding a short-circuit that forces an empty result (e.g.,
push '1 = 0' into where/stateOnlyWhere when state === 'mine' && !mineLogin) so
the API returns no rows instead of all issues; ensure you update the same logic
where the author filter is added (the place that pushes 'LOWER(i.author_login) =
?' and args.push(mineLogin.toLowerCase())) and the separate stateOnlyWhere path
to use the same defensive check.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 0d4567c3-9516-473d-a0e9-88c03b553038
📒 Files selected for processing (6)
src/app/api/repos/[owner]/[name]/issues-meta/route.tssrc/app/api/repos/[owner]/[name]/issues/route.tssrc/components/RepoExplorer.tsxsrc/components/repo-explorer/useIssueFilters.tssrc/lib/api-types.tssrc/types/entities.ts
Summary
Adds a "My Issues only" toggle to the Issues tab of the Explorer page, matching the existing "My PRs only" toggle on the Pull Requests tab. When enabled, the listing narrows to issues authored by the signed-in user, and a small badge shows the total count.
Implementation mirrors the PR side end to end:
useIssueFiltersgains amineOnlystate, andIssueStateaccepts'mine'./api/repos/:owner/:name/issuesreadsmine_loginand appliesLOWER(author_login) = ?whenstate=mine. ETag version bumped so stale clients refetch./api/repos/:owner/:name/issues-metareturnsmine_countwhenmine_loginis provided. ETag version bumped.RepoExplorerrenders the toggle next to the author filter, derivesissuesState = issueMineOnly ? 'mine' : issueState, and resets pagination on toggle change.IssuesMetaResponse(in bothtypes/entities.tsandlib/api-types.ts) gains the optionalmine_countfield.Related Issues
Closes #143
Screenshot
Type of Change
Testing
pnpm buildpassesVerified behavior:
issues-meta.Checklist
Summary by CodeRabbit
New Features
Bug Fixes