| author | |
| committer | |
| log | aca3c87cdbfb59ea5ed52fe2df82df508d57eb31 |
| tree | 0036342451623717e188d8bab838bbc26aa9e531 |
| parent | eafb4a9340bd2c2271b7c8fac7eddd55beea3972 |
| signature | Signed by PGP key B5690EEEBB952194 |
6 files changed, 10 insertions(+), 42 deletions(-)
apps/mobile/src/features/home/HomeScreen.tsx+3-3| ... | ... | @@ -924,9 +924,9 @@ export function HomeScreen(props: HomeScreenProps) { |
| 924 | 924 | : "flex-1 bg-screen" |
| 925 | 925 | } |
| 926 | 926 | > |
| 927 | {/* Same recycler the iPad sidebar and the legacy list use: cells are | |
| 928 | reused across data rebuilds and `itemsAreEqual` keeps a minute tick | |
| 929 | (or an unrelated shell update) from re-rendering untouched rows. */} | |
| 927 | {/* Shared with the iPad sidebar: cells are reused across data | |
| 928 | rebuilds and `itemsAreEqual` keeps a minute tick (or an unrelated | |
| 929 | shell update) from re-rendering untouched rows. */} | |
| 930 | 930 | <SwipeableScrollGateProvider enabled={swipeEnabled}> |
| 931 | 931 | <LegendList |
| 932 | 932 | data={threadListV2Items} |
apps/mobile/src/features/home/home-list-options.ts+2-15| ... | ... | @@ -1,12 +1,5 @@ |
| 1 | import type { | |
| 2 | EnvironmentId, | |
| 3 | SidebarProjectGroupingMode, | |
| 4 | SidebarThreadSortOrder, | |
| 5 | } from "@t3tools/contracts"; | |
| 6 | import { | |
| 7 | DEFAULT_SIDEBAR_PROJECT_SORT_ORDER, | |
| 8 | DEFAULT_SIDEBAR_THREAD_SORT_ORDER, | |
| 9 | } from "@t3tools/contracts"; | |
| 1 | import type { EnvironmentId, SidebarProjectGroupingMode } from "@t3tools/contracts"; | |
| 2 | import { DEFAULT_SIDEBAR_PROJECT_SORT_ORDER } from "@t3tools/contracts"; | |
| 10 | 3 | import { |
| 11 | 4 | createContext, |
| 12 | 5 | createElement, |
| ... | ... | @@ -24,7 +17,6 @@ import type { HomeProjectSortOrder } from "./homeThreadList"; |
| 24 | 17 | export interface HomeListOptions { |
| 25 | 18 | readonly selectedEnvironmentId: EnvironmentId | null; |
| 26 | 19 | readonly projectSortOrder: HomeProjectSortOrder; |
| 27 | readonly threadSortOrder: SidebarThreadSortOrder; | |
| 28 | 20 | } |
| 29 | 21 | |
| 30 | 22 | export interface ResolvedHomeListOptions extends HomeListOptions { |
| ... | ... | @@ -38,7 +30,6 @@ function defaultHomeListOptions(): HomeListOptions { |
| 38 | 30 | DEFAULT_SIDEBAR_PROJECT_SORT_ORDER === "manual" |
| 39 | 31 | ? "updated_at" |
| 40 | 32 | : DEFAULT_SIDEBAR_PROJECT_SORT_ORDER, |
| 41 | threadSortOrder: DEFAULT_SIDEBAR_THREAD_SORT_ORDER, | |
| 42 | 33 | }; |
| 43 | 34 | } |
| 44 | 35 | |
| ... | ... | @@ -90,13 +81,9 @@ export function useHomeListOptions(availableEnvironmentIds: ReadonlySet<Environm |
| 90 | 81 | const setProjectSortOrder = useCallback((value: HomeProjectSortOrder) => { |
| 91 | 82 | setOptions((current) => ({ ...current, projectSortOrder: value })); |
| 92 | 83 | }, []); |
| 93 | const setThreadSortOrder = useCallback((value: SidebarThreadSortOrder) => { | |
| 94 | setOptions((current) => ({ ...current, threadSortOrder: value })); | |
| 95 | }, []); | |
| 96 | 84 | return { |
| 97 | 85 | options: resolvedOptions, |
| 98 | 86 | setSelectedEnvironmentId, |
| 99 | 87 | setProjectSortOrder, |
| 100 | setThreadSortOrder, | |
| 101 | 88 | } as const; |
| 102 | 89 | } |
apps/mobile/src/features/home/homeThreadList.test.ts-3| ... | ... | @@ -2,7 +2,6 @@ import type { |
| 2 | 2 | EnvironmentProject, |
| 3 | 3 | EnvironmentThreadShell, |
| 4 | 4 | } from "@t3tools/client-runtime/state/shell"; |
| 5 | import { threadSearchMatchKey } from "@t3tools/client-runtime/state/thread-search"; | |
| 6 | 5 | import { EnvironmentId, ProjectId, ProviderInstanceId, ThreadId } from "@t3tools/contracts"; |
| 7 | 6 | import { describe, expect, it } from "vite-plus/test"; |
| 8 | 7 | |
| ... | ... | @@ -48,8 +47,6 @@ function makeThread( |
| 48 | 47 | }; |
| 49 | 48 | } |
| 50 | 49 | |
| 51 | const NOW = Date.parse("2026-06-29T00:00:00.000Z"); | |
| 52 | ||
| 53 | 50 | describe("home project scopes", () => { |
| 54 | 51 | it("builds one v2 scope for the same repository across environments", () => { |
| 55 | 52 | const localEnvironmentId = EnvironmentId.make("environment-local"); |
apps/mobile/src/features/home/homeThreadList.ts+2-19| ... | ... | @@ -1,31 +1,22 @@ |
| 1 | import { threadPullRequestSearchTerms } from "@t3tools/shared/threadPullRequests"; | |
| 2 | import { | |
| 3 | buildProjectGroups, | |
| 4 | derivePhysicalProjectKey, | |
| 5 | deriveProjectGroupLabel, | |
| 6 | } from "@t3tools/client-runtime/state/project-grouping"; | |
| 1 | import { buildProjectGroups } from "@t3tools/client-runtime/state/project-grouping"; | |
| 7 | 2 | import type { |
| 8 | 3 | EnvironmentProject, |
| 9 | 4 | EnvironmentThreadShell, |
| 10 | 5 | } from "@t3tools/client-runtime/state/shell"; |
| 11 | 6 | import { |
| 12 | 7 | getThreadSortTimestamp, |
| 13 | sortThreads, | |
| 14 | 8 | toSortableTimestamp, |
| 15 | 9 | } from "@t3tools/client-runtime/state/thread-sort"; |
| 16 | import { threadSearchMatchKey } from "@t3tools/client-runtime/state/thread-search"; | |
| 17 | 10 | import type { |
| 18 | 11 | EnvironmentId, |
| 19 | 12 | ScopedProjectRef, |
| 20 | 13 | SidebarProjectGroupingMode, |
| 21 | 14 | SidebarProjectSortOrder, |
| 22 | SidebarThreadSortOrder, | |
| 23 | 15 | } from "@t3tools/contracts"; |
| 24 | 16 | import * as Arr from "effect/Array"; |
| 25 | import * as Option from "effect/Option"; | |
| 26 | 17 | import * as Order from "effect/Order"; |
| 27 | 18 | |
| 28 | import { scopedProjectKey, scopedThreadKey } from "../../lib/scopedEntities"; | |
| 19 | import { scopedProjectKey } from "../../lib/scopedEntities"; | |
| 29 | 20 | import type { PendingNewTask } from "../../state/use-pending-new-tasks"; |
| 30 | 21 | |
| 31 | 22 | export type HomeProjectSortOrder = Exclude<SidebarProjectSortOrder, "manual">; |
| ... | ... | @@ -133,11 +124,3 @@ export function sortHomeProjectScopes(input: { |
| 133 | 124 | ), |
| 134 | 125 | ); |
| 135 | 126 | } |
| 136 | ||
| 137 | /** | |
| 138 | * Default home view only surfaces threads active within this window, to keep the | |
| 139 | * screen compact while keeping recent work visible. | |
| 140 | */ | |
| 141 | const RECENT_THREAD_WINDOW_MS = 5 * 24 * 60 * 60 * 1000; | |
| 142 | /** Fallback when a project has no threads inside the recency window. */ | |
| 143 | const RECENT_THREAD_FALLBACK_COUNT = 3; |
apps/mobile/src/features/threads/threadListV2.test.ts-1| ... | ... | @@ -5,7 +5,6 @@ import { |
| 5 | 5 | threadOrderAfterMove, |
| 6 | 6 | threadDropLifecycle, |
| 7 | 7 | reconcilePendingThreadOrder, |
| 8 | computeThreadMoveAvailability, | |
| 9 | 8 | type PendingThreadOrder, |
| 10 | 9 | type ThreadMoveAvailability, |
| 11 | 10 | } from "./threadOrder"; |
packages/contracts/src/settings.ts+3-1| ... | ... | @@ -58,7 +58,9 @@ export const DEFAULT_SIDEBAR_PROJECT_SORT_ORDER: SidebarProjectSortOrder = "upda |
| 58 | 58 | |
| 59 | 59 | export const SidebarThreadSortOrder = Schema.Literals(["updated_at", "created_at"]); |
| 60 | 60 | export type SidebarThreadSortOrder = typeof SidebarThreadSortOrder.Type; |
| 61 | export const DEFAULT_SIDEBAR_THREAD_SORT_ORDER: SidebarThreadSortOrder = "updated_at"; | |
| 61 | // Not exported: mobile was the last consumer of the value itself; the | |
| 62 | // wire field keeps its decoding default below. | |
| 63 | const DEFAULT_SIDEBAR_THREAD_SORT_ORDER: SidebarThreadSortOrder = "updated_at"; | |
| 62 | 64 | |
| 63 | 65 | export const SidebarProjectGroupingMode = Schema.Literals([ |
| 64 | 66 | "repository", |