Skip to content

Fix docked-terminal behavior in OK Desktop and add Shift+Enter newline…#228

Merged
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync
Jun 22, 2026
Merged

Fix docked-terminal behavior in OK Desktop and add Shift+Enter newline…#228
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync

Conversation

@inkeep-oss-sync

Copy link
Copy Markdown
Contributor

Fix docked-terminal behavior in OK Desktop and add Shift+Enter newline support.

  • The docked terminal is available in every view and survives navigation. It now opens from folder, asset, and large-file views (previously it only mounted on the document editor and empty state, so "Open with AI → Claude" or ⌘J did nothing there). A single terminal is docked in the editor column — beside the doc/properties panel, which keeps its full height — and the session stays alive across tab switches, view-kind changes, and tab closes, instead of resetting each time.
  • The terminal can be resized much taller. Drag it up to 95% of the dock height for long CLI sessions (it was capped at 50%).
  • Shift+Tab stays in the terminal. It previously moved focus out of the terminal instead of reaching the running CLI (e.g. the Claude TUI's mode toggle); the keystroke now reaches the PTY.
  • Shift+Enter inserts a newline instead of submitting, matching how Ghostty and Cursor map the chord.

* 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

@inkeep-internal-ci inkeep-internal-ci Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@inkeep-oss-sync inkeep-oss-sync Bot merged commit e52ec2e into main Jun 22, 2026
@inkeep-oss-sync inkeep-oss-sync Bot deleted the copybara/sync branch June 22, 2026 23:07
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants