Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep Mac app for release, fix bugs in iOS app #258

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

AngeloStavrow
Copy link
Collaborator

This PR closes #248 and #256, and makes progress towards #224.

To prepare for the release of the Mac app, we get some dependencies upgraded for Sparkle (as well as docs for updating the app), and set up a new WFNavigation view that begins to incorporate SwiftUI's newer navigation paradigms into the Mac app. Some work has been done around the iOS app but it's a bit trickier to manage.

This PR also fixes a bug that would force the app to navigate back to the post list whenever you'd switch over to another app.

@AngeloStavrow AngeloStavrow added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request ios Anything specific to the iPhone/iPad app mac Anything specific to the Mac app reproduced The bug has been confirmed labels Apr 14, 2024
@AngeloStavrow AngeloStavrow self-assigned this Apr 14, 2024
Comment on lines -97 to -99
if let languageCode = Locale.current.languageCode {
post.language = languageCode
post.rtl = Locale.characterDirection(forLanguage: languageCode) == .rightToLeft
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was throwing warnings in newer versions of Xcode.

NSApp.keyWindow?.contentViewController?.tryToPerform(
#selector(NSSplitViewController.toggleSidebar(_:)), with: nil
#if os(macOS)
WFNavigation(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're essentially just wrapping these same views in our new WFNavigation view.


var body: some View {
#if os(macOS)
NavigationSplitView {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually we want to move the iOS app to use NavigationSplitView for iOS 16+

@@ -126,18 +126,18 @@ struct PostListView: View {
.frame(height: frameHeight)
.background(Color(UIColor.systemGray5))
.overlay(Divider(), alignment: .top)
.onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)) { _ in
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every time the app becomes active, this notification would fire in iOS 17 and navigate us back to the Post list view. Moving it to an onAppear modifier below fixes this behaviour will maintaining the list-refresh intent.

@AngeloStavrow AngeloStavrow linked an issue May 4, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request ios Anything specific to the iPhone/iPad app mac Anything specific to the Mac app reproduced The bug has been confirmed
Development

Successfully merging this pull request may close these issues.

Post closes when focus is lost on iPhone Upgrade Sparkle to 2.4.1 to address warnings in Xcode 14.3
1 participant