Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style(chat): AskUserQuestion polish — lighter selected option & neutral skipped state (#18108)

YuTengjing57b581c5accb
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index 6824881ccca..d6f4df19263 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -1525,6 +1525,7 @@
"tool.intervention.optionApprove": "Approve",
"tool.intervention.optionApproveRemember": "Approve, and don't ask again for similar actions",
"tool.intervention.pending": "Pending",
+ "tool.intervention.questionSkipped": "You skipped this question",
"tool.intervention.reject": "Reject",
"tool.intervention.rejectOnly": "Reject",
"tool.intervention.rejectReasonPlaceholder": "Tell the agent what you'd like instead",
@@ -1541,6 +1542,7 @@
"tool.intervention.submit": "Submit",
"tool.intervention.toolAbort": "You canceled this Skill call",
"tool.intervention.toolRejected": "This Skill call was rejected",
+ "tool.intervention.toolSkipped": "You skipped this step",
"tool.intervention.viewParameters": "View parameters ({{count}})",
"toolAuth.authorize": "Authorize",
"toolAuth.authorizing": "Authorizing...",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index bdcd0523ee9..b7d82b4dd49 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -1525,6 +1525,7 @@
"tool.intervention.optionApprove": "批准",
"tool.intervention.optionApproveRemember": "批准,且类似操作不再询问",
"tool.intervention.pending": "等待中",
+ "tool.intervention.questionSkipped": "你已跳过此次提问",
"tool.intervention.reject": "拒绝",
"tool.intervention.rejectOnly": "仅拒绝",
"tool.intervention.rejectReasonPlaceholder": "告诉 Agent 你希望它怎么做",
@@ -1541,6 +1542,7 @@
"tool.intervention.submit": "提交",
"tool.intervention.toolAbort": "你已取消本次技能调用",
"tool.intervention.toolRejected": "本次技能调用已被拒绝",
+ "tool.intervention.toolSkipped": "你已跳过此步骤",
"tool.intervention.viewParameters": "查看参数 ({{count}})",
"toolAuth.authorize": "授权",
"toolAuth.authorizing": "授权中…",
diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.ts
index f125a62aca6..db8e3e27ad2 100644
--- a/packages/locales/src/default/chat.ts
+++ b/packages/locales/src/default/chat.ts
@@ -1770,6 +1770,8 @@ export default {
'tool.intervention.viewParameters': 'View parameters ({{count}})',
'tool.intervention.toolAbort': 'You canceled this Skill call',
'tool.intervention.toolRejected': 'This Skill call was rejected',
+ 'tool.intervention.questionSkipped': 'You skipped this question',
+ 'tool.intervention.toolSkipped': 'You skipped this step',
'toolAuth.authorize': 'Authorize',
'toolAuth.authorizing': 'Authorizing...',
'toolAuth.hint':
diff --git a/packages/shared-tool-ui/src/components/OptionCard.tsx b/packages/shared-tool-ui/src/components/OptionCard.tsx
index 50d26b8a80e..f55c464e484 100644
--- a/packages/shared-tool-ui/src/components/OptionCard.tsx
+++ b/packages/shared-tool-ui/src/components/OptionCard.tsx
@@ -61,11 +61,16 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
optionLabel: css`
font-weight: 500;
`,
+ // One step above the hover tint is enough — the checkmark carries the
+ // selection signal, so a heavy fill just reads as a muddy block. The hover
+ // override repeats the same fill: it must outrank `.option:hover` (which
+ // would otherwise drop the row to the lighter unselected tint), and no
+ // darkening keeps the selected row flat — it's already "on".
optionSelected: css`
- background: ${cssVar.colorFillSecondary};
+ background: ${cssVar.colorFillTertiary};
&:hover {
- background: ${cssVar.colorFill};
+ background: ${cssVar.colorFillTertiary};
}
`,
recommendedBadge: css`
diff --git a/packages/types/src/message/common/tools.ts b/packages/types/src/message/common/tools.ts
index c0a76ce07c0..6cdb6578548 100644
--- a/packages/types/src/message/common/tools.ts
+++ b/packages/types/src/message/common/tools.ts
@@ -6,11 +6,18 @@ import type { LobeToolRenderType } from '../../tool';
// ToolIntervention must be defined first to avoid circular dependency
export interface ToolIntervention {
rejectedReason?: string;
+ /**
+ * The user skipped the interaction (e.g. AskUserQuestion) rather than
+ * rejecting the tool call — still `status: 'rejected'` for the runtime, but
+ * the UI renders a neutral "skipped" state instead of a rejection warning.
+ */
+ skipped?: boolean;
status?: 'pending' | 'approved' | 'rejected' | 'aborted' | 'none';
}
export const ToolInterventionSchema = z.object({
rejectedReason: z.string().optional(),
+ skipped: z.boolean().optional(),
status: z.enum(['pending', 'approved', 'rejected', 'aborted', 'none']).optional(),
});
diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/RejectedResponse.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/RejectedResponse.tsx
index 35c054c8074..6394457ea38 100644
--- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/RejectedResponse.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/RejectedResponse.tsx
@@ -1,9 +1,11 @@
import { Flexbox, Icon } from '@lobehub/ui';
import { createStaticStyles, cssVar } from 'antd-style';
-import { AlertTriangle } from 'lucide-react';
+import { AlertTriangle, CornerUpRight } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
+import { resolveRejectedCopyKey } from './resolveRejectedCopyKey';
+
const styles = createStaticStyles(({ css, cssVar }) => ({
container: css`
padding-block: 8px;
@@ -20,21 +22,30 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
}));
interface RejectedResponseProps {
+ /** Distinguishes question skips from other skipped interactions in the copy. */
+ apiName?: string;
reason?: string;
+ /**
+ * The user skipped the interaction (e.g. an AskUserQuestion) instead of
+ * rejecting the tool call — render a neutral note, not a warning.
+ */
+ skipped?: boolean;
}
-const RejectedResponse = memo<RejectedResponseProps>(({ reason }) => {
+const RejectedResponse = memo<RejectedResponseProps>(({ apiName, reason, skipped }) => {
const { t } = useTranslation('chat');
+ const copyKey = resolveRejectedCopyKey({ apiName, reason, skipped });
+
return (
<Flexbox className={styles.container} gap={8}>
<Flexbox horizontal align={'center'} gap={8}>
- <Icon color={cssVar.colorWarning} icon={AlertTriangle} size={16} />
- <div className={styles.title}>
- {reason
- ? t('tool.intervention.rejectedWithReason', { reason })
- : t('tool.intervention.toolRejected')}
- </div>
+ {skipped ? (
+ <Icon color={cssVar.colorTextTertiary} icon={CornerUpRight} size={16} />
+ ) : (
+ <Icon color={cssVar.colorWarning} icon={AlertTriangle} size={16} />
+ )}
+ <div className={styles.title}>{t(copyKey, { reason })}</div>
</Flexbox>
</Flexbox>
);
diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/index.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/index.tsx
index 4df0a8d6f71..1678abf0aa2 100644
--- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/index.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/index.tsx
@@ -56,7 +56,13 @@ const Render = memo<RenderProps>(
}
if (intervention?.status === 'rejected') {
- return <RejectedResponse reason={intervention.rejectedReason} />;
+ return (
+ <RejectedResponse
+ apiName={apiName}
+ reason={intervention.rejectedReason}
+ skipped={intervention.skipped}
+ />
+ );
}
if (intervention?.status === 'aborted') {
diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/resolveRejectedCopyKey.test.ts b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/resolveRejectedCopyKey.test.ts
new file mode 100644
index 00000000000..e6fa6d04aae
--- /dev/null
+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/resolveRejectedCopyKey.test.ts
@@ -0,0 +1,35 @@
+import { describe, expect, it } from 'vitest';
+
+import { resolveRejectedCopyKey } from './resolveRejectedCopyKey';
+
+describe('resolveRejectedCopyKey', () => {
+ it('picks question-specific copy for a skipped askUserQuestion', () => {
+ expect(resolveRejectedCopyKey({ apiName: 'askUserQuestion', skipped: true })).toBe(
+ 'tool.intervention.questionSkipped',
+ );
+ });
+
+ // Regression: the skip path is shared by all custom interactions (e.g. the
+ // onboarding marketplace picker) — those must not be labeled as questions.
+ it('picks generic skipped copy for a skipped non-question interaction', () => {
+ expect(resolveRejectedCopyKey({ apiName: 'showAgentMarketplace', skipped: true })).toBe(
+ 'tool.intervention.toolSkipped',
+ );
+ });
+
+ it('picks generic skipped copy when apiName is missing', () => {
+ expect(resolveRejectedCopyKey({ skipped: true })).toBe('tool.intervention.toolSkipped');
+ });
+
+ it('keeps the rejection warning for non-skipped rejections', () => {
+ expect(resolveRejectedCopyKey({ apiName: 'askUserQuestion' })).toBe(
+ 'tool.intervention.toolRejected',
+ );
+ });
+
+ it('uses the reason variant for non-skipped rejections with a reason', () => {
+ expect(resolveRejectedCopyKey({ reason: 'not safe' })).toBe(
+ 'tool.intervention.rejectedWithReason',
+ );
+ });
+});
diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/resolveRejectedCopyKey.ts b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/resolveRejectedCopyKey.ts
new file mode 100644
index 00000000000..750af19b96c
--- /dev/null
+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/resolveRejectedCopyKey.ts
@@ -0,0 +1,34 @@
+/**
+ * All ask surfaces (user-interaction, lobe-agent, claude-code) share this
+ * apiName; other skippable interactions (e.g. the onboarding marketplace
+ * picker) get the generic skipped copy instead of the question-specific one.
+ */
+const ASK_USER_QUESTION_API_NAME = 'askUserQuestion';
+
+interface ResolveRejectedCopyKeyInput {
+ apiName?: string;
+ reason?: string;
+ skipped?: boolean;
+}
+
+/**
+ * Picks the i18n key for a rejected tool intervention: user skips render as a
+ * neutral note (question-specific for ask surfaces), true rejections keep the
+ * warning copy.
+ */
+export const resolveRejectedCopyKey = ({
+ apiName,
+ reason,
+ skipped,
+}: ResolveRejectedCopyKeyInput):
+ | 'tool.intervention.questionSkipped'
+ | 'tool.intervention.rejectedWithReason'
+ | 'tool.intervention.toolRejected'
+ | 'tool.intervention.toolSkipped' => {
+ if (skipped)
+ return apiName === ASK_USER_QUESTION_API_NAME
+ ? 'tool.intervention.questionSkipped'
+ : 'tool.intervention.toolSkipped';
+
+ return reason ? 'tool.intervention.rejectedWithReason' : 'tool.intervention.toolRejected';
+};
diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/StatusIndicator.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/StatusIndicator.tsx
index 8ca20b7e7c5..7f31bd2e5a6 100644
--- a/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/StatusIndicator.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/StatusIndicator.tsx
@@ -1,7 +1,16 @@
import { type ToolIntervention } from '@lobechat/types';
import { Block, Icon, Tooltip } from '@lobehub/ui';
import { cssVar } from 'antd-style';
-import { AlertTriangle, Ban, Check, HandIcon, type LucideIcon, PauseIcon, X } from 'lucide-react';
+import {
+ AlertTriangle,
+ Ban,
+ Check,
+ CornerUpRight,
+ HandIcon,
+ type LucideIcon,
+ PauseIcon,
+ X,
+} from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -49,7 +58,13 @@ const StatusIndicator = memo<StatusIndicatorProps>(
</Tooltip>
);
} else if (isReject) {
- icon = (
+ // A user skip (e.g. AskUserQuestion) is a normal outcome, not a denial —
+ // keep the glyph and copy neutral instead of the rejection ban sign.
+ icon = intervention?.skipped ? (
+ <Tooltip title={t('tool.intervention.toolSkipped')}>
+ <Icon color={cssVar.colorTextTertiary} icon={CornerUpRight} />
+ </Tooltip>
+ ) : (
<Tooltip title={t('tool.intervention.toolRejected')}>
<Icon color={cssVar.colorTextTertiary} icon={Ban} />
</Tooltip>
diff --git a/src/store/chat/slices/agentRun/actions/entries/conversationControl.ts b/src/store/chat/slices/agentRun/actions/entries/conversationControl.ts
index 30ec4245155..bf022deab1d 100644
--- a/src/store/chat/slices/agentRun/actions/entries/conversationControl.ts
+++ b/src/store/chat/slices/agentRun/actions/entries/conversationControl.ts
@@ -989,7 +989,7 @@ export class ConversationControlActionImpl {
// 1. Mark intervention as rejected (skipped) with reason
await this.#get().optimisticUpdateMessagePlugin(
toolMessageId,
- { intervention: { rejectedReason: reason, status: 'rejected' } },
+ { intervention: { rejectedReason: reason, skipped: true, status: 'rejected' } },
optimisticContext,
);
@@ -1226,7 +1226,13 @@ export class ConversationControlActionImpl {
const reason = actionType === 'skip' ? 'User skipped' : 'User cancelled';
await this.#get().optimisticUpdateMessagePlugin(
toolMessageId,
- { intervention: { rejectedReason: reason, status: 'rejected' } },
+ {
+ intervention: {
+ rejectedReason: reason,
+ skipped: actionType === 'skip',
+ status: 'rejected',
+ },
+ },
optimisticContext,
);
await this.#get().optimisticUpdateMessageContent(