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
fix(tui): help支持esc退出
kdgmpw230d5995aae1
diff --git a/jiuwenswarm/channels/tui/frontend/src/app-state.ts b/jiuwenswarm/channels/tui/frontend/src/app-state.tsindex 629a059b58..112d2751b1 100644--- a/jiuwenswarm/channels/tui/frontend/src/app-state.ts+++ b/jiuwenswarm/channels/tui/frontend/src/app-state.ts@@ -1202,6 +1202,19 @@ export class CliPiAppState {this.emitChange();};+ readonly isHelpVisible = (): boolean => {+ if (this.entries.length === 0) return false;+ const lastEntry = this.entries[this.entries.length - 1];+ return lastEntry?.kind === "info" && lastEntry.meta?.view === "help";+ };++ readonly dismissHelp = (): boolean => {+ if (!this.isHelpVisible()) return false;+ this.entries = this.entries.slice(0, -1);+ this.emitChange();+ return true;+ };+readonly beginDeferredTranscript = (): void => {this.deferTranscriptFrames = true;};diff --git a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.tsindex e5ed159913..0481fc4cfc 100644--- a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts+++ b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts@@ -1797,6 +1797,14 @@ export class AppScreen implements Component, Focusable {return;}+ // ESC 关闭 help 视图(只读,无输入栏)+ if (!pendingQuestion && !hasOverlay && !snapshot.cancellableWork && isCancelWorkKey) {+ if (this.state.dismissHelp()) {+ this.tui.requestRender();+ return;+ }+ }+if (this.startupPromptList !== null && matchesKey(data, "ctrl+c")) {this.startupPromptList.handleInput(data);this.tui.requestRender();@@ -2195,6 +2203,10 @@ export class AppScreen implements Component, Focusable {}}+ if (!snapshot.pendingQuestion && this.state.isHelpVisible()) {+ return;+ }+// Detect pasted file paths (drag-and-drop) in the terminal// When files are dragged in, they arrive as a pasted string.// Windows/PowerShell may not send bracketed paste markers,@@ -2248,12 +2260,14 @@ export class AppScreen implements Component, Focusable {// search_list/select_value phase: no text input needed in the main editor.// The resume picker has its own search input, so hide the main editor while it is// open to avoid a misleading second input bar (restored on Esc). Mirrors Claude Code.+ // /help is read-only transcript content — hide the composer until Esc dismisses it.const isConfigEditorActive = this.configEditorState !== null;const hideEditorForInlinePlanReject = this.isEditingInlinePlanReject(snapshot);const hideMainEditor =isConfigEditorActive ||hideEditorForInlinePlanReject ||- this.resumeSessionList !== null;+ this.resumeSessionList !== null ||+ this.state.isHelpVisible();const editorLines = hideMainEditor? []: this.applySlashCommandHint(this.editor.render(width), width);