History

Normalize branch and model selection handling

- Deduplicate terminal IDs and favorite model slugs with trim-aware iteration - Use effect-based filtering for local branch and built-in model lists - Switch stable array handling to non-mutating `toSorted`

Julius Marminge committed 6 months ago

Commit 7793bd61 parent 7f03f4d8 files · +63 −23Browse files

Showing the changes to apps/mobile (1 of 8 files). Show all

Unified · Split

apps/mobile/src/features/threads/git/GitConfirmSheet.tsx+5−1
@@ -1,5 +1,7 @@
1import { resolveDefaultBranchActionDialogCopy } from "@t3tools/client-runtime";1import { resolveDefaultBranchActionDialogCopy } from "@t3tools/client-runtime";
2import { resolveAutoFeatureBranchName } from "@t3tools/shared/git";2import { resolveAutoFeatureBranchName } from "@t3tools/shared/git";
3import * as Arr from "effect/Array";
4import * as Result from "effect/Result";
3import { useLocalSearchParams, useRouter } from "expo-router";5import { useLocalSearchParams, useRouter } from "expo-router";
4import { useCallback, useMemo } from "react";6import { useCallback, useMemo } from "react";
5import { View } from "react-native";7import { View } from "react-native";
@@ -74,7 +76,9 @@ export function GitConfirmSheet() { · 68 unmodified lines
74 ? gitState.selectedThreadBranches76 ? gitState.selectedThreadBranches
75 : await gitActions.refreshSelectedThreadBranches();77 : await gitActions.refreshSelectedThreadBranches();
76 const newBranchName = resolveAutoFeatureBranchName(78 const newBranchName = resolveAutoFeatureBranchName(
77 branches.filter((branch) => !branch.isRemote).map((branch) => branch.name),79 Arr.filterMap(branches, (branch) =>
80 branch.isRemote ? Result.failVoid : Result.succeed(branch.name),
81 ),
78 );82 );
79 await gitActions.onCreateSelectedThreadBranch(newBranchName);83 await gitActions.onCreateSelectedThreadBranch(newBranchName);
80 await gitActions.onRunSelectedThreadGitAction({ action: confirmAction });84 await gitActions.onRunSelectedThreadGitAction({ action: confirmAction });