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): Fix TUI transcript scrolling after skills list
chensheng123453c546bd6eefb
diff --git a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.tsindex 92648a365e..2e474c53e4 100644--- a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts+++ b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts@@ -1304,6 +1304,7 @@ export class AppScreen implements Component, Focusable {private fileViewerState: FileViewerState | null = null;/** DiffViewer state for interactive diff browsing */private diffViewerState: DiffViewerState | null = null;+ private mouseTrackingEnabled = false;/** Previous session title for terminal window title sync. */private previousSessionTitle: string = "";@@ -1476,6 +1477,8 @@ export class AppScreen implements Component, Focusable {}private setMouseTrackingEnabled(enabled: boolean): void {+ if (this.mouseTrackingEnabled === enabled) return;+ this.mouseTrackingEnabled = enabled;if (enabled) {this.tui.terminal.write(ENABLE_MOUSE_TRACKING);} else {@@ -2696,6 +2699,28 @@ export class AppScreen implements Component, Focusable {pendingInput,pendingInputBaseline,).length;+ const approximateFixedHeight =+ questionLines.length + editorLines.length + composerPreviewLines.length + 2;+ const transcriptMayScroll =+ transcriptLineCount > Math.max(0, this.tui.terminal.rows - approximateFixedHeight);+ const interactiveOverlayActive =+ this.startupPromptList !== null ||+ this.resumeSessionList !== null ||+ this.statusViewState !== null ||+ this.mcpDetail !== null ||+ this.mcpList !== null ||+ this.mcpTools !== null ||+ this.modelList !== null ||+ this.toolSelector !== null ||+ this.themeList !== null ||+ this.swarmWorkflowsViewState !== null ||+ this.configEditorState !== null ||+ this.questionList !== null;+ this.setMouseTrackingEnabled(+ transcriptMayScroll ||+ snapshot.pendingQuestion !== null ||+ interactiveOverlayActive,+ );if (this.transcriptScrollOffset > 0 &&this.lastTranscriptLineWidth === width &&diff --git a/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.ts b/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.tsindex 227bf30e5d..c94de4abb2 100644--- a/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.ts+++ b/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.ts@@ -421,19 +421,6 @@ export function buildAppScreenLines(snapshot: AppSnapshot, options: ScreenLayout}const requestedOffset = Math.max(0, Math.floor(options.transcriptScrollOffset ?? 0));- const teamWorking =- isTeamMode(snapshot.mode) &&- isTeamWorking(snapshot.teamMemberEvents, snapshot.teamMessageEvents);- const liveTranscript =- snapshot.isProcessing ||- snapshot.isPaused ||- snapshot.cancellableWork ||- teamWorking ||- snapshot.workflowRuns.some((workflow) => workflow.status === "running");- if (requestedOffset === 0 && !liveTranscript) {- return [...transcriptLines, ...fixedLines];- }-const maxOffset = transcriptLines.length - transcriptHeight;const offset = Math.min(maxOffset, requestedOffset);if (offset !== requestedOffset) {