Skip to content

Commit 5b82fed

Browse files
authored
Merge pull request #474 from objectstack-ai/copilot/complete-roadmap-development-tasks
2 parents 7ac69e5 + d4939f3 commit 5b82fed

File tree

30 files changed

+2571
-94
lines changed

30 files changed

+2571
-94
lines changed

README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,88 @@ function App() {
259259
export default App
260260
```
261261
262+
### Copy-Paste Schema Examples
263+
264+
#### 📝 Contact Form
265+
266+
```json
267+
{
268+
"type": "form",
269+
"title": "Contact Us",
270+
"fields": [
271+
{ "name": "name", "type": "text", "label": "Full Name", "required": true },
272+
{ "name": "email", "type": "email", "label": "Email", "required": true },
273+
{ "name": "subject", "type": "select", "label": "Subject", "options": [
274+
{ "label": "General Inquiry", "value": "general" },
275+
{ "label": "Bug Report", "value": "bug" },
276+
{ "label": "Feature Request", "value": "feature" }
277+
]},
278+
{ "name": "message", "type": "textarea", "label": "Message", "required": true }
279+
],
280+
"actions": [{ "type": "submit", "label": "Send Message" }]
281+
}
282+
```
283+
284+
#### 📊 Data Grid
285+
286+
```json
287+
{
288+
"type": "crud",
289+
"api": "/api/users",
290+
"columns": [
291+
{ "name": "name", "label": "Name", "sortable": true },
292+
{ "name": "email", "label": "Email" },
293+
{ "name": "role", "label": "Role", "type": "select", "options": ["Admin", "User", "Viewer"] },
294+
{ "name": "status", "label": "Status", "type": "badge" },
295+
{ "name": "created_at", "label": "Joined", "type": "date" }
296+
],
297+
"filters": [
298+
{ "name": "role", "type": "select", "label": "Filter by Role" },
299+
{ "name": "status", "type": "select", "label": "Filter by Status" }
300+
],
301+
"showSearch": true,
302+
"showCreate": true,
303+
"showExport": true
304+
}
305+
```
306+
307+
#### 📈 Dashboard
308+
309+
```json
310+
{
311+
"type": "dashboard",
312+
"title": "Sales Dashboard",
313+
"widgets": [
314+
{ "type": "stat-card", "title": "Revenue", "value": "${stats.revenue}", "trend": "+12%", "w": 3, "h": 1 },
315+
{ "type": "stat-card", "title": "Orders", "value": "${stats.orders}", "trend": "+8%", "w": 3, "h": 1 },
316+
{ "type": "stat-card", "title": "Customers", "value": "${stats.customers}", "trend": "+5%", "w": 3, "h": 1 },
317+
{ "type": "stat-card", "title": "Conversion", "value": "${stats.conversion}", "trend": "-2%", "w": 3, "h": 1 },
318+
{ "type": "chart", "chartType": "line", "title": "Revenue Over Time", "w": 8, "h": 3 },
319+
{ "type": "chart", "chartType": "pie", "title": "Sales by Region", "w": 4, "h": 3 }
320+
]
321+
}
322+
```
323+
324+
#### 🔄 Kanban Board
325+
326+
```json
327+
{
328+
"type": "kanban",
329+
"objectName": "tasks",
330+
"groupBy": "status",
331+
"titleField": "title",
332+
"cardFields": ["assignee", "priority", "due_date"],
333+
"columns": [
334+
{ "value": "todo", "label": "To Do", "color": "#6366f1" },
335+
{ "value": "in_progress", "label": "In Progress", "color": "#f59e0b" },
336+
{ "value": "review", "label": "In Review", "color": "#3b82f6" },
337+
{ "value": "done", "label": "Done", "color": "#22c55e" }
338+
]
339+
}
340+
```
341+
342+
> 📖 **More examples:** See [examples/](./examples/) for complete working applications.
343+
262344
## 📦 Packages
263345
264346
Object UI is a modular monorepo with packages designed for specific use cases:

ROADMAP.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ All 4 phases complete across 5 designers (Page, View, DataModel, Process, Report
9494

9595
| Area | Count | Notes |
9696
|------|-------|-------|
97-
| Packages | 35 | 27 with README, 10 missing README |
97+
| Packages | 35 | 37 with README (100%) |
9898
| Components | 91+ | 48 base UI + 14 custom + 29 renderers |
9999
| Field Widgets | 36+ | Consistent FieldWidgetProps pattern |
100100
| Storybook Stories | 68 | Good coverage, some gaps in edge-case stories |
101-
| Documentation Pages | 128 | .mdx files across 8 categories |
101+
| Documentation Pages | 134 | .mdx/.md files across 8 categories |
102102
| Test Files | 200+ | 3,235+ tests, 80% coverage |
103103
| Examples | 4 | todo, crm, kitchen-sink, msw-todo |
104104
| CLI Commands | 11 | init, build, dev, serve, doctor, etc. |
@@ -116,13 +116,13 @@ All 4 phases complete across 5 designers (Page, View, DataModel, Process, Report
116116
- 13 CI/CD workflows including performance budgets and visual regression
117117

118118
**Gaps Identified:**
119-
- 10 packages missing README: auth, tenant, permissions, i18n, mobile, collaboration, plugin-ai, plugin-designer, plugin-workflow, plugin-report
120-
- 20+ React hooks exported without JSDoc documentation
121-
- Console has hardcoded English strings (LoadingScreen, KeyboardShortcutsDialog) outside i18n
122-
- MIGRATION_GUIDE.md referenced in README but does not exist
119+
- ~~10 packages missing README~~ ✅ All 37 packages now have READMEs
120+
- ~~20+ React hooks exported without JSDoc documentation~~ ✅ All hooks documented with JSDoc
121+
- ~~Console has hardcoded English strings outside i18n~~ ✅ All strings migrated to i18n keys
122+
- ~~MIGRATION_GUIDE.md referenced in README but does not exist~~ ✅ Created
123123
- Types package has minimal JSDoc on exported interfaces
124124
- No interactive schema playground in documentation site
125-
- Core error messages lack error codes and actionable fix suggestions
125+
- ~~Core error messages lack error codes and actionable fix suggestions~~ ✅ Error code system implemented
126126

127127
---
128128

@@ -139,27 +139,27 @@ All 4 phases complete across 5 designers (Page, View, DataModel, Process, Report
139139
- [ ] Streamline `npx create-objectui-app` scaffolding with working Vite + Tailwind templates
140140
- [ ] Ensure `pnpm install && pnpm dev` starts the console with zero additional configuration
141141
- [x] Add a standalone "Hello World" example (5-file, <50 lines total) demonstrating JSON → UI flow
142-
- [ ] Provide copy-paste-ready schema examples in the root README for instant gratification
142+
- [x] Provide copy-paste-ready schema examples in the root README for instant gratification
143143

144144
#### P1.2 API Discoverability & JSDoc
145145
- [x] Add JSDoc comments to all 20+ exported React hooks (`useExpression`, `useActionRunner`, `useViewData`, `useDynamicApp`, `usePerformance`, `useCrudShortcuts`, etc.)
146146
- [x] Add JSDoc with usage examples to key types in `@object-ui/types` (`SchemaNode`, `FieldMetadata`, `ViewSchema`, `ActionSchema`, etc.)
147-
- [ ] Document all context providers (`ThemeContext`, `AuthContext`, `I18nContext`, `NotificationContext`, `DndContext`) with usage examples
147+
- [x] Document all context providers (`ThemeContext`, `AuthContext`, `I18nContext`, `NotificationContext`, `DndContext`) with usage examples
148148
- [ ] Ensure TypeScript autocompletion works smoothly for all schema types via strict discriminated unions
149149

150150
#### P1.3 Error Messages & Debugging
151151
- [x] Create error code system (`OBJUI-001`, `OBJUI-002`, etc.) with documentation links
152152
- [x] Improve SchemaErrorBoundary to show actionable fix suggestions in dev mode (e.g., "Missing field 'type'. Did you mean to use a PageSchema?")
153153
- [x] Replace generic `console.warn()` calls in core with structured error factory
154154
- [x] Add `OBJECTUI_DEBUG=true` mode with schema resolution tracing and component render timing
155-
- [ ] Ensure console warnings for deprecated APIs include migration code snippets
155+
- [x] Ensure console warnings for deprecated APIs include migration code snippets
156156

157157
#### P1.4 CLI Tooling Polish
158158
- [ ] Verify `objectui init` produces a buildable project with all dependencies resolved
159-
- [ ] Enhance `objectui doctor` to check TypeScript version, Tailwind config, and peer dependencies
159+
- [x] Enhance `objectui doctor` to check TypeScript version, Tailwind config, and peer dependencies
160160
- [ ] Verify `create-plugin` template produces a plugin with working tests and Storybook story
161-
- [ ] Add `objectui validate <schema.json>` command for schema linting with actionable error messages
162-
- [ ] Resolve 8 TODO/FIXME items in CLI code (`doctor.ts`, `dev.ts`, `check.ts`)
161+
- [x] Add `objectui validate <schema.json>` command for schema linting with actionable error messages
162+
- [x] Resolve TODO/FIXME items in CLI code (`doctor.ts`, `dev.ts`, `check.ts`)
163163

164164
#### P1.5 Package READMEs (10 Missing)
165165
- [x] Add README for `@object-ui/auth` — authentication guards, login/register forms, AuthContext
@@ -182,14 +182,14 @@ All 4 phases complete across 5 designers (Page, View, DataModel, Process, Report
182182
#### P2.1 Console i18n Completeness
183183
- [x] Migrate hardcoded strings in `LoadingScreen.tsx` to i18n keys ("ObjectStack Console", "Initializing application...")
184184
- [x] Migrate hardcoded strings in `KeyboardShortcutsDialog.tsx` to i18n keys
185-
- [ ] Audit all `apps/console/src/components/` for remaining hardcoded UI strings
185+
- [x] Audit all `apps/console/src/components/` for remaining hardcoded UI strings
186186
- [x] Remove all Chinese UI strings; enforce English-only with i18n key lookups
187-
- [ ] Add locale switcher to Console settings panel
187+
- [x] Add locale switcher to Console settings panel
188188

189189
#### P2.2 Console Architecture Cleanup
190190
- [ ] Consolidate hand-wired ObjectView into plugin-based ObjectView (eliminate duplication)
191191
- [ ] Replace lightweight local data adapter with official `@object-ui/data-objectstack`
192-
- [ ] Replace custom `defineConfig()` with standard `defineStack()` configuration
192+
- [x] Replace custom `defineConfig()` with standard `defineStack()` configuration
193193
- [ ] Register all missing plugins properly in the plugin registry
194194
- [ ] Convert hardcoded view tabs to schema-driven configuration
195195

@@ -258,9 +258,9 @@ All 4 phases complete across 5 designers (Page, View, DataModel, Process, Report
258258

259259
#### P4.1 Guide Content
260260
- [ ] Verify "Getting Started" guide (`quick-start.md`) stays current with latest API
261-
- [ ] Write "Building a CRUD App" end-to-end tutorial (complete walkthrough: schema → data → deploy)
262-
- [ ] Write "Custom Plugin Development" guide with best practices and template walkthrough
263-
- [ ] Write "Theming & Customization" guide (Tailwind config, cva variants, dark mode, CSS custom properties)
261+
- [x] Write "Building a CRUD App" end-to-end tutorial (complete walkthrough: schema → data → deploy)
262+
- [x] Write "Custom Plugin Development" guide with best practices and template walkthrough
263+
- [x] Write "Theming & Customization" guide (Tailwind config, cva variants, dark mode, CSS custom properties)
264264
- [ ] Add deployment guides for examples (Docker, Vercel, Railway configurations)
265265

266266
#### P4.2 API Reference
@@ -276,10 +276,10 @@ All 4 phases complete across 5 designers (Page, View, DataModel, Process, Report
276276
- [ ] Deploy Storybook to a publicly accessible URL (storybook.objectui.org)
277277

278278
#### P4.4 Architecture & Internals
279-
- [ ] Document the layer architecture (spec → types → core → react → components → plugins) with data flow diagrams
280-
- [ ] Document the plugin system architecture (registration, lifecycle, lazy loading)
281-
- [ ] Add troubleshooting guide for common development issues
282-
- [ ] Document CI/CD pipeline architecture (13 workflows, their triggers and responsibilities)
279+
- [x] Document the layer architecture (spec → types → core → react → components → plugins) with data flow diagrams
280+
- [x] Document the plugin system architecture (registration, lifecycle, lazy loading)
281+
- [x] Add troubleshooting guide for common development issues
282+
- [x] Document CI/CD pipeline architecture (13 workflows, their triggers and responsibilities)
283283

284284
---
285285

@@ -319,13 +319,13 @@ All 4 phases complete across 5 designers (Page, View, DataModel, Process, Report
319319
| **Test Count** | 3,235+ | 4,000+ | `pnpm test` summary |
320320
| **Spec Compliance** | 98% | 100% | SPEC_COMPLIANCE_EVALUATION.md |
321321
| **Storybook Stories** | 68 | 91+ (1 per component) | Story file count |
322-
| **Package READMEs** | 27/35 (77%) | 35/35 (100%) | README.md presence |
323-
| **Hooks with JSDoc** | ~5/20+ (~25%) | 20+/20+ (100%) | Grep `/** */` in hooks |
324-
| **Console i18n Coverage** | ~80% | 100% | No hardcoded strings |
322+
| **Package READMEs** | 37/37 (100%) | 37/37 (100%) | README.md presence |
323+
| **Hooks with JSDoc** | 20+/20+ (100%) | 20+/20+ (100%) | Grep `/** */` in hooks |
324+
| **Console i18n Coverage** | ~100% | 100% | No hardcoded strings |
325325
| **Build Status** | 42/42 pass | 42/42 pass | `pnpm build` |
326326
| **WCAG AA Compliance** | Primitives only | Full Console pages | axe-core audit |
327327
| **CLI Commands Working** | 11 | 11 (all verified) | `objectui doctor` |
328-
| **TODO/FIXME Count** | 8 files | 0 | Grep `TODO\|FIXME\|HACK` |
328+
| **TODO/FIXME Count** | 0 files | 0 | Grep `TODO\|FIXME\|HACK` |
329329

330330
### DX Success Criteria
331331
- [ ] New developer can `git clone``pnpm install``pnpm dev` → see Console in < 5 minutes

apps/console/src/components/AppHeader.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
import { Search, Bell, HelpCircle, ChevronDown } from 'lucide-react';
2828

2929
import { ModeToggle } from './mode-toggle';
30+
import { LocaleSwitcher } from './LocaleSwitcher';
3031
import { ConnectionStatus } from './ConnectionStatus';
3132
import type { ConnectionState } from '../dataSource';
3233

@@ -202,6 +203,11 @@ export function AppHeader({ appName, objects, connectionState }: { appName: stri
202203
<div className="shrink-0">
203204
<ModeToggle />
204205
</div>
206+
207+
{/* Language switcher */}
208+
<div className="shrink-0">
209+
<LocaleSwitcher />
210+
</div>
205211
</div>
206212
</div>
207213
);

apps/console/src/components/ErrorBoundary.tsx

Lines changed: 53 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,58 @@
1818
import { Component, type ErrorInfo, type ReactNode } from 'react';
1919
import { Button, Empty, EmptyTitle, EmptyDescription } from '@object-ui/components';
2020
import { AlertTriangle, RotateCcw, Home } from 'lucide-react';
21+
import { useObjectTranslation } from '@object-ui/i18n';
22+
23+
/** Inner fallback component that uses the i18n hook */
24+
function DefaultErrorFallback({ error, onReset }: { error: Error; onReset: () => void }) {
25+
const { t } = useObjectTranslation();
26+
27+
return (
28+
<div className="flex h-full items-center justify-center p-8">
29+
<div className="max-w-md text-center">
30+
<Empty>
31+
<div className="mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10">
32+
<AlertTriangle className="h-6 w-6 text-destructive" />
33+
</div>
34+
<EmptyTitle>{t('console.errors.somethingWentWrong')}</EmptyTitle>
35+
<EmptyDescription className="mb-4">
36+
{error.message || t('console.errors.unexpectedError')}
37+
</EmptyDescription>
38+
<div className="flex items-center justify-center gap-2">
39+
<Button
40+
variant="outline"
41+
size="sm"
42+
onClick={onReset}
43+
className="gap-2"
44+
>
45+
<RotateCcw className="h-4 w-4" />
46+
{t('console.errors.tryAgain')}
47+
</Button>
48+
<Button
49+
variant="ghost"
50+
size="sm"
51+
onClick={() => { window.location.href = '/'; }}
52+
className="gap-2"
53+
>
54+
<Home className="h-4 w-4" />
55+
{t('console.errors.goHome')}
56+
</Button>
57+
</div>
58+
</Empty>
59+
{import.meta.env.DEV && (
60+
<details className="mt-6 text-left">
61+
<summary className="cursor-pointer text-xs text-muted-foreground">
62+
{t('console.errors.errorDetails')}
63+
</summary>
64+
<pre className="mt-2 max-h-60 overflow-auto rounded-md border bg-muted p-3 text-xs">
65+
{error.stack}
66+
</pre>
67+
</details>
68+
)}
69+
</div>
70+
</div>
71+
);
72+
}
2173

2274
interface ErrorBoundaryProps {
2375
children: ReactNode;
@@ -66,49 +118,7 @@ export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundarySt
66118

67119
// Default fallback UI
68120
return (
69-
<div className="flex h-full items-center justify-center p-8">
70-
<div className="max-w-md text-center">
71-
<Empty>
72-
<div className="mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10">
73-
<AlertTriangle className="h-6 w-6 text-destructive" />
74-
</div>
75-
<EmptyTitle>Something went wrong</EmptyTitle>
76-
<EmptyDescription className="mb-4">
77-
{this.state.error.message || 'An unexpected error occurred while rendering this view.'}
78-
</EmptyDescription>
79-
<div className="flex items-center justify-center gap-2">
80-
<Button
81-
variant="outline"
82-
size="sm"
83-
onClick={this.resetErrorBoundary}
84-
className="gap-2"
85-
>
86-
<RotateCcw className="h-4 w-4" />
87-
Try Again
88-
</Button>
89-
<Button
90-
variant="ghost"
91-
size="sm"
92-
onClick={() => { window.location.href = '/'; }}
93-
className="gap-2"
94-
>
95-
<Home className="h-4 w-4" />
96-
Go Home
97-
</Button>
98-
</div>
99-
</Empty>
100-
{import.meta.env.DEV && (
101-
<details className="mt-6 text-left">
102-
<summary className="cursor-pointer text-xs text-muted-foreground">
103-
Error Details (dev only)
104-
</summary>
105-
<pre className="mt-2 max-h-60 overflow-auto rounded-md border bg-muted p-3 text-xs">
106-
{this.state.error.stack}
107-
</pre>
108-
</details>
109-
)}
110-
</div>
111-
</div>
121+
<DefaultErrorFallback error={this.state.error} onReset={this.resetErrorBoundary} />
112122
);
113123
}
114124

0 commit comments

Comments
 (0)