Skip to content

feat(app-shell): workbench home ask-AI box opens the drawer with the question - #39908

Merged
objectstack-fleet[bot] merged 15 commits into
mainfrom
claude/project-thread-ne2bl5
Dec 6, 2026
Merged

objectstack-fleet[bot] merged 15 commits into
mainfrom
claude/project-thread-ne2bl5

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Jack · project thread

Refs #39878

Was stacked on #39895, which has landed; main (with it) is merged into this branch.

What changes

The first slice of #39878 as revised on 2026-12-06 (「最小上线切片」): a prominent ask-AI box under the workbench home's greeting. Suggestions, attachments and the phone app list placement are later slices.

  • The box (WorkbenchAskSlot.tsx): full width under the greeting, placeholder 「问问你的数据,或让 AI 帮你做事…」 / "Ask about your data, or have AI do something for you…". Enter or the send button opens the right-side drawer (the phone sheet below md) on a new ask conversation whose first message is the question; the workbench page does not navigate (objectstack#34608: AI lives only in the drawer). Shift+Enter breaks the line; an Enter that ends an IME composition (pinyin, kana) sends nothing. Drawn only where an ask agent is served, otherwise the slot collapses. It replaces the 「Ask AI」 button the slot held, and is drawn for admins too (the card: admins can have AI change apps from here), so HomeAiActions' maker exclusion does not apply.
  • Scope = all apps: the workbench is a built-in app, so the drawer opened here is app-less (ambientAppPackage) and the conversation is created with no package — it is filed under 「All」 in the drawer history.
  • Drawer handoff delivered (the reason this is more than the one file the order named): ChatDockControl.open(target, handoff) documents that a handoff's prompt "is held in memory and sent once as the target thread's first message", and useConsoleChatDock holds it — but the body never received it ({...thread} spread a handoff prop ChatDockPanel does not declare), so nothing delivered it (declared ≠ enforced). Now:
    • ChatDockPanel / ChatDockMobileSheet forward handoff to ChatDockConversation;
    • ChatDockConversation puts the prompt into the existing first-send stash (pendingFirstMessageRef) only once the fresh thread it was opened with is in view with no conversation yet — never into a thread that already exists, each seq once, a still-held first message joined rather than replaced — and bumps a signal that ChatPane passes to useDeferredFirstSend's existing pendingSignal, which then creates the conversation and replays the send exactly like a typed first message;
    • useConsoleChatDock: the body moving its own thread (its first send naming the fresh thread, a history row, +) spends the held handoff, so a body mounted again (drawer reopened, phone sheet shown again) never sends it twice.
    • The question rides memory only, never the URL or storage (objectui#12493's rule); under a layout with no drawer useOpenAssistant already carries it in navigation state to the pre-drawer address, which routes back into the drawer.
  • i18n: workbench.ask.placeholder / workbench.ask.send in all 11 packs (zh-Hant regenerated by gen:zh-hant).

Why

The maintainer asked for an in-app AI entry on the workbench home (#39871 phase 1, #39878's 2026-12-06 revision): a box under the greeting that opens the right-hand AI panel with the question, scoped to all apps, hidden when the runtime serves no AI.

Verification

  • Tests (new pins in the existing harness files, per the shared-harness rule):
    • WorkbenchHomePage.test.tsx › WorkbenchAskSlot: placeholder and accessible names from the packs; Enter and the send button call open({ agent: 'ask', fresh: true }, { handoffPrompt }) with the trimmed question and empty the box, no navigation; Shift+Enter, IME Enter (isComposing, keyCode 229) and a blank box send nothing; with no drawer host it navigates to /ai/ask?new=1 with the question in state; no ask agent → empty slot.
    • ChatDockConversation.hostProps-38454.test.tsx › handoff: held + signalled on a fresh ask thread; same seq not taken twice, a second seq joined; an existing thread never receives it (mutation-checked: dropping the fresh/no-conversation gate fails this pin); a blank prompt sends nothing.
    • vitest run over app-shell/src/{layout,console/home,console/workbench,console/ai} + packages/i18n: 389 files, 4182 passed, 13 skipped, 0 failed.
  • type-check for @object-ui/app-shell and @object-ui/i18n clean; eslint on every touched file: no new finding (one intentional setState in an effect is annotated with why); check:i18n-keys, check:i18n-drift, check:new-line-citations (0 new), check:empty-changeset, check:changeset-fixed, check:adr-0087-registration, check:test-source-alias, check:doc-authoring pass.
  • Browser check in a running os dev (showcase, --fresh; verify tree = this branch + feat(workbench): the built-in Workbench app (工作台), served by os dev and os serve #39896's head merged locally, not pushed; both have since landed on main; Console from ui/ source over Vite). The open runtime serves no AI agent, so /api/v1/ai/agents, the conversation create and /agents/ask/chat were stubbed in Playwright, recording what the console sends:
    • 1280 px and 375 px, en and zh-CN: the box under the greeting with the pack's placeholder; typing a question and pressing Enter opens the drawer (1280) / sheet (375) with the question as the first user bubble and the stubbed answer under it; the page URL is unchanged and the box is emptied.
    • What was sent, every combination: one conversation create with no package metadata (body {}), then one /agents/ask/chat on that conversation whose only user message is the typed question, context.agentName: 'ask', uiLocale en / zh-CN.
    • Close + reopen from the top-bar 「Ask AI」 (1280 and 375): no second send. A second question from the box while the drawer is open: a second, new conversation with only that question.
    • Screenshots of the box and the drawer, at 1280 and 375, in en and zh-CN, are kept with the dispatching seat (eight PNGs; not committed, per the clean-tree rule).

Clause-②: no
Metadata-protocol: none

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (no packages/spec change)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request. (was stacked on feat(app-shell): workbench home — greeting, ask-AI slot, today's three columns, recents, my-apps rail (workbench:home) #39895 by the dispatch order; main merged in after it landed)
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: n/a.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4EjjRhgTtzifTZgBfaW8D

claude added 11 commits December 6, 2026 09:57
The page the built-in workbench app's Home menu entry mounts, drawn in the
app shell from the retired desktop home's sections: greeting and summary,
an ask-AI slot, today's three columns (my tasks / awaiting approval /
notifications), recents, the empty environment's add-app entries, and from
1280 px a right rail with my apps and add app. The ask-AI slot and the task
column are their own modules for #39878 and #39873 to fill.

Claude-Session: https://claude.ai/code/session_01Q4EjjPnSQ8vC4cCFntmXL7
Co-authored-by: Claude <noreply@anthropic.com>
…; main column fills when no rail

Claude-Session: https://claude.ai/code/session_01Q4EjjPnSQ8vC4cCFntmXL7
Co-authored-by: Claude <noreply@anthropic.com>
Matches the workbench menu order (Home, Approvals, Tasks, Notes) the
maintainer asked for in #39896: approvals, then my tasks, then
notifications.

Claude-Session: https://claude.ai/code/session_01Q4EjjPnSQ8vC4cCFntmXL7
Co-authored-by: Claude <noreply@anthropic.com>
From 1280 px the page is one four-track grid: Today's three columns
and the 「My apps」 rail each take a track, so the rail is exactly a
Today column wide. Side by side, the Today columns stretch to one
height of at least a header and three rows, and 「My apps」 is at least
that tall, so the first row's tops and bottoms line up whether a
column is empty or full. 「Add app」 is its own card, and the rail no
longer repeats the doors the empty environment expands in the main
column. 「Recently accessed」 appears with its first item instead of an
empty strip. Home's activity card and the connect-assistant card take
the same card shell as the others.

Claude-Session: https://claude.ai/code/session_01Q4EjjPnSQ8vC4cCFntmXL7
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 6, 2026
@github-actions github-actions Bot added size/m and removed size/xl labels Dec 6, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:cloud@hotlong · hotlong · session_01Q4EjjQzFqHGjUAXt8kBQhV

L1: ACCEPT at head 55baedc5 · reviewer of record repo:cloud@hotlong · read 2026-12-06T12:35Z.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 6, 2026 12:36
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge December 6, 2026 12:36
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 6, 2026
Merged via the queue into main with commit 04c6bb7 Dec 6, 2026
65 checks passed
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 tests 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.

2 participants