5fe5d51b1b
AI Proxy (was AI Router): - server/lib/ai-proxies.js, proxy-apply.js, routes/ai-proxies.js mounted at /api/ai-proxies and the old /api/ai-routers; `router` still accepted on the start routes; profiles move to <CLAUDE_HOME>/agenthub-proxies/ - dashboard_runs.router renamed in place to proxy: an older build on the same DB fails on that column, so dev and prod sharing one DB update together - a proxy's baseUrl stored as its root (a typed /v1 made /v1/v1/messages); Test probes Claude /v1/messages and Codex /v1/responses - Settings → AI Proxy (/settings/ai-router redirects), ProxyPicker Updates: - every tab reloads onto the new UI build when its WebSocket reconnects to a server of another version (lib/newBuildReload.ts, once per version) - Update now stops waiting on a plugin chain that failed or pulled nothing (the old server never goes down), and reloads as soon as a new version answers Also: - a pane whose command exits at once says so (EPANEEXITED) instead of "Command failed: tmux set-option … mouse on" - the pane drag preview draws where the pane actually lands
37 lines
1.4 KiB
TypeScript
37 lines
1.4 KiB
TypeScript
/**
|
|
* @file PaneGrid.test.ts
|
|
* @description The pane drop preview: it draws where the dragged pane will
|
|
* actually land (`dropPreview` over `applyDrop`), not half of the target's
|
|
* current box, and nothing for a drop that changes nothing.
|
|
* @author Nguyễn Ngọc Trí Vĩ <vinnt@smartgift.vn>
|
|
*/
|
|
|
|
import { describe, expect, it } from "vitest";
|
|
import { dropPreview } from "../PaneGrid";
|
|
import { pane, split, type PaneLayout } from "../../../lib/paneLayout";
|
|
|
|
const AB: PaneLayout = { root: split("row", pane(0), pane(1)), focus: 0 };
|
|
|
|
describe("dropPreview", () => {
|
|
it("a shown pane leaves its place first: A onto B's top is the whole top half", () => {
|
|
expect(dropPreview(AB, 0, 1, "top")).toEqual({ slot: 0, x: 0, y: 0, w: 1, h: 0.5 });
|
|
});
|
|
|
|
it("a pane from another tab splits the target's current box", () => {
|
|
expect(dropPreview(AB, 2, 1, "bottom")).toEqual({ slot: 2, x: 0.5, y: 0.5, w: 0.5, h: 0.5 });
|
|
});
|
|
|
|
it("the center swaps into the target's box", () => {
|
|
expect(dropPreview(AB, 0, 1, "center")).toEqual({ slot: 0, x: 0.5, y: 0, w: 0.5, h: 1 });
|
|
});
|
|
|
|
it("nothing on its own pane or on a refused move", () => {
|
|
expect(dropPreview(AB, 0, 0, "left")).toBeNull();
|
|
const full: PaneLayout = {
|
|
root: split("row", split("col", pane(0), pane(1)), split("col", pane(2), pane(3))),
|
|
focus: 0,
|
|
};
|
|
expect(dropPreview(full, 5, 0, "left")).toBeNull();
|
|
});
|
|
});
|