You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 21ad7c5
Browse filesBrowse the repository at this point in the historyBrowse files
feat(app-shell): the AI inquiry page lists this app's recent conversations (#37940)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D3PqTGGb1rgoRqKj4rT4Xjk)_Fixes#37790
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:在应用的 AI 问询页首页,提问框下方新增「最近的对话」,列出在本页、为本应用发起的最近 5 条对话(标题 +
多久以前),点一下就在本页打开;没有时显示一句空状态。
- 为什么做:AI 问询首页史诗的第三步,让常来提问的用户能接着上次的问题继续,不必再去右上角机器人里找。
- 出错会怎样:最坏是列表漏掉或多列出一条对话;打开时仍走原有的归属校验,别的应用或抽屉里的对话不会被打开;改动可直接撤回。
- 要你做什么:无。
## What changes
- `AppAskPage` home state: a "Recent conversations" section below the
question box. It reads the caller's newest 50 conversations through the
existing list hook (`useConversationList`, `GET
/conversations?limit=50`), keeps those whose `metadata.activePackageId`
is this app's package, and shows the newest 5 with title and relative
time (`timeAgo`, display locale). Empty state when none; nothing drawn
while the list loads or fails.
- A click writes `?c=ID` (push), so the page's existing restore path
judges it exactly as a reload does: no second ownership check.
- `appAskPageModel.ts`: `recentAskPageConversations` (reuses
`conversationBelongsToAskPage`), `ASK_RECENT_FETCH_LIMIT`,
`MAX_ASK_RECENT`.
- `useConversationList.ts`: `ConversationListItem` carries `metadata`
when the row's value is a record (`AiConversationSchema.metadata`); any
other value reads as absent, so such a row is not listed.
- i18n: `console.ai.askPage.recentTitle` / `recentEmpty` in all eleven
locales.
- Item 2 of the card (the drawer opener) is cut per the seat's Premise
corrected (ADR-0057 Amendment A4, "No drawer on the page"); nothing here
opens the drawer.
## Tests
- `appAskPageModel.test.ts`, new top-level describe
`recentAskPageConversations (objectstack#37790)`: package filter
(another app, a drawer row with no metadata, a drawer row with other
metadata), the cap of 5, the empty answer.
- `AppAskPage-37788.test.tsx`, new top-level describe `AppAskPage recent
conversations (objectstack#37790)` over the real page and real list hook
with a stubbed fetch: only this app's rows listed newest first and
capped (another app's, a drawer row and a string-metadata row excluded);
empty state; a failing list draws nothing; a click opens the
conversation in the page through `?c=`.
- Ablation of the package filter (`scripts/ablation-replace.mjs`, filter
predicate mutated to keep every row): 4 of the new cases red, restore
proven by blob hash equal to HEAD.
## Acceptance notes
- The list wire is the spec's `AiConversationSchema.metadata`, a record.
The client does not JSON-parse a string-valued `metadata`
(contract-first): such a row is simply not listed, and a pinned case
shows it. If the cloud list route ever ships a string there, that is the
route's contract defect.
- Drawer create paths (`ChatDockConversation`, `AiChatPage`) pass no
`createMetadata`, so a drawer thread carries no `activePackageId` and
never lists.
- The card's claim named `useChatConversation.ts` for the type; its
`ServerConversation` already carries `metadata` from #37788. The list
row type lives in `useConversationList.ts`, which is the file changed
here.
## Verification
Two-minute check: open an app that has an `ai:chat` entry, ask a
question, press "New conversation": the question appears under "Recent
conversations"; clicking it reopens it with `?c=` in the address. A
thread started from the top-bar robot elsewhere does not appear.
<details><summary>Local readings</summary>
See the os-dev-report comment on #37790 for the commands, exit codes and
the ablation log.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_016WV4cwGVgec21LwQTtRY85
---------
Co-authored-by: Claude <noreply@anthropic.com>
feat(app-shell): an app's AI inquiry page lists its recent conversations on the home state
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
Below the question box, the `ai:chat` page's home state lists the newest five conversations the caller started on this page for this app (title and when it was last active), read from the caller's newest 50 conversations and kept by their `metadata.activePackageId`. A conversation started in the assistant drawer, or on another app's page, is not listed; with none, the section says so. Choosing one opens it in the page through its `?c=` address. The conversation-history list row (`ConversationListItem`) now carries the row's `metadata` when it is a record. New strings: `console.ai.askPage.recentTitle` and `console.ai.askPage.recentEmpty`.
0 commit comments