Refactor session runtime persistence
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import type { ExportedMessageRepository } from "@assistant-ui/core";
|
||||
import { ThreadListPrimitive } from "@assistant-ui/react";
|
||||
import {
|
||||
BarChart3Icon,
|
||||
BotIcon,
|
||||
@@ -185,6 +184,7 @@ function CollapsedSidebarRail({
|
||||
onLogout: () => void;
|
||||
}) {
|
||||
const { setOpen } = useSidebar();
|
||||
const { clearSession } = useClawSessionReplay();
|
||||
|
||||
return (
|
||||
<div className="flex h-full w-full flex-col items-center border-r bg-sidebar py-3 text-sidebar-foreground">
|
||||
@@ -200,19 +200,17 @@ function CollapsedSidebarRail({
|
||||
</button>
|
||||
|
||||
<div className="flex flex-col items-center gap-3">
|
||||
<div
|
||||
onClickCapture={() => {
|
||||
<CollapsedIconButton
|
||||
label="新任务"
|
||||
onClick={() => {
|
||||
clearActiveSessionId();
|
||||
pushHomeUrl();
|
||||
clearSession();
|
||||
window.dispatchEvent(new Event("claw-active-session-cleared"));
|
||||
}}
|
||||
>
|
||||
<ThreadListPrimitive.New asChild>
|
||||
<CollapsedIconButton label="新任务">
|
||||
<SquarePenIcon className="size-4" />
|
||||
</CollapsedIconButton>
|
||||
</ThreadListPrimitive.New>
|
||||
</div>
|
||||
<SquarePenIcon className="size-4" />
|
||||
</CollapsedIconButton>
|
||||
<CollapsedSessionSearch />
|
||||
<CollapsedRecentSessions />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user