feat(scene): add scene editor, executor and fakes (phase 1) #5

Merged
KremeCN merged 10 commits from feat/scene-editor into main 2026-08-25 20:20:19 +08:00
10 Commits
Author SHA1 Message Date
KremeCN e7da708e37 fix(scene): preserve fixed gateway device identifiers, fix edit loading race condition and parallel abort strategy 2026-08-25 18:00:25 +08:00
KremeCN b48079564f fix(scene): address bot review on fake executor delays, time input validation, and localization 2026-08-25 17:35:32 +08:00
KremeCN 56451be0d8 fix(scene): address bot review comments on concurrency, cancellation, validation, and race conditions 2026-08-25 17:16:04 +08:00
KremeCN db6a7978a9 fix(scene): simplify card styling to flat outlined cards without nested double shells 2026-08-25 16:21:16 +08:00
KremeCN 9ac1616046 feat(scene): refactor scene automation into modular trigger-action system
- Support manual one-tap commands and automatic condition-based rules
- Add modular triggers (time, temperature, humidity, device state)
- Add modular conditions (environment thresholds, socket state, time range)
- Upgrade actions to support virtual remotes, sockets, delays, and notifications
- Support sequential/parallel concurrency mode and error execution strategies
- Refactor SceneListScreen with filter tabs, quick execution, and enable switches
- Refactor SceneEditorScreen with modular builders and preset pickers
- Enhance SceneExecutionScreen with step timing, skips, and rerun capability
- Add comprehensive domain and UI ViewModel unit tests
2026-08-25 16:15:31 +08:00
KremeCN f70f034119 fix(scene): promote scene editor and execution screens to full-screen secondary destinations 2026-08-25 15:54:22 +08:00
KremeCN a896b8eecf Merge remote-tracking branch 'origin/main' into feat/scene-editor 2026-08-25 15:48:02 +08:00
Moler 6b4ef585fb feat(scene): integrate scene navigation host into authenticated MainAppShell 2026-08-25 11:38:54 +08:00
Moler df46d6273d feat(scene): integrate scene domain, viewmodels, screens and tests 2026-08-25 11:26:07 +08:00
tzh 533ce46de6 feat(scene): add scene editor, executor and fakes (phase 1)
Introduce the scene module skeleton that satisfies phase 1 exit conditions for
tzh's responsibility in project_plan.md section 6.5: scene list, editor and Fake-driven
execution that can be tested independently.

Domain layer (domain/):
- Scene, SceneAction (SocketPower / InfraredKey), SceneIcon, SceneColor
- SceneExecutionResult with per-action outcome aggregation
- SceneRepository port (observe/get/create/update/delete, provider-isolated)
- SceneExecutor port (sequential execution, per-action failure continues)

Fakes (testing/fakes/):
- FakeSceneRepository: in-memory, provider-isolated, seeds local-experience catalog
- FakeSceneExecutor: drives existing SocketGateway/InfraredGateway fakes,
  rejects concurrent execution of the same scene

Android app (android/app/):
- SceneListScreen / SceneListViewModel: list, empty state, delete confirm
- SceneEditorScreen / SceneEditorViewModel: name/icon/color, action add/remove/reorder
- SceneExecutionScreen / SceneExecutionViewModel: run, progress, per-action summary
- SceneRoutes + NavGraphBuilder extensions wired into ABoxManagerApp
- SceneModule (debug) binds FakeSceneRepository, FakeSceneExecutor and a
  LocalProfileId qualifier that feat/provider-login will retire later

Build (settings.gradle.kts):
- Apply foojay-resolver-convention so the JVM 17 toolchain is auto-provisioned

Resources: zh-rCN / en strings for all scene surfaces
Tests: 20 unit tests covering repository isolation, CRUD, executor ordering,
failure continuation and concurrent-execution rejection
2026-08-25 11:25:35 +08:00