Skip to content

Follow Circuit best practices: use sealed interface for screen events#441

Merged
hossain-khan merged 2 commits into
mainfrom
copilot/ensure-circuit-best-practices
Apr 19, 2026
Merged

Follow Circuit best practices: use sealed interface for screen events#441
hossain-khan merged 2 commits into
mainfrom
copilot/ensure-circuit-best-practices

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

Circuit's official documentation consistently uses sealed interface for CircuitUiEvent types, not sealed class. All 8 screen files in the project were using the less idiomatic sealed class form.

Changes

  • Converted sealed class Event : CircuitUiEventsealed interface Event : CircuitUiEvent in all screen files
  • Updated all event subclass declarations: : Event(): Event (interfaces have no constructor)

Before:

sealed class Event : CircuitUiEvent {
    data object GoBack : Event()
    data class DeleteNotification(val notification: RemoteAlert) : Event()
}

After:

sealed interface Event : CircuitUiEvent {
    data object GoBack : Event
    data class DeleteNotification(val notification: RemoteAlert) : Event
}

Files Updated

  • AlertsListScreen.kt
  • AboutAppScreen.kt
  • NotificationMediumListScreen.kt
  • AlertCheckLogViewerScreen.kt
  • ConfigureNotificationMediumScreen.kt
  • BackupRestoreScreen.kt
  • AddNewRemoteAlert.kt
  • DeveloperPortalScreen.kt

Copilot AI changed the title [WIP] Update template app to follow circuit best practices Follow Circuit best practices: use sealed interface for screen events Apr 19, 2026
Copilot AI requested a review from hossain-khan April 19, 2026 16:39
@hossain-khan hossain-khan marked this pull request as ready for review April 19, 2026 16:45
@hossain-khan hossain-khan requested a review from Copilot April 19, 2026 16:45
Copy link
Copy Markdown
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.

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 : CircuitUiEvent to sealed interface Event : CircuitUiEvent across all affected screens.
  • Updated event subtype declarations from : Event() to : Event to 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.

@github-actions
Copy link
Copy Markdown

Code Coverage Report

View Coverage Report

@github-actions
Copy link
Copy Markdown

📊 APK Size Analysis

Comparing maincopilot/ensure-circuit-best-practices (this PR)

OLD: base.apk (signature: V2)
NEW: app-release.apk (signature: V2)

          │            compressed            │           uncompressed           
          ├───────────┬───────────┬──────────┼───────────┬───────────┬──────────
 APK      │ old       │ new       │ diff     │ old       │ new       │ diff     
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
      dex │   6.7 MiB │   6.7 MiB │ -1.1 KiB │   6.7 MiB │   6.7 MiB │ -1.1 KiB 
     arsc │ 370.7 KiB │ 370.7 KiB │      0 B │ 370.6 KiB │ 370.6 KiB │      0 B 
 manifest │   3.7 KiB │   3.7 KiB │      0 B │  16.8 KiB │  16.8 KiB │      0 B 
      res │ 126.1 KiB │ 126.1 KiB │      0 B │ 168.3 KiB │ 168.3 KiB │      0 B 
   native │  64.3 KiB │  64.3 KiB │      0 B │    63 KiB │    63 KiB │      0 B 
    asset │  55.4 KiB │  55.4 KiB │     -1 B │ 143.2 KiB │ 143.2 KiB │     -1 B 
    other │  74.6 KiB │  74.6 KiB │     -1 B │ 154.9 KiB │ 154.9 KiB │      0 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
    total │   7.4 MiB │   7.4 MiB │ -1.1 KiB │   7.6 MiB │   7.6 MiB │ -1.1 KiB 

 DEX     │ old   │ new   │ diff         
─────────┼───────┼───────┼──────────────
   files │     1 │     1 │   0          
 strings │ 34045 │ 34044 │  -1 (+9 -10) 
   types │  9115 │  9115 │   0 (+0 -0)  
 classes │  7750 │  7750 │   0 (+0 -0)  
 methods │ 43378 │ 43362 │ -16 (+0 -16) 
  fields │ 26019 │ 26011 │  -8 (+0 -8)  

 ARSC    │ old │ new │ diff 
─────────┼─────┼─────┼──────
 configs │ 105 │ 105 │  0   
 entries │ 273 │ 273 │  0
APK
     compressed      │    uncompressed     │                                           
──────────┬──────────┼──────────┬──────────┤                                           
 size     │ diff     │ size     │ diff     │ path                                      
──────────┼──────────┼──────────┼──────────┼───────────────────────────────────────────
  6.7 MiB │ -1.1 KiB │  6.7 MiB │ -1.1 KiB │ ∆ classes.dex                             
    271 B │     -1 B │    120 B │      0 B │ ∆ META-INF/version-control-info.textproto 
 12.2 KiB │     -1 B │ 12.1 KiB │     -1 B │ ∆ assets/dexopt/baseline.prof             
──────────┼──────────┼──────────┼──────────┼───────────────────────────────────────────
  6.7 MiB │ -1.1 KiB │  6.7 MiB │ -1.1 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff        
  ───────┼───────┼─────────────
   34045 │ 34044 │ -1 (+9 -10) 
  
  +

@hossain-khan hossain-khan merged commit a9ee8b2 into main Apr 19, 2026
8 checks passed
@hossain-khan hossain-khan deleted the copilot/ensure-circuit-best-practices branch April 19, 2026 16:53
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.

Ensure ciruit best practices are followed

3 participants