Skip to content

fix(console): on a phone, a page the assistant opens closes its sheet - #37571

Draft
objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/project-thread-pgrwny
Draft

objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/project-thread-pgrwny

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread
Fixes #37556
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:在手机上用应用内 AI,点回答下方的引用后,AI 对话面板自动收起,直接看到被标出的那一段;再打开 AI 面板,还是原来的对话。电脑上面板照旧留在页面旁边。
  • 为什么做:记录 AI 问询专题里引用条的跟进,原先手机上点引用像没反应,要手动关面板才看得到。
  • 出错会怎样:手机上点 AI 里的链接后面板该收不收或不该收时收起;对话和数据不受影响,撤回本次合并即可恢复原样。
  • 要你做什么:无。

What changes

  • ui/packages/app-shell/src/layout/useConsoleChatDock.tsx: on a phone (the drawer is a bottom sheet over the page), the host closes the sheet when the location moves by a PUSH or POP away from the history entry (location.key) the sheet was shown open on. A PUSH onto the same URL counts (a second click on the same citation chip carries fresh section state to the same URL). A REPLACE never closes it: a page rewriting its own query, the host's handoff hand-over, and an old /ai… link landing with the drawer armed open all stay as they were.
  • The entry the sheet was shown on is kept per tab in sessionStorage (ai-chat-dock-sheet-shown-at, cleared whenever the sheet is closed), not in the hook. The booted check found why: a chip in the sheet opened over Home lands on an app's record through another layout, which mounts a new dock host that never saw the navigation; a hook-local rule left the sheet open there.
  • The rule lives in the host, not at the chip: every navigation the chat makes on a phone (citation chip, open_record, list link, open-form) now reveals the page, and the chip's click path (AiChatPage.tsx, under PR fix(chatbot): redraw record-citation chips after a reload; keep the cited-section scroll to new clicks #37539) is not touched.
  • The conversation is kept: closing only collapses the sheet; the dock target is untouched, so reopening shows the same thread. Desktop rail and the full-window rule are unchanged.
  • Changeset .changeset/37556-phone-dock-closes-on-citation.md (patch, @object-ui/app-shell).

Read first: useConsoleChatDock.tsx, the effect under the full-window one and the two storage helpers above hasHandoff.

Tests

  • ui/packages/app-shell/src/layout/__tests__/useConsoleChatDock.phoneCollapseOnNavigate-37556.test.tsx (5), the real host, useChatDockState and router, with stand-in sheet/rail: a phone chip click (PUSH to the cited record) closes the sheet, and reopening it with no target shows the same conversation; a re-click of the same chip URL closes the reopened sheet; a chip that leaves Home for an app (two layouts, two hosts) closes it and reopening shows the same conversation; a same-page REPLACE leaves it open; CONTROL: at desktop width the rail stays open after the same chip click.
  • Ablation (the collapse call replaced by a no-op): 3 failed, 2 passed (the three phone-click cases red; the REPLACE case and the desktop control green); restored 5/5.

Acceptance notes

  • Acceptance 1 (test): above.
  • Acceptance 2 (booted-console phone check): see Verification.

Verification

  • Local: the new test 5/5; @object-ui/app-shell type-check exit 0; the 38 derived gate families exit 0 (dispatch-gates --ran: 38 run, 0 NOT-MEASURED). The package's whole suite is left to CI's Test UI (a local whole-suite run of this package took about an hour on 37365 跟进:刷新或重开对话后,AI 回答下方的引用消失 #37487); declared narrowing.
  • Two-minute check: pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/useConsoleChatDock.phoneCollapseOnNavigate-37556.test.tsx, expected 5 passed.
  • Booted-console phone check (iPhone 13 profile), on a local merge of this branch with PR fix(chatbot): redraw record-citation chips after a reload; keep the cited-section scroll to new clicks #37539's head (that PR is what draws the chips from conversation history, so the fixture can show them; this branch alone does not depend on it). Showcase app (objectstack dev --seed-admin) with the ui/ console dev server pointed at it. Injected, not produced: no producer emits the citations part before cloud 10c, so the run serves the conversation-history read with an answer carrying a data-record-citations part, and a one-agent catalog because the boot has no model.
    • The old /ai/ask/CONVERSATION link lands on Home with the sheet open and 3 chips.
    • Chip click: URL /apps/com.example.showcase/showcase_field_zoo/record/ID?section=contractor-scope, sheet gone (0 in the DOM), the marked heading Contractor scope at top 45 px, in view. Before the per-tab fix the same run left the sheet open over it.
    • Reopening the assistant: sheet open, the same 3 chips. The same chip again: same URL, sheet gone, heading in view.
    • Screenshots: objectstack-seat5/ai-36996/shots-37556/ in the project files (phone-dock-before-chip.png, phone-dock-chip-closes-sheet.png, phone-dock-reopened-same-thread.png, phone-dock-same-chip-again.png, plus the script).

🤖 Generated with Claude Code


Generated by Claude Code

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CXDoFxnz75MqdAxLSW
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
…her layout

The booted phone check showed a chip in the sheet opened over Home lands
on an app's record through another layout, which mounts a new dock host
that never saw the navigation. The history entry the sheet was shown on
is now kept per tab, so the new host closes it too; a REPLACE never does.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CXDoFxnz75MqdAxLSW

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

37487 跟进:手机上点 AI 引用后,对话面板仍盖住被引用的段落

2 participants