Restore workspace status display
This commit is contained in:
@@ -422,13 +422,17 @@ async function cancelLatestRun(sessionId: string, runId?: string | null) {
|
||||
const ChatTopActions: FC = () => {
|
||||
const { openFiles } = useActivityPanel();
|
||||
const [workspaceOpen, setWorkspaceOpen] = useState(false);
|
||||
const normalizedSessionId = useCurrentThreadSessionId({
|
||||
const actionSessionId = useCurrentThreadSessionId({
|
||||
includePending: true,
|
||||
// 工作区切换必须绑定当前可见会话;空白新会话不能回退到上一个
|
||||
// activeSessionId,否则会把 Jupyter 工作区切到旧会话上。
|
||||
includeActive: false,
|
||||
});
|
||||
const workspaceStatus = useJupyterWorkspaceStatus(normalizedSessionId);
|
||||
const displaySessionId = useCurrentThreadSessionId({
|
||||
includePending: true,
|
||||
includeActive: true,
|
||||
});
|
||||
const workspaceStatus = useJupyterWorkspaceStatus(displaySessionId);
|
||||
|
||||
return (
|
||||
<div className="pointer-events-none sticky top-3 z-20 mr-4 flex justify-end">
|
||||
@@ -455,7 +459,7 @@ const ChatTopActions: FC = () => {
|
||||
type="button"
|
||||
className="flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors hover:bg-muted"
|
||||
onClick={() => {
|
||||
openFiles(normalizedSessionId);
|
||||
openFiles(displaySessionId);
|
||||
}}
|
||||
>
|
||||
<FileTextIcon className="size-4 text-muted-foreground" />
|
||||
@@ -475,7 +479,7 @@ const ChatTopActions: FC = () => {
|
||||
<WorkspaceSwitchDialog
|
||||
open={workspaceOpen}
|
||||
onOpenChange={setWorkspaceOpen}
|
||||
sessionId={normalizedSessionId}
|
||||
sessionId={actionSessionId}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
@@ -852,7 +856,7 @@ const Composer: FC = () => {
|
||||
const replayedRun = useReplayedRunState();
|
||||
const workspaceSessionId = useCurrentThreadSessionId({
|
||||
includePending: true,
|
||||
includeActive: false,
|
||||
includeActive: true,
|
||||
});
|
||||
return (
|
||||
<ComposerPrimitive.Root className="aui-composer-root relative flex w-full flex-col">
|
||||
|
||||
Reference in New Issue
Block a user