mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
wip(desktop): progress
This commit is contained in:
parent
89d51ad596
commit
56540f8312
2 changed files with 9 additions and 9 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue