Skip to content

Conversation

@Jozys
Copy link
Collaborator

@Jozys Jozys commented Apr 28, 2025

🚀 Pull Request

Brief Description

This pull request hide the corresponding PermissionCard in case of Health Connect historical health functionality is not available. Apart from that it also localizes missing read permission.

Linked Issues

GitHub Copilot Text

This pull request introduces support for checking the availability of historical health data permissions, refactors error messages to use localized strings, and updates the UI logic to conditionally display historical health data options based on availability. Below are the key changes grouped by theme:

Localization Updates:

  • Added a new localized string permission_health_read_missing to both lib/l10n/app_de.arb and lib/l10n/app_en.arb for displaying a message when health data read permissions are missing. [1] [2]

Permissions State Enhancements:

  • Introduced a new property isHealthHistoricalAvailable in the PermissionsState class to track the availability of historical health data functionality. Updated the constructor, copyWith method, and PermissionsNotifier logic to handle this property. [1] [2] [3] [4] [5]

UI Logic Adjustments:

  • Updated the PermissionsPage and PermissionsSettingsScreen widgets to use the new isHealthHistoricalAvailable property instead of relying solely on the platform check. This ensures the historical health data option is displayed only when available. [1] [2] [3] [4]

Error Message Refactoring:

  • Replaced hardcoded error messages for missing health data read permissions with the localized permission_health_read_missing string across multiple widgets for consistency. [1] [2] [3] [4]

- In case of Health Connect historical health functionality is not available, hide the corresponding PermissionCard
- Add localization for missing read permission
@Jozys Jozys requested review from ScreepCode and Copilot April 28, 2025 15:21
Copy link
Contributor

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.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (5)
  • lib/l10n/app_de.arb: Language not supported
  • lib/l10n/app_en.arb: Language not supported
  • lib/presentation/onboarding/providers/permissions_provider.dart: Language not supported
  • lib/presentation/onboarding/widgets/permissions_page.dart: Language not supported
  • lib/presentation/profile/screen/permissions_settings_screen.dart: Language not supported

@Jozys Jozys requested a review from ScreepCode April 29, 2025 10:27
@Jozys Jozys merged commit 97b6f59 into development Apr 29, 2025
2 checks passed
@Jozys Jozys deleted the fix/historical-health-data branch April 29, 2025 14:45
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.

3 participants