Resize the details column by dragging its edge

Like the thread list: drag to resize, right-click to reset, kept as
detailsWidth in layout.json. The conversation keeps its minimum width; a
dragged width gives way to it before the panel goes in place.
This commit is contained in:
Callum Alpass committed 2026-11-03 01:49:12 +11:00
1 parent 9702c31e62
commit bbf8ff49e1
4 files changed
+57 -21

No files matched your search

+17
View File
@@ -386,4 +386,21 @@ describe("mouse", () => {
const next = await open({ layout });
expect(next.find("┃").x).toBe(before + 7);
});
test("dragging the details edge resizes it and keeps the width; right-click resets it", async () => {
// Wide enough for the details column to open by itself.
const first = await open({ width: 200 });
// The details edge is the last bar on a row above the composer.
const edge = () => first.frame().split("\n")[10]!.lastIndexOf("┃");
const before = edge();
expect(before).toBe(200 - 38 - 1);
await first.mockMouse.drag(before, 10, before - 10, 10);
await first.settle(100);
expect(edge()).toBe(before - 10);
expect((await loadLayout()).detailsWidth).toBe(48);
await first.click(before - 10, 10, 2);
await first.settle(100);
expect(edge()).toBe(before);
expect((await loadLayout()).detailsWidth).toBeNull();
});
});