Compare commits

...

1 Commits

Author SHA1 Message Date
dayuan.jiang
d07217b747 fix: show all enabled panels on chat lobby instead of only templates 2026-04-10 13:25:56 +09:00

View File

@@ -107,8 +107,8 @@ export function ChatLobby({
currentInput = "", currentInput = "",
dict, dict,
}: ChatLobbyProps) { }: ChatLobbyProps) {
const [templatesExpanded, setTemplatesExpanded] = useState(false) const [templatesExpanded, setTemplatesExpanded] = useState(true)
const [examplesExpanded, setExamplesExpanded] = useState(false) const [examplesExpanded, setExamplesExpanded] = useState(true)
const [panelVisibility, setPanelVisibility] = useState(getPanelVisibility) const [panelVisibility, setPanelVisibility] = useState(getPanelVisibility)
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false) const [deleteDialogOpen, setDeleteDialogOpen] = useState(false)
const [sessionToDelete, setSessionToDelete] = useState<string | null>(null) const [sessionToDelete, setSessionToDelete] = useState<string | null>(null)
@@ -125,20 +125,26 @@ export function ChatLobby({
const hasHistory = sessions.length > 0 const hasHistory = sessions.length > 0
if (!hasHistory) { if (!hasHistory) {
if (panelVisibility.myTemplates) { if (!panelVisibility.myTemplates && !panelVisibility.quickExamples) {
return null
}
return ( return (
<div className="animate-fade-in">
{panelVisibility.myTemplates && (
<TemplatePanel <TemplatePanel
setInput={setInput} setInput={setInput}
onSendTemplate={onSendTemplate} onSendTemplate={onSendTemplate}
currentInput={currentInput} currentInput={currentInput}
/> />
)}
{panelVisibility.quickExamples && (
<div className={panelVisibility.myTemplates ? "mt-6" : ""}>
<ExamplePanel setInput={setInput} setFiles={setFiles} />
</div>
)}
</div>
) )
} }
if (panelVisibility.quickExamples) {
return <ExamplePanel setInput={setInput} setFiles={setFiles} />
}
return null
}
// Show history + collapsible examples when there are sessions // Show history + collapsible examples when there are sessions
return ( return (