chore(mobile): clear the legacy-list deletion fallout (#13203)
This commit is contained in:
1 parent
eafb4a9340
commit
aca3c87cdb
6 files changed
+10
-42
No files matched your search
@@ -924,9 +924,9 @@ export function HomeScreen(props: HomeScreenProps) {
|
||||
: "flex-1 bg-screen"
|
||||
}
|
||||
>
|
||||
{/* Same recycler the iPad sidebar and the legacy list use: cells are
|
||||
reused across data rebuilds and `itemsAreEqual` keeps a minute tick
|
||||
(or an unrelated shell update) from re-rendering untouched rows. */}
|
||||
{/* Shared with the iPad sidebar: cells are reused across data
|
||||
rebuilds and `itemsAreEqual` keeps a minute tick (or an unrelated
|
||||
shell update) from re-rendering untouched rows. */}
|
||||
<SwipeableScrollGateProvider enabled={swipeEnabled}>
|
||||
<LegendList
|
||||
data={threadListV2Items}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
import type {
|
||||
EnvironmentId,
|
||||
SidebarProjectGroupingMode,
|
||||
SidebarThreadSortOrder,
|
||||
} from "@t3tools/contracts";
|
||||
import {
|
||||
DEFAULT_SIDEBAR_PROJECT_SORT_ORDER,
|
||||
DEFAULT_SIDEBAR_THREAD_SORT_ORDER,
|
||||
} from "@t3tools/contracts";
|
||||
import type { EnvironmentId, SidebarProjectGroupingMode } from "@t3tools/contracts";
|
||||
import { DEFAULT_SIDEBAR_PROJECT_SORT_ORDER } from "@t3tools/contracts";
|
||||
import {
|
||||
createContext,
|
||||
createElement,
|
||||
@@ -24,7 +17,6 @@ import type { HomeProjectSortOrder } from "./homeThreadList";
|
||||
export interface HomeListOptions {
|
||||
readonly selectedEnvironmentId: EnvironmentId | null;
|
||||
readonly projectSortOrder: HomeProjectSortOrder;
|
||||
readonly threadSortOrder: SidebarThreadSortOrder;
|
||||
}
|
||||
|
||||
export interface ResolvedHomeListOptions extends HomeListOptions {
|
||||
@@ -38,7 +30,6 @@ function defaultHomeListOptions(): HomeListOptions {
|
||||
DEFAULT_SIDEBAR_PROJECT_SORT_ORDER === "manual"
|
||||
? "updated_at"
|
||||
: DEFAULT_SIDEBAR_PROJECT_SORT_ORDER,
|
||||
threadSortOrder: DEFAULT_SIDEBAR_THREAD_SORT_ORDER,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -90,13 +81,9 @@ export function useHomeListOptions(availableEnvironmentIds: ReadonlySet<Environm
|
||||
const setProjectSortOrder = useCallback((value: HomeProjectSortOrder) => {
|
||||
setOptions((current) => ({ ...current, projectSortOrder: value }));
|
||||
}, []);
|
||||
const setThreadSortOrder = useCallback((value: SidebarThreadSortOrder) => {
|
||||
setOptions((current) => ({ ...current, threadSortOrder: value }));
|
||||
}, []);
|
||||
return {
|
||||
options: resolvedOptions,
|
||||
setSelectedEnvironmentId,
|
||||
setProjectSortOrder,
|
||||
setThreadSortOrder,
|
||||
} as const;
|
||||
}
|
||||
@@ -2,7 +2,6 @@ import type {
|
||||
EnvironmentProject,
|
||||
EnvironmentThreadShell,
|
||||
} from "@t3tools/client-runtime/state/shell";
|
||||
import { threadSearchMatchKey } from "@t3tools/client-runtime/state/thread-search";
|
||||
import { EnvironmentId, ProjectId, ProviderInstanceId, ThreadId } from "@t3tools/contracts";
|
||||
import { describe, expect, it } from "vite-plus/test";
|
||||
|
||||
@@ -48,8 +47,6 @@ function makeThread(
|
||||
};
|
||||
}
|
||||
|
||||
const NOW = Date.parse("2026-06-29T00:00:00.000Z");
|
||||
|
||||
describe("home project scopes", () => {
|
||||
it("builds one v2 scope for the same repository across environments", () => {
|
||||
const localEnvironmentId = EnvironmentId.make("environment-local");
|
||||
|
||||
@@ -1,31 +1,22 @@
|
||||
import { threadPullRequestSearchTerms } from "@t3tools/shared/threadPullRequests";
|
||||
import {
|
||||
buildProjectGroups,
|
||||
derivePhysicalProjectKey,
|
||||
deriveProjectGroupLabel,
|
||||
} from "@t3tools/client-runtime/state/project-grouping";
|
||||
import { buildProjectGroups } from "@t3tools/client-runtime/state/project-grouping";
|
||||
import type {
|
||||
EnvironmentProject,
|
||||
EnvironmentThreadShell,
|
||||
} from "@t3tools/client-runtime/state/shell";
|
||||
import {
|
||||
getThreadSortTimestamp,
|
||||
sortThreads,
|
||||
toSortableTimestamp,
|
||||
} from "@t3tools/client-runtime/state/thread-sort";
|
||||
import { threadSearchMatchKey } from "@t3tools/client-runtime/state/thread-search";
|
||||
import type {
|
||||
EnvironmentId,
|
||||
ScopedProjectRef,
|
||||
SidebarProjectGroupingMode,
|
||||
SidebarProjectSortOrder,
|
||||
SidebarThreadSortOrder,
|
||||
} from "@t3tools/contracts";
|
||||
import * as Arr from "effect/Array";
|
||||
import * as Option from "effect/Option";
|
||||
import * as Order from "effect/Order";
|
||||
|
||||
import { scopedProjectKey, scopedThreadKey } from "../../lib/scopedEntities";
|
||||
import { scopedProjectKey } from "../../lib/scopedEntities";
|
||||
import type { PendingNewTask } from "../../state/use-pending-new-tasks";
|
||||
|
||||
export type HomeProjectSortOrder = Exclude<SidebarProjectSortOrder, "manual">;
|
||||
@@ -133,11 +124,3 @@ export function sortHomeProjectScopes(input: {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Default home view only surfaces threads active within this window, to keep the
|
||||
* screen compact while keeping recent work visible.
|
||||
*/
|
||||
const RECENT_THREAD_WINDOW_MS = 5 * 24 * 60 * 60 * 1000;
|
||||
/** Fallback when a project has no threads inside the recency window. */
|
||||
const RECENT_THREAD_FALLBACK_COUNT = 3;
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
threadOrderAfterMove,
|
||||
threadDropLifecycle,
|
||||
reconcilePendingThreadOrder,
|
||||
computeThreadMoveAvailability,
|
||||
type PendingThreadOrder,
|
||||
type ThreadMoveAvailability,
|
||||
} from "./threadOrder";
|
||||
|
||||
@@ -58,7 +58,9 @@ export const DEFAULT_SIDEBAR_PROJECT_SORT_ORDER: SidebarProjectSortOrder = "upda
|
||||
|
||||
export const SidebarThreadSortOrder = Schema.Literals(["updated_at", "created_at"]);
|
||||
export type SidebarThreadSortOrder = typeof SidebarThreadSortOrder.Type;
|
||||
export const DEFAULT_SIDEBAR_THREAD_SORT_ORDER: SidebarThreadSortOrder = "updated_at";
|
||||
// Not exported: mobile was the last consumer of the value itself; the
|
||||
// wire field keeps its decoding default below.
|
||||
const DEFAULT_SIDEBAR_THREAD_SORT_ORDER: SidebarThreadSortOrder = "updated_at";
|
||||
|
||||
export const SidebarProjectGroupingMode = Schema.Literals([
|
||||
"repository",
|
||||
|
||||
Reference in new issue
Block a user