Skip to content

G2 continued work#2463

Merged
aisraelov merged 40 commits intodevfrom
g2-continued-work
Apr 15, 2026
Merged

G2 continued work#2463
aisraelov merged 40 commits intodevfrom
g2-continued-work

Conversation

@aisraelov
Copy link
Copy Markdown
Member

@aisraelov aisraelov commented Apr 6, 2026

  • Implement missing G2 functions for populating its dashboard (not necessary but this was an attempt to properly init the G2)
  • Disable "Hey Even" on-device VAD (this may have broken the G2 mic)
  • Add functions for changing head-up dashboard angle
  • Add functions for setting screen height/depth
  • Add functions for populating G2's long-press menu with Mentra Miniapps

Summary by CodeRabbit

Release Notes

  • New Features

    • Added glasses menu customization interface for configurable app dashboard on G2 devices
    • Added support for mini-app selection and toggling via glasses menu
  • Improvements

    • Enhanced device discovery with improved identification and validation
    • Dynamic image sizing for app switcher cards
    • Refined device pairing scan list display with clearer app information
  • Removals

    • Removed setMicState() from WebView SDK
    • Removed requestAudio() subscription from events API

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a3de20a4-a7b7-440f-8d32-3af6bd869c6d

📥 Commits

Reviewing files that changed from the base of the PR and between aecc94f and 7f5bd88.

📒 Files selected for processing (46)
  • mobile/modules/core/android/src/main/java/com/mentra/core/CoreManager.kt
  • mobile/modules/core/android/src/main/java/com/mentra/core/CoreModule.kt
  • mobile/modules/core/android/src/main/java/com/mentra/core/GlassesStore.kt
  • mobile/modules/core/android/src/main/java/com/mentra/core/sgcs/G1.java
  • mobile/modules/core/android/src/main/java/com/mentra/core/sgcs/G2.kt
  • mobile/modules/core/android/src/main/java/com/mentra/core/sgcs/Mach1.java
  • mobile/modules/core/android/src/main/java/com/mentra/core/sgcs/MentraLive.java
  • mobile/modules/core/android/src/main/java/com/mentra/core/sgcs/MentraNex.kt
  • mobile/modules/core/android/src/main/java/com/mentra/core/sgcs/SGCManager.kt
  • mobile/modules/core/android/src/main/java/com/mentra/core/sgcs/Simulated.kt
  • mobile/modules/core/ios/CoreModule.swift
  • mobile/modules/core/ios/Source/Bridge.swift
  • mobile/modules/core/ios/Source/CoreManager.swift
  • mobile/modules/core/ios/Source/GlassesStore.swift
  • mobile/modules/core/ios/Source/controllers/R1.swift
  • mobile/modules/core/ios/Source/sgcs/G1.swift
  • mobile/modules/core/ios/Source/sgcs/G2.swift
  • mobile/modules/core/ios/Source/sgcs/Mach1.swift
  • mobile/modules/core/ios/Source/sgcs/MentraLive.swift
  • mobile/modules/core/ios/Source/sgcs/MentraNex.swift
  • mobile/modules/core/ios/Source/sgcs/SGCManager.swift
  • mobile/modules/core/ios/Source/sgcs/Simulated.swift
  • mobile/modules/core/src/Core.types.ts
  • mobile/src/app/applet/webview.tsx
  • mobile/src/app/miniapps/settings/glasses-menu.tsx
  • mobile/src/app/miniapps/settings/glasses.tsx
  • mobile/src/app/miniapps/settings/super.tsx
  • mobile/src/app/pairing/scan.tsx
  • mobile/src/components/dev/CoreStatusBar.tsx
  • mobile/src/components/home/AppSwitcher.tsx
  • mobile/src/components/home/AppSwitcherButtton.tsx
  • mobile/src/components/ignite/Screen.tsx
  • mobile/src/components/miniapps/CapsuleMenu.tsx
  • mobile/src/components/ui/Group.tsx
  • mobile/src/effects/Compositor.tsx
  • mobile/src/i18n/en.ts
  • mobile/src/services/Composer.ts
  • mobile/src/services/MantleManager.ts
  • mobile/src/stores/glasses.ts
  • mobile/src/stores/settings.ts
  • mobile/src/utils/GlobalEventEmitter.tsx
  • mobile/src/utils/glassesMenu.ts
  • mobile/webview/sdk/README.md
  • mobile/webview/sdk/src/core.ts
  • mobile/webview/sdk/src/events.ts
  • mobile/webview/sdk/src/types.ts

📝 Walkthrough

Walkthrough

This pull request introduces debug method stubs across mobile platforms, implements a G2 glasses dashboard menu configuration system with synchronization, adds controller connection management, defines a mini-app selection event, and removes microphone-related SDK APIs while making various UI improvements.

Changes

Cohort / File(s) Summary
Debug Methods - Android
mobile/modules/core/android/src/main/java/com/mentra/core/CoreManager.kt, mobile/modules/core/android/src/main/java/com/mentra/core/CoreModule.kt, mobile/modules/core/android/src/main/java/com/mentra/core/sgcs/...
Added dbg1() and dbg2() stub methods to CoreManager, CoreModule, and all SGC implementations (G1, G2, Mach1, MentraLive, MentraNex, Simulated). SGCManager made these methods abstract to enforce implementation across all subclasses.
Debug Methods - iOS
mobile/modules/core/ios/CoreModule.swift, mobile/modules/core/ios/Source/CoreManager.swift, mobile/modules/core/ios/Source/sgcs/...
Added dbg1() and dbg2() async functions to CoreModule and stub methods across all SGC implementations. iOS CoreManager.dbg1() reconnects the controller; dbg2() is empty.
Dashboard Menu System - Core
mobile/modules/core/android/src/main/java/com/mentra/core/sgcs/SGCManager.kt, mobile/modules/core/ios/Source/sgcs/SGCManager.swift, mobile/src/utils/glassesMenu.ts
Added setDashboardMenu() method to SGCManager interface/implementations. Created glassesMenu utility module with menu building, default app selection, compatibility filtering, and sync logic to send configured menu items to native via CoreModule.
Dashboard Menu - UI & Settings
mobile/src/app/miniapps/settings/glasses-menu.tsx, mobile/src/app/miniapps/settings/glasses.tsx, mobile/src/stores/settings.ts, mobile/src/i18n/en.ts
Added GlassesMenuScreen component for drag-and-drop menu item management with app picker, compatibility validation, and reset functionality. Added conditional "Glasses Menu" button in settings for G2 glasses. Added glasses_menu_apps setting with persist and server sync enabled. Added localized menu configuration strings.
Dashboard Menu - Storage & Sync
mobile/modules/core/android/src/main/java/com/mentra/core/GlassesStore.kt, mobile/modules/core/ios/Source/GlassesStore.swift, mobile/src/services/MantleManager.ts
Extended GlassesStore to handle dashboard_menu_apps setting changes and invoke setDashboardMenu() on SGC. MantleManager triggers dashboard sync on glasses fully booted and app list changes. Added glasses_menu_apps and controllerMacAddress to respective stores.
Mini-app Selection Event
mobile/modules/core/android/src/main/java/com/mentra/core/CoreModule.kt, mobile/modules/core/ios/CoreModule.swift, mobile/modules/core/ios/Source/Bridge.swift, mobile/src/Core.types.ts
Added miniapp_selected event to CoreModule exports. Created MiniappSelectedEvent type with packageName field. Added Bridge.sendMiniappSelected function. MantleManager listens for event and toggles applet execution.
Controller Connection Management
mobile/modules/core/android/src/main/java/com/mentra/core/sgcs/SGCManager.kt, mobile/modules/core/ios/Source/sgcs/SGCManager.swift, mobile/modules/core/ios/Source/controllers/R1.swift
Added connectController() and disconnectController() methods to SGCManager protocol and all implementations. iOS CoreManager.disconnectController() now delegates to sgc. R1 tracks ring MAC address from BLE advertisements, enforces MAC validation for UUID-based reconnection, writes controllerMacAddress to store on ready, and schedules async controller connection.
Core Types & Status
mobile/modules/core/src/Core.types.ts, mobile/src/stores/glasses.ts
Extended GlassesStatus with controllerMacAddress field. Added MiniappSelectedEvent to CoreModuleEvents union. Added controllerMacAddress to glasses store initial state.
App Switching & Display
mobile/src/components/home/AppSwitcher.tsx, mobile/src/components/home/AppSwitcherButtton.tsx
AppSwitcher now computes dynamic image height from screenshot aspect ratio (loaded via useImage or persisted storage) instead of fixed height. Increased grid button sizing from h-15/w-15 to h-16/w-16.
Pairing & Navigation UI
mobile/src/app/pairing/scan.tsx, mobile/src/app/applet/webview.tsx
Updated device list to show model and device name in separate text elements (title/subtitle format) with adjusted background color. Changed device discovery to log manufacturer data. Disabled keyboard avoidance in WebView screen.
Screen Layout & Status
mobile/src/components/ignite/Screen.tsx, mobile/src/components/dev/CoreStatusBar.tsx, mobile/src/components/ui/Group.tsx
Screen now adds extra s6 padding for Android extraInsets. CoreStatusBar repositioned cloud-status tag with adjusted layout. Group component accepts optional forcePosition prop to override computed position styling. CoreStatusBar removed unused GlassView import.
Debug & Configuration UI
mobile/src/app/miniapps/settings/super.tsx
Added Debug group in super settings with buttons to invoke CoreModule.dbg1() and dbg2(). Added bottom spacer View for layout padding.
WebView SDK Removal
mobile/webview/sdk/src/core.ts, mobile/webview/sdk/src/events.ts, mobile/webview/sdk/src/types.ts, mobile/webview/sdk/README.md
Removed CoreModule.setMicState() method and related MicState/SetMicStateArgs types. Removed Events.requestAudio() subscription method. Updated SubscriptionType to exclude "audio". Removed corresponding documentation from SDK README.
Cleanup & Deprecation
mobile/src/effects/Compositor.tsx, mobile/src/services/Composer.ts, mobile/src/utils/GlobalEventEmitter.tsx
Removed PCM16 decoder helper functions from Compositor. Simplified fanOutPcm method in Composer (body remains empty). Added deprecation notice to GlobalEventEmitter directing users to CoreModule subscriptions.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Settings as GlassesMenuScreen
    participant Store as GlassesStore / AppletStore
    participant Util as glassesMenu Util
    participant Module as CoreModule
    participant SGC as SGC (Native)
    participant Hardware as G2 Hardware

    User->>Settings: Open glasses menu config
    Settings->>Store: Load saved glasses_menu_apps
    Settings->>Util: getDefaultMenuApps() if none saved
    Settings->>Settings: Render menu items, allow drag/reorder
    User->>Settings: Reorder or add/remove items
    Settings->>Store: setSavedMenuApps()
    Settings->>Util: syncDashboardMenu()
    Util->>Store: Get saved menu items
    Util->>Store: Resolve applet running state
    Util->>Module: updateCore({dashboard_menu_apps: items})
    Module->>SGC: setDashboardMenu(items)
    SGC->>Hardware: Send menu config
    Hardware-->>SGC: ACK
    SGC-->>Module: Complete
    Module-->>Util: Sync complete
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • isaiahb

Poem

🐰 Hopping through code with debug in sight,
Menus configured, controllers tight,
New events selected, MAC addresses gleam,
While old APIs fade like a distant dream! 🥕✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch g2-continued-work

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.42.1)
mobile/modules/core/android/src/main/java/com/mentra/core/sgcs/MentraLive.java

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

📋 PR Review Helper

📱 Mobile App Build

Ready to test! (commit 7f5bd88)

📥 Download APK

🕶️ ASG Client Build

Waiting for build...


🔀 Test Locally

gh pr checkout 2463

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 6, 2026

Deploying mentra-live-ota-site with  Cloudflare Pages  Cloudflare Pages

Latest commit: 939f400
Status: ✅  Deploy successful!
Preview URL: https://606dfd2c.mentra-live-ota-site.pages.dev
Branch Preview URL: https://g2-continued-work.mentra-live-ota-site.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 6, 2026

Deploying mentra-store-dev with  Cloudflare Pages  Cloudflare Pages

Latest commit: 939f400
Status: ✅  Deploy successful!
Preview URL: https://f3c3604c.augmentos-appstore-2.pages.dev
Branch Preview URL: https://g2-continued-work.augmentos-appstore-2.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 6, 2026

Deploying dev-augmentos-console with  Cloudflare Pages  Cloudflare Pages

Latest commit: 939f400
Status: ✅  Deploy successful!
Preview URL: https://4e439df9.dev-augmentos-console.pages.dev
Branch Preview URL: https://g2-continued-work.dev-augmentos-console.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 6, 2026

Deploying prod-augmentos-account with  Cloudflare Pages  Cloudflare Pages

Latest commit: 939f400
Status: ✅  Deploy successful!
Preview URL: https://e4f6cf9c.augmentos-e84.pages.dev
Branch Preview URL: https://g2-continued-work.augmentos-e84.pages.dev

View logs

@aisraelov aisraelov marked this pull request as ready for review April 15, 2026 16:55
@aisraelov aisraelov requested a review from a team as a code owner April 15, 2026 16:55
@aisraelov aisraelov merged commit 507a43f into dev Apr 15, 2026
9 of 10 checks passed
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