Repository navigation
feat(console): Home offers Connect an AI Assistant until the person has connected one; the first-run checklist gains its row - #31236
Merged
Conversation
…as connected one; the first-run checklist gains its row Co-Authored-By: Claude <noreply@anthropic.com>
…row, through the real router and data bus Co-Authored-By: Claude <noreply@anthropic.com>
… of any Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#1 · os-project-manager · session_01FEkQ5nLA7wiVY5YWjT9Svr Contract reviewServed-tier: The lane seat's own review of record, owed by the ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
Contributor
Author
|
domain:ui#1 · os-project-manager · session_01FEkQ5nLA7wiVY5YWjT9Svr 席位核对 · ACCEPT · 2026-11-07T19:34Z · head
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Leehom · project thread
Fixes #30895
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
console/home/ConnectAssistantCard.tsx, mounted inHomePage.tsxunder the recovery-password reminder, in both the empty and the full Home). For every signed-in person: "Work here from your AI assistant", one sentence that they can look up and change their records from Claude, Doubao and similar assistants, always as themselves, and one button, Connect an AI Assistant, which opens the page. It is drawn only when all of these hold:useConnectedAccessanswered that they have connected nothing: no authorized assistant and no API key that still works.While the read is out, or when it fails, the card stays away rather than offering a connection the person may already have. A dismissed card reads nothing.
connectAssistantCardGate.ts). Measured before adding anything: Home keeps no server-side preference; its two existing dismissible items (the recovery-password reminder and the first-run checklist) remember a dismissal in the browser'slocalStorage. The card does the same, keyed by the person (os:home:connect-assistant-dismissed:USER), so one person's dismissal on a shared browser does not hide it for the next.FirstRunChecklist.tsx, row 7,connect_assistant). "Connect an AI assistant": done once this administrator has authorized an assistant or holds an API key that still works, read from those records, never from a click; links to the page ("Connect" / "View"). Left out, like the other rows, when its state cannot be read, and left out where MCP is turned off. The read starts only once the checklist itself is going to draw, so a member's Home asks nothing for it.connectedAccess.ts). Both useuseConnectedAccessfrom PR feat(console): Connect an AI Assistant names the connected assistant and its last call; plain-words page subtitle #31198; no second copy. It gains{ enabled }so a caller that will not draw (a dismissed card, a member's checklist) costs no request, and an adapter without the auth client is now a failed read instead of a throw out of the effect.connectAssistantPath.ts, new). The avatar menu's "does the Account app carry the page, and what is its address" logic moves out ofAppHeader.tsxunchanged, and the avatar item, the Home card and the checklist row all read it.@object-ui/app-shellnow exportsuseConnectedAccess(with its types) andconnectAssistantPath, for the console's checklist.home.connectAssistant.title,body,action,dismissandconsole.firstRunChecklist.connectAssistant.title,todo,done,actionadded; nothing reworded or removed.zh-Hantregenerated withgen:zh-hant..changeset/30895-home-connect-assistant.md(@object-ui/app-shell,@object-ui/i18n,@object-ui/console: patch).Why
The card's Expected 2 ("Home shows a dismissible card … hidden once dismissed or once the person has connected one") and Expected 3 ("the administrator's first-run checklist on Home gains a row for it. Its done state is read from a real record … never from a click"). Expected 1, 4 and 5 landed in PR #30935; 2 and 3 waited for the "has connected" read, which PR #31198 built.
Tests
ConnectAssistantCard-30895.test.tsx, 9 cases, real router, real data bus and the real hook (only the adapter, the person and the served apps are stubbed): §1 nothing connected (only a revoked and an expired key) shows the card, and clicking its button lands on the Connect route; it reads only the person's own keys; §2 an authorized assistant, or a key that still works: no card; §3 while the read is out, or when it fails: no card; §4 the close button hides it, a later mount stays hidden and reads nothing, another person on the same browser still sees it; §5 no page in the Account app: no card and no read; §6 a key minted while it is shown (the data bus) takes it away.FirstRunChecklist.test.tsx, 7 new cases on the real settings client: not done with nothing connected (link to/apps/account/page/connect_agent, "0 of 7 done"); done from an authorized assistant; done from a working API key; clicking the row's link writes nothing and leaves it not done; a failed read leaves the row out; MCP off leaves the row out and reads nothing; a member reads nothing of it.scripts/ablation-replace.mjs, restored blob equal to HEAD each time): showing the card while connected (|| access.connectedremoved) turned three cases red (3 failed, 6 passed); ignoring the stored dismissal turned §4 red (1 failed, 8 passed); a checklist row that is never done (const done = false) turned two cases red (2 failed, 15 passed).Acceptance notes
layout/AppHeader.tsxandindex.tsare outside the claim's listed files. AppHeader only gives up its copy of the path rule toconnectAssistantPath.ts(21 lines out, 4 in, behaviour unchanged, its tests pass);index.tsadds the two exports the console needs.Clause-②: yes (widening): eight new catalogue keys per published@object-ui/i18npack, and two new exports from@object-ui/app-shell(a private package); nothing removed.Verification
Live, showcase on this branch (Vite console against it), admin and member, en and zh
/apps/com.objectstack.account/page/connect_agent.POST /api/v1/keys): no card; the row is done ("An AI assistant or API key of yours is connected.", "View"), "3 of 7 done". In zh the same row reads 「连接 AI 助手 / 你已连接了 AI 助手或 API 密钥。/ 查看」, 「已完成 3/7」.admin/create-user, password changed), zh, nothing connected: the card 「在 AI 助手里使用本系统 … 连接 AI 助手」, no checklist. Closing it removed it; after a reload it stayed hidden.Local tests and gates
pnpm --dir ui exec vitest run packages/app-shell/src/console/home/ packages/app-shell/src/console/connect/ packages/app-shell/src/layout/ apps/console/src/pages/settings/ packages/i18n/on head 68ff0b2: 318 files passed, 3263 tests passed, 13 skipped.type-checkfor@object-ui/app-shell,@object-ui/i18nand@object-ui/console: exit 0 (after building the console's dependency closure). eslint on the touched files: 0 errors; the new files carry no warnings.node scripts/pm/dispatch-gates.mjs --commandsderived 38 families on head 68ff0b2; all 38 exit 0,--ranreconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN (includespnpm --dir ui exec vitest run scripts/andnode scripts/check-sdui-manifest.mjs).Human Minimum
packages/specholds no runtime logic. (No spec change.)pnpm lintis CI's).main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5pMhSEyeAKtt6btsBe
Generated by Claude Code