feat(tui): add categorical theme hues (#37985)

This commit is contained in:
James Long 2026-07-20 15:28:53 -04:00 committed by GitHub
commit 79d0077f63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 202 additions and 91 deletions

View file

@ -41,10 +41,7 @@ export function parseModel(model: string) {
}
}
export function recentModels(
model: ModelPreferenceModel,
recent: ModelPreferenceModel[],
) {
export function recentModels(model: ModelPreferenceModel, recent: ModelPreferenceModel[]) {
const seen = new Set<string>()
return [model, ...recent]
.filter((item) => {
@ -94,17 +91,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
})
const colors = createMemo(() => {
const step = mode() === "light" ? 800 : 200
return dedupeWith(
[
themeV2.hue.blue(step),
themeV2.hue.purple(step),
themeV2.hue.green(step),
themeV2.hue.orange(step),
themeV2.hue.red(step),
themeV2.hue.cyan(step),
],
(first, second) => first.equals(second),
)
return dedupeWith(themeV2.categorical(step), (first, second) => first.equals(second))
})
return {
list() {