mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-06 17:38:35 +00:00
fix(webui): prevent mobile thread overflow
This commit is contained in:
parent
ff379b91cf
commit
be43a54570
@ -638,7 +638,7 @@ export const ThreadViewport = forwardRef<ThreadViewportHandle, ThreadViewportPro
|
|||||||
<div
|
<div
|
||||||
ref={messageRegionRef}
|
ref={messageRegionRef}
|
||||||
data-testid="thread-message-region"
|
data-testid="thread-message-region"
|
||||||
className="row-start-1 flex min-h-0 flex-col justify-start px-3 pb-4 pt-4 sm:px-4"
|
className="row-start-1 flex min-h-0 min-w-0 flex-col justify-start px-3 pb-4 pt-4 sm:px-4"
|
||||||
>
|
>
|
||||||
<div ref={messageContentRef} className="mx-auto w-full max-w-[49.5rem]">
|
<div ref={messageContentRef} className="mx-auto w-full max-w-[49.5rem]">
|
||||||
<ThreadMessages
|
<ThreadMessages
|
||||||
|
|||||||
@ -223,6 +223,28 @@ describe("ThreadViewport", () => {
|
|||||||
expect(messageRegion.className).not.toContain("5rem");
|
expect(messageRegion.className).not.toContain("5rem");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("allows long messages to shrink within the shared mobile grid column", () => {
|
||||||
|
render(
|
||||||
|
<ThreadViewport
|
||||||
|
messages={[
|
||||||
|
...messages,
|
||||||
|
{
|
||||||
|
id: "a-long-link",
|
||||||
|
role: "assistant",
|
||||||
|
content:
|
||||||
|
"https://github.com/HKUDS/nanobot/discussions/17788077"
|
||||||
|
+ "/a-very-long-unbroken-segment-that-must-not-widen-the-thread",
|
||||||
|
createdAt: Date.now(),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
isStreaming={false}
|
||||||
|
composer={<div>composer</div>}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(screen.getByTestId("thread-message-region")).toHaveClass("min-w-0");
|
||||||
|
});
|
||||||
|
|
||||||
it("top-aligns a short active turn while the agent is responding", () => {
|
it("top-aligns a short active turn while the agent is responding", () => {
|
||||||
render(
|
render(
|
||||||
<ThreadViewport
|
<ThreadViewport
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user