Skip to content

Expand command catalog with fourths, sixths, and ninths #14

Description

@martinbha

Goal

Expand the platform-neutral command catalog beyond the initial 28 commands with the next tranche of grid layouts: fourths, three-fourths, sixths, and ninths.

Context

Rectangle ships roughly 108 calculation variants including fourths, three-fourths, sixths, ninths, twelfths, and sixteenths. panes currently covers halves, corners, thirds, two-thirds, and the maximize/center/move/resize families. Fourths and the coarser grids are the most commonly used of the remaining layouts and are pure geometry, so they extend panes-core without any platform work.

Scope

  • Add fourth commands: first/second/third/last fourth, plus first three-fourths, center three-fourths, and last three-fourths.
  • Add sixth commands: top-left through bottom-right sixths (2x3 landscape, 3x2 portrait).
  • Add ninth commands: top-left through bottom-right ninths (3x3).
  • Handle portrait orientation consistently with the existing thirds logic.
  • Group the new commands under new CommandCategory values so the tray menu stays organized.
  • Leave the new commands unbound by default; hotkeys become configurable via Add persistent configuration loading #5.
  • Add layout unit tests for each family, including portrait screens and gap interaction.

Implementation Notes

  • Generalize the existing third helper into a grid helper (columns x rows, offset, span) rather than adding one function per variant; Rectangle's file-per-class approach does not need to be mirrored.
  • Twelfths, sixteenths, and eighths can wait for a follow-up issue once these land and menu organization is settled.
  • Command ids become config keys (Add persistent configuration loading #5), so choose stable kebab-case ids up front, e.g. first-fourth, top-left-ninth.

Acceptance Criteria

  • All new commands produce correct rects on landscape and portrait screens.
  • New commands appear in the tray menu under sensible categories on macOS.
  • Existing command ids and behavior are unchanged.
  • Unit tests cover representative cells of each grid family plus edge cells with gaps enabled.

Validation

  • cargo fmt --all -- --check
  • cargo check --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace

Metadata

Metadata

Assignees

No one assigned

    Labels

    corePlatform-neutral logic in panes-core or panes-runtimeenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions