Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent iOS notification screen crashes by stabilizing SwiftUI state synchronization (selected account + filter), ensuring the timeline view is recreated with a deterministic key when selection changes, and reducing redundant UI updates from presenter/network change streams.
Changes:
- Reworked
NotificationScreento sync selected account/filter via stable keys and to rebuildTimelinePagingContentusing a compositetimelineKey. - Updated
KotlinPresenterto skip publishing when the presenter emits the same state instance. - Simplified
NetworkMonitorupdates to only publishkindchanges and fixed mapping to useNWPath’s current flags.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| iosApp/flare/UI/Screen/NotificationScreen.swift | Adds stable-key based account/filter sync and timeline keying to avoid inconsistent SwiftUI state during selection changes. |
| iosApp/flare/UI/Component/KotlinPresenter.swift | Avoids redundant @Published updates when the emitted Kotlin state object is identical. |
| iosApp/flare/UI/Component/AvatarView.swift | Changes avatar clipping to use a type-erased shape in a ternary expression. |
| iosApp/flare/Common/NetworkMonitor.swift | Publishes network kind only on changes; computes constrained/expensive directly from the current NWPath. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| NetworkImage(data: data) | ||
| .if(avatarShape == .circle, if: { view in | ||
| view.clipShape(.circle) | ||
| }, else: { view in | ||
| view.clipShape(.rect(cornerRadius: 8)) | ||
| }) | ||
| .clipShape(avatarShape == .circle ? AnyShape(.circle) : AnyShape(.rect(cornerRadius: 8))) | ||
| } |
There was a problem hiding this comment.
AnyShape is referenced here but there is no AnyShape type defined anywhere in the repository, and SwiftUI doesn't provide an AnyShape type on the iOS 17 deployment target. This will fail to compile unless you add a type-erased AnyShape implementation (or revert to the existing .if(..., else:) clipShape approach).
No description provided.