Skip to content
Open
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
390 changes: 223 additions & 167 deletions client/src/App.tsx

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions client/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ export interface SessionRuntimeEntry {
provider?: string;
projectId?: string;
worktreeId?: string;
/**
* True when the agent has paused on a user-input request OR has at
* least one pending tool approval. The focus-queue sidebar uses
* this as the highest-priority "needs your attention" signal
* regardless of the session's `active` state.
*/
awaitingInput?: boolean;
}

export interface AgentEvent {
Expand Down
96 changes: 0 additions & 96 deletions client/src/components/__tests__/focus-advance-toast.test.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import test from "node:test";
import assert from "node:assert/strict";
import { renderToStaticMarkup } from "react-dom/server";
import { FocusConversationControls } from "../focus-conversation-controls.tsx";

function render(
variant: "mobile" | "desktop",
options: {
isOnRadar?: boolean;
countdown?: boolean;
autoAdvance?: boolean;
} = {},
) {
return renderToStaticMarkup(
<FocusConversationControls
variant={variant}
bindings={null}
isOnRadar={options.isOnRadar ?? true}
autoAdvance={options.autoAdvance ?? true}
onNext={() => {}}
onDone={() => {}}
onAddToRadar={() => {}}
onToggleAutoAdvance={() => {}}
countdown={options.countdown ? {
scheduledAt: Date.now(),
durationMs: 4000,
onStay: () => {},
} : null}
/>,
);
}

test("mobile controls restore the compact radar row with Next and Done", () => {
const html = render("mobile");
assert.match(html, /focus-conversation-controls-mobile/);
assert.match(html, /md:hidden/);
assert.match(html, />Next</);
assert.match(html, />Done</);
assert.match(html, /Auto advance/);
assert.match(html, /Auto-advance/);
assert.doesNotMatch(html, /On radar \d/);
});

test("desktop controls render as a top-right floating panel", () => {
const html = render("desktop");
assert.match(html, /focus-conversation-controls-desktop/);
assert.match(html, /absolute right-4 top-4/);
assert.match(html, /hidden/);
assert.match(html, /md:flex/);
assert.match(html, /flex-col items-stretch/);
assert.match(html, />Next</);
assert.match(html, />Done</);
});

test("an unpinned session keeps the panel with Next and Add to radar", () => {
const html = render("desktop", { isOnRadar: false });
assert.match(html, /Add to radar/);
assert.match(html, />Next</);
assert.doesNotMatch(html, />Done</);
});

test("the panel owns the auto-advance switch state", () => {
const enabledHtml = render("desktop");
assert.match(enabledHtml, /data-checked=""/);
assert.match(enabledHtml, /Ctrl\+T|⌃T/);
assert.match(
render("desktop", { autoAdvance: false }),
/data-unchecked=""/,
);
});

test("the panel replaces normal actions with the auto-advance countdown", () => {
const html = render("desktop", { countdown: true });
assert.match(html, /Advancing in 4s/);
assert.match(html, />Stay</);
assert.match(html, /lucide-pause/);
assert.match(html, />Next</);
assert.match(html, /Ctrl\+S|⌃S/);
assert.match(html, /flex-col items-stretch/);
assert.doesNotMatch(html, />Done</);
});

test("the mobile countdown keeps only the plain Stay action", () => {
const html = render("mobile", { countdown: true });
assert.match(html, /Advancing in 4s/);
assert.match(html, />Stay</);
assert.match(html, /lucide-pause/);
assert.doesNotMatch(html, />Next</);
assert.doesNotMatch(html, /Ctrl\+S|⌃S/);
});

test("mobile normal controls do not expose shortcut chips or tooltips", () => {
const html = render("mobile");
assert.doesNotMatch(html, /Ctrl\+[NSTD]|⌃[NSTD]/);
assert.doesNotMatch(html, /data-slot="kbd"/);
});
Loading