Skip to content

Revert "Add workspace pages in the titlebar" - #1040

Merged
lawrencecchen merged 1 commit into
mainfrom
revert-pr-1030-workspace-pages-titlebar
Mar 7, 2026
Merged

lawrencecchen merged 1 commit into
mainfrom
revert-pr-1030-workspace-pages-titlebar

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Mar 7, 2026 •

Copy link
Copy Markdown
Contributor

Reverts #1030.

This is the clean revert companion to the replacement work in #1039.

Verification:

  • ./scripts/reload.sh --tag revert-pr-1030-workspace-pages-titlebar

Summary by cubic

Reverts workspace pages in the titlebar and returns to a single-layout-per-workspace. This removes all page-related UI, shortcuts, CLI/socket APIs, persistence, tests, strings, and docs; see #1039 for the replacement work.

  • Migration
    • Removed CLI/socket v2 methods: page.list, page.select, page.next, page.previous, page.last.
    • Removed page keyboard shortcuts and menu commands; workspace shortcuts stay the same.
    • Session snapshots no longer include activePageId/pages; legacy fields are ignored on load.

Written for commit 78cc82a. Summary will update on new commits.

Summary by CodeRabbit

Release Notes

  • Removed Features

    • Page management functionality including creating, renaming, closing, and navigating between pages
    • Page-related keyboard shortcuts and menu commands
    • Page drag-and-drop reordering and UI elements in the titlebar
    • Page state persistence across sessions
  • Tests

    • Removed page functionality test coverage
  • Documentation

    • Removed workspace pages design specification

@vercel

vercel Bot commented Mar 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Mar 7, 2026 8:01am

@coderabbitai

coderabbitai Bot commented Mar 7, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR removes the entire "pages" feature from the codebase, including CLI commands, UI components, keyboard shortcuts, V2 API handlers, session persistence, and related tests across the workspace management system.

Changes

Cohort / File(s) Summary
CLI and Core Page Removal
CLI/cmux.swift, Sources/TerminalController.swift
Deleted page-related CLI subcommands (list-pages, new-page, duplicate-page, select-page, rename-page, close-page, reorder-page, next-page, previous-page, last-page) and corresponding V2 API handlers (v2PageList, v2PageCreate, v2PageSelect, etc.). Removed pageHandle from TreePath structure and tree-related path parsing logic.
Keyboard Shortcuts and Input Handling
Sources/KeyboardShortcutSettings.swift, Sources/AppDelegate.swift, Sources/cmuxApp.swift
Removed page-related Action enum cases (newPage, renamePage, closePage, nextPage, previousPage, selectPage1-8, selectLastPage) and their associated shortcut accessors, label mappings, and default key bindings. Deleted page-focused keyboard shortcut event handling logic and pageSelectionMenuShortcut helper.
UI Component Removal
Sources/ContentView.swift
Deleted titlebar page strip UI, page drag-and-drop monitors/controllers, page drop indicators and delegates, command palette integration for page actions, and WorkspaceHandoffPolicy.staleRetiringWorkspaceId logic. Simplified titlebar to show directory icon and title text instead of page navigation strip.
Data Model Simplification
Sources/SessionPersistence.swift, Sources/Workspace.swift
Removed activePageId and pages fields from SessionWorkspaceSnapshot; deleted SessionWorkspacePageStateSnapshot and SessionWorkspacePageSnapshot structs. Removed StoredPageState and all per-page session restoration/capture logic (currentPageSessionStateSnapshot, restoreSessionSnapshot, captureActivePageStoredState, etc.) and per-page mutation helpers.
Project Configuration and Localization
GhosttyTabs.xcodeproj/project.pbxproj, Resources/Localizable.xcstrings
Removed WorkspacePagesUITests.swift from build targets and file references. Deleted 755+ localization entries for page-related UI labels, menu items, tooltips, and command descriptions.
Tests Removal
cmuxTests/AppDelegateShortcutRoutingTests.swift, cmuxTests/CmuxWebViewKeyEquivalentTests.swift, cmuxTests/SessionPersistenceTests.swift, cmuxTests/WorkspaceContentViewVisibilityTests.swift, cmuxUITests/WorkspacePagesUITests.swift
Removed page-related test cases including page shortcut routing tests, titlebar page drop/drag planner tests, workspace pages session persistence tests, page lifecycle tests, and comprehensive titlebar page strip UI test suite.
Documentation and Integration Tests
docs/workspace-pages-spec.md, tests_v2/test_page_cli_socket_parity.py
Deleted workspace pages specification document and end-to-end regression test validating CLI/socket API parity for page operations.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 Pages once bounded through the interface so bright,
But now they fade like moonlight's gentle flight,
The strips, the drags, the shortcuts all are gone,
A simpler workspace greets the break of dawn. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.28% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: reverting a previous feature addition about workspace pages in the titlebar.
Description check ✅ Passed The description covers the main aspects: what is being reverted, why (it's a companion revert), and verification steps. However, it lacks testing details and a demo section from the template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-pr-1030-workspace-pages-titlebar

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 17 files

@lawrencecchen
lawrencecchen merged commit e7c3961 into main Mar 7, 2026
13 of 14 checks passed
@lawrencecchen
lawrencecchen deleted the revert-pr-1030-workspace-pages-titlebar branch March 7, 2026 08:05

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78cc82ad2d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/ContentView.swift
Comment on lines 2831 to 2834
workspaceHandoffGeneration &+= 1
let generation = workspaceHandoffGeneration
hidePortalViewsForWorkspace(staleRetiringWorkspaceId, reason: "superseded")
retiringWorkspaceId = oldSelectedId
workspaceHandoffFallbackTask?.cancel()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Hide superseded retiring workspace before replacing handoff

When a workspace switch is superseded (for example A→B followed quickly by B→C), this path overwrites retiringWorkspaceId without first hiding portal views for the previously retiring workspace. completeWorkspaceHandoff only hides the workspace currently stored in retiringWorkspaceId, so older retiring workspaces can keep terminal/browser portal-hosted views mounted and visually cover the newly selected workspace. The removed stale-retiring cleanup in startWorkspaceHandoffIfNeeded was preventing this exact overlap case.

Useful? React with 👍 / 👎.

@greptile-apps

greptile-apps Bot commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR is a clean, comprehensive revert of PR #1030 ("Add workspace pages in the titlebar"), paired with a replacement implementation in PR #1039. It removes the workspace pages feature across all layers of the codebase: CLI commands, socket API methods, UI (titlebar page strip + drag-drop), keyboard shortcuts, command palette entries, session persistence structures, localization strings, and all associated tests.

Key changes across the codebase:

  • CLI (CLI/cmux.swift): Removes 11 page-related commands (list-pages, new-page, duplicate-page, close-page, select-page, rename-page, reorder-page, next-page, previous-page, last-page, current-page), their help strings, and helper functions (normalizePageHandle, runReorderPage). The treeApplyMarkers extracted helper is inlined back, restoring the pre-Add workspace pages in the titlebar #1030 tree rendering logic. "page" is also removed from the handle ref validation in isHandleRef.
  • Socket API (Sources/TerminalController.swift): Removes all page.* V2 socket methods, the V2HandleKind.page case, page handle tracking maps, and page fields from the focused/caller context payloads. The debugProcessV2Command DEBUG helper (added in PR Add workspace pages in the titlebar #1030 for testing) is also removed.
  • UI (Sources/ContentView.swift): Removes the entire titlebar page strip (scroll view, drag-drop infrastructure, auto-scroll controller), all command palette page commands, and page rename flow. ShortcutHintModifierMonitor is simplified — renamed to SidebarShortcutHintModifierMonitor and the requiredModifierFlags parameter is removed (hardcoded to [.command]), since the [.option] variant existed solely for page hint shortcuts. WorkspaceHandoffPolicy is removed along with the stale-retiring-workspace portal view hiding logic introduced by PR Add workspace pages in the titlebar #1030 — the PR description notes this is handled in companion PR Reopen workspace pages in the titlebar #1039.
  • Workspace model (Sources/Workspace.swift): Removes WorkspacePage, StoredPageState, all page management methods, and reverts sessionSnapshot/restoreSessionSnapshot to the single-page model. Note: the panels.isEmpty safety guard (which created a replacement terminal when session restoration yields an empty workspace) is removed as it was introduced by PR Add workspace pages in the titlebar #1030.
  • Keyboard shortcuts (Sources/KeyboardShortcutSettings.swift): Removes 14 page-related Action cases with their labels, storage keys, and default bindings.
  • Session persistence (Sources/SessionPersistence.swift): Removes SessionWorkspacePageSnapshot and SessionWorkspacePageStateSnapshot structs, and removes activePageId/pages fields from SessionWorkspaceSnapshot. Existing snapshots with these fields will decode gracefully via Codable's optional handling.
  • AppDelegate (Sources/AppDelegate.swift): Removes page shortcut handlers and the ANSI key code fallback path for option-only modifiers (which was needed exclusively by page navigation shortcuts).
  • Tests & docs: Deletes WorkspacePagesUITests.swift, test_page_cli_socket_parity.py, workspace-pages-spec.md, and removes page test cases from AppDelegateShortcutRoutingTests.swift, SessionPersistenceTests.swift, and CmuxWebViewKeyEquivalentTests.swift.

Confidence Score: 5/5

  • This PR is safe to merge — it is a clean, mechanical revert of a well-scoped prior PR with a companion replacement PR in flight.
  • The revert is comprehensive and consistent across all layers (CLI, socket API, UI, shortcuts, persistence, localization, tests, Xcode project). No dangling references to removed types or methods were found. The few behavioral differences from the pre-Add workspace pages in the titlebar #1030 baseline (stale portal view hiding, panels.isEmpty safety guard) are explicitly documented as being handled by the companion PR Reopen workspace pages in the titlebar #1039. The ANSI key code fallback simplification and ShortcutHintModifierMonitor rename are correct cleanup that falls naturally out of removing the option-modifier page shortcuts.
  • No files require special attention — the revert is mechanically clean throughout.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[PR #1030: Add Workspace Pages] -->|Reverting| B[PR #1040: Clean Revert]
    B --> C[CLI/cmux.swift\nRemoves: list-pages, new-page,\nduplicate-page, close-page,\nselect-page, rename-page,\nreorder-page, next/prev/last-page]
    B --> D[Sources/AppDelegate.swift\nRemoves page shortcut handlers\nand ANSI fallback for option-only keys]
    B --> E[Sources/ContentView.swift\nRemoves titlebar page strip UI,\ndrag-drop infrastructure,\ncommand palette page commands]
    B --> F[Sources/TerminalController.swift\nRemoves page.* socket API\nmethods and page handle kind]
    B --> G[Sources/Workspace.swift\nRemoves WorkspacePage model,\npage management methods,\nstored page state infrastructure]
    B --> H[Sources/KeyboardShortcutSettings.swift\nRemoves 14 page-related\nshortcut actions]
    B --> I[Sources/SessionPersistence.swift\nRemoves SessionWorkspacePageSnapshot\nand SessionWorkspacePageStateSnapshot]
    B --> J[Tests/Docs\nDeletes WorkspacePagesUITests.swift\ntest_page_cli_socket_parity.py\nworkspace-pages-spec.md]
    C & D & E & F & G & H & I --> K[Companion PR #1039\nReplacement Implementation]
Loading

Last reviewed commit: 78cc82a

This branch was successfully deployed

1 active deployment
Preview — 78cc82ad Deployed Mar 7, 2026 by vercel[bot]
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.

1 participant