Skip to content

Commit 34bf9d8

Browse files
committed
feat: Enhance PageRenderer with structured layouts and region support
- Refactored PageRenderer to support multiple page types (record, home, app, utility) with named regions (header, sidebar, main, footer, aside). - Introduced RegionContent and RegionLayout components for better organization of page regions. - Added FlatContent as a fallback for legacy body/children rendering. - Implemented PageVariablesProvider to manage page-level state variables. - Removed deprecated usePageVariables hook and added comprehensive tests for new variable management functionality. - Updated component registration to avoid conflicts with existing layout registrations.
1 parent 88b2edb commit 34bf9d8

6 files changed

Lines changed: 1172 additions & 122 deletions

File tree

ROADMAP.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ ListColumn.action: string // Associated action ID
164164

165165
---
166166

167-
#### 5. Page System
167+
#### 5. Page System
168168

169169
**Spec Requirement:**
170170
```typescript
@@ -177,15 +177,29 @@ Page: {
177177
}
178178
```
179179

180-
**Current State:** Basic PageSchema exists but missing type differentiation.
180+
**Current State:** ✅ Complete — PageSchema fully aligned with @objectstack/spec.
181+
PageRenderer supports four page types with region-based layouts and page-level variables.
181182

182-
**Tasks:**
183-
- [ ] Add Page.type to PageSchema
184-
- [ ] Add Page.variables support (page-level state)
185-
- [ ] Add Page.template support (layout templates)
186-
- [ ] Add Page.object binding
187-
- [ ] PageRenderer type-aware rendering (record vs home vs app vs utility)
188-
- [ ] PageVariable initialization and context injection
183+
**Completed:**
184+
- [x] Add `PageType` = 'record' | 'home' | 'app' | 'utility' to @object-ui/types
185+
- [x] Add `PageVariable` interface (name, type, defaultValue) to @object-ui/types
186+
- [x] Add `PageRegionWidth` = 'small' | 'medium' | 'large' | 'full' to @object-ui/types
187+
- [x] Enhanced `PageRegion` (name, width, components, className) in @object-ui/types
188+
- [x] Enhanced `PageSchema` with pageType, object, template, variables, regions, isDefault, assignedProfiles
189+
- [x] Full Zod schemas: PageTypeSchema, PageVariableSchema, PageRegionSchema, PageRegionWidthSchema
190+
- [x] `PageVariablesProvider` + `usePageVariables` hook in @object-ui/react
191+
- [x] `useHasPageVariables` hook for context detection
192+
- [x] Upgraded PageRenderer with type-aware routing (Record / Home / App / Utility layouts)
193+
- [x] Region-based layout engine: header, sidebar, main, aside, footer named slots
194+
- [x] Region width mapping (small→w-64, medium→w-80, large→w-96, full→w-full)
195+
- [x] Page max-width by type (record→7xl, home→screen-2xl, app→screen-xl, utility→4xl)
196+
- [x] Legacy body/children fallback for backward compatibility
197+
- [x] Resolved duplicate 'page' registration between @object-ui/components and @object-ui/layout
198+
- [x] 36 PageRenderer tests + 23 usePageVariables tests, all passing
199+
200+
**Remaining:**
201+
- [ ] Page.template support (predefined layout templates)
202+
- [ ] Page.object data binding (auto-fetch record data)
189203

190204
---
191205

0 commit comments

Comments
 (0)