fix(webui): prevent mobile thread overflow
This commit is contained in:
@@ -638,7 +638,7 @@ export const ThreadViewport = forwardRef<ThreadViewportHandle, ThreadViewportPro
|
||||
<div
|
||||
ref={messageRegionRef}
|
||||
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]">
|
||||
<ThreadMessages
|
||||
|
||||
@@ -223,6 +223,28 @@ describe("ThreadViewport", () => {
|
||||
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", () => {
|
||||
render(
|
||||
<ThreadViewport
|
||||
|
||||
Reference in New Issue
Block a user