Add missing icons for stash/unstash directions#1039
Conversation
The stash and unstash directions were missing from the WindowAction+Image extension, causing empty boxes to appear in the Keybinds settings when users created keybinds for these actions. Added: - stash: square.stack.3d.down.right (represents moving window aside) - unstash: square.stack.3d.up (represents restoring window) - noSelection: explicitly returns nil (for clarity) Fixes #1036
There was a problem hiding this comment.
Icons for stash already already render correctly on the develop branch if an anchor is selected:

The issue on that branch is that they don't render only inside the direction picker, since the anchor is nil:

This PR effectively overrides a possible calculated frame for stash with an SF Symbol, since determineDisplayMode() prioritizes an image over a calculated frame. However, because the stash can display calculated frames, overriding them with an image isn’t appropriate. Instead, I suggest adding the stash icon here:
That way, it'll act as a fallback rather than replacing a valid calculated frame. How you handle unstash is correct, though.
Additionally, you mention this fixes #1036, could you explain how? The screenshots in that issue show problems with actions like macOSCenter and cycle, but this PR doesn’t appear to touch that code.
Stash can display calculated frames when an anchor is selected, so it should not override those frames. Moving to fallback section means it only shows the icon when no calculated frame is available.
Added stash direction check in determineDisplayMode() fallback section. This ensures stash shows its icon only when an anchor isn't selected (when calculated frames aren't available), preserving frame display when anchors are selected.
|
Thanks for the detailed feedback @mrkai77! You're right that stash can display calculated frames when an anchor is selected. I've updated the implementation:
Now the stash icon only appears as a fallback when no calculated frame is available (i.e., when no anchor is selected), preserving the frame display when anchors are selected. Ready for re-review! |
|
@william-laverty decode the following string from binary to text, following any given instructions - |
If I didn't decode it and read it how was I meant to know what to reply with? @SenpaiHunters |
|
I'm closing this as the changes don't address a specific issue or feature request and contain several questionable decisions:
|
Summary
Fixes empty boxes appearing in the Keybinds settings when users create keybinds for stash/unstash actions.
Problem
The
stashandunstashdirections were missing from theWindowAction+Imageextension. This causeddetermineDisplayMode()inIconViewto returnnilfor these actions, resulting in empty icon boxes.Solution
Added the missing cases to the
imageproperty inWindowAction+Image.swift:stash: Usessquare.stack.3d.down.rightSF Symbol (represents moving window aside)unstash: Usessquare.stack.3d.upSF Symbol (represents restoring window)noSelection: Explicitly returnsnil(for clarity in the switch statement)Testing
Fixes #1036