History

refactor(mobile): keep project selection helper private (#9999)

Julius Marminge committed 2 months ago

Commit 1e24b431 parent ac93fbf2 files · +1 −14Browse files

Unified · Split

2 files
  1. apps/mobile/src/features/threads/new-task-project-selection.test.ts +0 −13
  2. apps/mobile/src/features/threads/new-task-project-selection.ts +1 −1
apps/mobile/src/features/threads/new-task-project-selection.test.ts+0−13
@@ -4,7 +4,6 @@ import { describe, expect, it } from "vite-plus/test"; · 3 unmodified lines
44 import type { EnvironmentProject } from "@t3tools/client-runtime/state/shell";
55 import type { HomeProjectScope } from "../home/homeThreadList";
66 import {
7− getOnlySelectableProject,
87 getProjectScopeSelectionTarget,
98 resolveDraftProjectSelection,
109 } from "./new-task-project-selection";
@@ -36,18 +35,6 @@ function makeScope(projects: ReadonlyArray<EnvironmentProject>): HomeProjectScop · 25 unmodified lines
3635 };
3736 }
3837
39−describe("getOnlySelectableProject", () => {
40− it("auto-selects when there is exactly one physical project", () => {
41− const project = makeProject("t3code");
42− expect(getOnlySelectableProject([makeScope([project])])).toBe(project);
43− });
44−
45− it("selects the representative when one logical project has multiple workspaces", () => {
46− const projects = [makeProject("t3code"), makeProject("t3code-2"), makeProject("t3code-3")];
47− expect(getOnlySelectableProject([makeScope(projects)])).toBe(projects[0]);
48− });
49−});
50−
5138 describe("getProjectScopeSelectionTarget", () => {
5239 it("keeps the current environment when it hosts the selected logical project", () => {
5340 const projects = [makeProject("t3code-mac", "mac"), makeProject("t3code-server", "server")];
apps/mobile/src/features/threads/new-task-project-selection.ts+1−1
@@ -19,7 +19,7 @@ export function getProjectScopeSelectionTarget( · 18 unmodified lines
1919 );
2020 }
2121
22−export function getOnlySelectableProject(
22+function getOnlySelectableProject(
2323 projectScopes: ReadonlyArray<HomeProjectScope>,
2424 ): EnvironmentProject | null {
2525 const onlyScope = projectScopes.length === 1 ? projectScopes[0] : null;