diff --git a/static/src/app/methods/taskPolling.ts b/static/src/app/methods/taskPolling.ts index f51947f..9faf473 100644 --- a/static/src/app/methods/taskPolling.ts +++ b/static/src/app/methods/taskPolling.ts @@ -824,6 +824,9 @@ export const taskPollingMethods = { if (this.rightWidth < this.minPanelWidth) { this.rightWidth = this.minPanelWidth; } + if (this.isMobileViewport && this.activeMobileOverlay !== 'approval') { + this.openMobileOverlay('approval'); + } this.$forceUpdate(); }, @@ -837,6 +840,9 @@ export const taskPollingMethods = { ); if (!this.pendingToolApprovals.length) { this.rightCollapsed = true; + if (this.isMobileViewport && this.activeMobileOverlay === 'approval') { + this.closeMobileOverlay(); + } } this.$forceUpdate(); }, diff --git a/static/src/app/methods/ui.ts b/static/src/app/methods/ui.ts index 8ada1dc..8ff8d05 100644 --- a/static/src/app/methods/ui.ts +++ b/static/src/app/methods/ui.ts @@ -689,6 +689,9 @@ export const uiMethods = { async fetchPendingToolApprovals() { if (!this.currentConversationId) { this.pendingToolApprovals = []; + if (this.isMobileViewport && this.activeMobileOverlay === 'approval') { + this.closeMobileOverlay(); + } return; } try { @@ -706,6 +709,11 @@ export const uiMethods = { if (this.rightWidth < this.minPanelWidth) { this.rightWidth = this.minPanelWidth; } + if (this.isMobileViewport && this.activeMobileOverlay !== 'approval') { + this.openMobileOverlay('approval'); + } + } else if (this.isMobileViewport && this.activeMobileOverlay === 'approval') { + this.closeMobileOverlay(); } } catch (_error) { // ignore @@ -740,6 +748,9 @@ export const uiMethods = { ); if (!this.pendingToolApprovals.length) { this.rightCollapsed = true; + if (this.isMobileViewport && this.activeMobileOverlay === 'approval') { + this.closeMobileOverlay(); + } } } catch (error) { const msg = error instanceof Error ? error.message : String(error || '审批失败');