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(web): position mention remove action
chensheng12345398ca0759db8
diff --git a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.tsindex adaca7e4a3..5291b5c326 100644--- a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts+++ b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts@@ -121,6 +121,19 @@ const SWARM_WORKFLOW_LOG_PREVIEW_ROWS = 8;const SWARM_WORKFLOW_AGENT_TEXT_PREVIEW_ROWS = 6;const PERMISSION_TOOL_RE = /工具\s+`([^`]+)`\s+需要授权/;const CONFIRM_TOOL_RE = /(?:Tool|工具)\s*:\s*`([^`]+)`/i;++/**+ * Terminal mouse reporting takes ownership of drag events, which prevents the+ * terminal's native text selection and copy behaviour. Keep it scoped to UI+ * states that actually need mouse events; a scrollable transcript can still be+ * navigated with the keyboard without making the whole chat unselectable.+ */+export function shouldCaptureTerminalMouse(+ pendingQuestionActive: boolean,+ interactiveOverlayActive: boolean,+): boolean {+ return pendingQuestionActive || interactiveOverlayActive;+}const CONFIRM_ACTION_RE = /\*\*(?:Agent wants to|Tool `[^`]+` requires your approval)([^*]*)\*\*/i;const PLAN_REJECT_INPUT_RE = /(\s+\[ .+ \])$/;const PERMISSION_RISK_RE = /安全风险评估:\**\s*([^\s*]+)?\s*\**([^*\n]+?风险)\**/m;@@ -2936,10 +2949,6 @@ 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 ||@@ -2954,9 +2963,7 @@ export class AppScreen implements Component, Focusable {this.configEditorState !== null ||this.questionList !== null;this.setMouseTrackingEnabled(- transcriptMayScroll ||- snapshot.pendingQuestion !== null ||- interactiveOverlayActive,+ shouldCaptureTerminalMouse(snapshot.pendingQuestion !== null, interactiveOverlayActive),);if (this.transcriptScrollOffset > 0 &&diff --git a/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.ts b/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.tsindex f3cf4a560d..4d4d607516 100644--- a/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.ts+++ b/jiuwenswarm/channels/tui/frontend/src/ui/screen-layout.ts@@ -1,8 +1,7 @@import type { AppSnapshot } from "../app-state.js";import { isTeamMode } from "../core/modes.js";-import { renderMiniTeamTree, renderTeamPanel } from "./components/team-panel.js";+import { renderTeamPanel } from "./components/team-panel.js";import { isTeamWorking } from "./components/team-shared.js";-import { renderTeamStatusPill } from "./components/team-status-pill.js";import { renderTodoList } from "./components/todo-list.js";import { APP_SCREEN_KEY_BINDINGS } from "./keymap.js";import { padToWidth, renderWrappedText } from "./rendering/text.js";@@ -338,15 +337,9 @@ export function buildAppScreenLines(snapshot: AppSnapshot, options: ScreenLayoutsnapshot.teamMemberEvents.length > 0 ||snapshot.teamTaskEvents.length > 0 ||snapshot.teamMessageEvents.length > 0;- const teamStatusLines =- hasTeamActivity- ? renderTeamStatusPill(- snapshot.teamMemberEvents,- snapshot.teamTaskEvents,- snapshot.teamMessageEvents,- options.width,- )- : [];+ // Team events remain in the session after a task or mode switch. Keep them+ // out of the main composer area and render details only when the user opens+ // the Team panel explicitly with Ctrl+G.const teamPanelLines =options.showTeamPanel && hasTeamActivity? renderTeamPanel(@@ -358,23 +351,9 @@ export function buildAppScreenLines(snapshot: AppSnapshot, options: ScreenLayoutoptions.viewedTeamMemberId,): [];- const miniTeamTreeLines =- !options.showTeamPanel && hasTeamActivity- ? renderMiniTeamTree(- snapshot.teamMemberEvents,- snapshot.teamTaskEvents,- snapshot.teamMessageEvents,- options.width,- )- : [];const fixedLinesBeforeBtw = [...todoLines,- ...(todoLines.length > 0 &&- (teamStatusLines.length > 0 || miniTeamTreeLines.length > 0 || teamPanelLines.length > 0)- ? [" ".repeat(options.width)]- : []),- ...teamStatusLines,- ...miniTeamTreeLines,+ ...(todoLines.length > 0 && teamPanelLines.length > 0 ? [" ".repeat(options.width)] : []),...teamPanelLines,...options.questionLines,];diff --git a/jiuwenswarm/channels/tui/frontend/tests/run-tests.mjs b/jiuwenswarm/channels/tui/frontend/tests/run-tests.mjsindex 5da43d8869..9831c7e611 100644--- a/jiuwenswarm/channels/tui/frontend/tests/run-tests.mjs+++ b/jiuwenswarm/channels/tui/frontend/tests/run-tests.mjs@@ -8,10 +8,12 @@ import {getPlanApprovalListLayout,getPlanRejectFeedbackHint,isPlanApprovalRequest,+ shouldCaptureTerminalMouse,shouldAppendPlanRejectFeedback,shouldCollectPlanRejectFeedback,} from "../dist/ui/app-screen.js";import { planSwarmflowToggle } from "../dist/core/commands/builtins/swarmflow.js";+import { buildAppScreenLines } from "../dist/ui/screen-layout.js";import {canOpenSessionHistory,groupWorkflowAgentsByName,@@ -75,6 +77,90 @@ assert.equal();assert.deepEqual(getPlanApprovalListLayout(), { minPrimaryColumnWidth: 10, maxPrimaryColumnWidth: 10 });+// A long/scrollable transcript must not capture drag events: users should be+// able to select and copy completed responses with the terminal's native UI.+assert.equal(shouldCaptureTerminalMouse(false, false), false);+assert.equal(shouldCaptureTerminalMouse(true, false), true);+assert.equal(shouldCaptureTerminalMouse(false, true), true);++const teamSnapshot = {+ connectionStatus: "connected",+ sessionId: "team-session",+ mode: "code.normal",+ themeName: "default",+ accentColor: "blue",+ transcriptMode: "compact",+ transcriptFoldMode: "none",+ collapsedToolGroupIds: new Set(),+ entries: [],+ toolExecutions: [],+ streamingState: "idle",+ pendingQuestion: null,+ lastError: null,+ isProcessing: false,+ cancellableWork: false,+ isPaused: false,+ isInterrupted: false,+ activeSubtasks: [],+ todos: [],+ teamMemberEvents: [+ {+ id: "member-ready",+ type: "team.member.status_changed",+ teamId: "team-1",+ memberId: "member-1",+ newStatus: "idle",+ timestamp: Date.now(),+ },+ ],+ teamTaskEvents: [],+ teamMessageEvents: [],+ workflowRuns: [],+ pendingHumanPrompts: new Map(),+ evolutionStatus: "idle",+ contextCompression: null,+ contextWindowLimit: null,+ contextUsedPercentage: null,+ modelInfo: { provider: "", model: "", version: "" },+ preferredLanguage: "zh",+ sessionTitle: "",+ statusLineText: null,+ memoryWarnings: [],+ runningCommand: null,+ streamStalled: false,+ streamIdleMs: null,+ currentQueryUsage: { input_tokens: 0, output_tokens: 0, total_tokens: 0 },+ btwOverlay: null,+ btwOverlayIndex: -1,+ btwOverlayTotal: 0,+ btwActive: false,+};+const teamLayoutOptions = {+ width: 80,+ questionLines: [],+ editorLines: [],+ composerPreviewLines: [],+ showFullThinking: false,+ showToolDetails: false,+ showShortcutHelp: false,+ todosCollapsed: false,+ showTeamPanel: false,+ selectedTeamMemberId: "member-1",+ viewedTeamMemberId: null,+ transientNotice: null,+ animationPhase: 0,+ overlayTranscriptLines: [],+};+const collapsedTeamLines = buildAppScreenLines(teamSnapshot, teamLayoutOptions);+assert.equal(collapsedTeamLines.some((line) => line.includes("teammate")), false);+assert.equal(collapsedTeamLines.some((line) => line.includes("Member 1")), false);++const expandedTeamLines = buildAppScreenLines(teamSnapshot, {+ ...teamLayoutOptions,+ showTeamPanel: true,+});+assert.equal(expandedTeamLines.some((line) => line.includes("teammate")), true);+const slashCommands = AppScreen.prototype.buildSlashCommands.call({commands: {getAll: () => [diff --git a/jiuwenswarm/channels/web/frontend/src/components/ChatPanel/ChatPanel.css b/jiuwenswarm/channels/web/frontend/src/components/ChatPanel/ChatPanel.cssindex 6278d21292..b21bfc5267 100644--- a/jiuwenswarm/channels/web/frontend/src/components/ChatPanel/ChatPanel.css+++ b/jiuwenswarm/channels/web/frontend/src/components/ChatPanel/ChatPanel.css@@ -899,6 +899,15 @@ overflow: hidden;height: 12px;}+/* Member/role chips have no leading icon container. Keep their remove action+ in a reserved trailing slot so it never covers the member name on hover. */+.chat-input-chip-inline--member .chat-input-chip-inline__remove,+.chat-input-chip-inline--role .chat-input-chip-inline__remove {+ position: static;+ transform: none;+ color: var(--color-action-primary);+}+.chat-input-chip-inline:hover .chat-input-chip-inline__icon::before {opacity: 0;}diff --git a/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json b/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.jsonindex a2f253db1f..ad131335ba 100644--- a/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json+++ b/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json@@ -2077,7 +2077,7 @@"workDescription": "Office, collaboration, and general tasks","codeDescription": "Inspect and modify code in a project directory","environment": "Environment",- "changes": "Changes",+ "changes": "Current Turn Changes","review": "Review"},"multiSession": {diff --git a/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json b/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.jsonindex adef95410e..22f802256b 100644--- a/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json+++ b/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json@@ -2081,7 +2081,7 @@"workDescription": "处理办公、协作和通用任务","codeDescription": "在项目目录中查看并修改代码","environment": "环境信息",- "changes": "变更",+ "changes": "本轮变更","review": "审核"},"multiSession": {