Skip to content

feat(app): OG_DEMO flag to run demo driver on native builds for simulator testing - #4

Open
shroominic wants to merge 1 commit into
mainfrom
feat/sim-demo-mode
Open

feat(app): OG_DEMO flag to run demo driver on native builds for simulator testing#4
shroominic wants to merge 1 commit into
mainfrom
feat/sim-demo-mode

Conversation

@shroominic

Copy link
Copy Markdown
Owner

What this does

Adds a compile-time OG_DEMO build flag so native / iOS-simulator builds run the in-memory DemoCgmDriver instead of the real BLE Aidex driver, and auto-scan + auto-connect on launch so the app opens straight onto the populated dashboard.

The iOS simulator has no Bluetooth, so without this the app is stuck on the empty "0 sensors" scan view. This flag makes the whole feature fleet able to verify features in the simulator.

  • driver_factory_io.dart: when OG_DEMO=true, return DemoCgmDriver; otherwise unchanged (real AidexSensorDriver).
  • main.dart: when OG_DEMO=true, after bootstrap, scan and connect to the first demo sensor (the demo driver only yields its sensor after a scan). Skipped if a persisted session is already restoring. Strictly gated behind the flag.
  • New test/og_demo_flag_test.dart asserting the factory selects the demo driver under the flag and the real driver otherwise.

Flag defaults to false — production builds are untouched (real BLE driver, manual scan flow).

Why merge first

This is the simulator-verification prerequisite that the rest of the feature fleet builds on. It should merge first so other feature agents can run their work in the simulator.

Verification command

flutter build ios --simulator --debug --dart-define=OG_DEMO=true
# then install + launch on a booted simulator
# or: flutter run -d <udid> --dart-define=OG_DEMO=true

Results

  • iOS simulator (--dart-define=OG_DEMO=true): app lands directly on the populated dashboard — AiDEX Demo 07A12, 106 mg/dL, Connected, history chart + recent readings. Screenshot captured locally at /tmp/og-demo-dashboard.png.
  • Normal build (no flag) flutter build ios --simulator --debug: builds clean, uses real driver.
  • flutter analyze: clean (the only remaining info is pre-existing in live_activity_payload.dart, untouched).
  • flutter test: passes — both default and --dart-define=OG_DEMO=true.

🤖 Generated with Claude Code

…ator testing

Add a compile-time OG_DEMO build flag (--dart-define=OG_DEMO=true) so
native/simulator builds run the in-memory DemoCgmDriver instead of the
real BLE Aidex driver, and auto-scan + auto-connect on launch so the app
lands directly on the populated dashboard. The iOS simulator has no
Bluetooth, so this unblocks simulator-based feature verification.

When the flag is false (the default), behavior is unchanged: production
builds keep using the real AidexSensorDriver and the manual scan flow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant