JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
feat(tui-frontend): page btw overlay with ctrl+p/ctrl+n, close btw overlay with Enter/Space/ctrl+c
ldstyle8c1cd98b7d469
diff --git a/jiuwenswarm/agents/harness/common/rails/ask_user_rail.py b/jiuwenswarm/agents/harness/common/rails/ask_user_rail.pyindex 9cc6fd33f8..1ef48518d2 100644--- a/jiuwenswarm/agents/harness/common/rails/ask_user_rail.py+++ b/jiuwenswarm/agents/harness/common/rails/ask_user_rail.py@@ -56,7 +56,7 @@ _QUESTIONS_ITEM_SCHEMA: dict[str, Any] = {},"header": {"type": "string",- "description": "A short label displayed as a chip/tag (max 12 chars).",+ "description": "A short label displayed as a chip/tag.",},"options": {"type": "array",diff --git a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.tsindex a65e244196..f24a834b12 100644--- a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts+++ b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts@@ -3586,6 +3586,21 @@ export class AppScreen implements Component, Focusable {return true;}+ // Enter / Space / ctrl+c 关闭 btw 浮层(对齐 Esc:关闭 overlay + 取消进行中的 btw 请求)+ if (+ matchesKey(data, "enter") ||+ matchesKey(data, "return") ||+ matchesKey(data, "space") ||+ matchesKey(data, "ctrl+c")+ ) {+ this.state.clearBtwOverlay();+ this.btwOverlayScrollOffset = 0;+ this.state.requestLocalInterrupt();+ this.state.setBtwActive(false);+ this.tui.requestRender();+ return true;+ }+// ←/→ 在 btw 历史间切换(必须在 scroll 之前消费,避免落入 composer)if (matchesKey(data, "left")) {this.state.navigateBtw(-1);@@ -3615,6 +3630,17 @@ export class AppScreen implements Component, Focusable {}const pageSize = Math.max(1, Math.floor(this.tui.terminal.rows * 0.8));+ // ctrl+p / ctrl+n 翻页(对齐 PgUp/PgDn)+ if (matchesKey(data, "ctrl+p")) {+ this.btwOverlayScrollOffset = Math.max(0, this.btwOverlayScrollOffset - pageSize);+ this.tui.requestRender();+ return true;+ }+ if (matchesKey(data, "ctrl+n")) {+ this.btwOverlayScrollOffset += pageSize;+ this.tui.requestRender();+ return true;+ }if (matchesKey(data, "up")) {this.btwOverlayScrollOffset = Math.max(0, this.btwOverlayScrollOffset - 1);this.tui.requestRender();diff --git a/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.ts b/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.tsindex 3e2447e037..7cd5356b97 100644--- a/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.ts+++ b/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.ts@@ -270,12 +270,12 @@ function renderBtwOverlay(const showHistory = total > 1;const posLabel = showHistory ? `${(overlayIndex ?? 0) + 1}/${total}` : "";// 用数组拼接避免尾部多余管道符(不可滚动分支末尾不再出现 " | ")- const hintParts = ["Esc dismiss"];+ const hintParts = ["Esc/Enter/Space/ctrl+c dismiss"];if (showHistory) hintParts.push(`←/→ history ${posLabel}`);hintParts.push("c copy");hintParts.push("x delete");if (answerLines.length > bodyHeight) {- hintParts.push("↑/↓ scroll", "PgUp/PgDn page", `${rangeStart}-${rangeEnd}/${answerLines.length}`);+ hintParts.push("↑/↓ scroll", "PgUp/PgDn·ctrl+p/n page", `${rangeStart}-${rangeEnd}/${answerLines.length}`);}const scrollHint = hintParts.join(" | ");