Skip to content

Commit aca3c87

Browse files
chore(mobile): clear the legacy-list deletion fallout (#13203)
1 parent eafb4a9 commit aca3c87

6 files changed

Lines changed: 10 additions & 42 deletions

File tree

‎apps/mobile/src/features/home/HomeScreen.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -924,9 +924,9 @@ export function HomeScreen(props: HomeScreenProps) {
924924
: "flex-1 bg-screen"
925925
}
926926
>
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. */}
930930
<SwipeableScrollGateProvider enabled={swipeEnabled}>
931931
<LegendList
932932
data={threadListV2Items}

‎apps/mobile/src/features/home/home-list-options.ts‎

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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";
103
import {
114
createContext,
125
createElement,
@@ -24,7 +17,6 @@ import type { HomeProjectSortOrder } from "./homeThreadList";
2417
export interface HomeListOptions {
2518
readonly selectedEnvironmentId: EnvironmentId | null;
2619
readonly projectSortOrder: HomeProjectSortOrder;
27-
readonly threadSortOrder: SidebarThreadSortOrder;
2820
}
2921

3022
export interface ResolvedHomeListOptions extends HomeListOptions {
@@ -38,7 +30,6 @@ function defaultHomeListOptions(): HomeListOptions {
3830
DEFAULT_SIDEBAR_PROJECT_SORT_ORDER === "manual"
3931
? "updated_at"
4032
: DEFAULT_SIDEBAR_PROJECT_SORT_ORDER,
41-
threadSortOrder: DEFAULT_SIDEBAR_THREAD_SORT_ORDER,
4233
};
4334
}
4435

@@ -90,13 +81,9 @@ export function useHomeListOptions(availableEnvironmentIds: ReadonlySet<Environm
9081
const setProjectSortOrder = useCallback((value: HomeProjectSortOrder) => {
9182
setOptions((current) => ({ ...current, projectSortOrder: value }));
9283
}, []);
93-
const setThreadSortOrder = useCallback((value: SidebarThreadSortOrder) => {
94-
setOptions((current) => ({ ...current, threadSortOrder: value }));
95-
}, []);
9684
return {
9785
options: resolvedOptions,
9886
setSelectedEnvironmentId,
9987
setProjectSortOrder,
100-
setThreadSortOrder,
10188
} as const;
10289
}

‎apps/mobile/src/features/home/homeThreadList.test.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type {
22
EnvironmentProject,
33
EnvironmentThreadShell,
44
} from "@t3tools/client-runtime/state/shell";
5-
import { threadSearchMatchKey } from "@t3tools/client-runtime/state/thread-search";
65
import { EnvironmentId, ProjectId, ProviderInstanceId, ThreadId } from "@t3tools/contracts";
76
import { describe, expect, it } from "vite-plus/test";
87

@@ -48,8 +47,6 @@ function makeThread(
4847
};
4948
}
5049

51-
const NOW = Date.parse("2026-06-29T00:00:00.000Z");
52-
5350
describe("home project scopes", () => {
5451
it("builds one v2 scope for the same repository across environments", () => {
5552
const localEnvironmentId = EnvironmentId.make("environment-local");

‎apps/mobile/src/features/home/homeThreadList.ts‎

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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";
72
import type {
83
EnvironmentProject,
94
EnvironmentThreadShell,
105
} from "@t3tools/client-runtime/state/shell";
116
import {
127
getThreadSortTimestamp,
13-
sortThreads,
148
toSortableTimestamp,
159
} from "@t3tools/client-runtime/state/thread-sort";
16-
import { threadSearchMatchKey } from "@t3tools/client-runtime/state/thread-search";
1710
import type {
1811
EnvironmentId,
1912
ScopedProjectRef,
2013
SidebarProjectGroupingMode,
2114
SidebarProjectSortOrder,
22-
SidebarThreadSortOrder,
2315
} from "@t3tools/contracts";
2416
import * as Arr from "effect/Array";
25-
import * as Option from "effect/Option";
2617
import * as Order from "effect/Order";
2718

28-
import { scopedProjectKey, scopedThreadKey } from "../../lib/scopedEntities";
19+
import { scopedProjectKey } from "../../lib/scopedEntities";
2920
import type { PendingNewTask } from "../../state/use-pending-new-tasks";
3021

3122
export type HomeProjectSortOrder = Exclude<SidebarProjectSortOrder, "manual">;
@@ -133,11 +124,3 @@ export function sortHomeProjectScopes(input: {
133124
),
134125
);
135126
}
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‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
threadOrderAfterMove,
66
threadDropLifecycle,
77
reconcilePendingThreadOrder,
8-
computeThreadMoveAvailability,
98
type PendingThreadOrder,
109
type ThreadMoveAvailability,
1110
} from "./threadOrder";

‎packages/contracts/src/settings.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ export const DEFAULT_SIDEBAR_PROJECT_SORT_ORDER: SidebarProjectSortOrder = "upda
5858

5959
export const SidebarThreadSortOrder = Schema.Literals(["updated_at", "created_at"]);
6060
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";
6264

6365
export const SidebarProjectGroupingMode = Schema.Literals([
6466
"repository",

0 commit comments

Comments
 (0)