Skip to content

Conversation

@TimoPtr
Copy link
Member

@TimoPtr TimoPtr commented Nov 25, 2025

Summary

In the new onboarding the notification permission is displayed when we reach the dashboard instead of having a dedicated screen.

Checklist

  • New or updated tests have been added to cover the changes following the testing guidelines.
  • The code follows the project's code style and best_practices.
  • The changes have been thoroughly tested, and edge cases have been considered.
  • Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.

Screenshots

image image

Any other notes

This PR is based on #6081

@TimoPtr TimoPtr requested a review from jpelgrom November 25, 2025 09:51
Copy link
Member

@jpelgrom jpelgrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy flow functionally works OK, even though I personally preferred the placement in the onboarding flow.

<string name="connection_error_unknown_error">There was an error loading Home Assistant. Please review the connection settings and try again.</string>
<string name="back">Back</string>
<string name="notification_permission_dialog_title">Allow notifications?</string>
<string name="notification_permission_dialog_content">Enable notifications and get what\'s happening in your home, from detecting leaks to doors left open, you have full control over what it tells you.</string>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get that this is copied from iOS but it seems like a very long sentence to me + the reference to 'it' in the last part is unclear. @dshokouhi Can you give native speaker input please? 😇

Suggestion:

Suggested change
<string name="notification_permission_dialog_content">Enable notifications and get what\'s happening in your home, from detecting leaks to doors left open, you have full control over what it tells you.</string>
<string name="notification_permission_dialog_content">Enable notifications and get what\'s happening in your home, from detecting leaks to doors left open. You have full control over the notifications you receive and what they tell you.</string>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've applied the change but I keep this open in case anyone wants to give his opinion.

@TimoPtr TimoPtr requested a review from bgoncal November 26, 2025 09:07
@bgoncal bgoncal requested review from Copilot and removed request for bgoncal November 26, 2025 09:25
Copilot finished reviewing on behalf of bgoncal November 26, 2025 09:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a notification permission bottom sheet that appears in the WebView screen after the dashboard loads, replacing the previous dedicated permission screen in the onboarding flow. The implementation uses the Home Assistant design system components and stores the user's permission preference to avoid repeated prompts.

Key Changes

  • Added preference storage for tracking whether to ask for notification permission
  • Implemented a modal bottom sheet UI component requesting notification permission
  • Integrated the permission request into the WebView screen after initialization

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
common/src/main/res/values/strings.xml Added localized strings for notification permission dialog title, content, and button labels
common/src/main/kotlin/io/homeassistant/companion/android/common/data/prefs/PrefsRepository.kt Added interface methods for managing notification permission preference
common/src/main/kotlin/io/homeassistant/companion/android/common/data/prefs/PrefsRepositoryImpl.kt Implemented preference storage methods with default value of true
app/src/main/kotlin/io/homeassistant/companion/android/webview/WebViewPresenter.kt Added presenter interface methods to expose permission preference logic
app/src/main/kotlin/io/homeassistant/companion/android/webview/WebViewPresenterImpl.kt Implemented presenter methods delegating to PrefsRepository
app/src/main/kotlin/io/homeassistant/companion/android/webview/WebViewContentScreen.kt Added NotificationPermission composable with bottom sheet UI and integrated into main screen
app/src/main/kotlin/io/homeassistant/companion/android/webview/WebViewActivity.kt Added state management and callback handling for permission request flow
app/src/screenshotTest/kotlin/io/homeassistant/companion/android/webview/WebViewContentScreenScreenshotTest.kt Updated screenshot tests with new parameters and added test case for permission request

@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

Test Results

 87 files  ±0   87 suites  ±0   6m 52s ⏱️ -35s
784 tests +4  784 ✅ +4  0 💤 ±0  0 ❌ ±0 
797 runs  +4  797 ✅ +4  0 💤 ±0  0 ❌ ±0 

Results for commit c05dfb3. ± Comparison against base commit 5e0098b.

♻️ This comment has been updated with latest results.

@TimoPtr TimoPtr requested a review from jpelgrom November 27, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants