Skip to content

Conversation

@chownation
Copy link
Contributor

This PR introduces a comprehensive development infrastructure and refactors the core architecture for better testability and maintenance.

Changes

  1. Mock Backend: Added a python-based mock backend (tools/mock_backend/) to simulate vehicle hardware APIs, allowing full offline development.
  2. Test Suite: Added a comprehensive test suite (test/) covering unit, widget, and integration tests (340 tests), along with a scripts/run_tests.sh runner.
  3. Architecture Refactor:
    • Introduced BaseSettingsViewModel and specific view models for settings widgets to separate logic from UI.
    • Refactored Services to use Factory pattern (e.g., AudioServiceFactory, WindowServiceFactory) to seamlessly switch between Web and VM/Stub implementations for easier testing.
    • Abstracted JS Interop (MessageSender) to allow testing TouchscreenCubit in Dart VM.
  4. Documentation: Updated README.md, added docs/MOCK_BACKEND.md and test/README.md.

Testing

  • Runs clean with zero lint errors.
  • All tests passing (Coverage ~80%).
  • Verified against mock backend.

@mikegapinski
Copy link
Contributor

@chownation are you on our slack? I appreciate the effort but I've just started slowly killing (literally today...) this flutter web app to reduce memory footprint. There is a branch where I nuked the entire iframe, moved all the logic from the iframe to dart/flutter and enabled WASM.

The result was terrible, perfectly smooth when running on my laptop, decent on MCU3 but I couldn't even get it to run on MCU2 so I've decided to try vanilla js for the frontend. At least 55 MB of RAM saved, not mentioning not having to waste GPU/CPU cycles for canvaskit.

Not sure how this will all pan out, but if the lightweight frontend approach works as good as I expect it to I'll gut this app to just keep the settings portion for now before I rewrite it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants