fix(ios): propagation sync sheet — manual-only presentation + styling#95
Merged
Conversation
The propagation-node sync status sheet popped up automatically on every sync, including background, periodic, and on-foreground auto-syncs — not just user-initiated ones. It also rendered as an opaque content-sized band floating inside the system's default glass sheet chrome. - ChatsView: stop auto-presenting via `.onChange(of: syncState.isSyncing)`. The sheet is now shown only when the user taps a refresh button (toolbar and empty-state). Background / periodic / on-foreground / pull-to-refresh syncs update `syncState` silently. - SyncStatusBottomSheet: color the whole sheet with `.presentationBackground` instead of `.background(...)` on the content (the source of the glass + opaque-band artifact). Wrap content in a scroll-safe container so large Dynamic Type can't clip the progress bar. - PropagationNodeManager.syncNow: reset transfer state up front so the sheet opens on a clean "Connecting" state rather than flashing the prior run's result. - Present the sheet through a small container that reads `syncState` in a real view body, so SwiftUI Observation reliably drives live progress + the terminal result. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ration 1) Addresses Greptile P2: `syncNow()` reset `syncState` to `.linking` for every caller, so a background / periodic / on-foreground sync could clobber a status sheet the user had left open on a prior result (e.g. snap "3 new messages" back to "Connecting"). The reset only matters for syncs that present the sheet. Add `syncNow(userInitiated:)` (default false); reset the displayed transfer state only when true. Pass true from the user-initiated paths (Chats refresh button, pull-to-refresh, empty-state refresh, Settings Sync Now, Messaging Sync Messages); leave background callers (on-foreground auto-sync, BGAppRefresh, --auto-sync debug, periodic task, test hook) on the default. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
Two issues with the propagation-node sync status sheet on the Chats screen:
.onChange(of: syncState.isSyncing), which fires for all sync sources — background, periodic, the on-foreground auto-sync (ColumbaApp.swift, runs whenever the app becomes active and >60s since last sync), and Model B's NE-driven periodic sync — not just user-initiated ones. So it interrupted constantly..background(Theme.backgroundPrimary.ignoresSafeArea())was applied to the content, painting an opaque band sized to the content inside the system's default glass sheet chrome — an opaque edge-to-edge block floating in a transparent sheet.Changes
ChatsView.swift— Removed the auto-present.onChange. The sheet is now shown only when the refresh button is tapped (toolbar + empty-state). Background / periodic / on-foreground / pull-to-refresh syncs updatesyncStatesilently. Pull-to-refresh keeps its own native indicator.SyncStatusBottomSheet.swift— Replaced the content.background(...)with.presentationBackground(Theme.backgroundPrimary)(the SwiftUI-correct way, iOS 16.4+, to color the whole sheet surface). Wrapped content in aScrollViewwith.scrollBounceBehavior(.basedOnSize)so large Dynamic Type can't clip the progress bar.PropagationNodeManager.syncNow()— Resets transfer state up front so the sheet opens on a clean "Connecting…" state instead of briefly flashing the previous run's "Download complete / N new messages".syncStatein a real view body, so SwiftUI Observation reliably drives live progress + the terminal result (rather than relying solely on observation inside the.sheetcontent closure).Behavior notes
.noPatherror in the sheet — previously that case showed no feedback at all.Verification
Columba-Swift/Debug-Swift, iPhone 17 simulator (BUILD SUCCEEDED).🤖 Generated with Claude Code