History

Refactor collection handling for mobile remote connect

- Replace chained array transforms with explicit loops across mobile and server paths - Tighten provider, git, and orchestration parsing while preserving behavior - Improve remote-connect UI data shaping and thread activity filtering

Julius Marminge committed 6 months ago

Commit 90fea7b1 parent 7793bd654 files · +768 −546Browse files

Showing the changes to apps/server/src/sourceControl/SourceControlProviderRegistry.ts (1 of 54 files). Show all

Unified · Split

apps/server/src/sourceControl/SourceControlProviderRegistry.ts+11−12
@@ -92,18 +92,17 @@ function selectProviderContext( · 91 unmodified lines
92 readonly url: string;92 readonly url: string;
93 }>,93 }>,
94): SourceControlProvider.SourceControlProviderContext | null {94): SourceControlProvider.SourceControlProviderContext | null {
95 const candidates = remotes95 const candidates: Array<SourceControlProvider.SourceControlProviderContext> = [];
96 .map((remote) => {96 for (const remote of remotes) {
97 const provider = detectSourceControlProviderFromRemoteUrl(remote.url);97 const provider = detectSourceControlProviderFromRemoteUrl(remote.url);
98 return provider98 if (provider) {
99 ? {99 candidates.push({
100 provider,100 provider,
101 remoteName: remote.name,101 remoteName: remote.name,
102 remoteUrl: remote.url,102 remoteUrl: remote.url,
103 }103 });
104 : null;104 }
105 })105 }
106 .filter((value): value is SourceControlProvider.SourceControlProviderContext => value !== null);
107 106
108 return (107 return (
109 candidates.find((candidate) => candidate.remoteName === "origin") ??108 candidates.find((candidate) => candidate.remoteName === "origin") ??