cmux/Sources/Panels
Lawrence Chen cae40d1a4c
Sidebar ports on own line, wider sidebar, CMUX_PORT env vars (#160)
* Sidebar ports on own line, wider sidebar, CMUX_PORT env vars

- Move listening ports to dedicated sidebar row (removed from branch/directory line)
- Allow sidebar to resize up to 2/3 of screen width (was capped at 360px)
- Add CMUX_PORT, CMUX_PORT_END, CMUX_PORT_RANGE env vars per workspace
- Each workspace gets a dedicated port range (default: base 9100, range 10)
- Add settings UI for port base and range size
- Add portOrdinal to Workspace, monotonic counter in TabManager

Closes #129

* Make port ordinal counter static to avoid overlap across windows

Each window creates its own TabManager, so a per-instance counter
would reset and reuse port ranges. Making it static ensures unique
ranges across all windows.

* Fix portOrdinal race: pass through Workspace init instead of setting after

The first TerminalPanel is created inside Workspace.init, so setting
portOrdinal after init returns meant the initial terminal always got
ordinal 0. Pass portOrdinal as an init parameter and set it before
the TerminalPanel is created.

* Fix P2/P3: snapshot port settings at surface creation, use window screen for sidebar cap

P2: Port base/range are now snapshotted on TerminalSurface when the
panel is created, so changing settings mid-session won't cause
inconsistent CMUX_PORT values across terminals in the same workspace.

P3: Sidebar max width now uses NSApp.keyWindow?.screen instead of
NSScreen.main, so multi-monitor setups get the correct 2/3 cap for
the display the window is actually on.

* Fix P1: snapshot port base/range once per app session, not per panel

Port base and range size are now static properties on TerminalSurface,
initialized once from UserDefaults at first access. This prevents
overlapping port ranges across workspaces when settings are changed
mid-session (e.g., workspace 1 with range=10 at 9110-9119, then
range changed to 5, workspace 2 would overlap at 9110).
2026-02-20 14:12:14 -08:00
..
BrowserPanel.swift Add preference to disable in-app browser for terminal links (#174) 2026-02-20 13:58:39 -08:00
BrowserPanelView.swift Fix browser panel mouse back/forward buttons and middle-click (#131) (#139) 2026-02-19 23:38:21 -08:00
CmuxWebView.swift Fix browser panel mouse back/forward buttons and middle-click (#131) (#139) 2026-02-19 23:38:21 -08:00
Panel.swift Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
PanelContentView.swift Avoid O(N) re-renders by passing derived Bool instead of ObservableObject 2026-02-20 02:41:52 -08:00
TerminalPanel.swift Sidebar ports on own line, wider sidebar, CMUX_PORT env vars (#160) 2026-02-20 14:12:14 -08:00
TerminalPanelView.swift Render unread notification ring above portal-hosted terminal view 2026-02-20 02:41:52 -08:00