From 50ae739a4db8236b57a167f602568ad6921718ee Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 24 Jun 2026 14:33:55 +0800 Subject: [PATCH] fix: resolve stylelint warnings and enhance bubble layout for agent assistant --- src/components/agent/AgentAssistantEntry.vue | 77 +++++++++++--------- 1 file changed, 44 insertions(+), 33 deletions(-) diff --git a/src/components/agent/AgentAssistantEntry.vue b/src/components/agent/AgentAssistantEntry.vue index 74a5944d..b67ae6b9 100644 --- a/src/components/agent/AgentAssistantEntry.vue +++ b/src/components/agent/AgentAssistantEntry.vue @@ -382,7 +382,10 @@ function pauseFabAutoDock() { // 返回下一次趣味动作的随机等待时间,让动作出现节奏更自然。 function getFabRandomActionDelay() { - return FAB_RANDOM_ACTION_MIN_DELAY + Math.round(Math.random() * (FAB_RANDOM_ACTION_MAX_DELAY - FAB_RANDOM_ACTION_MIN_DELAY)) + return ( + FAB_RANDOM_ACTION_MIN_DELAY + + Math.round(Math.random() * (FAB_RANDOM_ACTION_MAX_DELAY - FAB_RANDOM_ACTION_MIN_DELAY)) + ) } // 判断当前交互状态是否适合播放随机动作,避免干扰半隐藏、拖拽和思考态。 @@ -461,7 +464,8 @@ function runFabRandomAction() { // 根据当前显示和交互状态同步随机动作队列。 function syncFabRandomActionSchedule() { if (canRunFabRandomAction()) { - if (!fabRandomAction.value && fabRandomActionTimer === null && fabRandomActionEndTimer === null) scheduleFabRandomAction() + if (!fabRandomAction.value && fabRandomActionTimer === null && fabRandomActionEndTimer === null) + scheduleFabRandomAction() return } @@ -658,7 +662,10 @@ function setFabDocked(docked: boolean) { updateFabPosition({ ...currentPosition, - x: Math.min(currentPosition.x, Math.max(0, getViewportSize().width - getOpenFabSize().width - FAB_DEFAULT_RIGHT_OFFSET)), + x: Math.min( + currentPosition.x, + Math.max(0, getViewportSize().width - getOpenFabSize().width - FAB_DEFAULT_RIGHT_OFFSET), + ), }) scheduleFabAutoDock() } @@ -676,7 +683,6 @@ function handleFabTriggerPointerDown(event: PointerEvent) { startY: currentPosition.y, moved: false, } - ;(event.currentTarget as HTMLElement).setPointerCapture?.(event.pointerId) } @@ -817,10 +823,7 @@ defineExpose({ v-for="bubble in fabBubbles" :key="bubble.id" class="agent-assistant-fab__bubble" - :class="[ - `agent-assistant-fab__bubble--${bubble.kind}`, - `agent-assistant-fab__bubble--${bubble.variant}`, - ]" + :class="[`agent-assistant-fab__bubble--${bubble.kind}`, `agent-assistant-fab__bubble--${bubble.variant}`]" role="status" > @@ -874,6 +877,7 @@ defineExpose({