Fix docked-terminal behavior in OK Desktop and add Shift+Enter newline…#228
Merged
Conversation
* fix(open-knowledge): docked terminal launch + shift-key handling The docked terminal only mounted on the document-editor and empty-state views, so launching "Open with AI -> Claude" or pressing Cmd-J while viewing a folder, asset, or large file did nothing. Mount it from every active view via a withTerminalDock helper (split views wrap only the primary column so the side panel stays full-height). Also fix two xterm key behaviors in the terminal: - Shift+Tab no longer escapes focus out of the terminal; the reverse-tab sequence reaches the PTY (e.g. the Claude TUI mode toggle). - Shift+Enter inserts a newline instead of submitting, matching Ghostty and Cursor. PRD-7152 * test(open-knowledge): cover terminal dock in asset and large-file views The withTerminalDock fix touches the asset, large-file, and folder+agent-panel branches too, but only the simple folder branch had a regression test. Add asset and large-file view tests (bridge present -> dock wraps the view child; no bridge -> no dock) so a future bare-return regression in those branches fails the suite. Addresses PR review feedback on PRD-7152. * fix(open-knowledge): hoist docked terminal so it survives view switches Mounting a TerminalDock per view branch meant switching the active view kind (doc <-> folder <-> asset <-> large-file) or closing a tab remounted the dock, disposing xterm and killing the running PTY — the terminal reset on every tab switch. Hoist a single TerminalDock into the EditorArea wrapper, around EditorAreaInner, so it stays at one stable React position regardless of the active view. The PTY and scrollback now survive view-kind changes and tab closes. It docks full-width below the whole editor area (doc/agent side panels sit above it), the VS Code bottom-terminal shape. EditorAreaInner no longer mounts the dock; it only reads terminalVisible so the empty state can collapse to the mascot. Adds a regression test asserting the dock is not remounted across view-kind switches. Addresses PR review feedback on PRD-7152. * docs(open-knowledge): note terminal persistence in changeset * docs(open-knowledge): correct Shift-chord test comment to cover both keys * refactor(open-knowledge): dock terminal in the editor column, kept persistent The previous fix hoisted one TerminalDock to wrap the whole editor area, which fixed session persistence but docked the terminal full-width below the right (doc/agent) panel. Restructure EditorAreaInner into a single stable horizontal skeleton: the active view's content + the terminal live in the left column, and the doc/agent panel is a sibling on the right that keeps its full height. The left column stays at one React position across every view kind, so the terminal PTY still survives tab switches and view-kind changes; it just no longer spans under the side panel. The doc-panel state is already null-safe when that panel isn't rendered, so non-doc views render the column full-width with no panel. Tests: passthrough-mock the resizable primitives (every view now renders inside the shared skeleton) and keep the cross-view no-remount persistence regression. * feat(open-knowledge): let the docked terminal grow to 95% of the dock Raise the terminal panel maxSize from 50% to 95% and drop the editor panel minSize from 20% to 5% so the drag can actually reach it. Users can now pull the terminal nearly full-height for long CLI sessions. * docs(open-knowledge): note terminal persistence + resize in changeset * docs(open-knowledge): refresh per-view terminal test comment for hoisted dock * fix(open-knowledge): drop editor-column panel id that broke doc-panel sticky width The restructure added id="editor-column" to the left ResizablePanel. That changed how react-resizable-panels redistributes space on the imperative doc-panel resize, so the ResizeObserver pixel-width sticky restore landed short (qa-sidebar-responsive QA-041: panel 382px instead of the persisted ~340px when the window widened to 1700px). The left panel is always the first child, so React keeps it mounted across right-panel toggles without an explicit id — the terminal still persists. Removing the id makes the web-host doc view byte-identical to the pre-restructure layout. * fix(open-knowledge): render hash-load skeleton outside the panel group The doc-load skeleton was rendered inside the shared horizontal panel group (one panel), then the doc panel was added when the provider landed. That 1→3 panel-count transition corrupted react-resizable-panels' doc-panel pixel-width sticky restore — on a later window widen the panel grew instead of staying put (qa-sidebar-responsive QA-041: 382px vs the persisted ~340px). Return the skeleton as a standalone early-return (as the pre-restructure code did), so when the doc lands its group mounts fresh with the doc panel already present — no panel-count transition. Switching between already-loaded tabs never hits the skeleton (the provider is ready), so the terminal still persists across tab switches. Verified locally: QA-041 + full qa-sidebar-responsive (41) + editor-area- viewport-resize + editor-tabs (20) all green. * test(open-knowledge): lock hash-load skeleton renders outside the panel group GitOrigin-RevId: 500de35a5291ac52cfed4fb91a56f9fc22a6d771
Contributor
There was a problem hiding this comment.
Automated approval from agents-private public-mirror-sync (run: https://github.com/inkeep/agents-private/actions/runs/27990083330). Source of truth is the monorepo; direct edits on inkeep/open-knowledge are overwritten on next sync.
|
|
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.
Fix docked-terminal behavior in OK Desktop and add Shift+Enter newline support.