|
| 1 | +# ObjectStack Console — Development Plan |
| 2 | + |
| 3 | +> Generated: 2026-02-07 |
| 4 | +> Status: **Active** |
| 5 | +
|
| 6 | +## Current State |
| 7 | + |
| 8 | +The console is a working prototype that merges 3 example configs (CRM + Todo + KitchenSink) and runs in the browser via MSW mock server. It demonstrates multi-app routing, CRUD, views, dashboards, reports, and pages. |
| 9 | + |
| 10 | +**Key Gaps vs ObjectStack Best Runtime:** |
| 11 | +- Lightweight local `ObjectStackDataSource` instead of official `@object-ui/data-objectstack` adapter |
| 12 | +- Custom `defineConfig()` instead of `defineStack()` from `@objectstack/spec` |
| 13 | +- Chinese UI strings violating English-only rule |
| 14 | +- Missing plugin registrations (plugin-view, plugin-form, plugin-dashboard, plugin-report, plugin-markdown) |
| 15 | +- Hardcoded view tabs instead of schema-driven `ViewSwitcher` |
| 16 | +- No runtime metadata fetching (all static config) |
| 17 | +- MSW workarounds that should be fixed upstream |
| 18 | +- Duplicated MetadataInspector code across all view components |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## Phase 1: Data Layer Upgrade ⚡ (Critical) |
| 23 | + |
| 24 | +**Goal:** Replace the lightweight local adapter with the official `@object-ui/data-objectstack` package. |
| 25 | + |
| 26 | +| Task | Description | Files | |
| 27 | +|------|-------------|-------| |
| 28 | +| 1.1 | Replace `ObjectStackDataSource` with `ObjectStackAdapter` | `src/App.tsx`, `src/dataSource.ts` | |
| 29 | +| 1.2 | Add connection state monitoring UI | New: `src/components/ConnectionStatus.tsx` | |
| 30 | +| 1.3 | Server-driven metadata fetching (objects, views) | `src/App.tsx` | |
| 31 | +| 1.4 | Server-driven view resolution via `client.meta.getView()` | `src/components/ObjectView.tsx` | |
| 32 | + |
| 33 | +**Estimate:** 1-2 days |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## Phase 2: English-Only Codebase 🌐 (Quick Win) |
| 38 | + |
| 39 | +**Goal:** Remove all Chinese strings per Rule #-1. |
| 40 | + |
| 41 | +| Task | Description | File | |
| 42 | +|------|-------------|------| |
| 43 | +| 2.1 | Fix breadcrumb labels: 仪表盘→Dashboard, 页面→Page, 报表→Report, 记录→Record | `src/components/AppHeader.tsx` | |
| 44 | +| 2.2 | Fix search placeholder: 搜索...→Search... | `src/components/AppHeader.tsx` | |
| 45 | + |
| 46 | +**Estimate:** 30 minutes |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +## Phase 3: Plugin Registration 🧩 (Quick Win) |
| 51 | + |
| 52 | +**Goal:** Ensure all plugins are registered via side-effect imports in one central place. |
| 53 | + |
| 54 | +| Task | Description | File | |
| 55 | +|------|-------------|------| |
| 56 | +| 3.1 | Add `import '@object-ui/plugin-view'` | `src/main.tsx` | |
| 57 | +| 3.2 | Add `import '@object-ui/plugin-form'` | `src/main.tsx` | |
| 58 | +| 3.3 | Add `import '@object-ui/plugin-dashboard'` | `src/main.tsx` | |
| 59 | +| 3.4 | Add `import '@object-ui/plugin-report'` | `src/main.tsx` | |
| 60 | +| 3.5 | Add `import '@object-ui/plugin-markdown'` | `src/main.tsx` | |
| 61 | + |
| 62 | +**Estimate:** 30 minutes |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## Phase 4: Config Alignment with `@objectstack/spec` 📜 (High) |
| 67 | + |
| 68 | +**Goal:** Use standard spec factories instead of custom config helpers. |
| 69 | + |
| 70 | +| Task | Description | |
| 71 | +|------|-------------| |
| 72 | +| 4.1 | Replace custom `defineConfig()` with `defineStack()` from `@objectstack/spec` | |
| 73 | +| 4.2 | Validate merged config at bootstrap using Zod schemas | |
| 74 | +| 4.3 | Remove local `src/config.ts` in favor of spec-standard patterns | |
| 75 | + |
| 76 | +**Estimate:** 1 day |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## Phase 5: MSW Runtime Fixes 🔧 (Medium) |
| 81 | + |
| 82 | +| Task | Description | |
| 83 | +|------|-------------| |
| 84 | +| 5.1 | Fix PluginLoader method stripping (upstream) | |
| 85 | +| 5.2 | Remove `process.on` polyfill hack | |
| 86 | +| 5.3 | Fix discovery endpoint patching in App.tsx | |
| 87 | +| 5.4 | Delegate data seeding to AppPlugin | |
| 88 | + |
| 89 | +**Estimate:** 1 day |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +## Phase 6: Schema-Driven Architecture 🎨 (Medium) |
| 94 | + |
| 95 | +| Task | Description | |
| 96 | +|------|-------------| |
| 97 | +| 6.1 | Use `ViewSwitcher` component from `@object-ui/plugin-view` in ObjectView | |
| 98 | +| 6.2 | Wire up `FilterUI` and `SortUI` components in ObjectView | |
| 99 | +| 6.3 | Pass `dataSource` to DashboardRenderer | |
| 100 | +| 6.4 | Create schema-driven `CrudDialog` using Action System pattern | |
| 101 | + |
| 102 | +**Estimate:** 2-3 days |
| 103 | + |
| 104 | +--- |
| 105 | + |
| 106 | +## Phase 7: Layout System Upgrade 🏠 (Medium) |
| 107 | + |
| 108 | +| Task | Description | |
| 109 | +|------|-------------| |
| 110 | +| 7.1 | Consume `ThemeSchema` tokens from spec | |
| 111 | +| 7.2 | Apply CSS custom properties from `app.branding.primaryColor` | |
| 112 | +| 7.3 | Support `header` and `empty` layout modes | |
| 113 | +| 7.4 | Improve mobile-responsive AppShell | |
| 114 | + |
| 115 | +**Estimate:** 1-2 days |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +## Phase 8: Navigation & Routing 🧭 (Medium) |
| 120 | + |
| 121 | +| Task | Description | |
| 122 | +|------|-------------| |
| 123 | +| 8.1 | Deep-link support with query param preservation | |
| 124 | +| 8.2 | Navigation guards with `visibleOn` expression evaluation | |
| 125 | +| 8.3 | `Cmd+K` command palette for quick navigation | |
| 126 | + |
| 127 | +**Estimate:** 1 day |
| 128 | + |
| 129 | +--- |
| 130 | + |
| 131 | +## Phase 9: Action System 🎯 (Low — Future Foundation) |
| 132 | + |
| 133 | +| Task | Description | |
| 134 | +|------|-------------| |
| 135 | +| 9.1 | Implement `ActionEngine` in `@object-ui/core` | |
| 136 | +| 9.2 | Wire up button actions via `ActionSchema` | |
| 137 | +| 9.3 | Support `navigate`, `validate`, `submit` action types | |
| 138 | + |
| 139 | +**Estimate:** 2-3 days |
| 140 | + |
| 141 | +--- |
| 142 | + |
| 143 | +## Phase 10: Developer Experience 🛠️ (Ongoing) |
| 144 | + |
| 145 | +| Task | Description | |
| 146 | +|------|-------------| |
| 147 | +| 10.1 | Extract shared `MetadataInspector` component | |
| 148 | +| 10.2 | Hot-reload on config changes | |
| 149 | +| 10.3 | Add React Error Boundaries per route | |
| 150 | +| 10.4 | Integration tests with Vitest + MSW | |
| 151 | + |
| 152 | +**Estimate:** Ongoing |
| 153 | + |
| 154 | +--- |
| 155 | + |
| 156 | +## Execution Order |
| 157 | + |
| 158 | +``` |
| 159 | +Phase 2 (i18n) → 30 min ← Quick Win |
| 160 | +Phase 3 (plugins) → 30 min ← Quick Win |
| 161 | +Phase 4 (spec config) → 1 day ← Spec Compliance |
| 162 | +Phase 1 (data layer) → 1-2 days ← Critical Foundation |
| 163 | +Phase 6 (schema-driven)→ 2-3 days ← Main Feature Work |
| 164 | +Phase 10 (DX) → 1 day ← Code Quality |
| 165 | +Phase 5 (MSW fixes) → 1 day ← Upstream |
| 166 | +Phase 7 (layout) → 1-2 days ← Polish |
| 167 | +Phase 8 (navigation) → 1 day ← Polish |
| 168 | +Phase 9 (actions) → 2-3 days ← Architecture |
| 169 | +``` |
| 170 | + |
| 171 | +**Total: ~2 weeks for Phases 1-8** |
0 commit comments