Add Window Projects panel for archiving and restoring terminal windows#620
Draft
YSaxon wants to merge 4 commits into
Draft
Add Window Projects panel for archiving and restoring terminal windows#620YSaxon wants to merge 4 commits into
YSaxon wants to merge 4 commits into
Conversation
Introduces a side-by-side panel (Window > Window Projects…) that lets
users organise iTerm2 windows into arbitrarily-nested projects:
• iTermWindowProjectsModel – data layer (projects, sub-projects, archived
windows). Persisted as JSON in ~/Library/Application Support/iTerm2/
WindowProjects.json.
• iTermProjectsPanelController – floating panel with an NSSplitView:
- Left: NSOutlineView showing the project tree. Each project can hold
sub-projects and archived (closed) windows. Hover preview shows an
ArrangementPreviewView for any archived window.
- Right: NSTableView listing every currently-open window. Hover preview
captures a live screenshot via CGWindowListCreateImage.
Actions: create/rename/delete projects & sub-projects; archive a
selected open window to a selected project (optionally closing it);
restore individual archived windows or all windows in a project.
Right-click context menus on both panes.
• Window > Window Projects… menu item wired to iTermApplicationDelegate.
https://claude.ai/code/session_011nQdWSvNudhnXQN7vu16YW
- Add Window > Window Projects… menu item (awakeFromNib, programmatic) - Add -showWindowProjectsPanel: IBAction to iTermApplicationDelegate - Register both new Swift files in iTerm2SharedARC target https://claude.ai/code/session_011nQdWSvNudhnXQN7vu16YW
- iTermWindowProject gains a lastUsed: Date field (backward-compatible;
defaults to distantPast on decode so older JSON sorts to the bottom)
- archiveWindow and restoreWindow/restoreAllWindows update lastUsed
- Projects pane header now has a two-segment control ("Name" / "Recent")
that re-sorts root and sub-project lists in the outline view on the fly;
"Recent" is the default
https://claude.ai/code/session_011nQdWSvNudhnXQN7vu16YW
Model (iTermWindowProjectsModel): - Add runtime liveAssociations ([windowNumber → projectID]) - associateWindow/disassociateWindow: mark open windows as belonging to a project without closing them - Auto-archive on close: NSWindow.willCloseNotification observer saves the window arrangement to its associated project when the window closes - closeProject: archive + close all live windows for a project - archivedWindow(id:) and project(id:) lookup helpers Panel UI (iTermProjectsPanelController): Left pane: now shows both live (bold, terminal.fill icon) and archived (grey, terminal icon) windows as leaves under each project. Double-click an open window → bring to front; double-click archived → restore. New "Close All" button + context menu item closes the selected project. Right pane: converted from NSTableView to NSOutlineView grouped by project. Each project that has open windows appears as an expandable group header. Unassociated open windows appear in an "Unassociated" section at the bottom. Bottom bar "Associate with Project" button (replaces old "Archive to Project") records the live association without closing the window. Drag-and-drop (all 6 semantic paths): right window → left project archive + close right window → right group reassign association (keep open) right window → Unassociated/root disassociate (keep open) right group → left pane close-all for that project left archived → right pane restore, remove archive entry left project → right pane restore all windows in project https://claude.ai/code/session_011nQdWSvNudhnXQN7vu16YW
Owner
|
This seems like a useful idea - basically a way of organizing arrangements. I think it would be better to start with a spec; the code as written is pretty far from being mergable. Do you have a vision for where this could go? It feels like a bigger idea is trapped inside waiting to get out. |
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.
Summary
Introduces a new "Window Projects" panel UI that allows users to organize, archive, and restore iTerm2 terminal windows into named project hierarchies. This feature enables saving window arrangements for later restoration while keeping projects organized in a tree structure.
Key Changes
New Panel UI (
iTermProjectsPanelController.swift):Data Model (
iTermWindowProjectsModel.swift):iTermWindowProject: Hierarchical project nodes supporting nested sub-projectsiTermArchivedWindow: Stores window metadata and binary-encoded arrangement dataProject Management Features:
Window Archiving:
UI Polish:
Integration:
iTermApplicationDelegate.mImplementation Details
CGWindowListCreateImagefor live thumbnailsArrangementPreviewViewcomponenthttps://claude.ai/code/session_011nQdWSvNudhnXQN7vu16YW