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/web/src/components/ChatView.tsx (1 of 8 files). Show all

Unified · Split

apps/web/src/components/ChatView.tsx+3−2
@@ -194,6 +194,7 @@ import { · 193 unmodified lines
194 isVersionMismatchDismissed,194 isVersionMismatchDismissed,
195 resolveServerConfigVersionMismatch,195 resolveServerConfigVersionMismatch,
196} from "../versionSkew";196} from "../versionSkew";
197import { equals } from "effect/Equal";
197 198
198const IMAGE_ONLY_BOOTSTRAP_PROMPT =199const IMAGE_ONLY_BOOTSTRAP_PROMPT =
199 "[User attached one or more images without additional text. Respond using the conversation context and the attached image(s).]";200 "[User attached one or more images without additional text. Respond using the conversation context and the attached image(s).]";
@@ -438,8 +439,8 @@ function terminalIdListsEqual(left: readonly string[], right: readonly string[]) · 238 unmodified lines
438 if (left.length === 0) {439 if (left.length === 0) {
439 return true;440 return true;
440 }441 }
441 const sortedLeft = [...left].sort((a, b) => a.localeCompare(b));442 const sortedLeft = left.toSorted((a, b) => a.localeCompare(b));
442 const sortedRight = [...right].sort((a, b) => a.localeCompare(b));443 const sortedRight = right.toSorted((a, b) => a.localeCompare(b));
443 for (let index = 0; index < sortedLeft.length; index += 1) {444 for (let index = 0; index < sortedLeft.length; index += 1) {
444 if (sortedLeft[index] !== sortedRight[index]) {445 if (sortedLeft[index] !== sortedRight[index]) {
445 return false;446 return false;