Skip to content

Commit c6387ab

Browse files
authored
Merge branch 'main' into codex/revise-milestone-goals-in-tasks.md
2 parents ae347d4 + 6b814c2 commit c6387ab

2 files changed

Lines changed: 211 additions & 138 deletions

File tree

docs/AI_Codex_Guide.md

Lines changed: 69 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ AI execution rules: this file + docs/AI_GUIDELINES.md (if present)
1111
0) Mission & Constraints
1212
Mission
1313

14-
Implement the Home, Rooms, Security, and Control Center screens as per the low-fi wireframes. Produce small, reviewable changes that run smoothly on device.
14+
Implement the Rooms, CCTV, Weather, Media, and Settings experiences as per the low-fi wireframes.
15+
Produce small, reviewable changes that run smoothly on device.
1516

1617
Hard Constraints (do not deviate)
1718

@@ -33,14 +34,19 @@ Keep interaction animations ≥50 FPS, ambient ≥30 FPS.
3334
AI_Codex_Guide.md ← this file (you are here)
3435
AI_GUIDELINES.md ← optional extra rules
3536

36-
/ui
37-
ui_theme.h ← tokens (spacing, colors, radii, motion)
38-
ui_components.* ← shared cards/chips/sliders/toasts
39-
ui_home.* ← Home screen
40-
ui_rooms.* ← Rooms screen
41-
ui_security.* ← Security (Frigate) screen
42-
ui_control_center.* ← Control Center sheet
43-
ui_debug.* ← optional debug overlay (FPS, heap)
37+
/custom/ui
38+
ui_theme.* ← tokens (spacing, colors, radii, motion)
39+
ui_nav_rail.* ← navigation rail & gestures
40+
ui_root.* ← screen container + page routing
41+
ui_wallpaper.* ← shared wallpaper helper
42+
pages/
43+
ui_page_rooms.* ← Rooms cards + detail events
44+
ui_page_cctv.* ← CCTV view + event list
45+
ui_page_weather.* ← Local climate metrics
46+
ui_page_media.* ← Media controls & scenes
47+
ui_page_settings.* ← Settings sliders + testers
48+
ui_rooms_model.* ← shared Rooms state helpers
49+
widgets/ ← shared cards/chips/sliders/toasts
4450

4551
/assets
4652
icons/ ← 1x assets sized to final use, RGB565
@@ -83,27 +89,37 @@ Do not invent new tokens, colors, or timings. If you need one, add it to docs/wi
8389

8490
Implement exactly these behaviors:
8591

86-
Home
92+
Rooms (ui_page_rooms.*)
8793

88-
Cards: tap → expand; long-press Quick Action → confirm sheet.
94+
- Grid of room cards populated from `ui_rooms_model.*`.
95+
- Tap the toggle on a card to fire `UI_PAGE_ROOMS_EVENT_TOGGLE` with optimistic feedback.
96+
- Long-press a card body to request the per-room sheet via `UI_PAGE_ROOMS_EVENT_OPEN_SHEET`.
97+
- Cards surface temperature/humidity badges and availability state.
8998

90-
Status chips: navigate to relevant screen; anomaly colors: accent/warn/alert.
99+
CCTV (ui_page_cctv.*)
91100

92-
Rooms
101+
- Primary camera card with Prev/Next controls, quality picker, and mute toggle shell.
102+
- Live feed placeholder sized per spec; keep toggles hidden on camera/event cards.
103+
- Event cards list recent clips; tapping should emit an open-clip signal when bindings arrive.
93104

94-
List left, detail right; two-finger swipe changes room.
105+
Weather (ui_page_weather.*)
95106

96-
Long-press a light → per-entity detail sheet.
107+
- Living Room card shows indoor temperature, humidity, and HVAC mode metrics.
108+
- Outdoor card surfaces raw sensor IDs with current readings.
109+
- Forecast row presents 3 quick-glance day summaries with iconography.
97110

98-
Security
111+
Media (ui_page_media.*)
99112

100-
Camera carousel + Live tile; event chips open clip/PiP.
113+
- Now Playing card renders album art, metadata, transport buttons, and a volume slider.
114+
- Quick Scenes card exposes preset buttons for lighting/media moods.
115+
- Hide unused default room-card specs/toggles when not applicable.
101116

102-
Alert mode: frame screen in warn/alert, focus automatically.
117+
Settings (ui_page_settings.*)
103118

104-
Control Center
105-
106-
Swipe-down to open; brightness, volume, toggles; sleep action.
119+
- Connectivity testers display pill states (Online/Degraded/Offline) per status callbacks.
120+
- Theme block combines dark-mode switch and theme dropdown; changes propagate via async payloads.
121+
- Brightness slider updates the numeric pill; action buttons (OTA, diagnostics, logs)
122+
forward events.
107123

108124
Global
109125

@@ -159,29 +175,42 @@ Fallback chain: HLS → MJPEG → snapshot (UI shows badge).
159175

160176
Skeleton screens (layout only)
161177

162-
Create empty ui_home.*, ui_rooms.*, ui_security.*, ui_control_center.* with layout objects and placeholder components from ui_components.*.
178+
- Stand up `custom/ui/ui_root.*` with nav rail scaffolding.
179+
- Create empty `ui_page_rooms.*`, `ui_page_cctv.*`, `ui_page_weather.*`, `ui_page_media.*`,
180+
and `ui_page_settings.*` with layout placeholders using shared widgets.
163181

164-
Hook tab navigation & gestures.
182+
Rooms iteration
165183

166-
Components
184+
- Build the room card grid with `ui_room_card` widgets and wire toggle/long-press events.
185+
- Populate cards from `ui_rooms_model.*`; surface climate badges and availability state.
167186

168-
Shared Card, Chip, Slider, Toast, Tabs, Confirm Sheet—styled via ui_theme.h.
187+
CCTV iteration
169188

170-
Bindings
189+
- Compose the live camera card with toolbar controls and video placeholder.
190+
- Lay out event cards for recent clips; stub tap handlers for future bindings.
171191

172-
Wire Home card values to mock data → then swap to MQTT/Frigate bindings.
192+
Weather iteration
173193

174-
Motion & feedback
194+
- Add Living Room and Outdoor cards with metric stacks.
195+
- Render the forecast row with icon + high/low pairs.
196+
197+
Media iteration
175198

176-
Add expand/contract, color pulse, toast confirmations; error states.
199+
- Flesh out the Now Playing card (album art, metadata, transport controls, volume slider).
200+
- Add Quick Scenes buttons and make them emit scene selection events.
177201

178-
Control Center
202+
Settings iteration
203+
204+
- Implement connectivity testers, theme toggle/dropdown, brightness slider, and action buttons.
205+
- Expose async setters for status/theme/brightness updates.
206+
207+
Motion & feedback
179208

180-
Brightness/volume toggles; sleep action; publish to HA where applicable.
209+
- Add transitions for card/toolbars, slider feedback, and toast confirmations; cover error states.
181210

182211
Debug & Perf
183212

184-
Hidden overlay; verify FPS/allocations.
213+
- Hidden overlay; verify FPS/allocations.
185214

186215
Each step should be a small PR (see checklist below).
187216

@@ -209,7 +238,14 @@ Each step should be a small PR (see checklist below).
209238

210239
Use a standard preface when asking the AI for changes:
211240

212-
Context: You are working in baba-dev/M5Tab5-UserDemo. Read docs/wireframes.md and docs/AI_Codex_Guide.md. Build only what those files describe. Use LVGL on Tab5 at 1280×720 landscape. Respect tokens in ui_theme.h. Keep changes minimal and isolated: prefer editing ui_home.*, ui_rooms.*, ui_security.*, ui_control_center.*, ui_components.*, or integration/*. Preload RGB565 assets sized to display; no runtime scaling. Use optimistic UI with rollback on timeout. Add a short note on performance and video of the result.
241+
Context: You are working in baba-dev/M5Tab5-UserDemo.
242+
Read docs/wireframes.md and docs/AI_Codex_Guide.md.
243+
Build only what those files describe. Use LVGL on Tab5 at 1280×720 landscape.
244+
Respect tokens in ui_theme.h. Keep changes minimal and isolated: prefer editing custom/ui/ui_root.*,
245+
custom/ui/pages/ui_page_*.*, custom/ui/pages/ui_rooms_model.*,
246+
custom/ui/widgets/*, or integration/*.
247+
Preload RGB565 assets sized to display; no runtime scaling.
248+
Use optimistic UI with rollback on timeout. Add a short note on performance and video of the result.
213249

214250
Example task prompts (no code requested here)
215251

0 commit comments

Comments
 (0)