Repository navigation
feat(web): a Terminals page for shells tied to no chat - #1032
Merged
Merged
Conversation
The rail gets a Terminals destination: a full-width page of terminal tabs and split panes that belong to no thread. "New tabs in" in the title row picks the project the next tab or split starts in, grouped under each computer's name; picking a project on another computer shows that computer's tabs. Each tab names its folder. Shells keep running while you browse threads, and nothing there starts an agent or makes a chat. Each server keeps its page's tabs under one reserved terminal thread id (TERMINALS_PAGE_THREAD_ID, "terminals-page"); requireThreadAbsent refuses to create a thread with it. Tab lists, history and "Run again" after a restart work as they do for a thread. The client keeps the page's layout through orphan cleanup and applies its terminal events with no thread behind them; removing a computer drops it. The thread drawer is unchanged for users. Its store wiring moves into a shared ManagedTerminalDrawer, the kill/restart question into TerminalStopConfirmDialog, and killing a tab into killTerminalTab; the drawer gains a page layout (fills the page, no hide or height edge, splits stack on phones, no "Restart here", no "Add to chat"). Killing a tab now also drops it from the local copy of the server's list, so an old list can't bring it back. Also: Cmd/Ctrl+Shift+J (navigate.terminals), the command palette (Open Terminals, and the terminal actions while the page is open), the desktop Go menu, the port-in-use notice's Show for a holder on the page, the app guide's Terminals place and topic, and docs/terminal.md.
…an't revive a killed one Killing a tab dropped it from this device's copy of the server's list before the server answered, and a failed close fell back to typing "exit" into the shell. When the kill failed, the page showed no tab while its shell still ran and held its port. Now the tab leaves the cached list only once close succeeds; on failure it comes back and a toast says the kill failed. The "exit" fallback stays only for servers without close. The thread drawer shares this code (killTerminalTab), so it gets the fix too. The kill/restart question (TerminalStopConfirmDialog) now knows its tab. It closes as soon as the tab leaves this device's layout (killed on another device), and Confirm re-checks first, so a Restart confirmed late can no longer start a shell another window just killed. Both the thread drawer and the Terminals page pass their tab in. The browser harness now answers terminal.close and terminal.clear the way the server does (nothing), instead of with a body the client rejects.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
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.
Closes #1017.
The terminal drawer inside a thread is tied to that thread's project, so watching a web server and an API from different projects meant switching chats or keeping another terminal window open. A new Terminals button in the left bar (Cmd/Ctrl+Shift+J, also in the command palette and the desktop Go menu) now opens a full-width page of terminal tabs and splits. "New tabs in [project]" picks the folder for the next tab or split, grouped by computer. Each computer keeps its own set of tabs, each tab names its folder, and shells keep running while you browse threads. Nothing on the page starts a chat or an agent. The per-thread drawer is unchanged for users; both now use one shared ManagedTerminalDrawer.
How it's kept: each computer's server holds the page's tabs under one reserved terminal thread id,
terminals-page(TERMINALS_PAGE_THREAD_ID in contracts). The server refuses to create a thread with that id. Tab lists, history and "Run again" after a restart work as they do for a thread, and deleting or archiving a thread never touches the page. The client exempts the key from orphan cleanup and from the unknown-thread event filter.Behavior in edge cases:
Known limits: a thread that already had the id
terminals-pagebefore this change would share the page's tabs; only a hand-made API call could have made one. On servers too old to send a tab list, a second device won't find the page's tabs and a tab's folder label is lost after a reload.Reviews: GPT-6.2 Astra reviewed the full diff (6 of 9 findings fixed; the rest are rare or app-wide), then the later store change and drawer extraction (no drawer regression; both bugs it found are fixed in the second commit). Also fixed: the browser test harness answered
terminal.closewith{}instead of nothing, which the old code hid by swallowing the error.Checked: fmt, lint, typecheck, web unit tests, server tests (decider, invariants, guide), contracts/shared/desktop tests, ThreadTerminalDrawer and ChatView.shell browser specs (63/63, three runs), full web browser suite (failures were in untouched files and passed alone), and a live run with a throwaway server.
This conflicts with #1031 (General chats placement) in NavigationRail.tsx and navigationRail.logic.ts; whichever merges second gets a rebase.