Keep the composer under a pending approval, and no working line meanwhile

The approval sits above the message box rather than replacing it, so a
message can still go with a decline, as in the web.
This commit is contained in:
Callum Alpass committed 2026-11-03 01:09:59 +11:00
1 parent 5b55f2ff30
commit ac903fdcba
2 files changed
+7 -7

No files matched your search

+4 -5
View File
@@ -1179,13 +1179,14 @@ export function App(props: { readonly session: T3Session; readonly config: Tui3C
<Button label="+ file" shortcut="a" onPress={attach.attachFile} />
</box>
) : null}
{working && threadId && !draft ? <LiveStatus label={liveLabel} tool={liveTool} /> : null}
{working && threadId && !draft && !pendingApproval ? <LiveStatus label={liveLabel} tool={liveTool} /> : null}
{threadId || draft ? (
<box flexDirection="column" flexShrink={0} marginTop={1} marginLeft={1} marginRight={1}>
{pendingApproval && !draft ? (
<box marginBottom={1} flexShrink={0}>
<ApprovalPanel approval={pendingApproval} onRespond={respond} />
) : (
<>
</box>
) : null}
<box
border={["left"]}
customBorderChars={BAR}
@@ -1248,8 +1249,6 @@ export function App(props: { readonly session: T3Session; readonly config: Tui3C
<box height={1} flexShrink={0} border={["left"]} borderColor={composerBarColor} customBorderChars={{ ...NO_BORDER, vertical: "╹" }}>
<box height={1} border={["bottom"]} borderColor={colors.element} customBorderChars={{ ...NO_BORDER, horizontal: "▀" }} />
</box>
</>
)}
</box>
) : null}
</box>
+3 -2
View File
@@ -181,14 +181,15 @@ describe("live status", () => {
});
describe("approvals", () => {
test("the request shows in the composer's place, with its buttons, and not in the timeline", async () => {
test("the request shows above the composer, with its buttons, and not in the timeline", async () => {
const app = await open({ session: fakeSession({ projection: withApproval() }) });
const frame = app.frame();
expect(frame).toContain("Command approval");
expect(frame).toContain("Deletes dist/ and rebuilds it.");
// Only the composer block names the command; its timeline row is hidden.
expect(frame.split("rm -rf dist && bun run build")).toHaveLength(2);
expect(frame).not.toContain("Press i to type");
// The composer stays below it, so a message can still go with a decline.
expect(app.find("Command approval").y).toBeLessThan(app.find("gpt-5.4").y);
const approve = app.find("Approve");
await app.click(approve.x, approve.y);
expect(app.calls("respond").map((call) => call.args[2])).toEqual(["accept"]);