refactor: split remaining god files and unify the socket command catalog#129
Merged
Conversation
Nuclear-review restructuring pass (2026-07-09 audit, tracking issue #104): - #94 ContentView.swift 7,913 -> 5,791 lines; window chrome, overlay controllers, workspace mount presentation, vertical tabs sidebar, shortcut hints, tab drag, and the sidebar resizer moved to their own files (resizer as a ContentView extension per existing convention). - #97 GhosttyTerminalView.swift 8,446 -> stub; GhosttyApp, TerminalSurface (+registry/metal layer), GhosttyNSView, GhosttySurfaceScrollView, copy-mode types, and shared support split out. TerminalWindowPortal.swift 2,079 -> 1,054 with the host view and registry extracted. hitTest and forceRefresh moved byte-identical. - #98 Workspace.swift 5,660 -> 2,056; sidebar/remote value types and the theme/remote/surfaces/focus-geometry/sidebar-telemetry member groups extracted as Workspace+X files. - #99 browser trio 13,131 -> 6,139 across the three originals; settings, omnibar subsystem, toolbar views, BrowserPanel concern extensions, host/slot/drop views split out. - #87 one command catalog: v2Capabilities() now derives from the new V2CommandCatalog (literal method array deleted), 79 duplicated invalid-params guards collapsed onto v2InvalidParam(), and per-command CLI usage text moved into the CommandDescriptor table (the ~1,300-line subcommandUsage switch is gone). Pure moves plus the minimum private->internal flips the file boundaries require; no logic changes. App, CLI, and unit-test targets build. CLI top-level help and 27 sampled per-command helps are byte-identical to the shipped binary; capabilities JSON is set-identical and was already sorted before serialization. Closes #87, closes #94, closes #97, closes #98, closes #99, closes #104.
…esses The macos-26 runner image now ships two Xcodes (26.5 and 26.6). Setting only DEVELOPER_DIR leaves the system selection on the other Xcode, and /usr/bin/git shims spawned inside xcodebuild test processes exit 72 with a dual Xcode3Core clash — compat-tests has failed on every PR since 2026-07-13 because of this (git-branch probe and SSH bootstrap tests). Same fix ci.yml and release.yml already carry; applied to ci-macos-compat, test-depot, and test-e2e.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One PR for the five open nuclear-review issues. Everything here is file reorganization plus the command-catalog dedup, no behavior change.
What moved
#94 ContentView.swift 7,913 -> 5,791 lines. Window chrome, the window overlay controllers, workspace mount presentation, the vertical tabs sidebar, shortcut hints, internal tab drag, and the sidebar resizer each got their own file (the resizer as a
ContentViewextension, same shape as the existing command palette extension). TabItemView was already out; it is untouched here.#97 GhosttyTerminalView.swift 8,446 -> stub.
GhosttyApp,TerminalSurface(with the registry and metal layer),GhosttyNSView,GhosttySurfaceScrollView(with its private helper views and the SurfaceSearchOverlay mount), copy-mode types, and shared support each moved to their own file, matching the+Suffixconvention the module already used. TerminalWindowPortal.swift 2,079 -> 1,054 with the host view and cross-window registry extracted.#98 Workspace.swift 5,660 -> 2,056. Sidebar and remote value types moved to model files; the theme, remote glue, surface creation, focus/geometry reconciliation, and sidebar telemetry member groups are now
Workspace+Xextension files. Sidebar telemetry has one mutation target, as the review asked. The remote-session controller split had already landed on main.#99 browser trio 13,131 -> 6,139 across the three originals. Browser settings, the whole omnibar subsystem, toolbar views, six
BrowserPanel+Xconcern extensions, and the host/slot/drop views split out. The per-file private helper extensions were kept per-file on purpose so nothing collides; the PageSession facade idea stays future work.#87 one command catalog.
v2Capabilities()now derives from a newV2CommandCatalogand the hand-maintained method array is gone. The 79 copy-pasted invalid-params guards across theTerminalController+*handlers collapsed onto onev2InvalidParam()helper. On the CLI side every per-command usage text moved into theCommandDescriptortable and the ~1,300-linesubcommandUsageswitch is deleted. The dispatch switch itself is untouched, as the review cleared it. The per-family usage helpers that already live next to their descriptors inCLI/CLI+*.swiftwere left alone.Guardrails and verification
WindowTerminalHostView.hitTest()andTerminalSurface.forceRefresh()diff clean against main; key handling untouched.--helpoutputs are byte-identical to the shipped release binary;help <cmd>rejects arguments exactly like before.private/fileprivate-> internal) were made only where a file boundary now sits between a member and its callers; each agent's report lists them.Closes #87
Closes #94
Closes #97
Closes #98
Closes #99
Closes #104