- 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`
Showing the changes to apps/web/src/components/ChatView.tsx (1 of 8 files). Show all
Unified · Split
| @@ -194,6 +194,7 @@ import { · 193 unmodified lines | ||
| 194 | 194 | isVersionMismatchDismissed, |
| 195 | 195 | resolveServerConfigVersionMismatch, |
| 196 | 196 | } from "../versionSkew"; |
| 197 | +import { equals } from "effect/Equal"; | |
| 197 | 198 | |
| 198 | 199 | const IMAGE_ONLY_BOOTSTRAP_PROMPT = |
| 199 | 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 | 439 | if (left.length === 0) { |
| 439 | 440 | return true; |
| 440 | 441 | } |
| 441 | − const sortedLeft = [...left].sort((a, b) => a.localeCompare(b)); | |
| 442 | − const sortedRight = [...right].sort((a, b) => a.localeCompare(b)); | |
| 442 | + const sortedLeft = left.toSorted((a, b) => a.localeCompare(b)); | |
| 443 | + const sortedRight = right.toSorted((a, b) => a.localeCompare(b)); | |
| 443 | 444 | for (let index = 0; index < sortedLeft.length; index += 1) { |
| 444 | 445 | if (sortedLeft[index] !== sortedRight[index]) { |
| 445 | 446 | return false; |