Skip to content

feat(tasks): server-side scope filtering, pagination, and draft bug fix - #1135

Merged
Jinwoo-H merged 2 commits into
mainfrom
Jinwoo-H/gh-issues-improve
Apr 26, 2026
Merged

Jinwoo-H merged 2 commits into
mainfrom
Jinwoo-H/gh-issues-improve

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Apr 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Server-side scope filtering: Preset queries now include is:issue/is:pr qualifiers so the GitHub API returns only the relevant type, eliminating lossy client-side filtering where filtered views could miss items
  • Draft bug fix: Fixed --draft flag regression where is:pr is:open (the "PRs" preset) silently filtered to drafts-only, showing only 2 of 39 open PRs
  • Pagination: Added GitHub-style pagination bar with ellipsis pattern (Previous 1 2 ... 116 117 Next), powered by total_count from GitHub's search API. Cursor-based page loading via updated:<DATE qualifier
  • Dual-limit architecture: Separated PER_REPO_FETCH_LIMIT (36, per-repo API budget) from CROSS_REPO_DISPLAY_LIMIT (100, UI display cap), centralized in shared/work-items.ts

Changes

  • src/shared/work-items.ts — New shared constants file
  • src/shared/task-query.ts — Added draft: boolean field to ParsedTaskQuery
  • src/main/github/client.ts — Fixed --draft condition, added countWorkItems via search API, added before cursor support
  • src/main/ipc/github.ts + src/preload/ — IPC wiring for countWorkItems and before param
  • src/renderer/src/components/TaskPage.tsx — Pagination bar with ellipsis, pages state, total count fetch
  • src/renderer/src/store/slices/github.ts — fetchWorkItemsNextPage, countWorkItemsAcrossRepos, dual-limit support
  • src/renderer/src/store/slices/ui.ts + lib/new-workspace.ts — Updated presets with scope qualifiers

Test plan

  • Select "PRs" preset → should show all open PRs (not just drafts)
  • Select "Issues" preset → should show only issues, using full fetch budget
  • Search is:draft → should show only draft PRs
  • Pagination bar shows correct total pages with ellipsis for large result sets
  • Clicking an unloaded page number shows spinner only on that page button
  • Previous/Next navigation works correctly at boundaries
  • Cross-repo mode: items merge correctly with display limit of 100
  • Refresh button forces fresh fetch (not served from cache)

Made with Orca 🐋

- Add `is:issue`/`is:pr` qualifiers to preset queries so the GitHub API
  returns only the relevant type, eliminating lossy client-side filtering
- Introduce dual-limit architecture: PER_REPO_FETCH_LIMIT (36) per repo,
  CROSS_REPO_DISPLAY_LIMIT (100) for the merged UI view
- Fix --draft flag regression: only pass `--draft` when user explicitly
  searches `is:draft`, not for any `is:pr is:open` query
- Add cursor-based pagination via `updated:<DATE` search qualifier
- Add GitHub-style pagination bar with ellipsis (Previous 1 2 ... N Next)
- Precompute total page count via GitHub search API `total_count`
- Centralize constants in shared/work-items.ts, replace hardcoded 36s

Co-authored-by: Orca <help@stably.ai>
@github-actions github-actions Bot added the size/m Medium PR (≤600 added lines, ≤25 files) label Apr 26, 2026
Add aria-label, aria-current="page", and nav landmark to the
pagination bar. Only disable non-target page buttons during loading
so the active target remains clickable for screen readers.

Co-authored-by: Orca <help@stably.ai>
@Jinwoo-H
Jinwoo-H merged commit 7720ed1 into main Apr 26, 2026
3 checks passed
@Jinwoo-H
Jinwoo-H deleted the Jinwoo-H/gh-issues-improve branch April 26, 2026 19:31
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m Medium PR (≤600 added lines, ≤25 files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant