diff --git a/.changeset/37862-empty-conversation.md b/.changeset/37862-empty-conversation.md
new file mode 100644
index 00000000000..d86bdf332f1
--- /dev/null
+++ b/.changeset/37862-empty-conversation.md
@@ -0,0 +1,18 @@
+---
+'@object-ui/app-shell': patch
+'@object-ui/plugin-chatbot': patch
+'@object-ui/i18n': patch
+---
+
+feat(app-shell): one empty-conversation layout for the AI home, the full-window drawer and the narrow drawer
+
+Clause-②: yes (widening) — `@object-ui/plugin-chatbot` `ChatbotEnhancedProps` gains the optional `renderEmptyState`; `@object-ui/i18n` gains `console.ai.suggestionsLabel` and `console.ai.suggestions.page.*` (eight keys) in every locale
+Metadata-protocol: none
+
+A conversation with no message now shows the same layout in all three places: a greeting, a line on what to ask, suggested questions and the recent conversations with their titles.
+
+- **The AI home page** (an app's `ai:chat` entry) keeps its large question box, its suggestions that send and its recent conversations that open on the page. Its heading is the entry's declared `title`; with none it now greets the user by the time of day and name, as Home does, where it read "Ask your data".
+- **The console's assistant drawer** draws the layout before the first message: large when the drawer fills the window, compact in the side rail and the phone sheet. The composer stays where it is, under the conversation. The `ask` assistant's suggestions follow the page in view: on a record, "Summarize this record" and "What is related to this record?" put their text in the composer for the user to finish; on a list, a dashboard or a report, the page's two questions send at once. Elsewhere, and for other assistants, the starter questions are the ones they had. The recent conversations list the drawer assistant's last three (five in the full window), not the AI home's own, and open in the drawer.
+- **`@object-ui/plugin-chatbot`.** `ChatbotEnhanced` takes `renderEmptyState`: a host's empty conversation drawn in place of the built-in one, given `send` (sends a text) and `fill` (puts it in the composer, focused, sending nothing).
+
+Nothing to migrate.
diff --git a/ui/packages/app-shell/src/console/ai/AppAskPage.tsx b/ui/packages/app-shell/src/console/ai/AppAskPage.tsx
index c0fe5b98622..da492270653 100644
--- a/ui/packages/app-shell/src/console/ai/AppAskPage.tsx
+++ b/ui/packages/app-shell/src/console/ai/AppAskPage.tsx
@@ -23,6 +23,11 @@
* (`recentAskPageConversations`). A drawer thread is never one of them. Opening one
* writes its `?c=`, so it is restored the way a reload restores it.
*
+ * The home state is the shared empty conversation (`EmptyConversation`,
+ * objectstack#37862), large, with this page's own question box in its
+ * composer slot: the drawer draws the same layout. Its heading is the entry's
+ * declared title, else the time-of-day greeting; the entry's suggestions send.
+ *
* The page is the one ask conversation on its screen: while it is the active
* route the console's drawer stays closed and its triggers are hidden or inert
* (`useConsoleChatDock`'s `askPageActive`). A build hand-off from here still
@@ -34,10 +39,10 @@
import * as React from 'react';
import { useNavigate, useParams, useSearchParams } from 'react-router-dom';
-import { ArrowUp, MessageSquare, Plus, Sparkles } from 'lucide-react';
+import { ArrowUp, Plus, Sparkles } from 'lucide-react';
import { useAuth } from '@object-ui/auth';
-import { Badge, Button, Textarea, cn } from '@object-ui/components';
-import { useDisplayLocale, useObjectTranslation } from '@object-ui/i18n';
+import { Badge, Button, Textarea } from '@object-ui/components';
+import { useObjectTranslation } from '@object-ui/i18n';
import { resolveNavItemLabel } from '@object-ui/layout';
import type { NavigationItem } from '@object-ui/types';
import { resolveAgentParam, useAgents } from '@object-ui/plugin-chatbot/core';
@@ -58,7 +63,8 @@ import { useChatConversation, type HydratedUIMessage } from '../../hooks/useChat
import { fetchConversation } from '../../hooks/useChatConversation.js';
import { useAiSurfaceEnabled } from '../../hooks/useAiSurface.js';
import { useConversationList } from '../../hooks/useConversationList.js';
-import { timeAgo } from '../../utils/relativeTime.js';
+import { EmptyConversation, EmptyConversationGreeting, RecentConversationList } from './EmptyConversation.js';
+import { appHomeSuggestions } from './emptyConversationModel.js';
import { useHomePath } from '../../hooks/useHomePath.js';
import { useMetadata } from '../../providers/MetadataProvider.js';
import { useNavigationContext } from '../../context/NavigationContext.js';
@@ -90,6 +96,8 @@ export function AppAskPage() {
const entry = React.useMemo(() => findAiChatNavEntry(app), [app]);
const copy = React.useMemo(() => readAiChatPageCopy(entry), [entry]);
const pageLabel = entry ? resolveNavItemLabel(entry as unknown as NavigationItem, t, undefined, language) : '';
+ // The page header's name when the entry has no label: the declared title,
+ // else the neutral one. The home state's heading greets instead (below).
const title = copy.title ?? t('console.ai.empty.ask.title', { defaultValue: 'Ask your data' });
const subtitle = copy.subtitle ?? t('console.ai.empty.ask.description', {
defaultValue:
@@ -272,7 +280,7 @@ export function AppAskPage() {
} else {
body = (
}
subtitle={subtitle}
placeholder={placeholder}
suggestions={copy.suggestions}
@@ -311,7 +319,7 @@ export function AppAskPage() {
function noop() {}
interface AskHomeProps {
- title: string;
+ heading: React.ReactNode;
subtitle: string;
placeholder: string;
suggestions: string[];
@@ -322,77 +330,65 @@ interface AskHomeProps {
recent?: React.ReactNode;
}
-/** The home state: the welcome, the large question box and the suggested questions. */
-function AskHome({ title, subtitle, placeholder, suggestions, scopeLabel, sendLabel, onAsk, recent }: AskHomeProps) {
+/**
+ * The home state: the shared empty conversation, large, with this page's
+ * question box in its composer slot. The entry's suggestions send.
+ */
+function AskHome({ heading, subtitle, placeholder, suggestions, scopeLabel, sendLabel, onAsk, recent }: AskHomeProps) {
const [text, setText] = React.useState('');
const submit = () => {
if (text.trim()) onAsk(text);
};
+ const homeSuggestions = React.useMemo(() => appHomeSuggestions(suggestions), [suggestions]);
return (
-
-
-
-
- {title}
-
-
- {subtitle}
-
-
-
+ }
+ />
);
}
@@ -411,47 +407,17 @@ interface RecentAskConversationsProps {
*/
function RecentAskConversations({ userId, apiBase, packageId, onOpen }: RecentAskConversationsProps) {
const { t } = useObjectTranslation();
- const displayLocale = useDisplayLocale();
const { conversations, isLoading, error } = useConversationList({ userId, apiBase, limit: ASK_RECENT_FETCH_LIMIT });
const recent = React.useMemo(() => recentAskPageConversations(conversations, packageId), [conversations, packageId]);
// A list that has not answered, or failed, draws nothing: never an empty state it cannot vouch for.
if (isLoading || error) return null;
return (
-
-
- )}
-
+ onOpen(conversation.id)}
+ />
);
}
diff --git a/ui/packages/app-shell/src/console/ai/ChatPane.tsx b/ui/packages/app-shell/src/console/ai/ChatPane.tsx
index 8168e80b1b3..0f2c4fcc4c1 100644
--- a/ui/packages/app-shell/src/console/ai/ChatPane.tsx
+++ b/ui/packages/app-shell/src/console/ai/ChatPane.tsx
@@ -72,6 +72,8 @@ import { isSpreadsheetAttachment, uploadChatAttachments, chatAttachmentNotes } f
import { listLinkTarget, recordOpenTarget, nextSectionOpening } from './aiChatLinks.js';
import { hydratedMessagesToChatMessages } from './aiChatHydration.js';
import { localizeAgentLabel, agentEmptyState, buildAgentSuggestions } from './agentCopy.js';
+import { drawerSuggestions, type EmptyConversationSize } from './emptyConversationModel.js';
+import { DrawerRecentConversations, EmptyConversation, EmptyConversationGreeting } from './EmptyConversation.js';
import {
useDeferredFirstSend,
useComposerDraftHandoff,
@@ -163,6 +165,20 @@ interface ChatPaneProps {
* @default false
*/
actionsInHost?: boolean;
+ /**
+ * objectstack#37862 — the host draws the shared empty conversation before
+ * the first message (`EmptyConversation`): the greeting, what to ask, the
+ * page's suggestions and 「最近会话」, `large` where the chat fills the
+ * window and `compact` in the rail and the phone sheet. `userId` and
+ * `onOpenConversation` list the recent conversations and open one where the
+ * host shows conversations; without them the section is not drawn. Absent,
+ * the pane keeps the chat's built-in empty state.
+ */
+ emptyConversation?: {
+ size: EmptyConversationSize;
+ userId?: string;
+ onOpenConversation?: (conversation: { id: string; agentId?: string }) => void;
+ };
}
export function ChatPane({
@@ -188,6 +204,7 @@ export function ChatPane({
onShare,
hideHeader = false,
actionsInHost = false,
+ emptyConversation,
}: ChatPaneProps) {
const { t, language } = useObjectTranslation();
const navigate = useNavigate();
@@ -603,6 +620,45 @@ export function ChatPane({
);
const emptyState = useMemo(() => agentEmptyState(t, activeAgent), [t, activeAgent]);
+ // objectstack#37862 — the shared empty conversation, where the host asks for
+ // it. The page's suggestions read the surface the agent is sent; one about
+ // the record in view fills the composer, the rest send.
+ const emptySuggestions = useMemo(
+ () =>
+ emptyConversation
+ ? drawerSuggestions(t, { agentName: activeAgent, agentLabel: activeAgentLabel, surface: surfaceContext })
+ : [],
+ [emptyConversation, t, activeAgent, activeAgentLabel, surfaceContext],
+ );
+ const emptySize = emptyConversation?.size;
+ const recentUserId = emptyConversation?.userId;
+ const openRecentConversation = emptyConversation?.onOpenConversation;
+ const renderEmptyState = useMemo(() => {
+ if (!emptySize) return undefined;
+ return (actions: { send: (text: string) => void; fill: (text: string) => void }) => (
+ }
+ subtitle={emptyState.description}
+ suggestions={emptySuggestions}
+ onSuggestion={(suggestion) =>
+ suggestion.mode === 'fill' ? actions.fill(suggestion.text) : actions.send(suggestion.text)
+ }
+ recent={
+ recentUserId && openRecentConversation ? (
+
+ ) : null
+ }
+ />
+ );
+ }, [emptySize, emptyState.description, emptySuggestions, recentUserId, openRecentConversation, apiBase, activeAgent]);
+
// objectstack#37146 — with one launchable agent there is nothing to switch,
// so the row names no agent (it read only 「提问」 once the in-app build
// entry closed). Where the host lifts Share into its own title bar (the
@@ -844,6 +900,7 @@ export function ChatPane({
onModelChange={setSelectedModelId}
allowanceUsedFraction={allowanceUsedFraction}
suggestions={suggestions}
+ renderEmptyState={renderEmptyState}
onSendMessage={handleSend}
// objectstack#32749 — the attach button and the attachment chips: the
// send reads spreadsheets, images and PDFs (see `doSend`), and a file
diff --git a/ui/packages/app-shell/src/console/ai/EmptyConversation.tsx b/ui/packages/app-shell/src/console/ai/EmptyConversation.tsx
new file mode 100644
index 00000000000..9f1989886bd
--- /dev/null
+++ b/ui/packages/app-shell/src/console/ai/EmptyConversation.tsx
@@ -0,0 +1,248 @@
+// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
+
+/**
+ * EmptyConversation — the one layout a conversation shows before its first
+ * message (objectstack#37862, topic objectstack#37853 C7): a greeting, a
+ * line on what to ask, the composer, suggested questions and 「最近会话」
+ * with each conversation's title.
+ *
+ * One component, three places, two sizes:
+ * - the AI home page (`AppAskPage`, ui ADR-0057 A4), `large`, drawing its own
+ * large question box in the `composer` slot; a recent conversation opens on
+ * that page;
+ * - the drawer filling the window, `large`, and the narrow drawer (rail and
+ * phone sheet), `compact`. There the composer stays docked under the
+ * conversation (it carries the page chip, the focus row and queued sends),
+ * so the slot is empty; a recent conversation opens in the drawer.
+ *
+ * What a suggestion does is its `mode` (`emptyConversationModel.ts`): the host
+ * sends a `send` one and puts a `fill` one in the composer.
+ */
+
+import * as React from 'react';
+import { MessageSquare } from 'lucide-react';
+import { useAuth } from '@object-ui/auth';
+import { Button, cn } from '@object-ui/components';
+import { useDisplayLocale, useObjectTranslation } from '@object-ui/i18n';
+import { useConversationList, type ConversationListItem } from '../../hooks/useConversationList.js';
+import { timeAgo } from '../../utils/relativeTime.js';
+import {
+ DRAWER_RECENT_COUNT,
+ DRAWER_RECENT_FETCH_LIMIT,
+ greetingForHour,
+ greetingName,
+ selectDrawerRecent,
+ type EmptyConversationSize,
+ type EmptySuggestion,
+} from './emptyConversationModel.js';
+
+/**
+ * The time-of-day greeting with the user's name, as Home writes it: the name
+ * in the primary colour, the pack's own separator and closing mark.
+ */
+export function EmptyConversationGreeting({ now }: { now?: Date }) {
+ const { t } = useObjectTranslation();
+ const { user } = useAuth();
+ const hour = (now ?? new Date()).getHours();
+ const { key, defaultValue } = greetingForHour(hour);
+ const greeting = t(key, { defaultValue });
+ const name = greetingName(user);
+ return (
+ <>
+
+ {greeting}
+ {name ? t('home.greetingSeparator', { defaultValue: ', ' }) : ''}
+
+ {name ? {name} : null}
+ {t('home.greetingEnd', { defaultValue: '.' })}
+ >
+ );
+}
+
+export interface EmptyConversationProps {
+ size: EmptyConversationSize;
+ /** The heading: the greeting, or the AI home's declared title. */
+ heading: React.ReactNode;
+ /** The line under the heading. */
+ subtitle?: string;
+ /** The host's own question box (the AI home); absent where the composer is docked below. */
+ composer?: React.ReactNode;
+ suggestions: readonly EmptySuggestion[];
+ /** A suggestion was clicked: the host sends it or fills the composer, by its `mode`. */
+ onSuggestion: (suggestion: EmptySuggestion) => void;
+ /** 「最近会话」, drawn last. */
+ recent?: React.ReactNode;
+ className?: string;
+}
+
+export function EmptyConversation({
+ size,
+ heading,
+ subtitle,
+ composer,
+ suggestions,
+ onSuggestion,
+ recent,
+ className,
+}: EmptyConversationProps) {
+ const { t } = useObjectTranslation();
+ const large = size === 'large';
+ return (
+
+ );
+}
+
+export interface RecentConversationListProps {
+ size: EmptyConversationSize;
+ conversations: readonly ConversationListItem[];
+ /** Drawn when there are none; absent, the section is not drawn at all. */
+ emptyText?: string;
+ onOpen: (conversation: ConversationListItem) => void;
+}
+
+/**
+ * 「最近会话」: each conversation's title (the history row's label: the
+ * server title, else the latest user message) and when it was last active,
+ * newest first.
+ */
+export function RecentConversationList({ size, conversations, emptyText, onOpen }: RecentConversationListProps) {
+ const { t } = useObjectTranslation();
+ const displayLocale = useDisplayLocale();
+ if (conversations.length === 0 && !emptyText) return null;
+ const title = t('console.ai.askPage.recentTitle', { defaultValue: 'Recent conversations' });
+ const large = size === 'large';
+ return (
+
+
+ )}
+
+ );
+}
+
+/**
+ * The drawer's 「最近会话」: the caller's newest list page, read through
+ * `selectDrawerRecent`. A list that has not answered, or failed, draws nothing.
+ */
+export function DrawerRecentConversations({
+ size,
+ userId,
+ apiBase,
+ agentName,
+ onOpen,
+}: {
+ size: EmptyConversationSize;
+ userId: string;
+ apiBase: string;
+ agentName: string | undefined;
+ onOpen: (conversation: { id: string; agentId?: string }) => void;
+}) {
+ const { conversations, isLoading, error } = useConversationList({ userId, apiBase, limit: DRAWER_RECENT_FETCH_LIMIT });
+ const recent = React.useMemo(
+ () => selectDrawerRecent(conversations, agentName, DRAWER_RECENT_COUNT[size]),
+ [conversations, agentName, size],
+ );
+ if (isLoading || error) return null;
+ return (
+ onOpen({ id: conversation.id, agentId: conversation.agentId })}
+ />
+ );
+}
diff --git a/ui/packages/app-shell/src/console/ai/__tests__/AppAskPage-37788.test.tsx b/ui/packages/app-shell/src/console/ai/__tests__/AppAskPage-37788.test.tsx
index 4e020c7590c..98d4876f4ad 100644
--- a/ui/packages/app-shell/src/console/ai/__tests__/AppAskPage-37788.test.tsx
+++ b/ui/packages/app-shell/src/console/ai/__tests__/AppAskPage-37788.test.tsx
@@ -131,8 +131,8 @@ describe('AppAskPage (objectstack#37788)', () => {
it('draws the copy the entry declares', () => {
mount();
- expect(screen.getByTestId('app-ask-title')).toHaveTextContent('Ask about our policies');
- expect(screen.getByTestId('app-ask-subtitle')).toHaveTextContent('Rules, forms and deadlines.');
+ expect(screen.getByTestId('empty-conversation-heading')).toHaveTextContent('Ask about our policies');
+ expect(screen.getByTestId('empty-conversation-subtitle')).toHaveTextContent('Rules, forms and deadlines.');
expect(screen.getByTestId('app-ask-input')).toHaveAttribute('placeholder', 'Type a question');
expect(screen.getByTestId('app-ask-scope')).toHaveTextContent('Answers prefer this app');
expect(screen.getByRole('button', { name: 'How do I apply?' })).toBeInTheDocument();
@@ -143,14 +143,20 @@ describe('AppAskPage (objectstack#37788)', () => {
it('falls back to the neutral copy for every key the entry omits', () => {
apps = [appWith()];
mount();
- expect(screen.getByTestId('app-ask-title')).toHaveTextContent('Ask your data');
+ // objectstack#37862 — with no declared title the home state greets by
+ // the time of day (the seat's ruling on the claim); the subtitle keeps the
+ // neutral platform line.
+ expect(screen.getByTestId('empty-conversation-heading').textContent).toMatch(
+ /^(Good morning|Good afternoon|Good evening|Working late)\.$/,
+ );
+ expect(screen.getByTestId('empty-conversation-subtitle')).toHaveTextContent(/Ask questions about your records/);
expect(screen.getByTestId('app-ask-input')).toHaveAttribute('placeholder', 'Ask anything…');
- expect(screen.queryByTestId('app-ask-suggestions')).not.toBeInTheDocument();
+ expect(screen.queryByTestId('empty-conversation-suggestions')).not.toBeInTheDocument();
});
it('never reads its copy from the URL', () => {
mount('/apps/brightrule/component/ai/chat?title=Injected');
- expect(screen.getByTestId('app-ask-title')).toHaveTextContent('Ask about our policies');
+ expect(screen.getByTestId('empty-conversation-heading')).toHaveTextContent('Ask about our policies');
});
it('a suggestion asks it: the pane mounts on ask, bound to the package, and the create records the app', async () => {
@@ -255,7 +261,7 @@ describe('AppAskPage recent conversations (objectstack#37790)', () => {
...[2, 3, 4, 5, 6].map((n) => row(`p${n}`, `Question ${n}`, `2026-11-2${n}T10:00:00Z`, { activePackageId: PKG })),
]);
mount();
- const items = await screen.findAllByTestId('app-ask-recent-item');
+ const items = await screen.findAllByTestId('empty-conversation-recent-item');
expect(items.map((i) => i.getAttribute('data-conversation'))).toEqual(['p6', 'p5', 'p4', 'p3', 'p2']);
expect(screen.queryByText('Other app thread')).not.toBeInTheDocument();
expect(screen.queryByText('Drawer thread')).not.toBeInTheDocument();
@@ -270,8 +276,8 @@ describe('AppAskPage recent conversations (objectstack#37790)', () => {
row('d1', 'Drawer thread', '2026-11-26T09:00:00Z'),
]);
mount();
- expect(await screen.findByTestId('app-ask-recent-empty')).toHaveTextContent('Questions you ask here will appear here.');
- expect(screen.queryByTestId('app-ask-recent-item')).not.toBeInTheDocument();
+ expect(await screen.findByTestId('empty-conversation-recent-empty')).toHaveTextContent('Questions you ask here will appear here.');
+ expect(screen.queryByTestId('empty-conversation-recent-item')).not.toBeInTheDocument();
});
it('draws nothing while the list fails, never an empty state', async () => {
@@ -279,7 +285,7 @@ describe('AppAskPage recent conversations (objectstack#37790)', () => {
mount();
await waitFor(() => expect(lists()).toHaveLength(1));
await act(async () => {});
- expect(screen.queryByTestId('app-ask-recent')).not.toBeInTheDocument();
+ expect(screen.queryByTestId('empty-conversation-recent')).not.toBeInTheDocument();
});
it('a click opens the conversation in the page through ?c=', async () => {
diff --git a/ui/packages/app-shell/src/console/ai/__tests__/emptyConversationModel-37862.test.ts b/ui/packages/app-shell/src/console/ai/__tests__/emptyConversationModel-37862.test.ts
new file mode 100644
index 00000000000..4ea5dfe1c99
--- /dev/null
+++ b/ui/packages/app-shell/src/console/ai/__tests__/emptyConversationModel-37862.test.ts
@@ -0,0 +1,98 @@
+// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
+
+/**
+ * objectstack#37862 — the empty conversation's rules with no React: the
+ * greeting's time of day and name, the kind of page the drawer sits on, and
+ * which suggestions each place offers with what a click on one does.
+ */
+
+import { describe, it, expect } from 'vitest';
+import {
+ appHomeSuggestions,
+ drawerSuggestions,
+ greetingForHour,
+ greetingName,
+ pageKindOfSurface,
+} from '../emptyConversationModel';
+
+const t = (_key: string, options?: Record) => String(options?.defaultValue ?? _key);
+
+describe('greetingForHour (objectstack#37862)', () => {
+ it('greets by Home\'s keys at each boundary', () => {
+ expect(greetingForHour(0).key).toBe('home.greetingNight');
+ expect(greetingForHour(4).key).toBe('home.greetingNight');
+ expect(greetingForHour(5).key).toBe('home.greetingMorning');
+ expect(greetingForHour(11).key).toBe('home.greetingMorning');
+ expect(greetingForHour(12).key).toBe('home.greetingAfternoon');
+ expect(greetingForHour(17).key).toBe('home.greetingAfternoon');
+ expect(greetingForHour(18).key).toBe('home.greetingEvening');
+ expect(greetingForHour(22).key).toBe('home.greetingEvening');
+ expect(greetingForHour(23).key).toBe('home.greetingNight');
+ });
+});
+
+describe('greetingName (objectstack#37862)', () => {
+ it('is the display name, else the email before @, else nothing', () => {
+ expect(greetingName({ name: ' Dana Lee ', email: 'dana@acme.test' })).toBe('Dana Lee');
+ expect(greetingName({ name: '', email: 'dana@acme.test' })).toBe('dana');
+ expect(greetingName({})).toBe('');
+ expect(greetingName(undefined)).toBe('');
+ });
+});
+
+describe('pageKindOfSurface (objectstack#37862)', () => {
+ it('reads the kind off the surface the console sends', () => {
+ expect(pageKindOfSurface({ artifact: { type: 'object', name: 'deal' }, selection: { kind: 'record', id: 'd1' } })).toBe('record');
+ expect(pageKindOfSurface({ artifact: { type: 'object', name: 'deal' } })).toBe('list');
+ expect(pageKindOfSurface({ artifact: { type: 'object', name: 'deal' }, selection: { kind: 'view', id: 'v' } })).toBe('list');
+ expect(pageKindOfSurface({ artifact: { type: 'dashboard', name: 'pipeline' } })).toBe('dashboard');
+ expect(pageKindOfSurface({ artifact: { type: 'report', name: 'won' } })).toBe('report');
+ expect(pageKindOfSurface({ artifact: { type: 'page', name: 'welcome' } })).toBeUndefined();
+ expect(pageKindOfSurface(undefined)).toBeUndefined();
+ });
+});
+
+describe('drawerSuggestions (objectstack#37862)', () => {
+ const record = { artifact: { type: 'object', name: 'deal' }, selection: { kind: 'record', id: 'd1' } };
+
+ it('ask on a record: the record\'s two suggestions, which fill', () => {
+ const s = drawerSuggestions(t, { agentName: 'ask', agentLabel: 'Ask', surface: record });
+ expect(s.map((x) => x.text)).toEqual(['Summarize this record', 'What is related to this record?']);
+ expect(s.every((x) => x.mode === 'fill')).toBe(true);
+ });
+
+ it('ask on a list, a dashboard or a report: that page\'s suggestions, which send', () => {
+ for (const surface of [
+ { artifact: { type: 'object', name: 'deal' } },
+ { artifact: { type: 'dashboard', name: 'pipeline' } },
+ { artifact: { type: 'report', name: 'won' } },
+ ]) {
+ const s = drawerSuggestions(t, { agentName: 'ask', agentLabel: 'Ask', surface });
+ expect(s).toHaveLength(2);
+ expect(s.every((x) => x.mode === 'send')).toBe(true);
+ }
+ expect(drawerSuggestions(t, { agentName: 'ask', agentLabel: 'Ask', surface: { artifact: { type: 'report', name: 'won' } } })[0].text)
+ .toBe('Summarize this report');
+ });
+
+ it('ask on a page with no kind: the agent\'s starters, which send', () => {
+ const s = drawerSuggestions(t, { agentName: 'ask', agentLabel: 'Ask', surface: undefined });
+ expect(s.map((x) => x.text).join(' ')).toMatch(/How many users/);
+ expect(s.every((x) => x.mode === 'send')).toBe(true);
+ });
+
+ it('another agent on a record: its own starters, never the record\'s', () => {
+ const s = drawerSuggestions(t, { agentName: 'build', agentLabel: 'Build', surface: record });
+ expect(s.map((x) => x.text)).not.toContain('Summarize this record');
+ expect(s.every((x) => x.mode === 'send')).toBe(true);
+ });
+});
+
+describe('appHomeSuggestions (objectstack#37862)', () => {
+ it('an app\'s own suggestions send, in the declared order', () => {
+ expect(appHomeSuggestions(['B', 'A'])).toEqual([
+ { text: 'B', mode: 'send' },
+ { text: 'A', mode: 'send' },
+ ]);
+ });
+});
diff --git a/ui/packages/app-shell/src/console/ai/emptyConversationModel.ts b/ui/packages/app-shell/src/console/ai/emptyConversationModel.ts
new file mode 100644
index 00000000000..b6eee0e1a6c
--- /dev/null
+++ b/ui/packages/app-shell/src/console/ai/emptyConversationModel.ts
@@ -0,0 +1,171 @@
+// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
+
+/**
+ * The empty conversation (objectstack#37862, topic objectstack#37853 C7), the
+ * parts that need no React: the greeting's time of day, what kind of page the
+ * drawer sits on, and the suggestions each place offers with what a click on
+ * one does.
+ *
+ * One layout, three places: the AI home page (`AppAskPage`, ui ADR-0057 A4),
+ * the drawer filling the window, and the narrow drawer (rail and phone sheet,
+ * the compact form). Kept free of the chat UI so its rules are unit-tested
+ * without it.
+ */
+
+import { agentAliasGroup, isAskAgent } from '@object-ui/plugin-chatbot/core';
+import type { ChatSurfaceContext } from '../../layout/chatSurfaceContext.js';
+import type { ConversationListItem } from '../../hooks/useConversationList.js';
+import { buildAgentSuggestions } from './agentCopy.js';
+import { ASK_RECENT_FETCH_LIMIT } from './appAskPageModel.js';
+
+type TranslationFn = (key: string, options?: Record) => string;
+
+/**
+ * What a click on a suggestion does. `send` sends its text as the first
+ * message; `fill` puts the text in the composer for the user to finish, and
+ * sends nothing. An app's own suggestions on its AI home send (as that page
+ * always did); the drawer's platform suggestions about the record in view fill.
+ */
+export type EmptySuggestionMode = 'send' | 'fill';
+
+export interface EmptySuggestion {
+ text: string;
+ mode: EmptySuggestionMode;
+}
+
+/** The two sizes: the AI home and the filled window draw `large`, the rail and the sheet `compact`. */
+export type EmptyConversationSize = 'large' | 'compact';
+
+/**
+ * The time-of-day greeting's key for a local hour, the one Home greets with
+ * (`home.greeting*`), so the console greets one way everywhere.
+ */
+export function greetingForHour(hour: number): { key: string; defaultValue: string } {
+ if (hour < 5) return { key: 'home.greetingNight', defaultValue: 'Working late' };
+ if (hour < 12) return { key: 'home.greetingMorning', defaultValue: 'Good morning' };
+ if (hour < 18) return { key: 'home.greetingAfternoon', defaultValue: 'Good afternoon' };
+ if (hour < 23) return { key: 'home.greetingEvening', defaultValue: 'Good evening' };
+ return { key: 'home.greetingNight', defaultValue: 'Working late' };
+}
+
+/** The name the greeting addresses: the user's display name, else the part of their email before `@`. */
+export function greetingName(user: { name?: unknown; email?: unknown } | null | undefined): string {
+ const name = typeof user?.name === 'string' ? user.name.trim() : '';
+ if (name) return name;
+ const email = typeof user?.email === 'string' ? user.email : '';
+ return (email.split('@')[0] ?? '').trim();
+}
+
+/**
+ * The kind of page the drawer sits on, read off the surface the console sends
+ * the agent (`consoleChatSurface`): a record (on its page or in the list's
+ * record drawer), an object's list, a dashboard or a report. Any other page
+ * (Home, a custom page, a component page) has no kind of its own.
+ */
+export type EmptyPageKind = 'record' | 'list' | 'dashboard' | 'report';
+
+export function pageKindOfSurface(surface: ChatSurfaceContext | undefined): EmptyPageKind | undefined {
+ const type = surface?.artifact?.type;
+ if (type === 'object') return surface?.selection?.kind === 'record' ? 'record' : 'list';
+ if (type === 'dashboard' || type === 'report') return type;
+ return undefined;
+}
+
+/**
+ * The platform's suggestions for a kind of page. The two about the record in
+ * view fill the composer: the user names what they want from it. The rest send.
+ */
+function pageSuggestions(t: TranslationFn, kind: EmptyPageKind): EmptySuggestion[] {
+ switch (kind) {
+ case 'record':
+ return [
+ {
+ text: t('console.ai.suggestions.page.record.summarize', { defaultValue: 'Summarize this record' }),
+ mode: 'fill',
+ },
+ {
+ text: t('console.ai.suggestions.page.record.related', { defaultValue: 'What is related to this record?' }),
+ mode: 'fill',
+ },
+ ];
+ case 'list':
+ return [
+ {
+ text: t('console.ai.suggestions.page.list.summarize', { defaultValue: 'Summarize the records in this list' }),
+ mode: 'send',
+ },
+ {
+ text: t('console.ai.suggestions.page.list.recent', { defaultValue: 'Which records were added this week?' }),
+ mode: 'send',
+ },
+ ];
+ case 'dashboard':
+ return [
+ {
+ text: t('console.ai.suggestions.page.dashboard.explain', { defaultValue: 'What does this dashboard show?' }),
+ mode: 'send',
+ },
+ {
+ text: t('console.ai.suggestions.page.dashboard.standOut', { defaultValue: 'What stands out on this dashboard?' }),
+ mode: 'send',
+ },
+ ];
+ case 'report':
+ return [
+ {
+ text: t('console.ai.suggestions.page.report.summarize', { defaultValue: 'Summarize this report' }),
+ mode: 'send',
+ },
+ {
+ text: t('console.ai.suggestions.page.report.takeaways', { defaultValue: 'What are the key takeaways from this report?' }),
+ mode: 'send',
+ },
+ ];
+ }
+}
+
+/**
+ * The drawer's suggestions. The `ask` agent on a page of a known kind offers
+ * that page's; anything else (another agent, or a page with no kind) offers
+ * the agent's starters, which send, as before.
+ */
+export function drawerSuggestions(
+ t: TranslationFn,
+ options: { agentName: string | undefined; agentLabel: string; surface: ChatSurfaceContext | undefined },
+): EmptySuggestion[] {
+ const kind = isAskAgent(options.agentName) ? pageKindOfSurface(options.surface) : undefined;
+ if (kind) return pageSuggestions(t, kind);
+ return buildAgentSuggestions(options.agentName, options.agentLabel, t).map((text) => ({ text, mode: 'send' }));
+}
+
+/** An app's own suggestions on its AI home: each sends, in the declared order. */
+export function appHomeSuggestions(texts: readonly string[]): EmptySuggestion[] {
+ return texts.map((text) => ({ text, mode: 'send' }));
+}
+
+/**
+ * How many of the caller's newest conversations the drawer reads to pick its
+ * recent ones from: the AI home's page size, so a
+ * caller with many app-home or other-agent threads still sees the drawer's own.
+ */
+export const DRAWER_RECENT_FETCH_LIMIT = ASK_RECENT_FETCH_LIMIT;
+
+/** How many recent conversations each size lists in the drawer. */
+export const DRAWER_RECENT_COUNT: Record = { large: 5, compact: 3 };
+
+/**
+ * The drawer's recent conversations: of the caller's newest list page, those
+ * of the drawer's agent (alias-aware, as its history scopes them) and none the
+ * AI home created for an app (`metadata.activePackageId`: that page's own
+ * threads, which open there), newest first as the list gives them.
+ */
+export function selectDrawerRecent(
+ rows: readonly ConversationListItem[],
+ agentName: string | undefined,
+ count: number,
+): ConversationListItem[] {
+ const group = agentName ? new Set(agentAliasGroup(agentName)) : undefined;
+ return rows
+ .filter((row) => (!group || !row.agentId || group.has(row.agentId)) && row.metadata?.activePackageId === undefined)
+ .slice(0, count);
+}
diff --git a/ui/packages/app-shell/src/layout/ChatDockConversation.tsx b/ui/packages/app-shell/src/layout/ChatDockConversation.tsx
index 99f3b11ed23..b4333868f31 100644
--- a/ui/packages/app-shell/src/layout/ChatDockConversation.tsx
+++ b/ui/packages/app-shell/src/layout/ChatDockConversation.tsx
@@ -326,6 +326,14 @@ export function ChatDockConversation({
[apiBase],
);
const publicShareBase = React.useMemo(() => resolvePublicShareBase(), []);
+ const emptyConversation = React.useMemo(
+ () => ({
+ size: presentation === 'full' ? ('large' as const) : ('compact' as const),
+ userId,
+ onOpenConversation: openConversation,
+ }),
+ [presentation, userId, openConversation],
+ );
const inert = !isLoading && agents.length === 0;
React.useEffect(() => {
onActionsChange?.(
@@ -387,6 +395,10 @@ export function ChatDockConversation({
onSent={handleSent}
onShare={() => setShareOpen(true)}
actionsInHost={actionsInHost}
+ // objectstack#37862 — the shared empty conversation: large where
+ // the drawer fills the window, compact in the rail and the sheet;
+ // a recent conversation opens here, as a history row does.
+ emptyConversation={emptyConversation}
/>
{/* Rail and sheet: the history covers the chat while open; the pane
diff --git a/ui/packages/app-shell/src/layout/__tests__/ChatDock.emptyConversation-37862.test.tsx b/ui/packages/app-shell/src/layout/__tests__/ChatDock.emptyConversation-37862.test.tsx
new file mode 100644
index 00000000000..fda29a2ba2a
--- /dev/null
+++ b/ui/packages/app-shell/src/layout/__tests__/ChatDock.emptyConversation-37862.test.tsx
@@ -0,0 +1,213 @@
+// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
+
+/**
+ * objectstack#37862 — the drawer's empty conversation: the layout the AI home
+ * draws, large where the drawer fills the window and compact in the rail and
+ * the phone sheet. The greeting names the user; the suggestions follow the
+ * page in view (one about the record fills the composer, the rest send); 「最近
+ * 会话」 lists the drawer agent's threads and opens one in the drawer.
+ *
+ * ## Real subjects
+ *
+ * The real `ChatDockConversation`, the real `ChatPane`, the real
+ * `ChatbotEnhanced` with its composer, the real `useChatConversation` and
+ * `useConversationList` over a `fetch` stub. Stand-ins: the agent catalog,
+ * the signed-in user, and the chat transport (`useObjectChat`: no messages,
+ * `sendMessage` recorded).
+ */
+
+// AiChatPage reads a dropped spreadsheet through `import('@object-ui/plugin-grid')`; load it
+// here so collection pays that transform, not a clocked case (check-test-source-alias).
+import '@object-ui/plugin-grid';
+import '@testing-library/jest-dom/vitest';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
+import { MemoryRouter } from 'react-router-dom';
+import React from 'react';
+
+const state = {
+ agents: [{ name: 'ask', label: 'Ask' }] as Array<{ name: string; label: string }>,
+ sendMessage: vi.fn(),
+};
+
+vi.mock('@object-ui/plugin-chatbot', async (importOriginal) => {
+ const actual = await importOriginal>();
+ return {
+ ...actual,
+ useAiModels: () => ({ models: [], defaultModelId: undefined }),
+ useHitlInChat: () => ({ decide: vi.fn(), decisions: {} }),
+ useObjectChat: () => ({
+ messages: [],
+ isLoading: false,
+ error: undefined,
+ sendMessage: state.sendMessage,
+ stop: vi.fn(),
+ reload: vi.fn(),
+ clear: vi.fn(),
+ setMessages: vi.fn(),
+ }),
+ };
+});
+vi.mock('@object-ui/plugin-chatbot/core', async (importOriginal) => ({
+ ...(await importOriginal()),
+ useAgents: () => ({ agents: state.agents, isLoading: false, error: undefined, refetch: vi.fn() }),
+}));
+vi.mock('@object-ui/auth', async (importOriginal) => ({
+ ...(await importOriginal>()),
+ useAuth: () => ({ user: { id: 'u1', name: 'Dana' } }),
+}));
+vi.mock('../../providers/AdapterProvider', async (importOriginal) => ({
+ ...(await importOriginal>()),
+ useAdapter: () => null,
+}));
+vi.mock('../AiUsageIndicator', () => ({ AiUsageIndicator: () => null }));
+
+import { I18nProvider } from '@object-ui/i18n';
+import { ChatDockConversation } from '../ChatDockConversation';
+import type { ChatSurfaceContext } from '../chatSurfaceContext';
+
+window.matchMedia = ((query: string) => ({
+ matches: false,
+ media: query,
+ onchange: null,
+ addEventListener: () => {},
+ removeEventListener: () => {},
+ addListener: () => {},
+ removeListener: () => {},
+ dispatchEvent: () => false,
+})) as unknown as typeof window.matchMedia;
+
+const API = '/api/v1/ai';
+let listRows: unknown[];
+let creates: number;
+
+function installFetch(): void {
+ vi.stubGlobal(
+ 'fetch',
+ vi.fn(async (input: RequestInfo | URL, init?: RequestInit) => {
+ const url = String(input);
+ const method = init?.method ?? 'GET';
+ const json = (body: unknown, status = 200) =>
+ new Response(JSON.stringify(body), { status, headers: { 'Content-Type': 'application/json' } });
+ if (url.startsWith(`${API}/conversations?`) && method === 'GET') return json({ conversations: listRows });
+ if (url === `${API}/conversations` && method === 'POST') {
+ creates += 1;
+ return json({ id: `conv-new-${creates}`, messages: [] });
+ }
+ if (/\/conversations\/[^/?]+$/.test(url) && method === 'GET') return json({ messages: [] });
+ return json({ success: true, data: [] });
+ }),
+ );
+}
+
+const RECORD: ChatSurfaceContext = { artifact: { type: 'object', name: 'deal' }, selection: { kind: 'record', id: 'd1' } };
+const LIST: ChatSurfaceContext = { artifact: { type: 'object', name: 'deal' } };
+
+function renderDrawer(options: {
+ presentation?: 'rail' | 'full' | 'sheet';
+ surface?: ChatSurfaceContext;
+} = {}) {
+ const onTargetChange = vi.fn();
+ render(
+
+
+
+
+ ,
+ );
+ return { onTargetChange };
+}
+
+const row = (id: string, title: string, updatedAt: string, extra: Record = {}) => ({
+ id,
+ title,
+ createdAt: updatedAt,
+ updatedAt,
+ ...extra,
+});
+
+beforeEach(() => {
+ state.agents = [{ name: 'ask', label: 'Ask' }];
+ state.sendMessage = vi.fn();
+ listRows = [];
+ creates = 0;
+ window.localStorage.clear();
+ window.sessionStorage.clear();
+ installFetch();
+});
+
+afterEach(() => {
+ cleanup();
+ vi.unstubAllGlobals();
+});
+
+describe('the drawer\'s empty conversation (objectstack#37862)', () => {
+ it('compact in the rail and the sheet, large where the drawer fills the window', async () => {
+ renderDrawer({ presentation: 'rail' });
+ expect(await screen.findByTestId('empty-conversation')).toHaveAttribute('data-size', 'compact');
+ cleanup();
+ renderDrawer({ presentation: 'sheet' });
+ expect(await screen.findByTestId('empty-conversation')).toHaveAttribute('data-size', 'compact');
+ cleanup();
+ renderDrawer({ presentation: 'full' });
+ expect(await screen.findByTestId('empty-conversation')).toHaveAttribute('data-size', 'large');
+ });
+
+ it('greets the user by name, with the ask agent\'s line under it', async () => {
+ renderDrawer();
+ const heading = await screen.findByTestId('empty-conversation-heading');
+ expect(heading.textContent).toMatch(/^(Good morning|Good afternoon|Good evening|Working late), Dana\.$/);
+ expect(screen.getByTestId('empty-conversation-subtitle')).toHaveTextContent(/Ask questions about your records/);
+ });
+
+ it('on a record: its suggestions fill the composer and send nothing', async () => {
+ renderDrawer({ surface: RECORD });
+ const suggestion = await screen.findByRole('button', { name: 'Summarize this record' });
+ expect(suggestion).toHaveAttribute('data-mode', 'fill');
+ fireEvent.click(suggestion);
+ const composer = within(screen.getByTestId('chat-dock-body')).getByRole('textbox') as HTMLTextAreaElement;
+ expect(composer.value).toBe('Summarize this record');
+ expect(document.activeElement).toBe(composer);
+ await new Promise((resolve) => setTimeout(resolve, 50));
+ expect(creates).toBe(0);
+ expect(state.sendMessage).not.toHaveBeenCalled();
+ });
+
+ it('on a list: a suggestion sends, which creates the conversation', async () => {
+ renderDrawer({ surface: LIST });
+ const suggestion = await screen.findByRole('button', { name: 'Summarize the records in this list' });
+ expect(suggestion).toHaveAttribute('data-mode', 'send');
+ fireEvent.click(suggestion);
+ await waitFor(() => expect(creates).toBe(1));
+ });
+
+ it('「最近会话」 lists the drawer agent\'s threads, not the AI home\'s, and opens one in the drawer', async () => {
+ listRows = [
+ row('a1', 'Pipeline question', '2026-11-26T10:00:00Z', { agentId: 'ask' }),
+ row('h1', 'AI home thread', '2026-11-26T11:00:00Z', { agentId: 'ask', metadata: { activePackageId: 'app.crm' } }),
+ row('b1', 'Build thread', '2026-11-26T12:00:00Z', { agentId: 'build' }),
+ row('a2', 'Older question', '2026-11-20T10:00:00Z', { agentId: 'ask' }),
+ row('a3', 'Third', '2026-11-19T10:00:00Z', { agentId: 'ask' }),
+ row('a4', 'Fourth, beyond the compact three', '2026-11-18T10:00:00Z', { agentId: 'ask' }),
+ ];
+ const { onTargetChange } = renderDrawer();
+ const items = await screen.findAllByTestId('empty-conversation-recent-item');
+ expect(items.map((item) => item.getAttribute('data-conversation'))).toEqual(['a1', 'a2', 'a3']);
+ fireEvent.click(items[0]);
+ expect(onTargetChange).toHaveBeenCalledWith({ agent: 'ask', conversationId: 'a1' });
+ });
+
+ it('draws no 「最近会话」 when the user has none', async () => {
+ renderDrawer();
+ await screen.findByTestId('empty-conversation');
+ await waitFor(() => expect(vi.mocked(fetch).mock.calls.some(([url]) => String(url).includes('/conversations?'))).toBe(true));
+ await new Promise((resolve) => setTimeout(resolve, 20));
+ expect(screen.queryByTestId('empty-conversation-recent')).not.toBeInTheDocument();
+ });
+});
diff --git a/ui/packages/i18n/src/locales/ar.ts b/ui/packages/i18n/src/locales/ar.ts
index 02853a42444..c6ee4296ca4 100644
--- a/ui/packages/i18n/src/locales/ar.ts
+++ b/ui/packages/i18n/src/locales/ar.ts
@@ -2646,7 +2646,29 @@ const ar = {
availableObjects: "اذكر كائنات البيانات المتاحة.",
recentActivity: "لخّص نشاطي الأخير.",
},
+ // objectstack#37862 — the drawer's empty conversation: the platform's
+ // suggestions by the kind of page in view (`emptyConversationModel.ts`).
+ page: {
+ record: {
+ summarize: 'لخّص هذا السجل',
+ related: 'ما المرتبط بهذا السجل؟',
+ },
+ list: {
+ summarize: 'لخّص السجلات في هذه القائمة',
+ recent: 'ما السجلات التي أُضيفت هذا الأسبوع؟',
+ },
+ dashboard: {
+ explain: 'ماذا تعرض لوحة المعلومات هذه؟',
+ standOut: 'ما اللافت في لوحة المعلومات هذه؟',
+ },
+ report: {
+ summarize: 'لخّص هذا التقرير',
+ takeaways: 'ما أبرز النقاط في هذا التقرير؟',
+ },
+ },
},
+ // objectstack#37862 — the accessible name of the empty conversation's suggestions.
+ suggestionsLabel: 'أسئلة مقترحة',
discussing: "قيد العرض: {{target}}",
focus: {
pin: "مواصلة السؤال عن هذا السجل",
diff --git a/ui/packages/i18n/src/locales/de.ts b/ui/packages/i18n/src/locales/de.ts
index b030cd61002..293d76dd135 100644
--- a/ui/packages/i18n/src/locales/de.ts
+++ b/ui/packages/i18n/src/locales/de.ts
@@ -2374,7 +2374,29 @@ const de = {
availableObjects: "Liste die verfügbaren Datenobjekte auf.",
recentActivity: "Fasse meine letzten Aktivitäten zusammen.",
},
+ // objectstack#37862 — the drawer's empty conversation: the platform's
+ // suggestions by the kind of page in view (`emptyConversationModel.ts`).
+ page: {
+ record: {
+ summarize: 'Diesen Datensatz zusammenfassen',
+ related: 'Was hängt mit diesem Datensatz zusammen?',
+ },
+ list: {
+ summarize: 'Die Datensätze in dieser Liste zusammenfassen',
+ recent: 'Welche Datensätze wurden diese Woche hinzugefügt?',
+ },
+ dashboard: {
+ explain: 'Was zeigt dieses Dashboard?',
+ standOut: 'Was fällt auf diesem Dashboard auf?',
+ },
+ report: {
+ summarize: 'Diesen Bericht zusammenfassen',
+ takeaways: 'Was sind die wichtigsten Erkenntnisse aus diesem Bericht?',
+ },
+ },
},
+ // objectstack#37862 — the accessible name of the empty conversation's suggestions.
+ suggestionsLabel: 'Vorgeschlagene Fragen',
discussing: "Angezeigt: {{target}}",
focus: {
pin: "Weiter zu diesem Datensatz fragen",
diff --git a/ui/packages/i18n/src/locales/en.ts b/ui/packages/i18n/src/locales/en.ts
index 39b76d88631..486b32c6925 100644
--- a/ui/packages/i18n/src/locales/en.ts
+++ b/ui/packages/i18n/src/locales/en.ts
@@ -3209,7 +3209,29 @@ const en = {
availableObjects: 'List the available data objects.',
recentActivity: 'Summarize my recent activity.',
},
+ // objectstack#37862 — the drawer's empty conversation: the platform's
+ // suggestions by the kind of page in view (`emptyConversationModel.ts`).
+ page: {
+ record: {
+ summarize: 'Summarize this record',
+ related: 'What is related to this record?',
+ },
+ list: {
+ summarize: 'Summarize the records in this list',
+ recent: 'Which records were added this week?',
+ },
+ dashboard: {
+ explain: 'What does this dashboard show?',
+ standOut: 'What stands out on this dashboard?',
+ },
+ report: {
+ summarize: 'Summarize this report',
+ takeaways: 'What are the key takeaways from this report?',
+ },
+ },
},
+ // objectstack#37862 — the accessible name of the empty conversation's suggestions.
+ suggestionsLabel: 'Suggested questions',
// objectui#3546 slice four — the AI console surfaces: the /ai chat page's app switcher,
// connection banner and plan/publish cards, the ChatDock chrome, and the
// conversation-list date buckets. `group.*` is the template-key family
diff --git a/ui/packages/i18n/src/locales/es.ts b/ui/packages/i18n/src/locales/es.ts
index 93907f51cec..f4ef31b0c41 100644
--- a/ui/packages/i18n/src/locales/es.ts
+++ b/ui/packages/i18n/src/locales/es.ts
@@ -2444,7 +2444,29 @@ const es = {
availableObjects: "Enumera los objetos de datos disponibles.",
recentActivity: "Resume mi actividad reciente.",
},
+ // objectstack#37862 — the drawer's empty conversation: the platform's
+ // suggestions by the kind of page in view (`emptyConversationModel.ts`).
+ page: {
+ record: {
+ summarize: 'Resumir este registro',
+ related: '¿Qué está relacionado con este registro?',
+ },
+ list: {
+ summarize: 'Resumir los registros de esta lista',
+ recent: '¿Qué registros se añadieron esta semana?',
+ },
+ dashboard: {
+ explain: '¿Qué muestra este panel?',
+ standOut: '¿Qué destaca en este panel?',
+ },
+ report: {
+ summarize: 'Resumir este informe',
+ takeaways: '¿Cuáles son las conclusiones clave de este informe?',
+ },
+ },
},
+ // objectstack#37862 — the accessible name of the empty conversation's suggestions.
+ suggestionsLabel: 'Preguntas sugeridas',
discussing: "Viendo: {{target}}",
focus: {
pin: "Seguir preguntando sobre este registro",
diff --git a/ui/packages/i18n/src/locales/fr.ts b/ui/packages/i18n/src/locales/fr.ts
index 3c3b61f9afd..57da64bbf58 100644
--- a/ui/packages/i18n/src/locales/fr.ts
+++ b/ui/packages/i18n/src/locales/fr.ts
@@ -2440,7 +2440,29 @@ const fr = {
availableObjects: "Liste les objets de données disponibles.",
recentActivity: "Résume mon activité récente.",
},
+ // objectstack#37862 — the drawer's empty conversation: the platform's
+ // suggestions by the kind of page in view (`emptyConversationModel.ts`).
+ page: {
+ record: {
+ summarize: 'Résumer cet enregistrement',
+ related: "Qu'est-ce qui est lié à cet enregistrement ?",
+ },
+ list: {
+ summarize: 'Résumer les enregistrements de cette liste',
+ recent: 'Quels enregistrements ont été ajoutés cette semaine ?',
+ },
+ dashboard: {
+ explain: 'Que montre ce tableau de bord ?',
+ standOut: "Qu'est-ce qui ressort de ce tableau de bord ?",
+ },
+ report: {
+ summarize: 'Résumer ce rapport',
+ takeaways: 'Quels sont les points clés de ce rapport ?',
+ },
+ },
},
+ // objectstack#37862 — the accessible name of the empty conversation's suggestions.
+ suggestionsLabel: 'Questions suggérées',
discussing: "Affiché : {{target}}",
focus: {
pin: "Continuer à poser des questions sur cet enregistrement",
diff --git a/ui/packages/i18n/src/locales/ja.ts b/ui/packages/i18n/src/locales/ja.ts
index 2831d84c0fb..271762cbcf3 100644
--- a/ui/packages/i18n/src/locales/ja.ts
+++ b/ui/packages/i18n/src/locales/ja.ts
@@ -2376,7 +2376,29 @@ const ja = {
availableObjects: "利用できるデータオブジェクトを一覧にしてください。",
recentActivity: "最近の自分の活動を要約してください。",
},
+ // objectstack#37862 — the drawer's empty conversation: the platform's
+ // suggestions by the kind of page in view (`emptyConversationModel.ts`).
+ page: {
+ record: {
+ summarize: 'このレコードを要約',
+ related: 'このレコードに関連するものは?',
+ },
+ list: {
+ summarize: 'この一覧のレコードを要約',
+ recent: '今週追加されたレコードは?',
+ },
+ dashboard: {
+ explain: 'このダッシュボードは何を示していますか?',
+ standOut: 'このダッシュボードで目立つ点は?',
+ },
+ report: {
+ summarize: 'このレポートを要約',
+ takeaways: 'このレポートの要点は?',
+ },
+ },
},
+ // objectstack#37862 — the accessible name of the empty conversation's suggestions.
+ suggestionsLabel: 'おすすめの質問',
discussing: "表示中: {{target}}",
focus: {
pin: "このレコードについて質問し続ける",
diff --git a/ui/packages/i18n/src/locales/ko.ts b/ui/packages/i18n/src/locales/ko.ts
index 542f431ffc3..32f4bcd2962 100644
--- a/ui/packages/i18n/src/locales/ko.ts
+++ b/ui/packages/i18n/src/locales/ko.ts
@@ -2374,7 +2374,29 @@ const ko = {
availableObjects: "사용 가능한 데이터 객체를 나열해 주세요.",
recentActivity: "내 최근 활동을 요약해 주세요.",
},
+ // objectstack#37862 — the drawer's empty conversation: the platform's
+ // suggestions by the kind of page in view (`emptyConversationModel.ts`).
+ page: {
+ record: {
+ summarize: '이 레코드 요약',
+ related: '이 레코드와 관련된 항목은?',
+ },
+ list: {
+ summarize: '이 목록의 레코드 요약',
+ recent: '이번 주에 추가된 레코드는?',
+ },
+ dashboard: {
+ explain: '이 대시보드는 무엇을 보여 주나요?',
+ standOut: '이 대시보드에서 눈에 띄는 점은?',
+ },
+ report: {
+ summarize: '이 보고서 요약',
+ takeaways: '이 보고서의 핵심 내용은?',
+ },
+ },
},
+ // objectstack#37862 — the accessible name of the empty conversation's suggestions.
+ suggestionsLabel: '추천 질문',
discussing: "보는 중: {{target}}",
focus: {
pin: "이 레코드에 대해 계속 질문",
diff --git a/ui/packages/i18n/src/locales/pt-BR.ts b/ui/packages/i18n/src/locales/pt-BR.ts
index 2b1fcc71b4b..aaecb9ba39b 100644
--- a/ui/packages/i18n/src/locales/pt-BR.ts
+++ b/ui/packages/i18n/src/locales/pt-BR.ts
@@ -2439,7 +2439,29 @@ const pt = {
availableObjects: "Liste os objetos de dados disponíveis.",
recentActivity: "Resuma minha atividade recente.",
},
+ // objectstack#37862 — the drawer's empty conversation: the platform's
+ // suggestions by the kind of page in view (`emptyConversationModel.ts`).
+ page: {
+ record: {
+ summarize: 'Resumir este registro',
+ related: 'O que está relacionado a este registro?',
+ },
+ list: {
+ summarize: 'Resumir os registros desta lista',
+ recent: 'Quais registros foram adicionados esta semana?',
+ },
+ dashboard: {
+ explain: 'O que este painel mostra?',
+ standOut: 'O que se destaca neste painel?',
+ },
+ report: {
+ summarize: 'Resumir este relatório',
+ takeaways: 'Quais são os principais pontos deste relatório?',
+ },
+ },
},
+ // objectstack#37862 — the accessible name of the empty conversation's suggestions.
+ suggestionsLabel: 'Perguntas sugeridas',
discussing: "Vendo: {{target}}",
focus: {
pin: "Continuar perguntando sobre este registro",
diff --git a/ui/packages/i18n/src/locales/ru.ts b/ui/packages/i18n/src/locales/ru.ts
index 5f2cdb0549e..bbaf3e2ba59 100644
--- a/ui/packages/i18n/src/locales/ru.ts
+++ b/ui/packages/i18n/src/locales/ru.ts
@@ -2516,7 +2516,29 @@ const ru = {
availableObjects: "Перечисли доступные объекты данных.",
recentActivity: "Сделай сводку моей недавней активности.",
},
+ // objectstack#37862 — the drawer's empty conversation: the platform's
+ // suggestions by the kind of page in view (`emptyConversationModel.ts`).
+ page: {
+ record: {
+ summarize: 'Кратко изложить эту запись',
+ related: 'Что связано с этой записью?',
+ },
+ list: {
+ summarize: 'Кратко изложить записи в этом списке',
+ recent: 'Какие записи добавлены на этой неделе?',
+ },
+ dashboard: {
+ explain: 'Что показывает эта панель?',
+ standOut: 'Что выделяется на этой панели?',
+ },
+ report: {
+ summarize: 'Кратко изложить этот отчёт',
+ takeaways: 'Каковы главные выводы из этого отчёта?',
+ },
+ },
},
+ // objectstack#37862 — the accessible name of the empty conversation's suggestions.
+ suggestionsLabel: 'Предлагаемые вопросы',
discussing: "Просмотр: {{target}}",
focus: {
pin: "Продолжать спрашивать об этой записи",
diff --git a/ui/packages/i18n/src/locales/zh-Hans.ts b/ui/packages/i18n/src/locales/zh-Hans.ts
index c5ac97705cf..915127e85f1 100644
--- a/ui/packages/i18n/src/locales/zh-Hans.ts
+++ b/ui/packages/i18n/src/locales/zh-Hans.ts
@@ -2729,7 +2729,29 @@ const zh = {
availableObjects: '列出可用的数据对象。',
recentActivity: '总结我的最近动态。',
},
+ // objectstack#37862 — the drawer's empty conversation: the platform's
+ // suggestions by the kind of page in view (`emptyConversationModel.ts`).
+ page: {
+ record: {
+ summarize: '总结这条记录',
+ related: '这条记录关联了哪些内容?',
+ },
+ list: {
+ summarize: '总结这个列表里的记录',
+ recent: '本周新增了哪些记录?',
+ },
+ dashboard: {
+ explain: '这个仪表盘展示了什么?',
+ standOut: '这个仪表盘里有什么值得注意的?',
+ },
+ report: {
+ summarize: '总结这份报表',
+ takeaways: '这份报表的要点是什么?',
+ },
+ },
},
+ // objectstack#37862 — the accessible name of the empty conversation's suggestions.
+ suggestionsLabel: '推荐问题',
// objectui#3546 slice four — the AI console surfaces: the /ai chat page's app switcher,
// connection banner and plan/publish cards, the ChatDock chrome, and the
// conversation-list date buckets. `group.*` is the template-key family
diff --git a/ui/packages/i18n/src/locales/zh-Hant.ts b/ui/packages/i18n/src/locales/zh-Hant.ts
index 2b5f07f98e0..85cfecde81a 100644
--- a/ui/packages/i18n/src/locales/zh-Hant.ts
+++ b/ui/packages/i18n/src/locales/zh-Hant.ts
@@ -2729,7 +2729,29 @@ const zhHant = {
availableObjects: '列出可用的資料物件。',
recentActivity: '總結我的最近動態。',
},
+ // objectstack#37862 — the drawer's empty conversation: the platform's
+ // suggestions by the kind of page in view (`emptyConversationModel.ts`).
+ page: {
+ record: {
+ summarize: '總結這條記錄',
+ related: '這條記錄關聯了哪些內容?',
+ },
+ list: {
+ summarize: '總結這個列表裡的記錄',
+ recent: '本週新增了哪些記錄?',
+ },
+ dashboard: {
+ explain: '這個儀表盤展示了什麼?',
+ standOut: '這個儀表盤裡有什麼值得注意的?',
+ },
+ report: {
+ summarize: '總結這份報表',
+ takeaways: '這份報表的要點是什麼?',
+ },
+ },
},
+ // objectstack#37862 — the accessible name of the empty conversation's suggestions.
+ suggestionsLabel: '推薦問題',
// objectui#3546 slice four — the AI console surfaces: the /ai chat page's app switcher,
// connection banner and plan/publish cards, the ChatDock chrome, and the
// conversation-list date buckets. `group.*` is the template-key family
diff --git a/ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx b/ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx
index 52288cc8001..f59e5202c2d 100644
--- a/ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx
+++ b/ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx
@@ -165,6 +165,7 @@ const ChatbotEnhanced = React.forwardRef(
acceptedFileTypes = 'image/*,.pdf,.doc,.docx,.txt,.csv,.tsv,.xlsx,.xlsm',
maxFileSize = 10 * 1024 * 1024,
suggestions,
+ renderEmptyState,
labels,
models,
selectedModelId,
@@ -487,6 +488,24 @@ const ChatbotEnhanced = React.forwardRef(
const promptInputWrapRef = React.useRef(null);
+ // objectstack#37862 — a host's empty conversation offers suggestions that
+ // fill the composer rather than send: the text replaces what the box holds
+ // and the caret lands at its end, so the user finishes the question.
+ const fillComposer = React.useCallback((text: string) => {
+ const textarea = promptInputWrapRef.current?.querySelector('textarea');
+ if (!textarea) return;
+ // Through the prototype's setter, so React's value tracker sees a change
+ // and the textarea's `onChange` (the host's `onInputChange`) runs.
+ Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value')?.set?.call(textarea, text);
+ textarea.dispatchEvent(new Event('input', { bubbles: true }));
+ textarea.focus();
+ textarea.setSelectionRange(text.length, text.length);
+ }, []);
+ const emptyStateActions = React.useMemo(
+ () => ({ send: handleSuggestionClick, fill: fillComposer }),
+ [handleSuggestionClick, fillComposer],
+ );
+
// Restore the composer text when a send was REJECTED before reaching the
// model (rate-limit / network — `notSent`). The composer's own form.reset
// clears the box optimistically and the optimistic user bubble was rolled
@@ -616,7 +635,9 @@ const ChatbotEnhanced = React.forwardRef(
: 'px-4 py-3',
)}
>
- {messages.length === 0 ? (
+ {messages.length === 0 && renderEmptyState ? (
+
{renderEmptyState(emptyStateActions)}
+ ) : messages.length === 0 ? (
{assistantAvatarUrl ? (
diff --git a/ui/packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.renderEmptyState-37862.test.tsx b/ui/packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.renderEmptyState-37862.test.tsx
new file mode 100644
index 00000000000..bd59fa970e0
--- /dev/null
+++ b/ui/packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.renderEmptyState-37862.test.tsx
@@ -0,0 +1,98 @@
+/**
+ * ObjectUI
+ * Copyright (c) 2024-present ObjectStack Inc.
+ *
+ * objectstack#37862 — `renderEmptyState`: the host's own empty conversation,
+ * drawn in place of the built-in one while the conversation has no message.
+ * It gets two actions: `send` sends a text as a built-in suggestion chip does,
+ * `fill` puts it in the composer and focuses it, sending nothing.
+ *
+ * Real subject: the real `ChatbotEnhanced` with its real composer; the host
+ * render function and `onSendMessage` are the inputs.
+ */
+import '@testing-library/jest-dom/vitest';
+import { describe, it, expect, vi } from 'vitest';
+import { render, screen, fireEvent } from '@testing-library/react';
+import { ChatbotEnhanced } from '../ChatbotEnhanced';
+
+type Actions = { send: (text: string) => void; fill: (text: string) => void };
+
+function host() {
+ return (actions: Actions) => (
+
+
+
+
+ );
+}
+
+describe('ChatbotEnhanced renderEmptyState (objectstack#37862)', () => {
+ it('draws the host empty state instead of the built-in one, suggestions included', () => {
+ render(
+ ,
+ );
+ expect(screen.getByTestId('host-empty')).toBeInTheDocument();
+ expect(screen.queryByText('Built-in title')).not.toBeInTheDocument();
+ expect(screen.queryByText('Built-in chip')).not.toBeInTheDocument();
+ });
+
+ it('control: without it the built-in empty state is drawn', () => {
+ render();
+ expect(screen.getByText('Built-in title')).toBeInTheDocument();
+ expect(screen.queryByTestId('chat-empty-state-host')).not.toBeInTheDocument();
+ });
+
+ it('is not drawn once the conversation has a message', () => {
+ render(
+ ,
+ );
+ expect(screen.queryByTestId('host-empty')).not.toBeInTheDocument();
+ });
+
+ it('send: the text goes out as a message', () => {
+ const onSendMessage = vi.fn();
+ render();
+ fireEvent.click(screen.getByRole('button', { name: 'send-one' }));
+ expect(onSendMessage).toHaveBeenCalledWith('Count my deals');
+ });
+
+ it('fill: the text lands in the focused composer, the host hears the change, and nothing is sent', () => {
+ const onSendMessage = vi.fn();
+ const onInputChange = vi.fn();
+ render(
+ ,
+ );
+ fireEvent.click(screen.getByRole('button', { name: 'fill-one' }));
+ const textarea = screen.getByRole('textbox') as HTMLTextAreaElement;
+ expect(textarea.value).toBe('Summarize this record');
+ expect(document.activeElement).toBe(textarea);
+ expect(textarea.selectionStart).toBe('Summarize this record'.length);
+ expect(onInputChange).toHaveBeenLastCalledWith('Summarize this record');
+ expect(onSendMessage).not.toHaveBeenCalled();
+ });
+
+ it('fill replaces what the composer held', () => {
+ render();
+ const textarea = screen.getByRole('textbox') as HTMLTextAreaElement;
+ fireEvent.change(textarea, { target: { value: 'half a question' } });
+ fireEvent.click(screen.getByRole('button', { name: 'fill-one' }));
+ expect(textarea.value).toBe('Summarize this record');
+ });
+});
diff --git a/ui/packages/plugin-chatbot/src/chat/types.ts b/ui/packages/plugin-chatbot/src/chat/types.ts
index 56b88e4bc38..c6636160891 100644
--- a/ui/packages/plugin-chatbot/src/chat/types.ts
+++ b/ui/packages/plugin-chatbot/src/chat/types.ts
@@ -360,6 +360,18 @@ export interface ChatbotEnhancedProps extends React.HTMLAttributes void;
+ fill: (text: string) => void;
+ }) => React.ReactNode;
/**
* Optional UI string overrides for localization. Each field falls back
* to its English default, so existing callers keep working unchanged.