feat(webui): add temporary chat mode
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
Archive,
|
||||
Brain,
|
||||
CalendarClock,
|
||||
MessageCircleDashed,
|
||||
Menu,
|
||||
Search,
|
||||
Settings,
|
||||
@@ -34,7 +35,9 @@ interface SidebarProps {
|
||||
activeKey: string | null;
|
||||
loading: boolean;
|
||||
newChatActive: boolean;
|
||||
temporaryChatActive: boolean;
|
||||
onNewChat: () => void;
|
||||
onOpenTemporaryChat: () => void;
|
||||
onSelect: (key: string) => void;
|
||||
onRequestDelete: (key: string, label: string) => void;
|
||||
onTogglePin: (key: string) => void;
|
||||
@@ -95,8 +98,10 @@ export function Sidebar(props: SidebarProps) {
|
||||
const toggleLabel = t("thread.header.toggleSidebar");
|
||||
const newChatShortcut = newChatShortcutLabel();
|
||||
const activeActionRef = useRef<HTMLButtonElement>(null);
|
||||
const activeActionId = props.newChatActive
|
||||
? "new-chat"
|
||||
const activeActionId = props.temporaryChatActive
|
||||
? "temporary-chat"
|
||||
: props.newChatActive
|
||||
? "new-chat"
|
||||
: props.activeUtility
|
||||
? `utility:${props.activeUtility}`
|
||||
: null;
|
||||
@@ -170,6 +175,14 @@ export function Sidebar(props: SidebarProps) {
|
||||
shortcut={newChatShortcut}
|
||||
ariaKeyShortcuts="Meta+Shift+O Control+Shift+O"
|
||||
/>
|
||||
<SidebarActionButton
|
||||
collapsed={collapsed}
|
||||
label={t("temporaryChat.title")}
|
||||
onClick={props.onOpenTemporaryChat}
|
||||
active={props.temporaryChatActive}
|
||||
selectionRef={activeActionRef}
|
||||
icon={<MessageCircleDashed className="h-4 w-4" />}
|
||||
/>
|
||||
<SidebarActionButton
|
||||
collapsed={collapsed}
|
||||
label={t("sidebar.searchAria")}
|
||||
|
||||
Reference in New Issue
Block a user