feat(algorithm): dwindle #49

Closed
opened 2026-04-26 00:36:59 +00:00 by barrettruth · 1 comment
barrettruth commented 2026-04-26 00:36:59 +00:00

Add a dwindle algorithm — recursively split panes in a shrinking Fibonacci pattern. This is the sibling of spiral and maps cleanly to dwm/XMonad/Hyprland terminology.

Scope

  • New file scripts/algorithms/dwindle.sh
  • Hand-rolled tmux layout-string generation
  • Stable pane ordering and split-direction rules
  • Decide whether promote exists or this is relayout-only

Acceptance criteria

  • Setting @mosaic-algorithm dwindle applies deterministic dwindle tiling
  • Split/kill hooks preserve the recursive pattern
  • Tests cover 3, 4, and 5+ pane cases
  • README includes behavior, supported operations, and screenshots

Implementation notes

Probably best built alongside spiral with shared layout-string generation helpers.

Part of #42.

Add a `dwindle` algorithm — recursively split panes in a shrinking Fibonacci pattern. This is the sibling of `spiral` and maps cleanly to dwm/XMonad/Hyprland terminology. ## Scope - New file `scripts/algorithms/dwindle.sh` - Hand-rolled tmux layout-string generation - Stable pane ordering and split-direction rules - Decide whether `promote` exists or this is relayout-only ## Acceptance criteria - [ ] Setting `@mosaic-algorithm dwindle` applies deterministic dwindle tiling - [ ] Split/kill hooks preserve the recursive pattern - [ ] Tests cover 3, 4, and 5+ pane cases - [ ] README includes behavior, supported operations, and screenshots ## Implementation notes Probably best built alongside `spiral` with shared layout-string generation helpers. Part of #42.
barrettruth commented 2026-04-26 02:33:26 +00:00

I checked the upstream dwindle / Fibonacci family before starting this.

This one looks feasible in tmux because it is still a non-overlapping recursive split tree, unlike deck or two-pane.

The cleanest contract seems to be the dwm fibonacci patch, where spiral and dwindle are sibling layouts from the same recursive generator. In that model:

  • the first split uses mfact
  • later panes recurse by alternating split axis and direction
  • dwindle is the shrinking sibling of spiral, not a separate hidden-pane concept

For Mosaic, that suggests:

  • build spiral and dwindle from a shared layout-string generator
  • use stable tmux pane order
  • map @mosaic-mfact to the first split
  • keep the first pass simple and likely relayout-only rather than inventing promote semantics that the upstream layouts do not really define

So I would treat this as the follow-on to spiral, sharing the same geometry helper rather than designing the two independently.

I checked the upstream `dwindle` / Fibonacci family before starting this. This one looks feasible in tmux because it is still a non-overlapping recursive split tree, unlike `deck` or `two-pane`. The cleanest contract seems to be the dwm fibonacci patch, where `spiral` and `dwindle` are sibling layouts from the same recursive generator. In that model: - the first split uses `mfact` - later panes recurse by alternating split axis and direction - `dwindle` is the shrinking sibling of `spiral`, not a separate hidden-pane concept For Mosaic, that suggests: - build `spiral` and `dwindle` from a shared layout-string generator - use stable tmux pane order - map `@mosaic-mfact` to the first split - keep the first pass simple and likely relayout-only rather than inventing `promote` semantics that the upstream layouts do not really define So I would treat this as the follow-on to `spiral`, sharing the same geometry helper rather than designing the two independently.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/tmux-mosaic#49
No description provided.