-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
feat: add 3 more shortcut tabs #2010
Conversation
With the Dock options enabled (selection by hovering and showing by shortcut): dock_last_hovered_app.mov |
I answer for here and #2012: I can't evaluate the potential use of these features but I think having a lot of options is not an issue, especially for an app aimed at rather advanced users, as long as the defaults are adequate and these options are clear and well categorized, which might be a topic for #351. |
I think even clear and categorized preferences are still an issue in-and-of-itself. For example, a dropdown with 50 options is overwhelming for most people. Even if you reduce it to 5 options that each lead to 10 sub-options as a way to manage complexity, I think that system is still intimidating vs agreeing on the top 5 options most users use, and having only these 5 in the dropdown. I made the "mistake" with AltTab of adding too much customization early on. Based on 2 years of reading user feedback here and on other channels, I think the community at large would be better off with a few presets in terms of how the app looks, behave, and the use-cases people have with it. This is the purpose of #351. I hope this context helps you see my position |
src/logic/Preferences.swift
Outdated
var index = name.endIndex | ||
while index > name.startIndex { | ||
let newIndex = name.index(before: index) | ||
guard name[newIndex].isWholeNumber else { break } | ||
index = newIndex | ||
} | ||
let suffix = name.suffix(from: index) | ||
return suffix == "" ? 0 : Int(suffix)! - 1 |
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.
Maybe something simpler would work as well here? I'm thinking to check the last char directly like:
return name[name.endIndex].isWholeNumber ? Int(name[name.endIndex]) : 0
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.
It's done.
let index = Preferences.nameToIndex(id) | ||
let otherIndex = Preferences.nameToIndex($0.id) | ||
if id.starts(with: "holdShortcut") { | ||
return Preferences.nextWindowShortcut[index] == Preferences.nextWindowShortcut[otherIndex] && | ||
shortcut.modifierFlags == ControlsTab.shortcutControls["holdShortcut" + otherSuffix]!.0.objectValue!.modifierFlags | ||
shortcut.modifierFlags == ControlsTab.shortcutControls[Preferences.indexToName("holdShortcut", otherIndex)]!.0.objectValue!.modifierFlags | ||
} | ||
if id.starts(with: "nextWindowShortcut") { | ||
if let nextWindowShortcut = ControlsTab.shortcutControls["nextWindowShortcut" + otherSuffix]?.0.objectValue { | ||
if let nextWindowShortcut = ControlsTab.shortcutControls[Preferences.indexToName("nextWindowShortcut", otherIndex)]?.0.objectValue { |
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.
Thank you for doing this house cleaning after you generalized the index system!
(NSLocalizedString("Shortcut 1", comment: ""), tab1View), | ||
(NSLocalizedString("Shortcut 2", comment: ""), tab2View), | ||
(NSLocalizedString("Shortcut 3", comment: ""), tab3View), | ||
(NSLocalizedString("Shortcut 4", comment: ""), tab4View), | ||
(NSLocalizedString("Shortcut 5", comment: ""), tab5View), |
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.
I thought we may use a variable like "Shortcut %@"
here to avoid having each language translate 5 times the same thing, but then I checked, and some languages wouldn't work with this pattern (e.g. "Shortcut 2" = "الإختصار ٢";
). Oh well 😅
Hmm, I have to politely disagree with this point; IMO, the options added to AltTab preferences allow users to customise the app better, and users who prefer not to customise the app can simply choose to ignore the preferences. |
(the feature on windows:) Screen.Recording.2022-10-19.at.12.03.15.movIt's definitely a good feature, and maybe we should polish it (e.g. add pop-up animations to the apparition, and fade-out once the window is selected) to make it look even better. |
@XInTheDark what you show in the video is closer to what has been discussed in #529 #337 #967. What @decodism had proposed in this PR is that after hovering the Dock with the mouse, it would influence the next AltTab trigger, which would only show windows of the hovered app. It's quite different from hovering the Dock, and getting previews of the windows above the Dock, as in your video. |
It's actually easier both for the developpers to implement, and for the users, to have 5 shortcuts. It's less complex, flexible, changing. It's simple, set, static. In your example UI, we could see arise questions such as: what happens when we reach 5: the plus buttons disapears? How would I remove tabs to go back to 2 tabs? @decodism implementation provides the features with a simpler UI. It's 5 shortcuts, with the last 3 not set by default. I think it's a simple solution which has the very important property of being real since he implemented it. We discussed dynamic UIs in the past, but no-one took on to do it. The best property of an idea, in a volonteers project, is to be worked on and made concrete. |
Just to be clear: it's a dedicated shortcut |
I have cherry-picked the commit on the next-release branch. Thank you again for sharing this work! |
Add more shortcut tabs and an option to interact with the Dock.