Add smart ACK provider for WeChat MP replies
Replace fixed ackText with a rule-based AckProvider that picks response templates by message type and intent (translate, summary, rewrite, poster, ppt, mindmap, code, search, schedule). Pure sync, zero I/O, auto-falls back to config.ackText on any error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import { ChatPanel } from './ChatPanel';
|
||||
import { WechatBindPrompt } from './WechatBindPrompt';
|
||||
import { WechatAccountButton } from './WechatAccountButton';
|
||||
import { ChatHeaderMoreMenu } from './ChatHeaderMoreMenu';
|
||||
import { NotificationCenter } from './NotificationCenter';
|
||||
import type { MindSpaceSaveCategory } from '../types';
|
||||
|
||||
export function ChatView({
|
||||
@@ -56,7 +57,9 @@ export function ChatView({
|
||||
balanceCents,
|
||||
totalCreditCents,
|
||||
tokensUsed,
|
||||
subscription,
|
||||
openRecharge,
|
||||
openSubscribe,
|
||||
uploadChatImage,
|
||||
} = useChat();
|
||||
const online = useNetworkStatus();
|
||||
@@ -148,9 +151,12 @@ export function ChatView({
|
||||
balanceCents={balanceCents}
|
||||
totalCreditCents={totalCreditCents}
|
||||
tokensUsed={tokensUsed}
|
||||
subscription={subscription}
|
||||
onRecharge={openRecharge}
|
||||
onSubscribe={openSubscribe}
|
||||
/>
|
||||
)}
|
||||
<NotificationCenter onOpenRecharge={() => openRecharge(false)} />
|
||||
{onOpenAdmin && (
|
||||
<button type="button" className="ghost-btn" onClick={onOpenAdmin}>
|
||||
管理
|
||||
@@ -196,9 +202,12 @@ export function ChatView({
|
||||
balanceCents={balanceCents}
|
||||
totalCreditCents={totalCreditCents}
|
||||
tokensUsed={tokensUsed}
|
||||
subscription={subscription}
|
||||
onRecharge={openRecharge}
|
||||
onSubscribe={openSubscribe}
|
||||
/>
|
||||
)}
|
||||
<NotificationCenter onOpenRecharge={() => openRecharge(false)} />
|
||||
{onOpenSpace && (
|
||||
<button
|
||||
type="button"
|
||||
@@ -251,7 +260,7 @@ export function ChatView({
|
||||
|
||||
{notice && (
|
||||
<div className={`banner${notice === INSUFFICIENT_BALANCE_NOTICE ? ' banner-warning' : ' banner-info'}`}>
|
||||
<span>{notice}</span>
|
||||
<span style={{ whiteSpace: 'pre-line' }}>{notice}</span>
|
||||
{notice === INSUFFICIENT_BALANCE_NOTICE ? (
|
||||
<>
|
||||
<button type="button" className="banner-action" onClick={() => openRecharge(false)}>
|
||||
|
||||
Reference in New Issue
Block a user