Skip to content

fix(mobile): page GitHub tasks by number and drop pages from an old selection - #30140

Merged
AmoabaKelvin merged 4 commits into
mainfrom
mobile-tasks-github-paging
Oct 19, 2026
Merged

AmoabaKelvin merged 4 commits into
mainfrom
mobile-tasks-github-paging

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​165 $\color{#cf222e}{\Huge{\mathbf{−}}}$​24 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​141
Prod 29 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​997 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1042 $\color{#cf222e}{\Huge{\mathbf{−}}}$​45

ELI5

In mobile Tasks, GitHub's "next page" showed page 1 again. A page that finished loading after you changed the repo or filter also replaced the new list. Both are fixed, using the desktop task page's paging code.

What Changed

  • Before: mobile asked for the next page with a before date cursor. Hosts stopped reading it in fix(issues): replace cursor-based pagination with page-number Search API #8680 (July), so every page request returned page 1. Mobile also sized pages and counted totals differently from desktop, and merged rows by last update while the host pages by issue number. And the page handler never checked whether the list had reloaded while its request was in flight.
  • After: mobile asks for page: N as desktop does, splits the 100-row display budget across repos, counts pages per repo the way desktop does, and merges rows by issue number. A page request remembers which list load it belongs to. If the list reloaded since (new repo, filter, provider or refresh), the result is dropped.
  • Desktop's pure paging helpers (taskPageToGitHubApiPage, getTaskPagePerRepoLimit, the page-count math and GITHUB_SEARCH_RESULT_WINDOW) move from renderer files to src/shared/work-items.ts, unchanged. Mobile's copy of the shared work-item constants (mobile-work-items.ts) is gone; its comment said Metro couldn't import src/shared, which is no longer true.
  • Recordings: tk-provider-load and its matrix goldens re-recorded. The request now sends page: 1 instead of before: undefined, and the count settles to 1 page instead of 4 items. With no undefined parameter left, six goldens moved out of the bridge's params-undefined class, so the pins and baseline counts are updated.

Why

Desktop already pages by number, and #8680 removed the cursor from the host on purpose, so mobile follows desktop rather than bringing the cursor back. Sharing the helpers keeps the page size and count identical on both.

Things to know:

  • The mobile GitHub list is now ordered by issue number, like desktop, instead of by last update. Otherwise rows would move between pages.
  • Hosts older than v1.4.144 ignore page, so they still return page 1 for every page. Desktop has the same limit with those hosts.
  • Desktop's handling of an empty page and of GitHub's 1,000-result search limit (resolveEmptyPageOutcome) isn't ported. Mobile's page count stops at that limit, and an empty page leaves you where you are.

Linked Issue

Fixes #29067, together with #30142 (items 1, 3 and 4).

Visual Proof

N/A. The page controls look the same. What changes is which rows a page holds, and that a page from an old selection no longer appears.

Testing

  • use-mobile-tasks-task-pagination-actions.test.tsx: asks for the target page by number, and drops a page that lands after the list reloaded. Both fail on main.
  • src/shared/work-items.test.ts covers the moved helpers; desktop's existing paging tests still pass against the shared copies.
  • The RPC recording suite and bridge parity pass with the updated goldens and pins.

Not tried against a live GitHub repo on a device.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

SSH and remote hosts get the same requests over the same RPC. page is an existing optional parameter of github.listWorkItems, so there's no wire change. Nothing is platform-specific.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b4bde703-5638-41c4-becd-3f70cae1ee5f
📥 Commits

Reviewing files that changed from the base of the PR and between c889d63 and 5cc9a07.

📒 Files selected for processing: 1
  • mobile/src/tasks/use-mobile-tasks-task-pagination-actions.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

GitHub task loading and pagination now use numbered API pages and shared per-repository limits. Mobile state stores counted total pages, and page requests reject stale results when the client or load generation changes. Shared pagination helpers are also used by renderer code and aggregate counting. RPC golden recordings, pagination tests, and parity expectations are updated.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 5cc9a

Paging remains available when one selected repository has more results than another. No actionable merge-blocking issue remains after normal checks.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Linked Issues check Warning Directly linked open issue [#29067] defines four coding requirements. The PR implements the stale GitHub task-page guard in handleGitHubPageChange, and the added test verifies that stale results are… Implement and test the remaining [#29067] fixes, or change the direct issue linkage so that this PR is assessed only against an issue whose coding scope contains task pagination.
Docstring Coverage Warning Docstring coverage is 21.05% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 24 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: mobile GitHub tasks now use numbered pages and avoid displaying pages from an old selection.
Description check Passed The description covers the required sections, including the user impact, technical changes, rationale, linked issue, visual proof, testing, compatibility notes, and checklist. It also clearly states t…
Out of Scope Changes check Passed The numbered GitHub paging, per-repository limits, page counting, issue-number ordering, shared helper extraction, stale-result test, and updated recordings support the task-pagination requirement in …
Full details: Description check

Explanation

The description covers the required sections, including the user impact, technical changes, rationale, linked issue, visual proof, testing, compatibility notes, and checklist. It also clearly states that live device testing was not performed.

Full details: Out of Scope Changes check

Explanation

The numbered GitHub paging, per-repository limits, page counting, issue-number ordering, shared helper extraction, stale-result test, and updated recordings support the task-pagination requirement in [#29067]. No unrelated production change is demonstrated by the reviewed changes.

Full details: Linked Issues check

Explanation

Directly linked open issue [#29067] defines four coding requirements. The PR implements the stale GitHub task-page guard in handleGitHubPageChange, and the added test verifies that stale results are dropped after a list reload. The reviewed changes also implement numbered paging and shared helpers that support this fix. The reviewed changes do not implement the three other [#29067] requirements: preserving typed text during AI commit-message generation, reporting failed custom shortcut deletion, and adding the listed accessibility names, state, and hit targets.

Resolution

Implement and test the remaining [#29067] fixes, or change the direct issue linkage so that this PR is assessed only against an issue whose coding scope contains task pagination.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 785bcb42-004b-4c4f-819f-2245a80f3cea
📥 Commits

Reviewing files that changed from the base of the PR and between ce2d608 and 80b237d.

📒 Files selected for processing: 35
  • mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.countworkitems-1.json
  • mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.listworkitems-1.json
  • mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.listteams-1.json
  • mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.status-1.json
  • mobile/rpc-foundation/goldens/matrix-tasks.provider-load-settings.update-1.json
  • mobile/rpc-foundation/goldens/tk-provider-load.json
  • mobile/rpc-foundation/pilot-scenarios.json
  • mobile/src/tasks/mobile-tasks-dependencies.ts
  • mobile/src/tasks/mobile-tasks-provider-item-list.tsx
  • mobile/src/tasks/mobile-work-items.ts
  • mobile/src/tasks/smart-source-fan-out.ts
  • mobile/src/tasks/smart-source-search-requests.ts
  • mobile/src/tasks/use-mobile-tasks-client-settings-actions.tsx
  • mobile/src/tasks/use-mobile-tasks-provider-load-actions.tsx
  • mobile/src/tasks/use-mobile-tasks-route-and-item-state.tsx
  • mobile/src/tasks/use-mobile-tasks-server-repos.test.tsx
  • mobile/src/tasks/use-mobile-tasks-task-list-loading.tsx
  • mobile/src/tasks/use-mobile-tasks-task-pagination-actions.test.tsx
  • mobile/src/tasks/use-mobile-tasks-task-pagination-actions.tsx
  • mobile/src/test-support/bridged-parity/c2-page-closure.ts
  • mobile/src/test-support/bridged-parity/c2-task-source-closure-families.ts
  • mobile/src/test-support/bridged-parity/divergence-classes.test.ts
  • mobile/src/test-support/bridged-parity/divergence-classes.ts
  • mobile/src/test-support/rpc-recording/adapters/task-list-mount-adapters.ts
  • mobile/src/test-support/rpc-recording/rpc-recording-through-bridge.test.ts
  • src/renderer/src/components/task-page-github-landing-refresh-run.tsx
  • src/renderer/src/components/task-page-github-quiet-refresh-run.tsx
  • src/renderer/src/components/task-page-work-item-pagination.test.ts
  • src/renderer/src/components/task-page-work-item-pagination.ts
  • src/renderer/src/components/use-task-page-github-list-state.ts
  • src/renderer/src/components/use-task-page-github-search-pagination.ts
  • src/renderer/src/store/github/cache-policy.ts
  • src/renderer/src/store/github/work-item-aggregate-actions.ts
  • src/shared/work-items.test.ts
  • src/shared/work-items.ts
💤 Files with no reviewable changes: 4
  • mobile/src/tasks/mobile-work-items.ts
  • src/renderer/src/store/github/cache-policy.ts
  • src/renderer/src/components/task-page-work-item-pagination.test.ts
  • src/renderer/src/components/task-page-work-item-pagination.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-tasks-github-paging branch from 80b237d to c889d63 Compare October 18, 2026 02:35
Mobile needs the same page numbering, page size and page count as the
desktop task page.
Hosts stopped reading the `before` cursor in #8680, so every "next page"
returned page 1 again. A page that lands after the repo, filter or
provider changed no longer replaces the new list.
Without a count, Next only appeared when every repo returned a full page,
so one quiet repo blocked paging in the default all-repos view.
@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-tasks-github-paging branch from c889d63 to 5cc9a07 Compare October 18, 2026 20:30
@AmoabaKelvin
AmoabaKelvin merged commit d4dfcf2 into main Oct 19, 2026
34 checks passed
@AmoabaKelvin
AmoabaKelvin deleted the mobile-tasks-github-paging branch October 19, 2026 00:23
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.

[Bug]: Mobile: AI commit message overwrites typing, stale GitHub task pages, and unlabeled icon buttons

1 participant