Official
chat
Built-in chat UI (JavaScript UI plugin).
The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/chat@0.2.7
Permissions in 0.2.7
Files
side-split.test.ts4.1 KB
// Cmd+Shift+B hides and shows the side split from the chat, and does
// nothing while Settings is open, so going back finds the side split as it
// was left.
import assert from "node:assert/strict";
import test from "node:test";
import * as Effect from "effect/Effect";
import { InputLedger, withController } from "./testing.ts";
import { toggleSideSplit } from "./layout.ts";
import type { Controller } from "./controller.ts";
class SideLedger extends InputLedger {
updates: unknown[] = [];
override async call(method: string, raw: unknown): Promise<unknown> {
if (method === "host/layouts.update") {
this.updates.push(raw);
return { changed: true };
}
return super.call(method, raw);
}
}
const onRoute = (c: Controller, route: string) => {
Object.assign(c.app, { state: Effect.succeed({ route, chatId: "c1" }) });
};
test("the side split's key hides it from the chat and leaves it alone in Settings", async () => {
const ledger = new SideLedger();
await withController(ledger, (c) =>
Effect.gen(function* () {
c.state.layouts.side = { layout: null, remembered: [], open: true, width: 520 };
onRoute(c, "settings");
yield* toggleSideSplit(c);
assert.deepEqual(ledger.updates, [], "Settings keeps the side split as it was");
onRoute(c, "chat");
yield* toggleSideSplit(c);
assert.deepEqual(ledger.updates, [{ side: { open: false }, onScreen: null }]);
}),
);
});
test("the side split keeps the width it was dragged to, and opens again at it", async () => {
const { harness, chat, nodes, tree } = await import("./ui-for-tests.test.ts");
const { noteTask } = await import("./layout.ts");
const { renderTaskCenter } = await import("./views/layout.tsx");
const h = harness();
const c = h.controller;
c.state.chats.a = chat({ id: "a" });
c.state.panes.a = { chatId: "a", view: { id: 20, update() {}, remove() {} }, drawn: true, ready: true };
const own = { kind: "chat" as const, chatId: "a" };
const subagent = { kind: "item" as const, id: "i1", owner: "chat", itemKind: "chat.subagent", key: "s", title: "Scout", chatId: "a" };
const task = { id: "t", layout: { root: { kind: "pane" as const, id: "p", tabs: [own], active: own }, focused: "p" }, createdAt: "", updatedAt: "" };
noteTask(c.state.layouts, task);
const side = { layout: { root: { kind: "pane" as const, id: "sp", tabs: [subagent], active: subagent }, focused: "sp" }, remembered: [], open: true, width: 400, resized: true };
c.state.layouts.side = side;
let redrawn = 0;
Object.assign(h.v.ctx, { update: () => void redrawn++ });
const center = () => tree(renderTaskCenter(h.v, task));
const windowSplit = () => nodes(center()).find((node) => node.id === "window-split")!;
// The room is measured once, around the whole window split.
const measureRoom = (width: number) => (center().children[0]!.children[0]!.onResize as (size: { width: number; height: number }) => void)({ width, height: 900 });
const sideWidth = () => (windowSplit().sizes as number[])[1]! * 2000;
measureRoom(2000);
assert.equal(redrawn, 1, "a new room draws the side split again at its width");
assert.equal(Math.round(sideWidth()), 400);
// A drag to 260px, narrower than the old floor of 15% of the room, is the width it keeps.
(windowSplit().onResize as (e: { sizes: number[] }) => void)({ sizes: [0.87, 0.13] });
await h.settle();
assert.deepEqual((h.calls.findLast((call) => call.method === "host/layouts.update")?.params as { side: unknown }).side, { width: 260 });
side.width = 260;
assert.equal(Math.round(sideWidth()), 260, "drawn again, it stays where it was dropped");
// Hidden and shown again, it opens at the same width, with nothing measured in between.
side.open = false;
assert.equal(nodes(center()).find((node) => node.id === "window-split")!.sizes?.toString(), "1");
side.open = true;
assert.equal(Math.round(sideWidth()), 260, "it opens at the width it was dragged to");
assert.equal(redrawn, 1, "and nothing it did measured a new room");
// A drag stops where the width it would leave is kept: the task's column keeps 200px, the side split 240px.
assert.deepEqual(windowSplit().minSizes, [200, 240]);
await h.close();
});Versions
| Version | Published | Plugin API | Size | Permissions | Status |
|---|---|---|---|---|---|
| 0.2.9latest | Nov 21, 2026 | >=5 <6 | 349 KB | 5 permissions | Listed |
| 0.2.8 | Nov 16, 2026 | >=5 <6 | 348.6 KB | 5 permissions | Listed |
| 0.2.7 | Nov 11, 2026 | >=5 <6 | 314.3 KB | 5 permissions | Listed |
| 0.2.6 | Nov 9, 2026 | >=5 <6 | 306.2 KB | 5 permissions | Listed |
| 0.2.5 | Oct 27, 2026 | >=2 <4 | 178.6 KB | 5 permissions | Listed |
No comments yet.