fix(webui): adapt chat toolbar to available width (#5760)

* fix(webui): float chat controls above the transcript

* fix(webui): keep floating controls compact and flat

* fix(webui): adapt toolbar placement to conversation width

* refactor(webui): simplify responsive toolbar styles
This commit is contained in:
chengyongru authored and GitHub committed 2026-09-14 15:25:13 +08:00
1 parent 95b2346ea5
commit f611c880f9
6 files changed
+67 -24

No files matched your search

+20 -6
View File
@@ -279,7 +279,6 @@ describe("ThreadViewport", () => {
expect(messageRegion).toHaveClass("justify-start");
expect(messageRegion).not.toHaveClass("justify-end");
expect(messageRegion).toHaveClass("thread-message-viewport");
expect(messageRegion).toHaveClass("pt-3");
expect(messageRegion).toHaveClass("pb-0");
expect(messageRegion.className).not.toContain("5rem");
});
@@ -573,7 +572,7 @@ describe("ThreadViewport", () => {
});
await flushAnimationFrame();
expect(jumpTo).toHaveBeenCalledWith(1404);
expect(jumpTo).toHaveBeenCalledWith(1372);
});
it("drives the camera from a message commit when canonical replay replaces the prompt DOM id", async () => {
@@ -1681,7 +1680,7 @@ describe("ThreadViewport", () => {
fireEvent.click(targetPrompt);
expect(navigateTo).toHaveBeenCalledWith(1064);
expect(navigateTo).toHaveBeenCalledWith(1032);
});
it("renders markdown in prompt rail previews", async () => {
@@ -1855,14 +1854,29 @@ describe("ThreadViewport", () => {
expect(markers).toHaveLength(count);
markers.forEach((marker, index) => {
fireEvent.click(marker);
expect(navigateTo).toHaveBeenLastCalledWith(Math.max(0, index * 40 - 16));
expect(navigateTo).toHaveBeenLastCalledWith(Math.max(0, index * 40 - 48));
});
} else {
expect(markers.length).toBeGreaterThan(1);
expect(markers.length).toBeLessThan(count);
}
fireEvent.click(markers[markers.length - 1]);
expect(navigateTo).toHaveBeenLastCalledWith((count - 1) * 40 - 16);
expect(navigateTo).toHaveBeenLastCalledWith(Math.max(0, (count - 1) * 40 - 48));
});
it("keeps prompt jumps aligned when the header changes between a row and an overlay", async () => {
const navigateTo = vi.spyOn(ThreadCameraController.prototype, "navigateTo")
.mockReturnValue("started");
const { scroller } = await renderPromptRailViewport();
const marker = screen.getByRole("button", { name: "Jump to prompt: message 1" });
scroller.style.paddingTop = "16px";
fireEvent.click(marker);
expect(navigateTo).toHaveBeenLastCalledWith(344);
scroller.style.paddingTop = "48px";
fireEvent.click(marker);
expect(navigateTo).toHaveBeenLastCalledWith(312);
});
it("buckets dense prompt rails without rendering every prompt as a marker", async () => {
@@ -1913,7 +1927,7 @@ describe("ThreadViewport", () => {
fireEvent.click(promptMarkers[promptMarkers.length - 1]);
expect(navigateTo).toHaveBeenCalledWith(8894);
expect(navigateTo).toHaveBeenCalledWith(8862);
});
it("expands the window start to avoid cutting an agent activity cluster", () => {