Skip to content

Commit 3c1b717

Browse files
os-zhuangclaude
andauthored
polish(app-showcase): clean welcome home + full nav/list i18n (#2067)
QA-pass polish after walking every showcase surface in the browser. Home (showcase_component_gallery) — the default landing rendered as a debug canvas: an `ai:input` placeholder, an empty `page:card`, a full-width logo image, and a static number. Redesigned into a clean welcome: intro + a live 4-tile KPI grid (object-metric in the now-unshadowed layout grid: Projects / Tasks / Accounts / Open Tasks) + a primary "Create Task" action, with an "Explore" shortcut list in the sidebar. No placeholders or empty blocks. i18n — the translation bundle only covered project/task/account/invoice/ preference, so Products / Teams / Categories / Field Zoo (+ memberships) showed English labels in a zh-CN session — an obvious mixed-locale nav. Added en + zh-CN object + key-field labels for product / team / project_membership / category / field_zoo. Nav now reads 项目 / 任务 / 客户 / 发票 / 产品 / 团队 / 分类 / 字段动物园 consistently. Verified across the gallery, list, visualization (grid/gallery), record, dashboard and report surfaces on :5181. typecheck + 20 tests pass. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 95cc205 commit 3c1b717

2 files changed

Lines changed: 63 additions & 14 deletions

File tree

examples/app-showcase/src/pages/index.ts

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ export {
2424
} from './task-visualizations.pages.js';
2525

2626
/**
27-
* Component Gallery — a custom page that places a spread of standard page
28-
* components (header, card, tabs, text/number/image/divider/button elements,
29-
* and the AI chat window) so the page renderer and component registry can be
30-
* exercised visually.
27+
* Showcase home — a clean welcome landing. A live KPI grid (object-metric in
28+
* the layout `grid`) over the seeded data, an intro, and a primary action.
29+
* Deliberately avoids components that render as placeholders/empty in a page
30+
* region (ai:input, oversized element:image, page:card body) so the first
31+
* impression is polished, not a debug canvas.
3132
*/
3233
export const ComponentGalleryPage: Page = {
3334
name: 'showcase_component_gallery',
@@ -54,23 +55,33 @@ export const ComponentGalleryPage: Page = {
5455
name: 'main',
5556
width: 'large',
5657
components: [
57-
{ type: 'element:text', properties: { content: 'This page demonstrates the standard page component set. Open the navigation to explore objects, the 8 list-view types on Tasks, the Chart Gallery dashboard, and the four report types.' } },
58-
{ type: 'element:divider', properties: {} },
59-
{ type: 'page:card', properties: { title: 'Getting Started' } },
60-
{ type: 'element:number', properties: { label: 'Demo Tasks', value: 12 } },
61-
{ type: 'element:image', properties: { src: 'https://objectstack.ai/logo.png', alt: 'Logo' } },
58+
{ type: 'element:text', properties: { content: 'A working project-delivery workspace that exercises every metadata type, view, chart, and capability chain. Use the navigation to explore — start with My Work, the Delivery Operations dashboard, or the eight Task visualizations.' } },
59+
// Live KPI row over the seeded data (object-metric in the layout grid).
60+
{
61+
type: 'grid',
62+
properties: {
63+
columns: 4,
64+
gap: 4,
65+
children: [
66+
{ type: 'object-metric', properties: { objectName: 'showcase_project', label: 'Projects', icon: 'folder-kanban', aggregate: { field: 'id', function: 'count' } } },
67+
{ type: 'object-metric', properties: { objectName: 'showcase_task', label: 'Tasks', icon: 'check-square', aggregate: { field: 'id', function: 'count' } } },
68+
{ type: 'object-metric', properties: { objectName: 'showcase_account', label: 'Accounts', icon: 'building', aggregate: { field: 'id', function: 'count' } } },
69+
{ type: 'object-metric', properties: { objectName: 'showcase_task', label: 'Open Tasks', icon: 'list-checks', aggregate: { field: 'id', function: 'count' }, filter: { status: { $ne: 'done' } } } },
70+
],
71+
},
72+
},
6273
{ type: 'element:button', properties: { label: 'Create Task', actionName: 'showcase_new_task' } },
6374
],
6475
},
6576
{
6677
name: 'sidebar',
6778
width: 'small',
6879
components: [
69-
// NOTE: `ai:chat_window` is intentionally NOT a supported inline page
70-
// component — the canonical chat entry point is the floating chatbot
71-
// overlay (plugin-chatbot), so referencing it here surfaces a loud
72-
// "Unknown component type". Use a supported inline AI block instead.
73-
{ type: 'ai:input', properties: { agentName: 'showcase_assistant', placeholder: 'Ask the showcase assistant…' } },
80+
{ type: 'element:text', properties: { content: 'Explore' } },
81+
{ type: 'element:text', properties: { content: '• My Work — your queue & live KPIs' } },
82+
{ type: 'element:text', properties: { content: '• Delivery Operations — org dashboard' } },
83+
{ type: 'element:text', properties: { content: '• Tasks → All Views — 8 visualizations' } },
84+
{ type: 'element:text', properties: { content: '• Field Zoo — every field type' } },
7485
],
7586
},
7687
],

examples/app-showcase/src/translations/index.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,25 @@ export const ShowcaseTranslationBundle = {
8888
compact_density: { label: 'Compact Density' },
8989
},
9090
},
91+
showcase_product: {
92+
label: 'Product', pluralLabel: 'Products',
93+
fields: { name: { label: 'Name' }, sku: { label: 'SKU' }, description: { label: 'Description' }, unit_price: { label: 'Unit Price' }, active: { label: 'Active' } },
94+
},
95+
showcase_team: {
96+
label: 'Team', pluralLabel: 'Teams',
97+
fields: { name: { label: 'Team Name' }, lead: { label: 'Lead' }, capacity_hours: { label: 'Capacity (h)' } },
98+
},
99+
showcase_project_membership: {
100+
label: 'Membership', pluralLabel: 'Memberships',
101+
fields: { team: { label: 'Team' }, project: { label: 'Project' }, role: { label: 'Role' }, allocation_percent: { label: 'Allocation %' } },
102+
},
103+
showcase_category: {
104+
label: 'Category', pluralLabel: 'Categories',
105+
fields: { name: { label: 'Name' }, parent: { label: 'Parent' }, color: { label: 'Color' }, sort_order: { label: 'Sort Order' } },
106+
},
107+
showcase_field_zoo: {
108+
label: 'Field Zoo', pluralLabel: 'Field Zoo',
109+
},
91110
},
92111
},
93112
'zh-CN': {
@@ -169,6 +188,25 @@ export const ShowcaseTranslationBundle = {
169188
compact_density: { label: '紧凑密度' },
170189
},
171190
},
191+
showcase_product: {
192+
label: '产品', pluralLabel: '产品',
193+
fields: { name: { label: '名称' }, sku: { label: 'SKU' }, description: { label: '描述' }, unit_price: { label: '单价' }, active: { label: '启用' } },
194+
},
195+
showcase_team: {
196+
label: '团队', pluralLabel: '团队',
197+
fields: { name: { label: '团队名称' }, lead: { label: '负责人' }, capacity_hours: { label: '产能(小时)' } },
198+
},
199+
showcase_project_membership: {
200+
label: '成员', pluralLabel: '成员',
201+
fields: { team: { label: '团队' }, project: { label: '项目' }, role: { label: '角色' }, allocation_percent: { label: '分配比例' } },
202+
},
203+
showcase_category: {
204+
label: '分类', pluralLabel: '分类',
205+
fields: { name: { label: '名称' }, parent: { label: '上级' }, color: { label: '颜色' }, sort_order: { label: '排序' } },
206+
},
207+
showcase_field_zoo: {
208+
label: '字段动物园', pluralLabel: '字段动物园',
209+
},
172210
},
173211
},
174212
};

0 commit comments

Comments
 (0)