GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): /compact stays in the slash menu while a turn runs (#43595) · patroza/t3code@34d3f15

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/web/src/components
    • ChatView.handoffCompaction.browser.test.tsx
    • ChatView.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/web/src/components/ChatView.handoffCompaction.browser.test.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/ChatView.handoffCompaction.browser.test.tsx
+29-1Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ import {
2222
CODEX_PROVIDER,
2323
ENVIRONMENT_ID,
2424
dispatchedCommands,
25+
emitThreadEvent,
2526
installFakeEnvironment,
2627
threadWithHistory,
2728
type FakeDriver,
2829
} from "../../test/fakeEnvironment";
29-
import { render } from "../../test/render";
30+
import { act, render } from "../../test/render";
3031

3132
// The socket is the only fake layer.
3233
vi.mock("../../../../packages/client-runtime/src/connection/driver.ts", async (importOriginal) => {
@@ -165,3 +166,30 @@ it("drops the compact offer on a cold Claude thread while /clear is armed", asyn
165166
await expect.element(chip).toBeVisible();
166167
await expect.element(compactAndSend).toBeVisible();
167168
});
169+
170+
it("/compact stays in the slash menu while a turn runs, since a typed command queues", async () => {
171+
const history = threadWithHistory("compact-mid-turn", 2, {
172+
instanceId: CLAUDE,
173+
model: "claude-opus-4-6",
174+
});
175+
using _environment = installFakeEnvironment([history], { providers: [CLAUDE_PROVIDER] });
176+
__setClientSettingsForTests({
177+
...DEFAULT_CLIENT_SETTINGS,
178+
onboardingCompletedAt: "2026-01-01T00:00:00.000Z",
179+
});
180+
const router = getRouter(
181+
createMemoryHistory({ initialEntries: [`/${ENVIRONMENT_ID}/${history.id}`] }),
182+
);
183+
await router.load();
184+
await using _app = await render(<AppRoot router={router} />, { router: false });
185+
await expect.element(page.getByText(`Answer 1 for ${history.id}.`)).toBeVisible();
186+
const compact = page.getByRole("option", { name: /^\/compact/ });
187+
188+
await userEvent.type(page.getByTestId("composer-editor"), "/compact");
189+
await expect.element(compact).toBeVisible();
190+
191+
const running = { ...history.runs[1]!, status: "running" as const, completedAt: null };
192+
await act(() => emitThreadEvent(history.id, { type: "run.updated", payload: running }));
193+
await expect.element(page.getByRole("button", { name: "Steer message" })).toBeVisible();
194+
await expect.element(compact).toBeVisible();
195+
});
Collapse file

‎apps/web/src/components/ChatView.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/ChatView.tsx
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2665,15 +2665,15 @@ export default function ChatView(props: ChatViewProps) {
26652665
!activeProject ||
26662666
!isServerThread ||
26672667
!manualCompactionProviderAvailable ||
2668-
isWorking ||
26692668
isRevertingCheckpoint ||
26702669
threadDetailLoading ||
26712670
isPreparingWorktree ||
26722671
activeEnvironmentUnavailable ||
26732672
feedbackUploading ||
26742673
pendingApprovals.length > 0 ||
26752674
pendingUserInputs.length > 0;
2676-
const compactDisabled = compactThreadUnavailable;
2675+
// A typed /compact queues behind a running turn, so only the immediate compaction waits for idle.
2676+
const compactDisabled = compactThreadUnavailable || isWorking;
26772677
const freshSessionAvailable =
26782678
activeMessageCount > 0 && serverConfig?.environment.capabilities.freshContext === true;
26792679
const freshSessionArmed = useFreshSessionArmed(routeThreadKey);

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.