You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start Scenario: A "Save" button in `page:header` needs to submit a form in `record:details`.
133
+
***Solution:** Use a scoped `EventBus` provided by `PageContext`.
134
+
***Protocol:**`bus.emit('record:save')` -> `RecordDetails` listens and submits.
135
+
136
+
### C. Form State (React Hook Form + Zod)
137
+
Scenario: Validating fields based on metadata rules (`maxLength`, `min`, `regex`).
138
+
***Solution:** Automatically generate Zod Validation Schema from `field.zod.ts` definitions at runtime.
139
+
***Pattern:**`useZodForm(objectSchema)` hook that bridges Metadata -> React Hook Form.
140
+
141
+
### D. Field-Level Security (FLS)
142
+
Scenario: User sees the record but lacks permission to view 'Salary' field.
143
+
***Solution:**`DataEngine` must filter restricted fields *before* they reach the UI component, or `RecordDetails` component must check `perm.canRead(field)` for each user.
144
+
145
+
### E. Theme Injection
146
+
Scenario: App branding (`branding.primaryColor`) must apply to all Buttons.
147
+
***Solution:** Convert `App.branding` values into CSS Variables (`--os-primary: #ff0000`) injected at the root `<LayoutProvider>`. All atoms (`atom:button`) consume these variables.
148
+
149
+
---
150
+
151
+
## 5. The Expression Engine
152
+
153
+
The engine must support "Metadata Expressions" to allow logic without compilation.
154
+
155
+
### A. Syntax
156
+
Use generic string interpolation `{ !... }` or specific prefixes.
0 commit comments