Redesign app updater with global status management and UI enhancements - #191
Conversation
- Restore original ARVIO layout and typography to AppUpdateModal while incorporating new UX retry flows - Integrate global UpdateStatusManager across UI layers (HomeScreen, Settings, Modals) - Add proactive red notification badges to TopBar and Sidebar for available updates - Gracefully handle PackageInstaller callback states through ApkInstallReceiver - Remove temporary test code and clean up legacy inline dialog fields
…ign buttons
- Remove force-open state from HomeViewModel and SettingsViewModel on every updateStatusManager progress emission.
- Instead, only auto-open the dialog when first discovering a new un-ignored update.
- Refactor AppUpdateModal buttons to use a dynamic ActionButtonConfig list, ensuring the correct labels ('Install', 'Download', 'Retry', 'Hide') appear depending on the exact UX state, and preventing the D-pad from focusing on hidden buttons.
- Replaced persistent DataStore ignores with an in-memory sessionIgnoredTag in UpdateStatusManager. This ensures users are only unprompted during the current session, but will be notified again upon app restart. - Added a cancelDownloadAppUpdate() function to both HomeViewModel and SettingsViewModel. - Updated ApkDownloader and AppUpdateModal to show and handle the 'Cancel' button during active downloads.
|
Thanks, this is a good direction and the merge build passes for both Play and Sideload. I would like a few cleanups before merging:
|
Himanth-reddy
left a comment
There was a problem hiding this comment.
Implemented the review cleanups.
Changes:
UpdateStatusManager now remembers the last AppUpdate context and attaches it to context-free Failure statuses, so PackageInstaller failure/cancel retry can download again.
Ignore persists the release tag again via UpdatePreferences in both Home and Settings.
Home update badge/dialog suppression now checks the persisted ignored tag after restart.
Trimmed trailing whitespace in the touched files.
Verified:
git diff --check passes.
./gradlew :app:assemblePlayDebug :app:assembleSideloadDebug passes. Existing deprecation/always-true warnings remain, but no build errors.
This pull request introduces a comprehensive in-app update system for the application, including a user interface for update notifications and actions, and the necessary state management to support it. The update badge is now displayed in both the top bar and sidebar when an update is available, and a modal dialog guides users through the update process. The changes are grouped below by theme.
User Interface Enhancements for Updates:
Added an update badge indicator to both the
AppTopBarandSidebarcomponents, visually alerting users when an update is available. The badge appears as a red dot on the settings gear icon in the top bar and the settings icon in the sidebar. (AppTopBar.kt,Sidebar.kt) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Introduced a new
AppUpdateModalcomposable, which displays a modal dialog guiding users through the app update process, including states for checking, downloading, installing, failures, and update notes. The modal provides contextual action buttons and progress indicators. (AppUpdateModal.kt,HomeScreen.kt) [1] [2]State Management and ViewModel Integration:
Extended
HomeUiStateto include update-related properties:updateStatus,showAppUpdateDialog, andhasUpdateBadge, enabling the UI to react to update events and display the appropriate indicators and dialogs. (HomeViewModel.kt)Updated the
HomeViewModelto inject and use new update-related repositories and managers (AppUpdateRepository,ApkDownloader,UpdatePreferences,UpdateStatusManager), laying the groundwork for managing the update process and user preferences. (HomeViewModel.kt)These changes collectively provide users with a seamless and interactive in-app update experience, ensuring they are notified of new updates and can easily take action within the app.