Skip to content

Add mobile session notifications#102

Merged
davidortinau merged 3 commits intomainfrom
feature/session-notifications
Feb 13, 2026
Merged

Add mobile session notifications#102
davidortinau merged 3 commits intomainfrom
feature/session-notifications

Conversation

@davidortinau
Copy link
Collaborator

Summary

Adds opt-in local notifications on iOS and Android when sessions need attention while connected via DevTunnel remote mode.

Features

  • Platform-native notifications: Uses UNUserNotificationCenter on iOS/Mac Catalyst and NotificationChannel on Android
  • Opt-in setting: Toggle in Settings page under Remote mode section
  • Smart triggers: Only notifies on session completion or errors - not during ongoing work
  • Context-aware messages: Shows session name and reason (completed, error, needs interaction)

Bridge Protocol

New attention_needed message type flows from desktop server to mobile client with:

  • Session ID and name
  • Attention reason enum (Completed, Error, NeedsInteraction, ReadyForMore)
  • Optional context message

Bug Fixes

  • Fixed iOS DirectoryNotFoundException when .polypilot dir doesn't exist
  • Fixed mobile header overflow (settings icon off-screen)
  • Fixed 100dvh CSS issue in BlazorWebView

Testing

  • 141 unit tests passing
  • Tested on iOS device and Mac Catalyst

When connected via DevTunnel, mobile apps can now receive local notifications
when sessions need attention:

- Error: Session encountered an error
- ReadyForMore: Session is idle, ready for next prompt

Notifications are ONLY sent when the session is truly complete and waiting
for user input (OnSessionComplete), not after every turn. This prevents
spam during ongoing work.

Features:
- Opt-in toggle in Settings (Remote section)
- Platform-native notifications (iOS UNUserNotificationCenter, Android NotificationChannel)
- Tap notification to open app (with session ID for future deep linking)- Context-aware messages with emoji  indicators (
- New 'attention_needed' bridge message type

Also fixes:
- iOS mobile nav bar overflow (buttons flowing off screen)
- iOS bottom margin doubled (removed 100dvh, use 100vh)

Files:
- Services/INotificationManagerService.cs - Interface
- Services/NotificationMessageBuilder.cs - Message formatting
- Platforms/*/NotificationManagerService.cs - Platform implementations
- Models/BridgeMessages.cs - AttentionNeeded type + payload
- Services/WsBridgeServer.cs - Emit attention_needed events
- Services/WsBridgeClient.cs - Handle attention_needed + trigger notifications
- Components/Pages/Settings.razor - Toggle UI
- Ensure .polypilot directory exists before writing ui-state files
- Remove debug logging that caused DirectoryNotFoundException
- Add flex-shrink:0 to header-actions to keep settings icon visible
- Wrap notification handler in Task.Run for safer async handling
@davidortinau davidortinau merged commit 052e528 into main Feb 13, 2026
@PureWeen PureWeen deleted the feature/session-notifications branch February 22, 2026 00:18
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