Skip to content

Commit f4e383f

Browse files
committed
Refactor view layout sections for consistency and clarity in component contracts
1 parent 5382e3e commit f4e383f

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

content/prompts/development/component.prompt.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,41 +34,38 @@ Responsible for **Input** (Edit Mode) and **Display** (Read Mode) of a specific
3434
* **Visual:** `color` (Picker), `rating` (Star), `signature` (Canvas), `qrcode`, `progress`.
3535
* **Structure:** `json` (Object Editor), `address` (Street/City/State), `location` (Map Pin).
3636
37-
### B. List View Layouts (`view.list.*`)
38-
Responsible for rendering a collection of records.
37+
### B. View Layouts (`view.*`)
38+
Responsible for rendering records. The specific `type` determines the Props contract.
39+
40+
#### 1. List Views (Collection)
41+
* **Keys:** `view.grid`, `view.kanban`, `view.map`, `view.calendar`, `view.gantt`, etc.
3942
* **Contract:** Must implement `ListViewComponentProps`.
4043
```typescript
4144
type ListViewComponentProps = {
42-
config: ListView; // Config (Ref:src/ui/view.zod.ts)
45+
config: ListView; // Config (e.g. { type: 'grid', columns: [...] })
4346
data: any[]; // Runtime Collection
4447
isLoading?: boolean;
4548
onAction?: (actionId: string, record: any) => void;
4649
onSelectionChange?: (selectedIds: string[]) => void;
4750
}
4851
```
49-
* **Required Types (Ref: `src/ui/view.zod.ts`):**
50-
* **Data:** `grid` (Standard Table), `spreadsheet` (Editable Cell).
51-
* **Cards:** `gallery` (Image Deck), `kanban` (Status Board).
52-
* **Time:** `calendar` (Schedule), `gantt` (Project), `timeline` (Activity Stream).
53-
* **Geo:** `map` (Cluster/Markers).
54-
55-
### C. Form View Layouts (`view.form.*`)
56-
Responsible for rendering a single record detail.
52+
* **Required Types (Ref: `src/ui/view.zod.ts`):** `grid`, `spreadsheet`, `kanban`, `gallery`, `calendar`, `timeline`, `gantt`, `map`.
53+
54+
#### 2. Form Views (Detail)
55+
* **Keys:** `view.simple`, `view.wizard`, `view.tabbed`, `view.drawer`, etc.
5756
* **Contract:** Must implement `FormViewComponentProps`.
5857
```typescript
5958
type FormViewComponentProps = {
60-
config: FormView; // Config (Ref:src/ui/view.zod.ts)
59+
config: FormView; // Config (e.g. { type: 'simple', sections: [...] })
6160
data: any; // Single Runtime Record
6261
isLoading?: boolean;
6362
onAction?: (actionId: string, record: any) => void;
6463
onChange?: (field: string, value: any) => void;
6564
}
6665
```
67-
* **Required Types:**
68-
* `simple` (Vertical Flow), `tabbed` (Categorized), `wizard` (Step-by-Step).
69-
* `split` (Master-Detail), `drawer` (Side Panel), `modal` (Dialog).
66+
* **Required Types (Ref: `src/ui/view.zod.ts`):** `simple`, `tabbed`, `wizard`, `split`, `drawer`, `modal`.
7067
71-
### D. Dashboard Widgets (`widget.*`)
68+
### C. Dashboard Widgets (`widget.*`)
7269
Standalone cards placed on a dashboard grid.
7370
* **Contract:** Must implement `DashboardWidgetProps` (Ref: `src/ui/dashboard.zod.ts`).
7471
```typescript

0 commit comments

Comments
 (0)