Split trigger-zone into separate untrigger-zone for click restore#6
Open
klockeph wants to merge 1 commit into
Open
Split trigger-zone into separate untrigger-zone for click restore#6klockeph wants to merge 1 commit into
klockeph wants to merge 1 commit into
Conversation
triggerZone was serving double duty: hiding the bar when the cursor entered the top N px, and also as the guard that prevented a click from restoring the bar. These two roles have conflicting ideal values. - Hiding needs a small zone (~10px) so the bar only hides when you're genuinely approaching the menu bar edge. - Click restore needs a larger zone (~30px, the macOS menu bar height) so that clicking File/Edit/… while the bar is hidden doesn't snap it back mid-navigation. Using a single value forced a bad tradeoff: 10px meant menu clicks restored the bar; 30px meant the bar hid on any casual hover near the top. Adds untriggerZone (default 30px): a click while hidden only restores the bar if the cursor is at or below this threshold. triggerZone continues to control hiding exclusively. Both are independently configurable via --trigger-zone and --untrigger-zone. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a pet-peeve I encountered when starting to use sketchybar-toggle: When I click something in the menu bar (and realistically that is why I open it in the first place to get to the Edit, Preferences, etc. menus), the sketchybar immediately comes up and causes the ugly double-rendering of both bars on top of each other.
triggerZone was serving double duty: hiding the bar when the cursor entered the top N px, and also as the guard that prevented a click from restoring the bar. These two roles have conflicting ideal values.
Using a single value forced a bad tradeoff: 10px meant menu clicks restored the bar; 30px meant the bar hid on any casual hover near the top.
Adds untriggerZone (default 30px): a click while hidden only restores the bar if the cursor is at or below this threshold. triggerZone continues to control hiding exclusively. Both are independently configurable via --trigger-zone and --untrigger-zone.