Skip to content

Commit 035eff6

Browse files
committed
fix(v2): 「移到后台」挪进输入框页脚行(与 Full Auto 双三角同排)
用户反馈浮在输入框上方的大按钮难看。挪进 InputFooter(页脚一行: Full Auto 三态 · 免责声明 · 移到后台),同一行同一字号同一灰度。 触发条件不变(回合有阻塞中的 shell/subagent 工具时出现,回合 结束自然消失)
1 parent 5fce4d0 commit 035eff6

3 files changed

Lines changed: 39 additions & 17 deletions

File tree

‎src/features/chat/ChatPane.tsx‎

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -967,22 +967,6 @@ export const ChatPane = memo(function ChatPane({
967967
/>
968968

969969
<div ref={inputBoxWrapperRef} className="absolute bottom-0 left-0 right-0 z-10 pointer-events-none">
970-
{/* 移到后台:shell/task 工具阻塞回合时出现(官方 BackgroundMoveHint
971-
同款克制呈现:小号 ghost 文字按钮,不压输入框、不抢眼;
972-
回合结束自然消失) */}
973-
{blockingBackgroundTasks.length > 0 && (
974-
<div className="absolute bottom-full inset-x-0 flex justify-center pb-1.5 z-20">
975-
<button
976-
type="button"
977-
disabled={backgroundMoving}
978-
onClick={() => void handleMoveToBackground()}
979-
className="pointer-events-auto px-2 py-1 rounded-md text-[length:var(--fs-sm)] text-text-400 hover:text-text-200 hover:bg-bg-200/60 transition-colors disabled:opacity-50"
980-
title={blockingBackgroundTasks.map(task => task.label).join('、')}
981-
>
982-
{t('chat:sessionBackground.move', { count: blockingBackgroundTasks.length })}
983-
</button>
984-
</div>
985-
)}
986970
{(showCancelHint || (fullAutoHint && !showCancelHint)) && (
987971
<div className="absolute bottom-full inset-x-0 flex justify-center pb-2 pointer-events-none z-20">
988972
<div className="px-3 py-1.5 glass border border-border-200/60 rounded-lg shadow-lg text-[length:var(--fs-sm)] text-text-300 animate-in fade-in slide-in-from-bottom-2 duration-150">
@@ -1030,6 +1014,9 @@ export const ChatPane = memo(function ChatPane({
10301014
composerDraft={composerDraft}
10311015
busyDelivery={busyDelivery}
10321016
onBusyDeliveryChange={setBusyDelivery}
1017+
backgroundTasks={blockingBackgroundTasks}
1018+
onMoveToBackground={() => void handleMoveToBackground()}
1019+
backgroundMoving={backgroundMoving}
10331020
canRedo={canRedo}
10341021
revertSteps={redoSteps}
10351022
onRedo={handleRedoWithAnimation}

‎src/features/chat/InputBox.tsx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ export interface InputBoxProps {
165165
nonce: number
166166
restoreStash: boolean
167167
} | null
168+
/** 阻塞中的后台任务(非空时页脚显示「移到后台」入口) */
169+
backgroundTasks?: Array<{ label: string }>
170+
onMoveToBackground?: () => void
171+
backgroundMoving?: boolean
168172
/** busy 时的投递方式:steer=插队本轮 / queue=排队下轮(流式期间输入栏可切换) */
169173
busyDelivery?: 'queue' | 'steer'
170174
onBusyDeliveryChange?: (delivery: 'queue' | 'steer') => void
@@ -217,6 +221,9 @@ function InputBoxComponent({
217221
composerDraft,
218222
busyDelivery,
219223
onBusyDeliveryChange,
224+
backgroundTasks,
225+
onMoveToBackground,
226+
backgroundMoving,
220227
canRedo = false,
221228
revertSteps = 0,
222229
onRedo,
@@ -1622,6 +1629,9 @@ function InputBoxComponent({
16221629
sessionId={sessionId}
16231630
onNewChat={onNewChat}
16241631
inputContainerRef={inputContainerRef}
1632+
backgroundTasks={backgroundTasks}
1633+
onMoveToBackground={onMoveToBackground}
1634+
backgroundMoving={backgroundMoving}
16251635
/>
16261636
</div>
16271637
</div>

‎src/features/chat/input/InputFooter.tsx‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,19 @@ interface InputFooterProps {
2828
sessionId?: string | null
2929
onNewChat?: () => void
3030
inputContainerRef?: RefObject<HTMLDivElement | null>
31+
/** 阻塞中的后台任务(非空时显示「移到后台」入口,官方 BackgroundMoveHint 同款克制呈现) */
32+
backgroundTasks?: Array<{ label: string }>
33+
onMoveToBackground?: () => void
34+
backgroundMoving?: boolean
3135
}
3236

33-
export const InputFooter = memo(function InputFooter({ paneId, onNewChat }: InputFooterProps) {
37+
export const InputFooter = memo(function InputFooter({
38+
paneId,
39+
onNewChat,
40+
backgroundTasks,
41+
onMoveToBackground,
42+
backgroundMoving,
43+
}: InputFooterProps) {
3444
const { t } = useTranslation(['chat', 'common'])
3545
const fullAutoMode = useFullAutoMode(paneId)
3646

@@ -65,6 +75,21 @@ export const InputFooter = memo(function InputFooter({ paneId, onNewChat }: Inpu
6575
<button onClick={onNewChat} className="hover:text-text-300 transition-colors">
6676
{t('inputFooter.pleaseVerify')}
6777
</button>
78+
79+
{/* 移到后台(官方 BackgroundMoveHint 同款位置与重量:页脚一行的小字入口) */}
80+
{backgroundTasks && backgroundTasks.length > 0 && onMoveToBackground && (
81+
<>
82+
<span className="text-text-500/30 shrink-0">·</span>
83+
<button
84+
onClick={onMoveToBackground}
85+
disabled={backgroundMoving}
86+
className="hover:text-text-300 transition-colors disabled:opacity-50"
87+
title={backgroundTasks.map(task => task.label).join('、')}
88+
>
89+
{t('chat:sessionBackground.move', { count: backgroundTasks.length })}
90+
</button>
91+
</>
92+
)}
6893
</div>
6994
)
7095
})

0 commit comments

Comments
 (0)