Hide the drawer while the message editor is zoomed
This commit is contained in:
1 parent
9e4558d7d1
commit
2a191b1089
2 files changed
+8
-3
No files matched your search
+2
-2
@@ -1539,7 +1539,7 @@ export function App(props: { readonly session: T3Session; readonly config: T3tui
|
|||||||
</box>
|
</box>
|
||||||
{drawer ? (
|
{drawer ? (
|
||||||
<>
|
<>
|
||||||
{drawerInPlace ? null : (
|
{drawerInPlace || zoom === "message" ? null : (
|
||||||
<ResizeHandle
|
<ResizeHandle
|
||||||
horizontal
|
horizontal
|
||||||
active={resizing === "drawer"}
|
active={resizing === "drawer"}
|
||||||
@@ -1553,7 +1553,7 @@ export function App(props: { readonly session: T3Session; readonly config: T3tui
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<box flexDirection="column" minHeight={0} {...(drawerInPlace ? { flexGrow: 1, flexShrink: 1 } : { height: drawerHeight, flexShrink: 0 })}>
|
<box flexDirection="column" minHeight={0} visible={zoom !== "message"} {...(drawerInPlace ? { flexGrow: 1, flexShrink: 1 } : { height: drawerHeight, flexShrink: 0 })}>
|
||||||
{terminalPane}
|
{terminalPane}
|
||||||
</box>
|
</box>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ describe("terminal drawer", () => {
|
|||||||
|
|
||||||
test("ctrl+g writes the message in $EDITOR in the composer's place, and what's saved comes back", async () => {
|
test("ctrl+g writes the message in $EDITOR in the composer's place, and what's saved comes back", async () => {
|
||||||
// This one waits a moment, overwrites the file and exits.
|
// This one waits a moment, overwrites the file and exits.
|
||||||
setEditor("sleep 0.5; printf 'from the editor' >");
|
setEditor("sleep 0.8; printf 'from the editor' >");
|
||||||
const app = await open();
|
const app = await open();
|
||||||
await app.press("i");
|
await app.press("i");
|
||||||
await app.type("draft");
|
await app.type("draft");
|
||||||
@@ -344,6 +344,11 @@ describe("terminal drawer", () => {
|
|||||||
expect(app.frame()).not.toContain("draft");
|
expect(app.frame()).not.toContain("draft");
|
||||||
expect(app.find("Message · save and quit").x).toBeLessThan(composer.x);
|
expect(app.find("Message · save and quit").x).toBeLessThan(composer.x);
|
||||||
expect(app.hints()).toBe(keysOn("message"));
|
expect(app.hints()).toBe(keysOn("message"));
|
||||||
|
// Zoomed, it takes the conversation's place too.
|
||||||
|
const top = app.find("Message · save and quit").y;
|
||||||
|
await prefix(app, "z");
|
||||||
|
expect(app.find("Message · save and quit").y).toBeLessThan(top);
|
||||||
|
expect(app.frame()).not.toContain("Do the thing");
|
||||||
await waitFor(() => !app.frame().includes("Message · save and quit"));
|
await waitFor(() => !app.frame().includes("Message · save and quit"));
|
||||||
expect(app.frame()).not.toContain("Message · save and quit");
|
expect(app.frame()).not.toContain("Message · save and quit");
|
||||||
expect(app.frame()).toContain("from the editor");
|
expect(app.frame()).toContain("from the editor");
|
||||||
|
|||||||
Reference in new issue
Block a user