feat(app): add manifest-driven factory registry - #532
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughIntroduces a factory registry for motion, TTS, and UI implementations, moves compose.ts to registry lookups, splits manifest wiring into base and registry fragments, trims preload lists, and updates TypeScript aliases and tests for the new layout. ChangesFactory Registry Feature
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant RegisterModules
participant Registry
participant Compose
RegisterModules->>Registry: registerMotionDriverFactory/registerTTSFactory/registerUIFactory(type, factory)
Compose->>Registry: getMotionDriverFactory/getTTSFactory/getUIFactory(preferences.type)
Registry-->>Compose: factory or undefined
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
firmware/host/modules/testing/fakes/capabilities.ts (1)
15-16: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider a more structured fake
RobotUItype.
Record<string, unknown>is extremely permissive — any object satisfies it, which could mask missing methods in test fakes. The realRobotUIcontract (fromcapabilities.ts) has specific methods likeupdate,setFace,setMain,showFace, drawer operations, etc. APartial<RobotUI>or aPickof the methods actually used in tests would provide better compile-time safety while keeping fakes minimal.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@firmware/host/modules/testing/fakes/capabilities.ts` around lines 15 - 16, The fake RobotUI type is too permissive, so tests can compile even when required UI methods are missing. Update the RobotUI alias in capabilities.ts to use a structured shape based on the real RobotUI contract, such as a Partial or Pick of only the methods the fakes actually rely on (for example update, setFace, setMain, showFace, and drawer-related methods). Keep the fake minimal, but make the type strict enough to catch missing methods at compile time.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@firmware/host/app/factory-registry/ui.ts`:
- Around line 7-30: createRegisteredStackchanUI is ignoring
StackchanUIOptions.displayListLength and always using the separate
displayListLength parameter, so update the function to read the value from
options with a default fallback instead. Use the existing
createRegisteredStackchanUI and StackchanUIOptions symbols to remove the
redundant third argument or make it a fallback only, and ensure the value passed
into createAppControllerApplication comes from the resolved options value.
---
Nitpick comments:
In `@firmware/host/modules/testing/fakes/capabilities.ts`:
- Around line 15-16: The fake RobotUI type is too permissive, so tests can
compile even when required UI methods are missing. Update the RobotUI alias in
capabilities.ts to use a structured shape based on the real RobotUI contract,
such as a Partial or Pick of only the methods the fakes actually rely on (for
example update, setFace, setMain, showFace, and drawer-related methods). Keep
the fake minimal, but make the type strict enough to catch missing methods at
compile time.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f0eb462d-4b97-4f80-9236-4554d07ea11d
📒 Files selected for processing (36)
firmware/host/app/__tests__/factory-registry.test.tsfirmware/host/app/app-capabilities.architecture.tsfirmware/host/app/compose.tsfirmware/host/app/factory-registry/register/motion/dynamixel.tsfirmware/host/app/factory-registry/register/motion/m5stackchan.tsfirmware/host/app/factory-registry/register/motion/none.tsfirmware/host/app/factory-registry/register/motion/pwm.tsfirmware/host/app/factory-registry/register/motion/rs30x.tsfirmware/host/app/factory-registry/register/motion/scservo.tsfirmware/host/app/factory-registry/register/tts/elevenlabs.tsfirmware/host/app/factory-registry/register/tts/local.tsfirmware/host/app/factory-registry/register/tts/openai.tsfirmware/host/app/factory-registry/register/tts/remote.tsfirmware/host/app/factory-registry/register/tts/voicevox-web.tsfirmware/host/app/factory-registry/register/tts/voicevox.tsfirmware/host/app/factory-registry/register/ui/dog.tsfirmware/host/app/factory-registry/register/ui/image.tsfirmware/host/app/factory-registry/register/ui/simple.tsfirmware/host/app/factory-registry/register/ui/small-face.tsfirmware/host/app/factory-registry/registry.tsfirmware/host/app/factory-registry/ui.tsfirmware/host/app/manifest.jsonfirmware/host/app/manifest_base.jsonfirmware/host/app/manifest_factories_all.jsonfirmware/host/app/manifest_factory_registry.jsonfirmware/host/app/manifest_wasm.jsonfirmware/host/modules/audio/__tests__/audio-buffer-ownership.architecture.tsfirmware/host/modules/audio/manifest.jsonfirmware/host/modules/motion/manifest.jsonfirmware/host/modules/testing/fakes/capabilities.tsfirmware/host/modules/ui/application/app-controller.architecture.tsfirmware/host/modules/ui/views/splash/splash-view.architecture.tsfirmware/host/platforms/platform-manifest.architecture.tsfirmware/host/platforms/wasm/wasm-stubs.architecture.tsfirmware/tsconfig.jsonfirmware/tsconfig.test.json
|
@coderabbitai review |
✅ Action performedReview finished.
|
概要
compose.ts の driver / TTS / face 実装を manifest-controlled registry に移し、不要な実装を target ごとに外せる構成にします。
設計
変更内容
検証
未実施
リリース影響
patch。default manifest では既存挙動を維持しますが、build 構成に関わるためリリースノートに記載推奨です。
Closes #511
関連 #418
🤖 Generated with Claude Code
Summary by CodeRabbit