mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
fix(mobile): hold Tasks paging while a new filter loads
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user