Skip to content

Commit 1ee5c3d

Browse files
committed
fix(mobile): show all project environments in new-task environment picker
The picker filtered environments to hosts of the selected repository, so a draft seeded on the offline laptop hid the connected instabox which does not share that repo. List every environment that reports a project instead.
1 parent 9c0fb54 commit 1ee5c3d

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

‎apps/mobile/src/features/threads/new-task-flow-provider.tsx‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
CommandId,
1717
DEFAULT_PROVIDER_INTERACTION_MODE,
1818
MessageId,
19-
repositoryGroupingKeyOf,
2019
ThreadId,
2120
} from "@t3tools/contracts";
2221
import { threadContextsOutsideEnvironment } from "@t3tools/shared/composerContextReferences";
@@ -789,12 +788,6 @@ export function NewTaskFlowProvider(
789788
) !== null,
790789
);
791790

792-
const selectedRepositoryKey = selectedProject?.repositoryIdentity
793-
? repositoryGroupingKeyOf(selectedProject.repositoryIdentity)
794-
: null;
795-
// Use || null: placeholder workspaceRoot can be empty, and an empty basename rejects real hosts.
796-
const selectedWorkspaceBasename = selectedProject?.workspaceRoot.split("/").at(-1) || null;
797-
const selectedProjectTitle = selectedProject?.title ?? null;
798791
const environments = (() => {
799792
if (isScratchDraft) {
800793
return scratchEnvironments.map((environment) => ({
@@ -807,25 +800,7 @@ export function NewTaskFlowProvider(
807800
readonly environmentId: EnvironmentId;
808801
readonly environmentLabel: string;
809802
}> = [];
810-
const hostsSelectedRepository = (project: EnvironmentProject) => {
811-
if (selectedRepositoryKey === null && selectedWorkspaceBasename === null) {
812-
return true;
813-
}
814-
const projectKey = project.repositoryIdentity
815-
? repositoryGroupingKeyOf(project.repositoryIdentity)
816-
: null;
817-
if (selectedRepositoryKey !== null && projectKey !== null) {
818-
return projectKey === selectedRepositoryKey;
819-
}
820-
return (
821-
project.workspaceRoot.split("/").at(-1) === selectedWorkspaceBasename ||
822-
(selectedProjectTitle !== null && project.title === selectedProjectTitle)
823-
);
824-
};
825803
for (const project of projects) {
826-
if (!hostsSelectedRepository(project)) {
827-
continue;
828-
}
829804
if (seen.has(project.environmentId)) {
830805
continue;
831806
}

0 commit comments

Comments
 (0)