Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
00da345
CmuxControlSocket stage 3c-1: ControlCommandCoordinator + window domain
azooz2003-bit Jun 10, 2026
2383068
stage 3c: multi-protocol seam umbrella + shared param/ref helper port
azooz2003-bit Jun 10, 2026
b02c28d
stage 3c: extract App Focus + Feed + Notification domains
azooz2003-bit Jun 10, 2026
9bdae00
stage 3c: extract Mobile Host + Workspace Groups + Pane domains
azooz2003-bit Jun 10, 2026
4b8118f
stage 3c: fix int/double param helpers to match legacy NSNumber coercion
azooz2003-bit Jun 10, 2026
1905b38
stage 3c: integrate Workspace + Surface domains (full lifts)
azooz2003-bit Jun 10, 2026
8f7ac89
stage 3c: organize coordinator files into per-domain subfolders
azooz2003-bit Jun 10, 2026
487baaf
stage 3c: dedupe workspace.create onto the shared v2WorkspaceCreate body
azooz2003-bit Jun 10, 2026
6f2cba5
stage 3c: fix 8 divergences found by Workspace+Surface adversarial re…
azooz2003-bit Jun 11, 2026
fe419f0
Budget: entries for the two coordinator files grown by the divergence…
azooz2003-bit Jun 11, 2026
a94589d
Merge remote-tracking branch 'origin/main' into feat-ctl-coordinator-…
azooz2003-bit Jun 11, 2026
f731c27
Fix duplicate parameter name warning (sessionID sessionID) in workspa…
azooz2003-bit Jun 11, 2026
7d234dc
stage 3c: package side of System/Project/Debug/Sidebar/Browser domain…
azooz2003-bit Jun 11, 2026
39d111b
stage 3c: cut over System/Project/Debug/Sidebar/Browser domains to th…
azooz2003-bit Jun 11, 2026
a9eb608
CmuxSidebarGit: extract TabManager git-metadata + PR-polling subsystem
azooz2003-bit Jun 11, 2026
e446b2b
Merge remote-tracking branch 'origin/feat-ctl-coordinator-3c-1' into …
azooz2003-bit Jun 11, 2026
3e38fd9
CmuxSidebarGit tests: use a non-skip branch in PR poll tests
azooz2003-bit Jun 11, 2026
ecd5148
stage 3c: dedupe file.open onto the shared v2FileOpen body
azooz2003-bit Jun 11, 2026
3178b68
stage 3c: fix browser.focus_mode.set/zoom.set error precedence; finis…
azooz2003-bit Jun 11, 2026
42f9332
Budget tsv: strip accidental leading whitespace
azooz2003-bit Jun 11, 2026
1e88ee1
CmuxSettings: SettingsReading/SettingsWriting sync seam + Wave-3 key …
azooz2003-bit Jun 11, 2026
d47e003
Merge pull request #5909 from manaflow-ai/feat-ctl-3c-final-domains
azooz2003-bit Jun 11, 2026
4094e6e
Add CmuxSidebar, CmuxBrowser, CmuxNotifications Wave-3 packages (mode…
azooz2003-bit Jun 11, 2026
29d8342
stage 3c: address review threads (handles observation, window.close t…
azooz2003-bit Jun 11, 2026
2be538e
Merge origin/main: adopt PR 5778's socket-worker browser JS lane; rev…
azooz2003-bit Jun 12, 2026
ac0b71c
Merge origin/feat-ctl-coordinator-3c-1 into feat-sidebar-git
azooz2003-bit Jun 12, 2026
a0d4ff2
Wave-3 app cutover: TabManager drains settings enums + dismissal + br…
azooz2003-bit Jun 12, 2026
bc69ced
Merge origin/feat-sidebar-git (3c domains + main sync) into feat-tabm…
azooz2003-bit Jun 12, 2026
b1916de
Wave-4 tranche 1: CmuxWorkspaceNavigation package (FocusHistoryModel …
azooz2003-bit Jun 12, 2026
6d1116d
Wave-4 tranche 2: CmuxPanes package (SplitDirection/ResizeDirection v…
azooz2003-bit Jun 12, 2026
b889f5a
Wave-4 tranche 3: CmuxWorkspaces package bootstrap (WorkspaceGroup va…
azooz2003-bit Jun 12, 2026
5d63c88
Wave-4 tranche 4a: WorkspacesModel owns tabs/groups/selection storage…
azooz2003-bit Jun 12, 2026
7ad3dd7
Wave-4 tranche 4b: group + reorder flows drain into CmuxWorkspaces co…
azooz2003-bit Jun 12, 2026
0e8a3aa
Merge origin/main into feat-sidebar-git
azooz2003-bit Jun 12, 2026
4600f30
Merge origin/feat-sidebar-git (main sync) into feat-tabmanager-models
azooz2003-bit Jun 12, 2026
6bc21ba
Fix remaining conditional CmuxSettings imports in cmuxTests
azooz2003-bit Jun 12, 2026
94f18db
Budget: ratchet for the unconditional test imports (+1 line each)
azooz2003-bit Jun 12, 2026
5ae6fae
Fix missing CmuxSidebar import in SidebarWorkspaceSnapshotRefreshPoli…
azooz2003-bit Jun 12, 2026
399b9c5
Repair WorkspaceUnitTests detail-visibility retarget; pin ambiguous a…
azooz2003-bit Jun 12, 2026
09c9d72
KeyboardShortcutContextTests: ShortcutStroke pins to the package type
azooz2003-bit Jun 12, 2026
72907cc
Budget: ratchet for KeyboardShortcutContextTests typealias note (+2)
azooz2003-bit Jun 12, 2026
e283828
Merge origin/main into feat-tabmanager-models (retarget to main)
azooz2003-bit Jun 13, 2026
f8d9fb9
Merge origin/main (advanced past first merge: #6052, #5920)
azooz2003-bit Jun 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions .github/swift-file-length-budget.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
# Format: max_lines<TAB>relative path
# Reduce counts as files shrink. CI fails if tracked files exceed this budget.
33285 CLI/cmux.swift
19990 Sources/Workspace.swift
19225 Sources/ContentView.swift
18077 Sources/AppDelegate.swift
16075 Sources/GhosttyTerminalView.swift
14610 Sources/TerminalController.swift
19997 Sources/Workspace.swift
19220 Sources/ContentView.swift
18081 Sources/AppDelegate.swift
16076 Sources/GhosttyTerminalView.swift
14611 Sources/TerminalController.swift
13606 Sources/Panels/BrowserPanel.swift
12044 cmuxTests/AppDelegateShortcutRoutingTests.swift
9345 cmuxTests/CLINotifyProcessIntegrationRegressionTests.swift
8394 Sources/TabManager.swift
7737 Sources/Panels/BrowserPanelView.swift
7291 cmuxTests/WorkspaceUnitTests.swift
7305 cmuxTests/WorkspaceUnitTests.swift
6948 cmuxTests/WorkspaceRemoteConnectionTests.swift
6542 cmuxTests/GhosttyConfigTests.swift
6548 cmuxTests/GhosttyConfigTests.swift
6329 cmuxTests/SessionPersistenceTests.swift
6153 CLI/cmux_open.swift
6091 Sources/TabManager.swift
6071 Sources/TextBoxInput.swift
5966 cmuxTests/TerminalAndGhosttyTests.swift
5482 cmuxTests/BrowserConfigTests.swift
5462 Sources/cmuxApp.swift
5493 cmuxTests/BrowserConfigTests.swift
5468 Sources/cmuxApp.swift
4726 Packages/CmuxMobileShell/Sources/CmuxMobileShell/MobileShellComposite.swift
4460 Sources/Panels/FilePreviewPanel.swift
4400 cmuxTests/BrowserPanelTests.swift
Expand All @@ -30,7 +30,7 @@
3761 cmuxTests/TabManagerUnitTests.swift
3699 cmuxTests/CLIGenericHookPersistenceTests.swift
3665 Packages/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceView.swift
3396 Sources/CmuxConfig.swift
3397 Sources/CmuxConfig.swift
3316 cmuxTests/TabManagerSessionSnapshotTests.swift
3202 Sources/Update/UpdateTitlebarAccessory.swift
2877 Sources/SessionIndexView.swift
Expand All @@ -43,11 +43,11 @@
2322 Sources/Mobile/MobileHostService.swift
2314 Sources/FileExplorerView.swift
2260 Sources/TerminalWindowPortal.swift
2232 Sources/TerminalNotificationStore.swift
2235 Sources/TerminalNotificationStore.swift
2198 Sources/SessionPersistence.swift
2123 cmuxTests/ShortcutAndCommandPaletteTests.swift
2133 cmuxTests/ShortcutAndCommandPaletteTests.swift
2117 cmuxTests/CmuxConfigTests.swift
2030 Sources/KeyboardShortcutSettingsFileStore.swift
2031 Sources/KeyboardShortcutSettingsFileStore.swift
1949 Sources/Panels/BrowserWebAuthnSupport.swift
1860 cmuxTests/NotificationAndMenuBarTests.swift
1793 Sources/SessionIndexStore.swift
Expand All @@ -70,10 +70,10 @@
1362 Sources/CMUXInstalledExtensionSidebarHostView.swift
1312 cmuxTests/MobileHostAuthorizationTests.swift
1285 cmuxUITests/SidebarHelpMenuUITests.swift
1255 Sources/Feed/FeedCoordinator.swift
1256 Sources/Feed/FeedCoordinator.swift
1205 Packages/CmuxMobileTerminal/Sources/CmuxMobileTerminal/TerminalInputTextView.swift
1197 cmuxTests/CodexAppServerSessionTests.swift
1156 cmuxTests/SidebarOrderingTests.swift
1157 cmuxTests/SidebarOrderingTests.swift
1144 Sources/VaultAgentProcessScanner.swift
1139 cmuxTests/PiVaultAgentPersistenceTests.swift
1126 cmuxTests/FileExplorerStoreTests.swift
Expand All @@ -91,9 +91,9 @@
939 Sources/App/TerminalDirectoryOpenSupport.swift
937 Sources/TextBoxMentionIndexStore.swift
924 Sources/DockPanelView.swift
913 cmuxTests/WorkspaceGroupTests.swift
917 cmuxTests/WorkspaceGroupTests.swift
905 Sources/CmuxSSHURLRequest.swift
896 Sources/CommandPalette/CommandPaletteSettingsToggle.swift
903 Sources/CommandPalette/CommandPaletteSettingsToggle.swift
878 Sources/WorkspaceContentView.swift
868 Sources/Panels/BrowserScreenshotSnapshotter.swift
864 Sources/Panels/TerminalPanel.swift
Expand All @@ -111,12 +111,12 @@
760 Packages/CMUXAgentLaunch/Tests/CMUXAgentLaunchTests/AgentLaunchSanitizerTests.swift
756 Sources/Panels/AgentSessionWebRendererCoordinator.swift
752 cmuxUITests/CloseWorkspaceCmdDUITests.swift
749 Sources/TerminalController+ControlWorkspaceContext.swift
751 Sources/TerminalController+ControlWorkspaceContext.swift
739 Sources/App/MenuBarExtraController.swift
738 Packages/CMUXProjectModel/Sources/CMUXProjectModel/XcodeProjectAdapter.swift
738 Packages/CmuxAuthRuntime/Sources/CmuxAuthRuntime/Coordinator/AuthCoordinator.swift
716 Sources/TaskManagerSnapshot.swift
714 Sources/AppleScriptSupport.swift
715 Sources/AppleScriptSupport.swift
708 Sources/TerminalSSHSessionDetector.swift
705 CLI/CMUXCLI+Config.swift
705 cmuxUITests/BrowserOmnibarSuggestionsUITests.swift
Expand All @@ -128,11 +128,11 @@
693 Sources/Panels/BrowserPopupWindowController.swift
691 cmuxTests/TaskManagerResourcesTests.swift
690 Sources/NotificationSoundSettings.swift
688 cmuxTests/KeyboardShortcutContextTests.swift
683 Packages/CmuxSwiftRender/Sources/CmuxSwiftRender/SwiftViewInterpreter.swift
683 Sources/Panels/CodexAppServerSession.swift
681 Sources/Panels/AgentSessionProcessStore.swift
680 Sources/FileExplorerSearchController.swift
679 cmuxTests/KeyboardShortcutContextTests.swift
668 cmuxTests/FeedCoordinatorTests.swift
654 Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/KeyboardShortcutsSection.swift
650 Sources/Panels/MarkdownRemoteImageLoader.swift
Expand All @@ -146,6 +146,7 @@
614 cmuxTests/SessionIndexViewTests.swift
613 Sources/PortScanner.swift
611 Sources/TerminalController+ControlPaneContext.swift
608 Packages/CmuxWorkspaces/Sources/CmuxWorkspaces/Coordinators/WorkspaceGroupCoordinator.swift
603 Sources/SettingsNavigation.swift
599 Packages/CMUXAgentLaunch/Sources/CMUXAgentLaunch/AgentLaunchSanitizerPrimaryPolicies.swift
596 cmuxTests/CmuxEventBusTests.swift
Expand All @@ -168,6 +169,7 @@
551 Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/BrowserSection.swift
547 Packages/CmuxSocketControl/Sources/CmuxSocketControl/SocketControlSettings.swift
546 Sources/Windowing/WindowGlassEffect.swift
540 Packages/CmuxWorkspaces/Sources/CmuxWorkspaces/Coordinators/WorkspaceReorderCoordinator.swift
539 CLI/CodexTeamsApprovalBridge.swift
538 CLI/CMUXCLI+Themes.swift
536 cmuxTests/CmuxConfigContextMenuTests.swift
Expand Down
35 changes: 35 additions & 0 deletions Packages/CmuxBrowser/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// swift-tools-version: 6.0

import PackageDescription

let package = Package(
name: "CmuxBrowser",
platforms: [
.macOS(.v14),
],
products: [
.library(
name: "CmuxBrowser",
targets: ["CmuxBrowser"]
),
],
targets: [
.target(
name: "CmuxBrowser",
swiftSettings: [
.swiftLanguageMode(.v6),
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("InternalImportsByDefault"),
]
),
.testTarget(
name: "CmuxBrowserTests",
dependencies: ["CmuxBrowser"],
swiftSettings: [
.swiftLanguageMode(.v6),
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("InternalImportsByDefault"),
]
),
]
)
51 changes: 51 additions & 0 deletions Packages/CmuxBrowser/Sources/CmuxBrowser/BrowserModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
public import Foundation
import Observation

/// Per-window browser sub-model: owns the recently-closed browser panel
/// stack TabManager used to hold inline (`recentlyClosedBrowsers`).
///
/// `@MainActor` because every mutator and reader is a MainActor UI path
/// (the workspace close-panel callback, workspace teardown, the
/// Cmd+Shift+T reopen loop, the History menu) — state lives where its
/// callers live.
///
/// Generic over the window's restore-snapshot value: the full payload is
/// Workspace-owned (and migrates with the Workspace decomposition); this
/// model only needs ``BrowserPanelRestoreSnapshot`` identity. The
/// workspace/pane-coupled reopen walk stays app-side until the Wave-4
/// workspace/pane sub-models exist, popping entries through
/// ``BrowserManaging``.
@MainActor
@Observable
public final class BrowserModel<Snapshot: BrowserPanelRestoreSnapshot>: BrowserManaging {
/// The legacy capacity of the reopen history (20 panels per window).
public static var defaultRecentlyClosedCapacity: Int { 20 }

private var recentlyClosedBrowsers: RecentlyClosedBrowserStack<Snapshot>

/// Creates an empty model retaining at most `recentlyClosedCapacity`
/// closed-panel snapshots.
public init(recentlyClosedCapacity: Int = BrowserModel.defaultRecentlyClosedCapacity) {
self.recentlyClosedBrowsers = RecentlyClosedBrowserStack(capacity: recentlyClosedCapacity)
}

public var mostRecentClosedBrowserPanelClosedAt: Date? {
recentlyClosedBrowsers.mostRecentClosedAt
}

public func recordClosedBrowserPanel(_ snapshot: Snapshot) {
recentlyClosedBrowsers.push(snapshot)
}

public func popMostRecentlyClosedBrowserPanel() -> Snapshot? {
recentlyClosedBrowsers.pop()
}

public func removeClosedBrowserPanels(forWorkspaceId workspaceId: UUID) {
recentlyClosedBrowsers.removeSnapshots(forWorkspaceId: workspaceId)
}

public func clearRecentlyClosedBrowserPanels() {
recentlyClosedBrowsers = RecentlyClosedBrowserStack(capacity: recentlyClosedBrowsers.capacity)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
public import Foundation

/// The cross-cutting browser-state reads and mutations the app target
/// performs against the per-window browser sub-model: recording closed
/// browser panels, draining them for Cmd+Shift+T reopen, and the recency
/// read the History menu sorts windows by.
///
/// `@MainActor` because every caller is a MainActor UI path (panel close
/// callbacks, workspace teardown, the reopen shortcut) — state lives where
/// its callers live.
@MainActor
public protocol BrowserManaging<Snapshot>: AnyObject {
/// The restore-snapshot value the window's workspaces produce.
associatedtype Snapshot: BrowserPanelRestoreSnapshot

/// When the most recently closed browser panel was closed, if any.
var mostRecentClosedBrowserPanelClosedAt: Date? { get }

/// Records a closed browser panel for later reopen.
func recordClosedBrowserPanel(_ snapshot: Snapshot)

/// Removes and returns the most recently closed panel snapshot.
func popMostRecentlyClosedBrowserPanel() -> Snapshot?

/// Drops every snapshot owned by the given workspace (workspace closed).
func removeClosedBrowserPanels(forWorkspaceId workspaceId: UUID)

/// Clears the entire reopen history.
func clearRecentlyClosedBrowserPanels()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
public import Foundation

/// The identity a recently-closed browser entry needs for stack bookkeeping:
/// which workspace owned the panel and when it closed.
///
/// The full restore payload (URL, profile, pane/tab placement, split
/// fallback) is `Workspace`-owned and lands in its own browser-panel package
/// in the Workspace decomposition; this package only depends on the two
/// fields the recency stack reads, so the stack and model lift now without
/// dragging the workspace god file's types along.
public protocol BrowserPanelRestoreSnapshot: Sendable {
/// The workspace that owned the closed browser panel.
var workspaceId: UUID { get }
/// When the panel was closed.
var closedAt: Date { get }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
public import Foundation

/// Bounded LIFO stack of recently-closed browser panel snapshots.
///
/// Push appends and drops the oldest entries past `capacity`; pop returns
/// the most recent. Entries for a closing workspace are purged so a stale
/// snapshot can never restore into an unrelated workspace.
public struct RecentlyClosedBrowserStack<Snapshot: BrowserPanelRestoreSnapshot>: Sendable {
/// The entries oldest-first (the last element is the most recent close).
public private(set) var entries: [Snapshot] = []

/// The maximum number of entries retained (at least 1).
public let capacity: Int

/// Creates an empty stack retaining at most `capacity` entries.
public init(capacity: Int) {
self.capacity = max(1, capacity)
}

/// Whether the stack has no entries.
public var isEmpty: Bool {
entries.isEmpty
}

/// When the most recent entry was closed, if any.
public var mostRecentClosedAt: Date? {
entries.last?.closedAt
}

/// Appends a snapshot, dropping the oldest entries past capacity.
public mutating func push(_ snapshot: Snapshot) {
entries.append(snapshot)
if entries.count > capacity {
entries.removeFirst(entries.count - capacity)
}
}

/// Removes and returns the most recent snapshot, or `nil` when empty.
public mutating func pop() -> Snapshot? {
entries.popLast()
}

/// Drops every snapshot owned by the given workspace.
public mutating func removeSnapshots(forWorkspaceId workspaceId: UUID) {
entries.removeAll { $0.workspaceId == workspaceId }
}
}
Loading
Loading