Follow Circuit best practices: use sealed interface for screen events#441
Merged
Conversation
…t best practices Agent-Logs-Url: https://github.com/hossain-khan/android-remote-notify/sessions/a0ebbadf-e5a2-48f8-9264-abecd99251b6 Co-authored-by: hossain-khan <99822+hossain-khan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update template app to follow circuit best practices
Follow Circuit best practices: use Apr 19, 2026
sealed interface for screen events
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the app’s Circuit screen event modeling with Circuit’s documented best practice by switching screen Event types from sealed class to sealed interface, and updating all event subtype declarations accordingly across the UI screens.
Changes:
- Converted
sealed class Event : CircuitUiEventtosealed interface Event : CircuitUiEventacross all affected screens. - Updated event subtype declarations from
: Event()to: Eventto match interface implementation syntax.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/java/dev/hossain/remotenotify/ui/alertlist/AlertsListScreen.kt | Migrates screen events to sealed interface and updates event subtype declarations. |
| app/src/main/java/dev/hossain/remotenotify/ui/about/AboutAppScreen.kt | Migrates screen events to sealed interface and updates event subtype declarations. |
| app/src/main/java/dev/hossain/remotenotify/ui/alertmediumlist/NotificationMediumListScreen.kt | Migrates screen events to sealed interface and updates event subtype declarations. |
| app/src/main/java/dev/hossain/remotenotify/ui/alertchecklog/AlertCheckLogViewerScreen.kt | Migrates screen events to sealed interface and updates event subtype declarations. |
| app/src/main/java/dev/hossain/remotenotify/ui/alertmediumconfig/ConfigureNotificationMediumScreen.kt | Migrates screen events to sealed interface and updates event subtype declarations. |
| app/src/main/java/dev/hossain/remotenotify/ui/backup/BackupRestoreScreen.kt | Migrates screen events to sealed interface and updates event subtype declarations. |
| app/src/main/java/dev/hossain/remotenotify/ui/addalert/AddNewRemoteAlert.kt | Migrates screen events to sealed interface and updates event subtype declarations. |
| app/src/main/java/dev/hossain/remotenotify/ui/devportal/DeveloperPortalScreen.kt | Migrates screen events to sealed interface and updates event subtype declarations. |
Code Coverage Report |
📊 APK Size AnalysisComparing APKDEX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Circuit's official documentation consistently uses
sealed interfaceforCircuitUiEventtypes, notsealed class. All 8 screen files in the project were using the less idiomaticsealed classform.Changes
sealed class Event : CircuitUiEvent→sealed interface Event : CircuitUiEventin all screen files: Event()→: Event(interfaces have no constructor)Before:
After:
Files Updated
AlertsListScreen.ktAboutAppScreen.ktNotificationMediumListScreen.ktAlertCheckLogViewerScreen.ktConfigureNotificationMediumScreen.ktBackupRestoreScreen.ktAddNewRemoteAlert.ktDeveloperPortalScreen.kt