Skip to content

Cycle vertical sixths through whole sixth, top half and bottom half on repeat - #1968

Merged
rxhanson merged 3 commits into
rxhanson:mainfrom
ehippy:vertical-sixth-half-cycling
Nov 19, 2026
Merged

rxhanson merged 3 commits into
rxhanson:mainfrom
ehippy:vertical-sixth-half-cycling

Conversation

@ehippy

@ehippy ehippy commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-11-16.at.2.33.16.PM.mov

One chord pressed repeatedly: the window stays in the same sixth and steps whole sixth → half → other half → whole sixth.

I use the vertical sixths from #1917 every day. A full-height sixth is the right width but is often too tall for what I want next to it, and reaching for a second chord to get half of the column I'm already in breaks the flow.

Repeating any vertical sixth chord now cycles through the three placements available inside that sixth:

  • Landscape: full-height column → top half of that column → bottom half → repeat
  • Portrait: full-width row → left half of that row → right half → repeat
  • Respects the repeated-command setting; "do nothing" still does nothing

There are no new WindowActions, so nothing new to bind: no new shortcut identifiers, strings, icons or settings UI. This only changes what a repeat press does.

How this differs from the repeat behaviors that already exist

"Cycle sizes on side actions" (CycleSize) changes what fraction of the screen a side action takes, anchored to a screen edge — repeating Top Half gives 1/3 of the display, not half of the sixth you're already in. None of the vertical sixth or eighth actions use it.

halveHeightUp / halveHeightDown and friends do halve the current window, but they halve its own rect rather than snapping to the sixth boundary, need a separate chord per direction, and leave the gaps without edges to apply.

What's new here is a repeat press advancing a placement within the sixth: the ordinal is preserved, the half shares the sixth's boundary (same floor rounding at the same edge), and the window stays on the sixth grid throughout.

Notes

The half is taken across the sixth, not along it. Sixths slice the display along its long axis, so the sub-split is perpendicular to that: columns split top/bottom, portrait rows split left/right. Halving a portrait row's height instead would give an ~80pt sliver.

Repeat state travels in SubWindowAction, the way the other position-cycling actions do (cf. FirstThirdCalculation). Twenty-four new sub actions carry the ordinal plus the placement, and both directions of the ordinal ⇄ sub action mapping read from a single table so they can't drift apart.

Gaps still land correctly. Each placement reports only the edges it shares with a neighbour, so a top half of a middle column reports .left, .right, .bottom rather than the whole column's edges.

One intentional behavior change. Repeating firstVerticalSixth / lastVerticalSixth used to step through all six positions. The same chord repeating can't do both jobs, so the walk now sits behind the hidden verticalSixthsWalkAcrossScreen flag and is documented in TerminalCommands.md. The two tests that covered the walk assert it under that flag, so the old behavior stays pinned.

Worth generalizing?

I kept this to sixths deliberately. Repeat state lives in SubWindowAction, which needs a case per position × sub-placement × orientation: 24 here, 32 more for vertical eighths, 64 for sixteenths — and the 2D grid families have no unambiguous axis to subdivide. The vertical thirds already use repeat to walk top → middle → bottom, which is the same collision verticalSixthsWalkAcrossScreen exists for, and resizeAndCycleQuadrants already owns "repeat changes position" for grids.

So: if you want the pattern beyond sixths, I'd move repeat state into a small struct on RectangleAction rather than growing the enum, and I'd do that as its own change. Tell me which way you'd prefer and I'll follow up.

Testing

VerticalSixthActionTests extended: the three-stage cycle for each of the six actions, portrait rows splitting left/right, the extra pixel from an odd-sized sixth going to the trailing half, gap edges per placement, a different chord restarting at the whole sixth, and the walk under the hidden flag.

Full suite passes: 776 tests, 0 failures (2 pre-existing skips). Also running it by hand on my own display, which is where the daily-use case came from.

Implemented with an AI coding assistant (pi) against a fresh clone of main.

Repeating a vertical sixth chord now steps through the three placements
available inside that sixth: the whole sixth, then the half nearest the
leading edge (top of a column, or left of a row on a portrait display),
then the trailing half, then the whole sixth again. Cycling respects the
repeated-command setting and does nothing when it is disabled.

The old behavior, where repeating firstVerticalSixth or lastVerticalSixth
stepped through all six positions, is kept behind the hidden
`verticalSixthsWalkAcrossScreen` flag.
@ehippy
ehippy marked this pull request as ready for review November 16, 2026 21:40
@rxhanson

Copy link
Copy Markdown
Owner

Looks good.

So: if you want the pattern beyond sixths, I'd move repeat state into a small struct on RectangleAction rather than growing the enum, and I'd do that as its own change. Tell me which way you'd prefer and I'll follow up.

Let me test it out I'll let you know which path I think is better.

@rxhanson
rxhanson merged commit 5bf3a33 into rxhanson:main Nov 19, 2026
1 check passed
@rxhanson

rxhanson commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

I was ok without extending this beyond sixths for now, so went ahead and merged.

Since this would depart from existing functionality, and I prefer not adding anything to the UI to allow someone to get that functionality back, I decided to make this setting disabled by default. To enable it:

defaults write com.knollsoft.Rectangle verticalSixthsCycleTwelfths -bool true

Thanks!

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.

2 participants