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:
1 parent
5b55f2ff30
commit
ac903fdcba
2 files changed
+7
-7
No files matched your search
+4
-5
@@ -1179,13 +1179,14 @@ export function App(props: { readonly session: T3Session; readonly config: Tui3C
|
|||||||
<Button label="+ file" shortcut="a" onPress={attach.attachFile} />
|
<Button label="+ file" shortcut="a" onPress={attach.attachFile} />
|
||||||
</box>
|
</box>
|
||||||
) : null}
|
) : null}
|
||||||
{working && threadId && !draft ? <LiveStatus label={liveLabel} tool={liveTool} /> : null}
|
{working && threadId && !draft && !pendingApproval ? <LiveStatus label={liveLabel} tool={liveTool} /> : null}
|
||||||
{threadId || draft ? (
|
{threadId || draft ? (
|
||||||
<box flexDirection="column" flexShrink={0} marginTop={1} marginLeft={1} marginRight={1}>
|
<box flexDirection="column" flexShrink={0} marginTop={1} marginLeft={1} marginRight={1}>
|
||||||
{pendingApproval && !draft ? (
|
{pendingApproval && !draft ? (
|
||||||
|
<box marginBottom={1} flexShrink={0}>
|
||||||
<ApprovalPanel approval={pendingApproval} onRespond={respond} />
|
<ApprovalPanel approval={pendingApproval} onRespond={respond} />
|
||||||
) : (
|
</box>
|
||||||
<>
|
) : null}
|
||||||
<box
|
<box
|
||||||
border={["left"]}
|
border={["left"]}
|
||||||
customBorderChars={BAR}
|
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} flexShrink={0} border={["left"]} borderColor={composerBarColor} customBorderChars={{ ...NO_BORDER, vertical: "╹" }}>
|
||||||
<box height={1} border={["bottom"]} borderColor={colors.element} customBorderChars={{ ...NO_BORDER, horizontal: "▀" }} />
|
<box height={1} border={["bottom"]} borderColor={colors.element} customBorderChars={{ ...NO_BORDER, horizontal: "▀" }} />
|
||||||
</box>
|
</box>
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</box>
|
</box>
|
||||||
) : null}
|
) : null}
|
||||||
</box>
|
</box>
|
||||||
|
|||||||
@@ -181,14 +181,15 @@ describe("live status", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("approvals", () => {
|
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 app = await open({ session: fakeSession({ projection: withApproval() }) });
|
||||||
const frame = app.frame();
|
const frame = app.frame();
|
||||||
expect(frame).toContain("Command approval");
|
expect(frame).toContain("Command approval");
|
||||||
expect(frame).toContain("Deletes dist/ and rebuilds it.");
|
expect(frame).toContain("Deletes dist/ and rebuilds it.");
|
||||||
// Only the composer block names the command; its timeline row is hidden.
|
// 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.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");
|
const approve = app.find("Approve");
|
||||||
await app.click(approve.x, approve.y);
|
await app.click(approve.x, approve.y);
|
||||||
expect(app.calls("respond").map((call) => call.args[2])).toEqual(["accept"]);
|
expect(app.calls("respond").map((call) => call.args[2])).toEqual(["accept"]);
|
||||||
|
|||||||
Reference in new issue
Block a user