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