From d2fec6fe346bd4f1ad70751bb91d9528de6e1359 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 26 Nov 2026 13:44:28 +0000 Subject: [PATCH 1/2] fix(console): on a phone, a page the assistant opens closes its sheet A citation chip in the phone assistant sheet opened the cited record section underneath while the sheet stayed over it. A navigation that leaves the page, or a PUSH onto the same page, now collapses the sheet; the desktop rail is unchanged. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01Utp6CXDoFxnz75MqdAxLSW --- .../37556-phone-dock-closes-on-citation.md | 10 ++ ...ock.phoneCollapseOnNavigate-37556.test.tsx | 140 ++++++++++++++++++ .../src/layout/useConsoleChatDock.tsx | 21 ++- 3 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 .changeset/37556-phone-dock-closes-on-citation.md create mode 100644 ui/packages/app-shell/src/layout/__tests__/useConsoleChatDock.phoneCollapseOnNavigate-37556.test.tsx diff --git a/.changeset/37556-phone-dock-closes-on-citation.md b/.changeset/37556-phone-dock-closes-on-citation.md new file mode 100644 index 00000000000..d80988a2521 --- /dev/null +++ b/.changeset/37556-phone-dock-closes-on-citation.md @@ -0,0 +1,10 @@ +--- +'@object-ui/app-shell': patch +--- + +fix(console): on a phone, a page the AI assistant opens closes the assistant sheet so the page shows + +Clause-②: no +Metadata-protocol: none + +On a phone the assistant is a bottom sheet over the page. Clicking a citation chip in an answer opened the cited record section underneath, but the sheet stayed open over it, so the marked heading was hidden and the click looked like it did nothing. Now a navigation the assistant makes on a phone (a citation chip, a record or list link, opening a form) closes the sheet, including a second click on the same chip. The conversation is kept: reopening the assistant shows the same thread. On a desktop the assistant is a panel beside the page and stays open, as before. diff --git a/ui/packages/app-shell/src/layout/__tests__/useConsoleChatDock.phoneCollapseOnNavigate-37556.test.tsx b/ui/packages/app-shell/src/layout/__tests__/useConsoleChatDock.phoneCollapseOnNavigate-37556.test.tsx new file mode 100644 index 00000000000..007d8ce38c7 --- /dev/null +++ b/ui/packages/app-shell/src/layout/__tests__/useConsoleChatDock.phoneCollapseOnNavigate-37556.test.tsx @@ -0,0 +1,140 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * objectstack#37556 — on a phone the assistant drawer is a bottom sheet over + * the page. A citation chip in it navigates to the cited record section, and + * the sheet must get out of the way so the marked heading is visible; on a + * desktop the drawer is a rail beside the page and stays open. + * + * ## Real subjects + * + * The real `useConsoleChatDock` host, the real `useChatDockState`, the real + * router. The sheet and the rail are stand-ins that show whether the host + * mounts them open: which chrome is open is the subject, not the chat inside. + * The chip is a stand-in that navigates the way the chat's record-citation + * door does (a PUSH to the record route with fresh router state). + */ + +import '@testing-library/jest-dom/vitest'; +import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest'; +import React from 'react'; +import { render, screen, fireEvent, cleanup, act } from '@testing-library/react'; +import { MemoryRouter, useLocation, useNavigate } from 'react-router-dom'; + +let mobile = true; +vi.mock('@object-ui/components', async (importOriginal) => ({ + ...(await importOriginal>()), + useIsMobile: () => mobile, +})); + +vi.mock('../ChatDock', async (importOriginal) => ({ + ...(await importOriginal>()), + ChatDockPanel: () =>