Repository navigation
docs(panel-terminal): cut the context down to current behaviour and invariants (#1355) - #1382
Merged
Merged
Conversation
…nvariants (#1355) State current behaviour and its invariants with their reasons; correct nine statements the code no longer matches; drop history and narration. Every quoted section name cited elsewhere still resolves.
The re-open after a mid-spawn close follows the fulfilled open request and an unawaited stop, not the old PTY's exit; a rejected open re-opens nothing. The hidden-write guarantee covers the PTY data path only.
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
Part 12 of #1355:
.ai/contexts/panel-terminal.mdnow states current behaviour and its invariants, with the reason behind each rule kept.Corrected (old → new):
file-panel.jshas "three hooks only" → four (setPanelTerminalShellOnlyfromrenderTabContentwas missing).projectPath(shell profile), never the working directory.isPlainTerminalreader list → names the quit inventory (session-exit.js), which readspanelForand counts shells underpanels.showSessionuses the warm set (webglWarmTouch); the shell's context is the pair's.style.height"holds what the last drag asked for" → it holds the clamped display.initPanelTerminalalso sets it from storage.open-terminalrequest fulfils, right after a stop that is issued but not awaited, and only if the panel still shows that owner; nothing orders it after the old PTY's exit. A rejectedopenTerminalruns only itsfinally: no stop, no re-open, no refusal.terminal.write()calls" → that holds for the PTY data path (handleTerminalData);notePanelTerminalExitwrites a hidden shell's exit banner directly.stopPanelShell"both of its callers" → three call sites, the third inopenPanelTerminal's closed-while-spawning branch..visiblesweep is document-wide.Added: the projects worker's snapshot copies
panelFor; the region opens before the new terminal is measured (cited bypublic/panel-terminal.js, no text answered it); height default and clamp edge cases; the Shell toggle intool-bar.js;createSplitter's refusal anddestroy().Every quoted section name other files cite still resolves to a heading or bold phrase that holds the cited content: 16 pointers, 0 failures. That includes the name split across two comment lines in
test/build-projects-panel-shell.test.js.Docs
Agent docs only:
.ai/contexts/panel-terminal.md. No user-visible change.no-changelog.Tests
node scripts/check-docs.js --validate: passed.node scripts/check-doc-refs.js: 0 failures.git diff --check: clean.check-pointers.js, no exemption list): 16 pointers, 0 failures. On a copy with two names broken it fails with 3 failures, including the split-line pointer.test/panel-terminal.test.js,test/build-projects-panel-shell.test.js,test/panel-terminal-target.test.js) were run under Node 22 with--test-concurrency=1: 62 pass, 0 fail.Not verified
loadTerminalWebglcomment. It was not measured.tool-bar.md. They were not checked againststyle.css.test/projects-worker-equivalence.test.jsfails ifprojectsSnapshot()stops copyingpanelForwas not checked with a mutation.Invariants kept
Section names kept with their content: "Main process", "A panel shell is not a session", "Mount point", "Layout", "Lifecycle — one shell per session", "Spawn races", "The ordering rule", "LRU", "The refusal", "The third splitter", "Not in scope". Heading levels are unchanged.
isPanelShellSession, and the quit inventory counts shells aspanels..visiblesweeps use:not(.panel-terminal), with the reason. Widening either one makes a test fail.hideGridViewskips a mounted shell, and the reason is the ~16 context cap.panelMounted.panel:<owner>id. Re-key moves the panel state, with the knownpanelForlimit.applyProcessExitbranches, with the reason.destroyPanelTerminalForaccepts either id shape.