Skip to content

Split workspace.rs into six files - #15

Merged
sn merged 1 commit into
mainfrom
refactor/split-workspace
Nov 19, 2026
Merged

sn merged 1 commit into
mainfrom
refactor/split-workspace

Conversation

@sn

@sn sn commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

src/workspace.rs was 3,271 lines holding pane state, session restore, drawing, the palettes, plugins and the socket API. It is now six files in src/workspace/:

File Lines What it holds
mod.rs 931 The window's state, session restore, tab and pane actions, and the top-level drawing
titlebar.rs 563 Title bar, tab strip, tab colours and badges, tab dragging, window controls
panes.rs 544 Pane tree, its layout, dividers and each pane's frame
socket_api.rs 517 Answering the socket API's requests
plugin_host.rs 396 Starting and reloading plugins, approvals, their prompts, pickers and logs
palettes.rs 386 Command palette, theme picker and tab colour picker

Code is moved, not changed. Comparing every line with the original, the only differences are the module boilerplate, one signature rustfmt rewrapped, and four section-divider comments the files replace.

  • The 15 tests moved with the code they test.
  • 28 items gained pub(super), only where one file has to reach another. Nothing is newly visible outside workspace.
  • plugin_host and socket_api are named that way because plugins and api would clash with the top-level modules.
  • The source layout table in docs/development.md lists the six files.

Git shows workspace.rs as deleted rather than renamed, because less than half of it stayed in mod.rs. git log --follow and git blame -C still trace the lines.

Not done here: handle_api is still one 332-line function, now in socket_api.rs.

The window's code moves into src/workspace/: the title bar, the pane tree, the palettes, plugins, and the socket API each get a file, and mod.rs keeps the window's state, its actions and the top-level drawing. Code is moved, not changed: tests go with what they test, and 28 items gain pub(super) so one file can reach another.
@sn sn self-assigned this Nov 19, 2026
@sn
sn merged commit 01d2826 into main Nov 19, 2026
2 checks passed
@sn
sn deleted the refactor/split-workspace branch November 19, 2026 15:46
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