diff --git a/packages/cli/src/i18n/locales/de.js b/packages/cli/src/i18n/locales/de.js index 475806390..514ee134f 100644 --- a/packages/cli/src/i18n/locales/de.js +++ b/packages/cli/src/i18n/locales/de.js @@ -290,8 +290,8 @@ export default { 'Custom Witty Phrases': 'Benutzerdefinierte Witzige Sprüche', 'Enable Welcome Back': 'Willkommen-zurück aktivieren', 'Enable User Feedback': 'Benutzerfeedback aktivieren', - 'How is Claude doing this session? (optional)': - 'Wie macht sich Claude in dieser Sitzung? (optional)', + 'How is Qwen doing this session? (optional)': + 'Wie macht sich Qwen in dieser Sitzung? (optional)', Bad: 'Schlecht', Fine: 'In Ordnung', Good: 'Gut', diff --git a/packages/cli/src/i18n/locales/en.js b/packages/cli/src/i18n/locales/en.js index a8d7578b3..773f11b6e 100644 --- a/packages/cli/src/i18n/locales/en.js +++ b/packages/cli/src/i18n/locales/en.js @@ -287,8 +287,8 @@ export default { 'Custom Witty Phrases': 'Custom Witty Phrases', 'Enable Welcome Back': 'Enable Welcome Back', 'Enable User Feedback': 'Enable User Feedback', - 'How is Claude doing this session? (optional)': - 'How is Claude doing this session? (optional)', + 'How is Qwen doing this session? (optional)': + 'How is Qwen doing this session? (optional)', Bad: 'Bad', Fine: 'Fine', Good: 'Good', diff --git a/packages/cli/src/i18n/locales/ru.js b/packages/cli/src/i18n/locales/ru.js index 8f6dbdaf9..33c4a2f00 100644 --- a/packages/cli/src/i18n/locales/ru.js +++ b/packages/cli/src/i18n/locales/ru.js @@ -290,8 +290,8 @@ export default { 'Custom Witty Phrases': 'Пользовательские остроумные фразы', 'Enable Welcome Back': 'Включить приветствие при возврате', 'Enable User Feedback': 'Включить отзывы пользователей', - 'How is Claude doing this session? (optional)': - 'Как дела у Claude в этой сессии? (необязательно)', + 'How is Qwen doing this session? (optional)': + 'Как дела у Qwen в этой сессии? (необязательно)', Bad: 'Плохо', Fine: 'Нормально', Good: 'Хорошо', diff --git a/packages/cli/src/i18n/locales/zh.js b/packages/cli/src/i18n/locales/zh.js index 77788d803..7be23ef48 100644 --- a/packages/cli/src/i18n/locales/zh.js +++ b/packages/cli/src/i18n/locales/zh.js @@ -278,8 +278,7 @@ export default { 'Custom Witty Phrases': '自定义诙谐短语', 'Enable Welcome Back': '启用欢迎回来', 'Enable User Feedback': '启用用户反馈', - 'How is Claude doing this session? (optional)': - 'Claude 这次表现如何?(可选)', + 'How is Qwen doing this session? (optional)': 'Qwen 这次表现如何?(可选)', Bad: '差', Fine: '一般', Good: '好', diff --git a/packages/cli/src/ui/FeedbackDialog.tsx b/packages/cli/src/ui/FeedbackDialog.tsx index 1b8847cfc..346d3f1ac 100644 --- a/packages/cli/src/ui/FeedbackDialog.tsx +++ b/packages/cli/src/ui/FeedbackDialog.tsx @@ -34,7 +34,7 @@ export const FeedbackDialog: React.FC = () => { - {t('How is Claude doing this session? (optional)')} + {t('How is Qwen doing this session? (optional)')} 1: diff --git a/packages/cli/src/ui/hooks/useFeedbackDialog.ts b/packages/cli/src/ui/hooks/useFeedbackDialog.ts index 6c4d356b2..cee4d8c2a 100644 --- a/packages/cli/src/ui/hooks/useFeedbackDialog.ts +++ b/packages/cli/src/ui/hooks/useFeedbackDialog.ts @@ -9,6 +9,33 @@ import { StreamingState, MessageType, type HistoryItem } from '../types.js'; import type { LoadedSettings } from '../../config/settings.js'; import type { SessionStatsState } from '../contexts/SessionContext.js'; +const FEEDBACK_SHOW_PROBABILITY = 0.25; // 25% probability of showing feedback dialog + +/** + * Check if there's an AI response after the last user message in the conversation history + */ +const hasAIResponseAfterLastUserMessage = (history: HistoryItem[]): boolean => { + // Find the last user message + let lastUserMessageIndex = -1; + for (let i = history.length - 1; i >= 0; i--) { + if (history[i].type === MessageType.USER) { + lastUserMessageIndex = i; + break; + } + } + + // Check if there's any AI response (GEMINI message) after the last user message + if (lastUserMessageIndex !== -1) { + for (let i = lastUserMessageIndex + 1; i < history.length; i++) { + if (history[i].type === MessageType.GEMINI) { + return true; + } + } + } + + return false; +}; + export interface UseFeedbackDialogProps { config: Config; settings: LoadedSettings; @@ -74,26 +101,8 @@ export const useFeedbackDialog = ({ let timeoutId: NodeJS.Timeout; if (streamingState === StreamingState.Idle && history.length > 0) { - // Find the last user message and check if there's AI response after it - let lastUserMessageIndex = -1; - let hasAIResponseAfterLastUser = false; - - for (let i = history.length - 1; i >= 0; i--) { - if (history[i].type === MessageType.USER) { - lastUserMessageIndex = i; - break; - } - } - - // Check if there's any AI response (GEMINI message) after the last user message - if (lastUserMessageIndex !== -1) { - for (let i = lastUserMessageIndex + 1; i < history.length; i++) { - if (history[i].type === MessageType.GEMINI) { - hasAIResponseAfterLastUser = true; - break; - } - } - } + const hasAIResponseAfterLastUser = + hasAIResponseAfterLastUserMessage(history); const sessionDurationMs = Date.now() - sessionStats.sessionStartTime.getTime(); @@ -105,14 +114,13 @@ export const useFeedbackDialog = ({ // 4. Session duration > 10 seconds (meaningful interaction) // 5. Not already shown for this session // 6. Random chance (25% probability) - // Note: We check !isFeedbackDialogOpen to ensure it's not already open if ( config.getUsageStatisticsEnabled() && // Only show if telemetry is enabled settings.merged.ui?.enableUserFeedback !== false && // Default to true if not set hasAIResponseAfterLastUser && sessionDurationMs > 10000 && // 10 seconds minimum for meaningful interaction !feedbackShownForSession && - Math.random() < 0.25 // 25% probability + Math.random() < FEEDBACK_SHOW_PROBABILITY ) { timeoutId = setTimeout(() => { openFeedbackDialog();