wip(desktop): progress

This commit is contained in:
Adam 2025-12-10 17:30:53 -06:00
parent 89d51ad596
commit 56540f8312
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
2 changed files with 9 additions and 9 deletions

View file

@ -621,6 +621,12 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
</div>
)}
</List>
<Button variant="ghost" class="w-full justify-start">
<div class="flex items-center gap-2">
<Icon name="plus-small" />
<div class="text-text-strong">View all providers</div>
</div>
</Button>
</div>
</div>
</div>

View file

@ -48,9 +48,10 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext(
open: undefined as undefined | "provider" | "model",
},
})
const usedColors = new Set<string>()
function pickAvailableColor() {
const available = PASTEL_COLORS.filter((c) => !colors().has(c))
const available = PASTEL_COLORS.filter((c) => !usedColors.has(c))
if (available.length === 0) return PASTEL_COLORS[Math.floor(Math.random() * PASTEL_COLORS.length)]
return available[Math.floor(Math.random() * available.length)]
}
@ -69,6 +70,7 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext(
function colorize(project: Project & { expanded: boolean }) {
if (project.icon?.color) return project
const color = pickAvailableColor()
usedColors.add(color)
project.icon = { ...project.icon, color }
globalSdk.client.project.update({ projectID: project.id, icon: { color } })
return project
@ -76,14 +78,6 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext(
const enriched = createMemo(() => store.projects.flatMap(enrich))
const list = createMemo(() => enriched().flatMap(colorize))
const colors = createMemo(
() =>
new Set(
list()
.map((p) => p.icon?.color)
.filter(Boolean),
),
)
async function loadProjectSessions(directory: string) {
const [, setStore] = globalSync.child(directory)