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

feat: add 3 more shortcut tabs #2010

Closed
wants to merge 1 commit into from
Closed

Conversation

decodism
Copy link
Contributor

Add more shortcut tabs and an option to interact with the Dock.

@decodism
Copy link
Contributor Author

With the Dock options enabled (selection by hovering and showing by shortcut):

dock_last_hovered_app.mov

@lwouis
Copy link
Owner

lwouis commented Oct 12, 2022

The 5 shortcuts addresses #1458 so it's an easy merge. The other feature, I'm afraid seems very niche. I don't think many people would use it, and it adds quite a lot of complexity in the preferences UI. I'm already struggling to reach the goals set in #351

@decodism
Copy link
Contributor Author

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.

@lwouis
Copy link
Owner

lwouis commented Oct 13, 2022

I think having a lot of options is not an issue [...] as long as the defaults are adequate and these options are clear and well categorized

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

Comment on lines 409 to 416
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
Copy link
Owner

@lwouis lwouis Oct 14, 2022

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's done.

Comment on lines +89 to +96
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 {
Copy link
Owner

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!

Comment on lines +56 to +60
(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),
Copy link
Owner

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 😅

@XInTheDark
Copy link

Can't we make this process of adding more shortcut tabs simpler, by adding a + button to the right of "Shortcut 2" (i.e. here:
image
So that the user can add as many shortcuts they wish, instead of setting a fixed limit?

Also, I think this is a great feature (which ironically is directly copied from Windows):

With the Dock options enabled (selection by hovering and showing by shortcut):

A lot of Windows users who switched to Mac would appreciate this handy feature.

@XInTheDark
Copy link

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.

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.

@XInTheDark
Copy link

(the feature on windows:)

Screen.Recording.2022-10-19.at.12.03.15.mov

It'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.

@lwouis
Copy link
Owner

lwouis commented Oct 19, 2022

@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.

@lwouis
Copy link
Owner

lwouis commented Oct 19, 2022

Can't we make this process of adding more shortcut tabs simpler, by adding a + button to the right of "Shortcut 2"

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.

@decodism
Copy link
Contributor Author

@lwouis

it would influence the next AltTab trigger

Just to be clear: it's a dedicated shortcut

@lwouis
Copy link
Owner

lwouis commented Oct 27, 2022

I have cherry-picked the commit on the next-release branch. Thank you again for sharing this work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants