chore(frontend): fix corn task (#3)

This commit is contained in:
Haze
2026-02-07 01:28:38 +08:00
committed by GitHub
Unverified
parent fa6c23b82a
commit e6317cafd6
12 changed files with 530 additions and 4399 deletions

View File

@@ -35,20 +35,17 @@ export function ChatToolbar() {
'focus:outline-none focus:ring-2 focus:ring-ring',
)}
>
{/* Always show current session */}
<option value={currentSessionKey}>
{sessions.find((s) => s.key === currentSessionKey)?.displayName
|| sessions.find((s) => s.key === currentSessionKey)?.label
|| currentSessionKey}
</option>
{/* Other sessions */}
{sessions
.filter((s) => s.key !== currentSessionKey)
.map((s) => (
<option key={s.key} value={s.key}>
{s.displayName || s.label || s.key}
</option>
))}
{/* Render all sessions; if currentSessionKey is not in the list, add it */}
{!sessions.some((s) => s.key === currentSessionKey) && (
<option value={currentSessionKey}>
{currentSessionKey === 'main' ? 'main' : currentSessionKey}
</option>
)}
{sessions.map((s) => (
<option key={s.key} value={s.key}>
{s.displayName || s.label || s.key}
</option>
))}
</select>
<ChevronDown className="absolute right-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground pointer-events-none" />
</div>