refactor: simplify Hammerspoon grid to fixed 10x8/8x10 per orientation - #20
Merged
Conversation
Replace the aspect-ratio-derived grid calculation with fixed dimensions: 10x8 for landscape displays and 8x10 for portrait. This matches the default hs.grid HINTS table width (10), so the interactive overlay now renders correctly without cell merging. Also fixes the setGrid format string (removes spaces around "x"). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Hammerspoon window grid configuration to use fixed grid dimensions per screen orientation, simplifying setup and aligning the landscape grid width with hs.grid.HINTS overlay expectations.
Changes:
- Set global grid defaults to
10x8and configure per-display grids as10x8(landscape) or8x10(portrait). - Remove the previous aspect-ratio-based grid sizing logic and helper/constants.
- Update
grid.setGridusage to use correctly formatted dimension strings (no spaces aroundx).
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.
Summary
10x8for landscape displays and8x10for portraittoEven, the three sizing constants (GRID_H_LANDSCAPE,GRID_H_PORTRAIT_MAX,MAX_GRID_LONG), and the accompanying comment blocksetGridformat string (was"%d x %d", now"10x8"/"8x10") — spaces aroundxprevented correct parsingGRIDWIDTH,GRIDHEIGHT) to match the landscape fixed valuesThe fixed 10-column width matches the default
hs.grid.HINTStable width, so the interactive overlay now renders all columns without merging cells.Test plan
🤖 Generated with Claude Code