fix(mobile): hold Tasks paging while a new filter loads

This commit is contained in:
Kelvin Amoaba
2026-11-11 07:22:52 +00:00
parent 8ac9c5940e
commit 23f3fe445e
3 changed files with 8 additions and 3 deletions
@@ -48,6 +48,7 @@ export function useMobileTasksTaskPaginationActions(model: TaskListLoadingModel)
loadGenerationRef,
loadLinearContext,
loadTasks,
loading,
revalidating,
selectedHostedRepos,
setError,
@@ -150,9 +151,10 @@ export function useMobileTasksTaskPaginationActions(model: TaskListLoadingModel)
!githubCountedTotalPages &&
(provenPageLimit === null || githubPages.length < provenPageLimit) &&
hasRepoWithFullPage(githubPages.at(-1) ?? [], githubPerRepoLimit)
// A filter's kept pages stand in while it re-reads; paging from them would mix old and new rows.
// Pages kept or left from another filter stand in while a list loads; paging from them would mix old and new rows.
const githubCanShowPagination =
!revalidating &&
!loading &&
(githubTotalPages > 1 || (githubPages.length > 0 && githubCanLoadUncountedNextPage))
const githubPagePickerPages = useMemo(() => {
const visible = new Set<number>()
@@ -181,6 +183,7 @@ export function useMobileTasksTaskPaginationActions(model: TaskListLoadingModel)
targetPage < 0 ||
githubPaginationLoading ||
revalidating ||
loading ||
selectedHostedRepos.length === 0
) {
return
@@ -267,6 +270,7 @@ export function useMobileTasksTaskPaginationActions(model: TaskListLoadingModel)
githubPages,
githubPaginationLoading,
loadGenerationRef,
loading,
revalidating,
selectedHostedRepos,
setGithubCountedTotalPages,
+2 -2
View File
@@ -135,8 +135,8 @@ export function useTaskListCache(view: TaskListView) {
)
}, [hostId, queryClient])
// A read of a list starts on that filter's kept rows, else on its own rows still shown, else the spinner, so another
// filter's rows never sit under a new search; it is also the list this provider opens on next launch.
// A read of a list starts on that filter's kept rows, else on its own rows still shown, else the spinner, so a new
// search never starts on another filter's rows; it is also the list this provider opens on next launch.
const begin = useCallback(
(params: HostQueryParams | null, provider: string): void => {
cancelRead()
@@ -191,6 +191,7 @@ export function taskListMountAdapters(
loadGenerationRef: { current: 0 },
loadLinearContext: async () => {},
loadTasks: async () => {},
loading: false,
revalidating: false,
selectedHostedRepos: [HOSTED_REPO],
taskUiReady: true,