feat: add assistant conversation widget

This commit is contained in:
ajnart committed 2026-08-13 19:56:26 +02:00
1 parent c7b0c1bcf0
commit 00fa1192d7
17 files changed
+779 -93

No files matched your search

@@ -129,6 +129,26 @@ describe("item actions create-item", () => {
);
});
test("should fit a wide widget to every board layout", () => {
const layoutId = "compact-layout";
const layout = new LayoutMockBuilder({ id: layoutId, columnCount: 4 }).build();
const board = new BoardMockBuilder().addLayout(layout).addEmptySection({ id: "section" }).build();
const layoutsSpy = vi.spyOn(boardContext, "getBoardLayouts");
layoutsSpy.mockReturnValue([layoutId]);
const emptyPositionSpy = vi.spyOn(emptyPositionModule, "getFirstEmptyPosition");
emptyPositionSpy.mockReturnValue({ xOffset: 0, yOffset: 0 });
const result = createItemCallback({ kind: "assistant" })(board);
expect(result.items.at(0)?.layouts.at(0)).toEqual(
expect.objectContaining({ width: layout.columnCount, height: 4 }),
);
expect(emptyPositionSpy).toHaveBeenCalledWith([], layout.columnCount, undefined, {
width: layout.columnCount,
height: 4,
});
});
test("clamps wide defaults and places below a full automatic canvas", () => {
const board = new BoardMockBuilder().addEmptySection({ id: "canvas", yOffset: 0 }).build();
const layout = board.layouts[0];
@@ -47,7 +47,7 @@ interface BoardItemContentProps {
const getOverflowFromKind = (kind: SectionItem["kind"], hasCustomCssClasses: boolean) => {
if (kind === "systemResources") return { overflowX: "visible", overflowY: "visible" } as const;
if (kind === "iframe") return { overflowX: "hidden", overflowY: "hidden" } as const;
if (kind === "iframe" || kind === "assistant") return { overflowX: "hidden", overflowY: "hidden" } as const;
if (hasCustomCssClasses) return {};
return { overflowX: "hidden", overflowY: "auto" } as const;
};