Skip to content

Port 12 upstream PRs: new commands, format vars, popups & bugfixes (batch C) - #11

Merged
MintCollector merged 19 commits into
mainfrom
port/fork-batch-C
Jun 10, 2026
Merged

Port 12 upstream PRs: new commands, format vars, popups & bugfixes (batch C)#11
MintCollector merged 19 commits into
mainfrom
port/fork-batch-C

Conversation

@MintCollector

Copy link
Copy Markdown
Owner

Second batch of fork ports, cherry-picked from vitorebatista/AeroSpace's port/* branches (feature/fix/test commits only; their CLAUDE.md/CHANGELOG-FORK infra commits excluded). 19 commits. (Originally #10, stacked on #9; recreated after GitHub closed it on base-branch deletion.)

New commands & capabilities

Bugfixes & UX

Conflict resolutions / fork-specific decisions

  • list-windows --sort default: upstream defaults to app-name,window-title; our fork defaults to empty = preserve tree traversal order (aero-helper consumes that for tiling position). --sort is opt-in. Docs/tests updated accordingly.
  • layout --root + our fork layouts: upstream refactored window-layout logic into a changeWindowLayout helper + tilingMapping. Merged so our fork's unmanaged and sticky layout descriptors are preserved (added to the helper switch, tilingMapping, TilingContainer.matchesDescription), and --root rejects all four window-placement modes (tiling/floating/unmanaged/sticky) at parse time.
  • %{all} / orientation vars: merged additively with our fork's extra format vars (window-x/y/width/height/tree-index, monitor-width/height); canonical var order is orientation-var-immediately-after-its-layout-var, then fork extras. All possible-values test strings updated to match.

Verification

  • Clean build with -warnings-as-errors
  • Full XCTest suite passing (182 tests)
  • script/generate-cmd-help.sh produces no diff (generated help in sync)

All 12 source PRs verified still-open upstream at port time.

vitorebatista and others added 19 commits June 10, 2026 08:22
Ports nikitabobko#1156. Adds a floating-window branch to
ResizeCommand (gated on window.isFloating) that resizes the window's AX
frame and recenters it on the resized axis, clamping to the workspace
monitor bounds. Adapted to the fork's APIs: getAxRect()/setAxFrame and
BinaryExitCode; run() is now async throws.

Adds TestWindow.setAxFrame override to record frame mutations and 4 unit
tests covering grow/shrink/recenter and monitor-edge clamping.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 0945eef)
Note in aerospace-resize.adoc that resize also works on floating windows
(kept within the monitor / recentered as needed). Add a ResizeCommandTest
case covering maxY (bottom-edge) clamping when growing height near the
monitor bottom, complementing the existing right-edge (maxX) test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit ce9666b)
Adds a --sort option to list-windows accepting a comma-separated list of
recent, app-name, window-title. Default ordering remains app-name,window-title.
Introduces a global windowFocusSequence counter and Window.lastFocusedAt to
support the recent sort. The sort comparator is extracted into a testable
ListWindowsCommand.sortLess(...). Re-implemented against fork APIs (optional
prefetched title, allAlias, Sendable FormatVar). Generated cmdHelpGenerated.swift
regenerated from the updated .adoc.

Ports nikitabobko#1932

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 0b0f4b4)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 5f4009b)
Add the --sort flag to the list-windows rule in
grammar/commands-bnf-grammar.txt (both alternatives) so shell
completion knows about it, consistent with how --format is
represented. The .adoc synopsis already documented --sort.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit d4f88d8)
When the target workspace is already visible on another monitor,
--when-visible controls behavior:
  focus (default, backward-compatible): focus the workspace in place
  swap: exchange the active workspaces of the two monitors

Adapted to the fork's BinaryExitCode return type and ArgParser/
upcastArgParserFun parser API. Regenerated cmdHelpGenerated.swift via
generate-cmd-help.sh. Adds parse tests for the new flag.

Ports nikitabobko#1349

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit f5b3a47)
Add the --when-visible (focus|swap) flag to the summon-workspace
rule in grammar/commands-bnf-grammar.txt so shell completion offers
it. The .adoc synopsis and body already documented it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 9bbdf8d)
Ports nikitabobko#2097. Adds an additive boundaries-action enum
case that fails the move command when the newly created implicit container
is immediately flattened away by container normalization.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 9f701a0)
Adds a `sticky` layout subcommand that toggles a per-window `isSticky`
flag. Sticky floating windows stay visible on non-visible workspaces
(unhidden from the corner) and aren't auto-refocused away by the focus
cache when they live on a different workspace than the focused one.

Adds parse tests for the new `sticky` layout subcommand.

Ports nikitabobko#2083

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 97b9b71)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 64b718d)
Add the sticky descriptor to the layout rule in
grammar/commands-bnf-grammar.txt alongside the other layout
descriptors so shell completion offers it. The .adoc synopsis and
body already documented sticky.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 0773c9e)
Resolve the stub workspace for the previous monitor before reassigning
the focused workspace to the target monitor, so the stub is computed
against the correct prior state.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit b2daeb3)
Call workspace.normalizeContainers() at the end of FlattenWorkspaceTreeCommand
so residual empty/redundant containers are removed by the command itself,
not by callers. Updates the existing test and adds a deeply-nested case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 94c4004)
Previously `workspace next|prev` returned a non-zero exit code with no
stderr when the next/prev workspace could not be resolved (e.g. no
wrap-around and at the boundary of the list). Emit an explanatory error
message instead. Also clarifies the (next|prev) docs to describe how
"the list" is derived (stdin vs focused-monitor workspaces).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 0a9bc5d)
Order the menu-bar workspace list by the config persistent-workspaces
order first, then alphabetically for the rest.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 60775c2)
Move the persistent-then-alphabetical ordering out of the SwiftUI body into
a pure free function sortWorkspacesForMenuBar(_:persistentWorkspaces:),
behavior-identical, and have the view call it. Add MenuBarTest covering
mixed, all-persistent, none-persistent, missing-persistent, and empty cases.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit cbfe678)
Adds a %{all} format variable that expands to all available variables for
the object kind. Requires --json and must be used alone (validated with
error messages). Re-implemented against fork APIs (lazy title-var
expansion, list-* CmdArgs); resolved conflict in AeroObjKind, handled new
PlainInterVar.all case in format.swift, and updated TestCommandTest's
expected variable list.

Ports nikitabobko#1708

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 71d08a5)
Adds read-only interpolation variables %{window-parent-container-orientation}
and %{workspace-root-container-orientation}. They expand to "horizontal" or
"vertical"; windows return "NULL-ORIENTATION" for floating and macOS native
(fullscreen/minimized/hidden/popup) windows. Re-implemented against the fork's
lazy title-var expansion (toOrientationResult takes w.window); adapted tests to
AeroObj.window(.forTest(...)) and updated TestCommandTest's expected variable
lists. Dropped the upstream spurious .swift-version change.

Ports nikitabobko#1778

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit a056eb4)
Ports nikitabobko#2080. Adds an additive --root flag to the layout
command that operates on the workspace's root tiling container instead of the
focused window's parent. Mutually exclusive with --window-id; rejects the
tiling/floating window-placement descriptors at parse time. Succeeds on empty
or floating-only workspaces.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 77b03fc)
@MintCollector
MintCollector merged commit 30a0cbc into main Jun 10, 2026
0 of 5 checks passed
@MintCollector
MintCollector deleted the port/fork-batch-C branch June 10, 2026 15:57
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