Skip to content

feat(app-shell): favourite conversations open the assistant drawer in place from the sidebar - #38005

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-cw7d7z
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-cw7d7z

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Requested by Tesla · project thread
Fixes #37863
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:收藏过的 AI 对话出现在侧边栏「收藏」里,点一下就在当前页面右侧的助手抽屉里打开这段对话,页面不跳走;对话已被删除时,这一行会划掉、标「该对话已不可用」,仍可从菜单里移除。对话开始后(发出第一条消息后),抽屉顶部会出现 ☆ 收藏按钮,在侧栏、全屏和手机抽屉里都有;点一下收藏或取消。
  • 为什么做:「问 AI」入口改造专题的收藏会话卡,让常回看的对话能一键找回,不用翻历史。
  • 出错会怎样:最坏是点收藏没有在抽屉里打开,或误把可用的对话标成不可用;收藏数据本身不会丢,直接撤回这次改动即恢复原样。
  • 要你做什么:无。

What changes

Implements card #37863 as claimed (claim 7221246375), including the drawer header's ☆. C4 (#37970, the header row) merged at 4af32b99; this branch merged origin/main with it as a real merge (8aa37202, no conflict, no rebase), then added the ☆ (33463930) and settled its test on the header (3141f4db).

  1. A conversation favourite (FavoriteItem.type: 'conversation', id conversation:ID, new optional fields conversationId and agent). href is the conversation's /ai… address (aiAddressOf). It is a content favourite, so it counts against the cap of 20 (capByBucket unchanged). conversationFavoriteItem (new layout/conversationFavorites.ts) builds the entry the ☆ will toggle; the agent is stored as its route name (agentRouteName).
  2. The sidebar row opens the drawer in place. In UnifiedSidebar's Favorites rows, a conversation favourite's link click calls useChatDockControl().open({ agent, conversationId }), the target a history row opens (ui ADR-0057 A5, row 5), and closes the phone sidebar. The row stays a link: the address is followed with no drawer host, on the app's AI inquiry page (askPageActive, A4, where open refuses a non-handoff target; seat ruling in the claim), and for a modified click (new tab).
  3. The label follows the conversation; a gone one is marked. useUnavailableConversationFavorites reads each shown conversation favourite once per mount through the new readConversationRow (useConversationList.ts, the list's own normalize). A label that moved (server title, else latest user message, as the history row reads) is written back with refreshLabel. A 404 or 403 marks the row unavailable for that mount only (never stored): struck through, aria-disabled, a screen-reader suffix from the new sidebar.conversationUnavailable key, and a click opens nothing; its ⋯ menu still removes it. Any other failure (5xx, network) marks nothing.
  4. The drawer header's ☆ (33463930). ChatDockConversationActions gains agent (the route name, reported by ChatDockConversation). Once a thread exists (after the first send) the ☆ sits before + in the rail, the full window and the phone sheet; nothing is drawn before the first send. A click toggles conversationFavoriteItem (label: the header title, or 「New conversation」 while it loads); while favourited it is aria-pressed, named by common.addToFavorites / common.removeFromFavorites. A header title that changes while favourited is written back with refreshLabel (through a ref, ui AGENTS chore: version packages #10).
  5. Icon. CONTENT_KIND_ICON.conversation = 'message-circle'.
  6. i18n. sidebar.conversationUnavailable in all 11 packs (zh-Hant generated by gen:zh-hant).

Not in this card (seat ruling in the claim): restoring the record focus chip from the conversation's metadata is C5's (#37861); a favourite opens the same target a history row does.

Tests

  • New UnifiedSidebar.conversationFavorites-37863.test.tsx (15 cases; real FavoritesProvider, NavigationRenderer, SidebarItemMenu; a stand-in drawer handle; stubbed fetch): row and glyph; click opens the drawer in place and the address does not move; a backend agent name stores the route name; modified clicks are left to the link; no host and the A4 page follow the address; other favourites keep their link; server title and latest-message labels written back; 404 and 403 drawn unavailable and inert, store untouched; removal from ⋯; 500 and network failure mark nothing; the cap of 20 rolls the oldest content favourite off when a conversation is added.
  • Ablation, on disk with scripts/ablation-replace.mjs, restored to HEAD each time: the row's onClick removed → 6 of 15 red; readConversationRow reading 404/403 as a failure → 3 of 15 red; the label write-back removed → 2 of 15 red.
Readings

Acceptance notes

  • Unavailable is read once per mount. A conversation deleted from history while the sidebar stays mounted is marked on the next mount, not at once. Clicking it before then opens the drawer on a conversation the chat cannot load.
  • Reads. Up to 8 conversation reads per sidebar mount (the shown rows), one per favourite, none repeated within the mount.
  • README (ui/packages/app-shell/README.md, user-scoped state section) gained one paragraph per ui AGENTS.md commandment ✨ Set up Copilot instructions #2; outside the claim's first file list, reported to the seat.
  • content/docs/frontend/** has no page on favourites; nothing to update there.

Verification

Read first, by risk:

  1. ui/packages/app-shell/src/layout/UnifiedSidebar.tsx: openConversationFavorite and the row's link props.
  2. ui/packages/app-shell/src/layout/conversationFavorites.ts: useUnavailableConversationFavorites.
  3. ui/packages/app-shell/src/hooks/useConversationList.ts: readConversationRow.

Two-minute check: pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/UnifiedSidebar.conversationFavorites-37863.test.tsx. Expected: 15 passed.


Generated by Claude Code

… place from the sidebar

A favourite of type `conversation` stores the conversation id and agent;
its sidebar row opens the drawer on it, follows its server label, and is
drawn unavailable when the server answers it is gone or not this user's.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibxdwshRvTk3qXc7A6A
@github-actions github-actions Bot added size/l 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 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i

L1-c, the seat's L1 thread · 2026-11-27T16:47Z

席位核对 — L1 @ 3141f4db5cda384052b7819e5bda79e093adc6d8

Verdict: ACCEPT. There is one bookkeeping item for the seat before landing: amend the claim to name chatDockTarget.ts.

No contract review is owed. The diff touches no packages/spec/src/** and no governed path, the declaration is Clause-②: no with no narrowing arm, and record-recognisers --paths decides no face. So this L1 read is the whole review.

Checklist

  • Shape and relation. The PR is a draft on base main, with first line Fixes #37863 and no other closing keyword. C4 (feat(app-shell): Ask AI opens a new conversation after the user's own close, and the drawer header names the conversation #37970) has landed and is merged in at 8aa37202. Fixes is right; each of the card's five steps is in the diff:

    1. The conversation favourite type. It has id conversation:ID, plus conversationId, agent and the /ai… href. It counts against the cap of 20.
    2. The drawer header's ☆. It is drawn once a conversation id and an agent exist, before +, in the rail, the full window and the sheet. It sets aria-pressed while starred.
    3. The sidebar row opens the drawer in place. It calls chatDock.open(target). The href is followed only where no drawer can take it:
      • no dock control;
      • the app's AI inquiry page (askPageActive);
      • a modified or non-primary click.
    4. Stale entries. readConversationRow answers null only on 404/403, so a network failure never marks an entry stale. A stale row is struck through, opens nothing, and can still be removed from its ⋯ menu.
    5. Labels. The label follows the header title (☆) and the history row (sidebar). Reading focus back from metadata is C5's (入口专题 C5:记录焦点状态机重写,标签进输入框行首,去掉钉住与「改为问」,从会话 metadata 读回 #37861), by the seat's ruling in the claim.
  • Scope. 23 files. All but one are inside the claim (7221246375) and its amendment 7222387748 (the README paragraph). ui/packages/app-shell/src/layout/chatDockTarget.ts (+2: the optional agent on ChatDockConversationActions) is not named. It is a type line the ☆ needs, in the same private package. Please amend the claim to name it; that is prose only, and the head does not move.

  • Changeset, read sentence by sentence (.changeset/37863-favourite-conversations.md). app-shell and i18n are both patch, as Metadata-protocol: none requires. Every bullet is true at this head:

    • The ☆: drawn after the first send, pressed while starred, in all three presentations, and the label follows.
    • FavoriteItem.conversation: with the cap of 20.
    • The in-place open: with the three fallbacks.
    • Each favourite is read once: a requested set per apiBase.
    • The deleted mark: sidebar.conversationUnavailable, one new key in each of the 11 packs, with zh-Hant generated.
  • The Clause-② line (note, no change asked). Clause-②: no with a new key in a published locale pack follows this repository's mixed practice. C4, Q-page and others declared no for keys only app-shell reads; C7 and Q2a declared yes (widening). It decides no review face here either way.

  • Test and gate evidence. The os-dev-report (7222360447) and its delta (7223592078) cover:

    • ChatDock.favoriteStar-37863: 8/8, three runs in a row after 3141f4db made it wait for the header +;
    • the sidebar favourites test;
    • two ablations: removing the ☆ reds 6/8, removing the label follow reds 2/8;
    • 256 related files green, and local derived gates 41/41.

    Check-runs at this head: 47 success, 15 expected skip, 0 failed, 0 pending. Lint & Repo Gates and TypeScript Type Check are green. No dogfood battery is owed.

Note

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Landing · 2026-11-27T16:49Z · zone o3-askai (seat card thread)
Head-sha: 3141f4db5cda384052b7819e5bda79e093adc6d8

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 27, 2026 16:50
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit bb13a30 Nov 27, 2026
63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-cw7d7z branch November 27, 2026 17:18
os-tesla pushed a commit that referenced this pull request Nov 27, 2026
Main's UnifiedSidebar (#38005) imports resolveAiApiBase from
hooks/aiApiBase.js, the module this PR had folded back into useAiSurface.ts.
The module stays, for the reason it was split out: a reader that needs only
the URL must not import the surface hook's module, which the layout tests
mock without resolveAiApiBase. useAiSurface.ts imports and re-exports it as
main does; only the module's doc comment changes (its first reader,
useAskAiHandler, leaves with ask_ai).

Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK
Co-authored-by: Claude <noreply@anthropic.com>
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/l 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.

入口专题 C8:收藏会话(抽屉 ☆、侧边栏收藏、原地打开),19.1

2 participants