Repository navigation
fix(mobile): page GitHub tasks by number and drop pages from an old selection - #30140
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
785bcb42-004b-4c4f-819f-2245a80f3cea
📒 Files selected for processing: 35
mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.countworkitems-1.jsonmobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.listworkitems-1.jsonmobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.listteams-1.jsonmobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.status-1.jsonmobile/rpc-foundation/goldens/matrix-tasks.provider-load-settings.update-1.jsonmobile/rpc-foundation/goldens/tk-provider-load.jsonmobile/rpc-foundation/pilot-scenarios.jsonmobile/src/tasks/mobile-tasks-dependencies.tsmobile/src/tasks/mobile-tasks-provider-item-list.tsxmobile/src/tasks/mobile-work-items.tsmobile/src/tasks/smart-source-fan-out.tsmobile/src/tasks/smart-source-search-requests.tsmobile/src/tasks/use-mobile-tasks-client-settings-actions.tsxmobile/src/tasks/use-mobile-tasks-provider-load-actions.tsxmobile/src/tasks/use-mobile-tasks-route-and-item-state.tsxmobile/src/tasks/use-mobile-tasks-server-repos.test.tsxmobile/src/tasks/use-mobile-tasks-task-list-loading.tsxmobile/src/tasks/use-mobile-tasks-task-pagination-actions.test.tsxmobile/src/tasks/use-mobile-tasks-task-pagination-actions.tsxmobile/src/test-support/bridged-parity/c2-page-closure.tsmobile/src/test-support/bridged-parity/c2-task-source-closure-families.tsmobile/src/test-support/bridged-parity/divergence-classes.test.tsmobile/src/test-support/bridged-parity/divergence-classes.tsmobile/src/test-support/rpc-recording/adapters/task-list-mount-adapters.tsmobile/src/test-support/rpc-recording/rpc-recording-through-bridge.test.tssrc/renderer/src/components/task-page-github-landing-refresh-run.tsxsrc/renderer/src/components/task-page-github-quiet-refresh-run.tsxsrc/renderer/src/components/task-page-work-item-pagination.test.tssrc/renderer/src/components/task-page-work-item-pagination.tssrc/renderer/src/components/use-task-page-github-list-state.tssrc/renderer/src/components/use-task-page-github-search-pagination.tssrc/renderer/src/store/github/cache-policy.tssrc/renderer/src/store/github/work-item-aggregate-actions.tssrc/shared/work-items.test.tssrc/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.
80b237d to
c889d63
Compare
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.
c889d63 to
5cc9a07
Compare
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
beforedate 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.page: Nas 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.taskPageToGitHubApiPage,getTaskPagePerRepoLimit, the page-count math andGITHUB_SEARCH_RESULT_WINDOW) move from renderer files tosrc/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 importsrc/shared, which is no longer true.tk-provider-loadand its matrix goldens re-recorded. The request now sendspage: 1instead ofbefore: undefined, and the count settles to 1 page instead of 4 items. With no undefined parameter left, six goldens moved out of the bridge'sparams-undefinedclass, 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:
page, so they still return page 1 for every page. Desktop has the same limit with those hosts.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.tscovers the moved helpers; desktop's existing paging tests still pass against the shared copies.Not tried against a live GitHub repo on a device.
Agent skill upstream boundary
Notes
SSH and remote hosts get the same requests over the same RPC.
pageis an existing optional parameter ofgithub.listWorkItems, so there's no wire change. Nothing is platform-specific.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)