Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ describe("optimistic orchestrator topbar", () => {
expect(screen.getByRole("button", { name: "New task" })).toBeDisabled();
expect(screen.getByRole("button", { name: "Board" })).toBeDisabled();
expect(screen.queryByRole("button", { name: "Notifications" })).not.toBeInTheDocument();
expect(screen.getAllByTestId("workspace-topbar-actions")[0].querySelectorAll("button")).toHaveLength(5);
});
});

Expand Down
23 changes: 21 additions & 2 deletions frontend/src/renderer/components/SessionTopbarActions.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQueryClient } from "@tanstack/react-query";
import { useTranslation } from "react-i18next";
import { useNavigate, useParams } from "@tanstack/react-router";
import { LayoutDashboard, Plus } from "@/components/app-icons";
import { ChevronDown, Code2, LayoutDashboard, Play, Plus } from "@/components/app-icons";
import { useState, type ReactNode } from "react";
import { useProjectOrchestratorAction } from "../hooks/useProjectOrchestratorAction";
import { useOrchestratorReplyState } from "../stores/orchestrator-reply-store";
Expand Down Expand Up @@ -30,7 +30,7 @@ import { CoderWorkspaceTopbarButton } from "./CoderWorkspaceLinkButton";
import { useSessionMenuAvailable } from "../hooks/useAppMenuCommand";
import { useSessionShortcut } from "../hooks/useAppShortcut";
import { noDragStyle, PageTopbarActions } from "./PageTopbar";
import { Button } from "./ui/button";
import { Button, GHOST_PILL_CLASS } from "./ui/button";
import { TopbarActionError } from "./TopbarActionError";
import { SessionArchiveDialog, type SessionArchiveChoice } from "./SessionArchiveDialog";
import { TopbarOpenEditorButton } from "./TopbarOpenEditorButton";
Expand Down Expand Up @@ -154,6 +154,25 @@ export function SessionTopbarActions({
{sessionAction}
</div>
) : null}
{/* The session's own controls take their space while it starts, so the
cluster keeps its width and nothing slides when the session lands. */}
{startingOrchestrator ? (
<>
<div aria-hidden="true" className={`${GHOST_PILL_CLASS} inline-flex items-center gap-0 rounded-md before:hidden`} style={noDragStyle}>
<Button type="button" size="icon-sm" variant="quiet" className="before:hidden" aria-label={t("editor.chooseEditor")} disabled tabIndex={-1}>
<Code2 className="size-icon-md" aria-hidden="true" />
</Button>
<Button type="button" size="icon-sm" variant="quiet" className="before:hidden" aria-label={t("editor.openOptionsAria")} disabled tabIndex={-1}>
<ChevronDown className="size-icon-sm" aria-hidden="true" />
</Button>
</div>
<span className="inline-flex" style={noDragStyle}>
<Button type="button" size="icon-sm" variant="quiet" aria-label={t("cues.run")} data-priority="secondary" disabled tabIndex={-1}>
<Play className="size-icon-md" aria-hidden="true" />
</Button>
</span>
</>
) : null}
{/* Cloud sessions have no local workspace to hand off to an editor: the
local daemon has never heard of them, so querying it just surfaces
its 404 as a confusing "Unknown session" error (see workspace.ts's
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/renderer/components/chat/ChatWorkspace.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3077,6 +3077,15 @@ describe("ChatWorkspace timeline", () => {
await waitFor(() => expect(screen.queryByRole("list", { name: "Sample requests" })).not.toBeInTheDocument());
});

it("keeps the sample requests on screen while the orchestrator starts, without filling the composer", async () => {
const user = userEvent.setup();
render(<ChatWorkspace snapshot={chatFixtureEmpty} newWorkDisabled />);

const prompts = within(screen.getByRole("list", { name: "Sample requests" })).getAllByRole("button");
await user.click(prompts[0]);
expect(screen.getByLabelText("Message the agent")).not.toHaveTextContent("Review my recent changes for bugs");
});

it("offers sample artifact requests to artifact sessions outside Scratchpad too", () => {
render(<ChatWorkspace snapshot={chatFixtureEmpty} session={{ ...chatSession, requestedOutput: "artifact" }} />);

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/renderer/components/chat/ChatWorkspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2157,9 +2157,9 @@ function ChatWorkspaceContent({
</h1>
) : null}
<WelcomePromptSuggestions
open={conversationEmpty && composerEmpty && (!newWorkDisabled || pendingInPlaceStart)}
open={conversationEmpty && composerEmpty}
artifact={artifactSession}
onPick={(text) => { if (!pendingInPlaceStart) composerFocusRef.current?.setDraft(text); }}
onPick={(text) => { if (!newWorkDisabled) composerFocusRef.current?.setDraft(text); }}
/>
<div ref={composerBoxRef} className="relative z-10" data-composer-tray={conversationEmpty && composerTray ? "" : undefined}>
{welcomeLeaving ? (
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/renderer/routes/_shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -737,17 +737,19 @@ const replacementErrorCount = Object.keys(orchestratorReplacementErrors).length;
);
// The session now exists, so the sidebar button can open it even if
// the user left while it spawned.
window.clearTimeout(provisioningGuard);
setProjectProvisioning(workspace.id, false);
// Follow the new orchestrator only if the user is still waiting on
// this project's board; do not pull them back from another page.
// The provisioning gate stays up until the session route has landed,
// otherwise the board shows through for a beat between the two.
const current = routeParamsRef.current;
if (current.projectId === workspace.id && !current.sessionId && !current.hostId) {
void navigate({
await navigate({
to: "/projects/$projectId/sessions/$sessionId",
params: { projectId: workspace.id, sessionId },
});
}
window.clearTimeout(provisioningGuard);
setProjectProvisioning(workspace.id, false);
} catch (spawnError) {
window.clearTimeout(provisioningGuard);
setProjectProvisioning(workspace.id, false);
Expand Down
Loading