mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-15 16:49:24 +03:00
fix(webui): label temporary chat guidance
This commit is contained in:
@@ -110,7 +110,10 @@ export function ThreadHeader({
|
|||||||
align="end"
|
align="end"
|
||||||
className="max-w-72 rounded-xl border border-border/70 bg-popover px-3 py-2 text-[12px]/[1.4] text-popover-foreground shadow-[0_8px_24px_rgba(15,23,42,0.13)] dark:border-white/10"
|
className="max-w-72 rounded-xl border border-border/70 bg-popover px-3 py-2 text-[12px]/[1.4] text-popover-foreground shadow-[0_8px_24px_rgba(15,23,42,0.13)] dark:border-white/10"
|
||||||
>
|
>
|
||||||
|
<div className="font-medium">{t("temporaryChat.title")}</div>
|
||||||
|
<div className="mt-1 text-muted-foreground">
|
||||||
{t("temporaryChat.description")}
|
{t("temporaryChat.description")}
|
||||||
|
</div>
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</TooltipProvider>
|
</TooltipProvider>
|
||||||
|
|||||||
@@ -521,6 +521,13 @@ describe("App layout", () => {
|
|||||||
expect(heroTemporaryToggle.compareDocumentPosition(themeToggle)
|
expect(heroTemporaryToggle.compareDocumentPosition(themeToggle)
|
||||||
& Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
|
& Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
|
||||||
|
|
||||||
|
const user = userEvent.setup();
|
||||||
|
await user.hover(heroTemporaryToggle);
|
||||||
|
const temporaryTooltip = await screen.findByRole("tooltip");
|
||||||
|
expect(temporaryTooltip).toHaveTextContent("Temporary chat");
|
||||||
|
expect(temporaryTooltip).toHaveTextContent("Not saved to history or memory");
|
||||||
|
await user.unhover(heroTemporaryToggle);
|
||||||
|
|
||||||
fireEvent.click(within(sidebar).getByText("Existing topic"));
|
fireEvent.click(within(sidebar).getByText("Existing topic"));
|
||||||
expect(window.location.hash).toBe("#/chat/websocket%3Aexisting-chat");
|
expect(window.location.hash).toBe("#/chat/websocket%3Aexisting-chat");
|
||||||
expect(screen.queryByRole("button", { name: "Temporary chat" })).not.toBeInTheDocument();
|
expect(screen.queryByRole("button", { name: "Temporary chat" })).not.toBeInTheDocument();
|
||||||
|
|||||||
Reference in New Issue
Block a user