Skip to content

fix(linux): expose persisted windows in palette - #32

Merged
melonamin merged 1 commit into
melonamin:linux-portfrom
MemberIT:fix/linux-persisted-window-palette
Sep 1, 2026
Merged

melonamin merged 1 commit into
melonamin:linux-portfrom
MemberIT:fix/linux-persisted-window-palette

Conversation

@MemberIT

@MemberIT MemberIT commented Aug 28, 2026 •

Copy link
Copy Markdown

What

The v0.24.0 parity audit identified GAP Б3: Linux had no explicit UI for reopening one persisted window. Rechecking the current linux-port code found a narrower but real gap: Palette.swift already iterates every WindowLibrary.windows entry and routes it through openWindow, so a closed persisted window can technically be reopened, but it is mislabeled as Switch to Window. The palette does not distinguish an already-open window from a persisted closed one, unlike upstream macOS's explicit Open Window: entries.

This PR makes the state visible and aligns the Linux command palette with upstream semantics. Closed entries render as Open Window: and reopen through the existing lazy openWindow path; other live windows retain the Linux-only Switch to Window: convenience.

Cause

The dynamic window loop used one unconditional title for every non-current WindowLibrary.windows entry:

Switch to Window: <name>

WindowLibrary.windows is the complete persisted index, not only the loaded/open set. The action closure already called openWindow(target), which raises an attached window or lazily loads a closed store. The behavior therefore existed behind incorrect wording and had no unit or GTK smoke coverage to prevent the persisted-window entry from disappearing.

Minimal reproduction

  1. Create a second named window.
  2. Close that window without deleting it, leaving its entry in windows.json.
  3. Open the command palette in the surviving window and search for the closed window name.

Expected (upstream parity): Open Window: , and activating it reopens the same persisted window ID with its saved workspaces and sessions.

Actual before this PR: Switch to Window: . It happened to reopen the window because both states shared openWindow, but the UI presented a closed persisted window as if it were already on screen.

Change

Commit fix(linux): expose persisted windows in palette:

  • agterm-linux/Sources/AgtermLinux/Palette.swift — resolves each persisted entry's live state through WindowLibrary.isOpen and builds an explicit Open/Switch row while retaining the existing openWindow action.
  • agterm-linux/Sources/AgtermLinux/PalettePresentation.swift — centralizes the state-dependent window-row wording in the existing host-free palette presentation seam.
  • agterm-linux/Tests/AgtermLinuxTests/PalettePresentationTests.swift — pins closed → Open Window and open → Switch to Window.
  • agterm-linux/tests/atspi_smoke.py — creates and closes a named window, activates its Open Window palette row, and asserts that the same persisted ID becomes open again.
  • README.md — documents reopening persisted windows from the command palette.

Scope note

Command-palette presentation and coverage only. The persisted index format, open-set restoration at launch, WindowLibrary, window/session data, close/delete semantics, GTK window creation, and control protocol are unchanged. No new abstraction or platform adapter is introduced; the implementation reuses WindowLibrary.isOpen and openWindow.

Keep-in-sync

Control API already covers the same capability through window.list plus window.select <id>; this PR adds no new user action or mutable capability. The existing GUI row and control command both converge on the same window-open path.

The keymap format and window/workspace/session/pane model are unchanged, so the bundled agent skill command catalog does not need an update. README.md is updated for the user-visible palette surface. CHANGELOG.md is intentionally unchanged outside the release flow.

Testing

  • Local Docker verification against the CI base image swift:6.3.2-noble, with the workflow's complete GTK4/libadwaita/libepoxy, accessibility, Xvfb/software-GL, shell, Zig 0.16.0, and vendored-libghostty setup:
    • swift test --filter persistedWindowTitleFollowsOpenState — 1 test / 1 suite passed.
    • The test compiled the complete AgtermLinux target and exercised the host-free palette presentation seam.
  • python3 -m py_compile agterm-linux/tests/atspi_smoke.py — passed locally.
  • git diff --check — passed locally.
  • GitHub CI run 33163253630 — green:
    • Detect changes passed.
    • Unit tests (Linux) passed: shared agtermCore tests plus core-boundary and Linux CLI drift checks.
    • SwiftLint (Linux) passed in strict mode.
    • Build app (Linux GTK) passed: swift test in agterm-linux, Debug build, Release/WMO build, staged-payload validation, and the complete GTK AT-SPI smoke suite (including close → Open Window → same-ID reopen).
    • Cookbook checks skipped because this PR changes no cookbook inputs.
  • A bare-host invocation through mise x [email protected] reaches the pinned compiler but cannot compile CGtk because this workstation lacks libadwaita-1.pc / adwaita.h; Docker supplies those native dependencies and is the authoritative local result above.

@MemberIT
MemberIT requested a review from melonamin as a code owner August 28, 2026 10:24
@MemberIT
MemberIT marked this pull request as draft August 28, 2026 10:54
@MemberIT
MemberIT marked this pull request as ready for review August 28, 2026 11:13
@melonamin
melonamin merged commit 0a9b2f7 into melonamin:linux-port Sep 1, 2026
5 checks passed
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