-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Restore active preference when reopening window #26
Restore active preference when reopening window #26
Conversation
Safari keeps track of the last opened preference pane even after complete app restarts. Based on a cursory glance, I don't think this does. |
We need to check what the Human Interface Guidelines says about that and what other apps do. I would prefer to not have that behavior, personally. |
Well:
That could mean either. Restoring state is very broad, too, and says "Preserve and restore your app’s state so people can continue where they left off" and "Configure reopened windows as expected". But what's expected in terms of preferences? I would not expect the app to restore my last preferences editing session, because I don't do that a lot. But if an app relies on preferences modifications heavily + requiring restarts, this can get on one's nerves. Does this happen often? At all? Wouldn't be hard to use UserDefaults to restore the last session, but is that really a use case? |
Merged current Since the HIG aren't clear, I suggest the following:
|
/// - Parameter preferencePane: Identifier of the preference pane to display. | ||
/// - Note: Unless you need to open a specific pane, prefer not to pass a parameter at all or `nil`. | ||
/// - Parameter preferencePane: Identifier of the preference pane to display, or `nil` to show the | ||
/// tab that was open when the user last closed the window. | ||
public func show(preferencePane preferenceIdentifier: PreferencePaneIdentifier? = nil) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public func show(preferencePane preferenceIdentifier: PreferencePaneIdentifier? = nil) { | |
public func show(preferencePane preferencePaneIdentifier: PreferencePaneIdentifier? = nil) { |
?
I think we should be consistent in using preferencePane
over just preference
.
👍
I don't think we should do this at all. Most of Apple's apps don't do it, neither does most third-party apps. Instead, I think we should open a Radar to get Apple to clarify in the HIG exactly what's expected with restoring. What do you think? |
Found a bug and fixed it :) I'm fine with your verdict @sindresorhus as we can still move on merging this PR and then never talk about restoring the tab after relaunching the app. Works for me :) |
Closes #16