Skip to content

Commit

Permalink
Prepare release v1.0.11 for iOS (#225)
Browse files Browse the repository at this point in the history
* Add error handling to Mac app

* Log fatal crashes and present alert on next launch

* Update crash alert copy and navigate to help forum

* Refactor logging into reuseable methods

* Refactor class to use protocol

* Add environment object to settings window

* Improve deactivation of app when miniaturizing

* Chagne dispatch type when creating new post

* Bump version and build number

* Remove unnecessary TODO comment

* Update change log

* Log fatal crashes and present alert on next launch

* Update crash alert copy and navigate to help forum

* Refactor logging into reuseable methods

* Add environment object to settings window

* Improve deactivation of app when miniaturizing

* Chagne dispatch type when creating new post

* Improve default window size (#220)

* Clean up unnecessary import

* Set idealWidth property on sidebars

* Unset selected post on collection change (#218)

* Unset selected post when changing collection

* Update change log

* Bump build number and update change log
  • Loading branch information
AngeloStavrow authored Sep 10, 2022
1 parent 0d43cb0 commit 884da07
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 18 deletions.
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [Mac] Fixed a potential crash if the system keychain wasn't available at app launch.
- [Mac] Cleaned up some straggling project warnings.
- [Mac] Improved error-handling under the hood for better app stability.
- [iOS/Mac] Fixed a bug where the new-post button doesn't appear in the iOS 16 beta.
- [iOS/Mac] Fixed a bug where alerts weren't presented for login errors.
- [Mac] Selecting another collection while a blank draft is in the editor now works as expected.
- [Mac] Fixed a bug where the new-post button doesn't appear in the iOS 16 beta.
- [Mac] Fixed a bug where the list of posts published outside of a blog didn't update its title (Drafts/Anonymous).
- [Mac] Fixed a bug where alerts weren't presented for login errors.
- [Mac] Fixed some build warnings in the project.

## [1.0.11-ios] - 2022-09-07

- [iOS] Fixed a bug where the new-post button doesn't appear in the iOS 16 beta.
- [iOS] Fixed a bug where the list of posts published outside of a blog didn't update its title (Drafts/Anonymous).
- [iOS] Fixed a bug where alerts weren't presented for login errors.
- [iOS] Fixed some build warnings in the project.

## [1.0.10-ios] - 2022-07-28

Expand Down Expand Up @@ -277,7 +287,8 @@ suffixes to differentiate between platforms, until both are at feature parity.
- Contributing guide
- This changelog

[Unreleased]: https://github.com/writeas/writefreely-swiftui-multiplatform/compare/v1.0.10-ios...HEAD
[Unreleased]: https://github.com/writeas/writefreely-swiftui-multiplatform/compare/v1.0.11-ios...HEAD
[1.0.11-ios]: https://github.com/writeas/writefreely-swiftui-multiplatform/compare/v1.0.10-ios...v1.0.11-ios
[1.0.10-ios]: https://github.com/writeas/writefreely-swiftui-multiplatform/compare/v1.0.9-ios...v1.0.10-ios
[1.0.9-ios]: https://github.com/writeas/writefreely-swiftui-multiplatform/compare/v1.0.8-ios...v1.0.9-ios
[1.0.8-ios]: https://github.com/writeas/writefreely-swiftui-multiplatform/compare/v1.0.7-ios...v1.0.8-ios
Expand Down
4 changes: 3 additions & 1 deletion Shared/Navigation/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ struct ContentView: View {
// Create the new-post managed object
let managedPost = model.editor.generateNewLocalPost(withFont: model.preferences.font)
withAnimation {
DispatchQueue.main.asyncAfter(deadline: .now()) {
DispatchQueue.main.async {
// Load the new post in the editor
self.model.selectedPost = managedPost
}
}
}, label: { Image(systemName: "square.and.pencil") })
.help("Create a new local draft.")
}
.frame(idealWidth: 200)
#else
CollectionListView()
.withErrorHandling()
Expand All @@ -45,6 +46,7 @@ struct ContentView: View {
ZStack {
PostListView(selectedCollection: model.selectedCollection, showAllPosts: model.showAllPosts)
.withErrorHandling()
.frame(idealWidth: 300)
if model.isProcessingRequest {
ZStack {
Color(NSColor.controlBackgroundColor).opacity(0.75)
Expand Down
2 changes: 2 additions & 0 deletions Shared/PostCollection/CollectionListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ struct CollectionListView: View {
)
.listStyle(SidebarListStyle())
.onChange(of: model.selectedCollection) { collection in
model.selectedPost = nil
if collection != model.editor.fetchSelectedCollectionFromAppStorage() {
self.model.editor.selectedCollectionURL = collection?.objectID.uriRepresentation()
}
}
.onChange(of: model.showAllPosts) { value in
model.selectedPost = nil
if value != model.editor.showAllPostsFlag {
self.model.editor.showAllPostsFlag = model.showAllPosts
}
Expand Down
1 change: 1 addition & 0 deletions Shared/WriteFreely_MultiPlatformApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ struct WriteFreely_MultiPlatformApp: App {
}
.tag(2)
}
.environmentObject(model)
.withErrorHandling()
.frame(minWidth: 500, maxWidth: 500, minHeight: 200)
.padding()
Expand Down
16 changes: 8 additions & 8 deletions WriteFreely-MultiPlatform.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = "ActionExtension-iOS/ActionExtension-iOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 674;
CURRENT_PROJECT_VERSION = 676;
DEVELOPMENT_TEAM = TPPAB4YBA6;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "ActionExtension-iOS/Info.plist";
Expand Down Expand Up @@ -1085,7 +1085,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = "ActionExtension-iOS/ActionExtension-iOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 674;
CURRENT_PROJECT_VERSION = 676;
DEVELOPMENT_TEAM = TPPAB4YBA6;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "ActionExtension-iOS/Info.plist";
Expand Down Expand Up @@ -1228,7 +1228,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "WriteFreely-MultiPlatform (iOS).entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 674;
CURRENT_PROJECT_VERSION = 676;
DEVELOPMENT_TEAM = TPPAB4YBA6;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = iOS/Info.plist;
Expand All @@ -1254,7 +1254,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "WriteFreely-MultiPlatform (iOS).entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 674;
CURRENT_PROJECT_VERSION = 676;
DEVELOPMENT_TEAM = TPPAB4YBA6;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = iOS/Info.plist;
Expand Down Expand Up @@ -1282,7 +1282,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 620;
CURRENT_PROJECT_VERSION = 676;
DEVELOPMENT_TEAM = TPPAB4YBA6;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
Expand All @@ -1292,7 +1292,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.6.0;
MARKETING_VERSION = 0.7.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.abunchtell.WriteFreely-MultiPlatform";
PRODUCT_NAME = "WriteFreely for Mac";
SDKROOT = macosx;
Expand All @@ -1309,7 +1309,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 620;
CURRENT_PROJECT_VERSION = 676;
DEVELOPMENT_TEAM = TPPAB4YBA6;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
Expand All @@ -1319,7 +1319,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.6.0;
MARKETING_VERSION = 0.7.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.abunchtell.WriteFreely-MultiPlatform";
PRODUCT_NAME = "WriteFreely for Mac";
SDKROOT = macosx;
Expand Down
10 changes: 4 additions & 6 deletions macOS/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Cocoa
import Sparkle

class AppDelegate: NSObject, NSApplicationDelegate {

Expand All @@ -15,13 +14,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}

// If we're miniaturizing the window, deactivate it as well by activating Finder.app (note that
// this will bring any Finder windows that are behind other apps to the foreground).
// If we're miniaturizing the window, deactivate it as well.
// Credit to KHKnobl on GitHub:
// https://github.com/writefreely/writefreely-swiftui-multiplatform/issues/135#issuecomment-1101713817
func applicationDidChangeOcclusionState(_ notification: Notification) {
if let window = NSApp.windows.first, window.isMiniaturized {
NSWorkspace.shared.runningApplications.first(where: {
$0.activationPolicy == .regular
})?.activate(options: .activateAllWindows)
NSApp.hide(self)
}
}

Expand Down

0 comments on commit 884da07

Please sign in to comment.