Skip to content

Conversation

@zhangmo8
Copy link
Collaborator

@zhangmo8 zhangmo8 commented Jan 12, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling and display of streaming messages to reduce UI jitter and height recalculations.
    • Minimap and message list updates are now less frequent during streaming, improving performance and scroll stability.
    • Reduced DOM work while streaming to prevent unnecessary layout churn and preserve smoother interactions.

✏️ Tip: You can customize this high-level summary in your review settings.

@zhangmo8 zhangmo8 marked this pull request as draft January 12, 2026 14:34
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

📝 Walkthrough

Walkthrough

Integrated streaming-state-aware logic into MessageList.vue to track streaming status, adjust which messages are rendered, avoid minimap and DOM work while streaming, and change size-keying to prevent layout churn for pending streaming messages. No public API signatures were changed.

Changes

Cohort / File(s) Summary
MessageList core
src/renderer/src/components/message/MessageList.vue
Added streaming-state integration: new reactive state (inputText, currentContextLength) and imported useSendButtonState (variant: chat) to detect streaming. Introduced streaming-aware helpers to detect pending/streaming messages and exclude them from the main virtualized list.
Virtualization & Size-keying
src/renderer/src/components/message/MessageList.vue
getMessageSizeKey now returns a streaming-specific key (streaming:<message.id>) for pending messages during streaming to avoid height re-calculation churn. getVariantSizeKey bypasses variant calculation for pending streaming messages.
Minimap & DOM collection
src/renderer/src/components/message/MessageList.vue
Minimap construction now filters out pending messages when streaming to reduce recalculation. recordVisibleDomInfo short-circuits during streaming to skip DOM-info collection and reduce work while streaming.
Rendering & scroll interaction tweaks
src/renderer/src/components/message/MessageList.vue
Streaming tail items are excluded from virtual items and handled separately; scroller behavior adjusted to avoid trying to locate streaming items in the main list and to skip certain scroll-restoration steps when streaming.
Public API surface
src/renderer/src/components/message/MessageList.vue
No exported props, emits, or public signatures were changed; new helpers/computed properties remain internal (not exposed).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I nibble code where streams run bright,
Tucking pending tails out of sight,
Keys and maps hum soft and small,
Minimaps sleep until the call,
A hoppity tweak — the list stays light. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'optimize code blocker' does not match the actual changes, which focus on streaming state optimization in MessageList component, not code block rendering. Consider renaming to better reflect the actual changes, such as 'feat: optimize message list rendering during streaming' or 'feat: improve streaming performance in MessageList'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @src/renderer/src/components/message/MessageList.vue:
- Line 47: Remove the invalid :active="false" binding from the <template> used
for v-for over streamingTailItems in MessageList.vue; <template> cannot accept
props—delete the :active attribute and, if the active state was meant for a
DynamicScrollerItem or a child component (e.g., DynamicScrollerItem,
MessageItem), move or apply the binding there instead (apply :active to the
actual component element inside the template or compute the prop in its parent
render logic).
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7c6bdd and 1ed9235.

📒 Files selected for processing (1)
  • src/renderer/src/components/message/MessageList.vue
🧰 Additional context used
📓 Path-based instructions (9)
src/renderer/**/*.vue

📄 CodeRabbit inference engine (CLAUDE.md)

src/renderer/**/*.vue: Use Vue 3 Composition API for all components
Use Tailwind CSS for styling with scoped styles
All user-facing strings must use i18n keys via vue-i18n

Files:

  • src/renderer/src/components/message/MessageList.vue
src/renderer/src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use usePresenter.ts composable for renderer-to-main IPC communication via direct presenter method calls

Ensure all code comments are in English and all log messages are in English, with no non-English text in code comments or console statements

Use VueUse composables for common utilities like useLocalStorage, useClipboard, useDebounceFn

Vue 3 renderer app code should be organized in src/renderer/src with subdirectories for components/, stores/, views/, i18n/, and lib/

Files:

  • src/renderer/src/components/message/MessageList.vue
**/*.{js,ts,tsx,jsx,vue,mjs,cjs}

📄 CodeRabbit inference engine (.cursor/rules/development-setup.mdc)

All logs and comments must be in English

Files:

  • src/renderer/src/components/message/MessageList.vue
**/*.{js,ts,tsx,jsx,vue,json,mjs,cjs}

📄 CodeRabbit inference engine (.cursor/rules/development-setup.mdc)

Use Prettier as the code formatter

Files:

  • src/renderer/src/components/message/MessageList.vue
src/renderer/src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/i18n.mdc)

src/renderer/src/**/*.{vue,ts,tsx}: Use vue-i18n framework for internationalization located at src/renderer/src/i18n/
All user-facing strings must use i18n keys, not hardcoded text

src/renderer/src/**/*.{vue,ts,tsx}: Use ref for primitives and references, reactive for objects in Vue 3 Composition API
Prefer computed properties over methods for derived state in Vue components
Import Shadcn Vue components from @/shadcn/components/ui/ path alias
Use the cn() utility function combining clsx and tailwind-merge for dynamic Tailwind classes
Use defineAsyncComponent() for lazy loading heavy Vue components
Use TypeScript for all Vue components and composables with explicit type annotations
Define TypeScript interfaces for Vue component props and data structures
Use usePresenter composable for main process communication instead of direct IPC calls

Files:

  • src/renderer/src/components/message/MessageList.vue
src/renderer/src/**/*.vue

📄 CodeRabbit inference engine (.cursor/rules/i18n.mdc)

Import useI18n from vue-i18n in Vue components to access translation functions t and locale

src/renderer/src/**/*.vue: Use <script setup> syntax for concise Vue 3 component definitions with Composition API
Define props and emits explicitly in Vue components using defineProps and defineEmits with TypeScript interfaces
Use provide/inject for dependency injection in Vue components instead of prop drilling
Use Tailwind CSS for all styling instead of writing scoped CSS files
Use mobile-first responsive design approach with Tailwind breakpoints
Use Iconify Vue with lucide icons as primary choice, following pattern lucide:{icon-name}
Use v-memo directive for memoizing expensive computations in templates
Use v-once directive for rendering static content without reactivity updates
Use virtual scrolling with RecycleScroller component for rendering long lists
Subscribe to events using rendererEvents.on() and unsubscribe in onUnmounted lifecycle hook

Files:

  • src/renderer/src/components/message/MessageList.vue
src/renderer/src/components/**/*.vue

📄 CodeRabbit inference engine (.cursor/rules/vue-stack-guide.mdc)

Name Vue components using PascalCase (e.g., ChatInput.vue, MessageItemUser.vue)

Files:

  • src/renderer/src/components/message/MessageList.vue
**/*.vue

📄 CodeRabbit inference engine (AGENTS.md)

Vue components must be named in PascalCase (e.g., ChatInput.vue) and use Vue 3 Composition API with Pinia for state management and Tailwind for styling

Files:

  • src/renderer/src/components/message/MessageList.vue
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Use camelCase for variable and function names; use PascalCase for types and classes; use SCREAMING_SNAKE_CASE for constants
Configure Prettier with single quotes, no semicolons, and line width of 100 characters. Run pnpm run format after completing features

Files:

  • src/renderer/src/components/message/MessageList.vue
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-stack-guide.mdc:0-0
Timestamp: 2026-01-05T02:41:31.661Z
Learning: Applies to src/renderer/src/**/*.vue : Use virtual scrolling with `RecycleScroller` component for rendering long lists
📚 Learning: 2026-01-05T02:41:31.661Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-stack-guide.mdc:0-0
Timestamp: 2026-01-05T02:41:31.661Z
Learning: Applies to src/renderer/src/**/*.vue : Use virtual scrolling with `RecycleScroller` component for rendering long lists

Applied to files:

  • src/renderer/src/components/message/MessageList.vue
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-check (x64)
🔇 Additional comments (3)
src/renderer/src/components/message/MessageList.vue (3)

193-221: LGTM!

The streaming detection logic is well-structured:

  • isStreamingMessage correctly short-circuits for non-assistant messages
  • streamingTailItems efficiently collects contiguous streaming messages from the tail
  • Using a Set for streamingTailIds provides O(1) lookups
  • virtualItems short-circuits when there are no streaming items

48-60: Streaming tail rendering looks correct.

The assistant message rendering in the after slot mirrors the main scroller's implementation with proper event handlers and minimap integration. The v-if guard aligns with isStreamingMessage which only returns true for assistant messages.


612-620: Good handling of scroll behavior for streaming messages.

The logic correctly handles the case where a target message is in the streaming tail by scrolling to bottom instead of attempting to locate it in the virtual scroller (where it doesn't exist).

@zhangmo8 zhangmo8 reopened this Jan 13, 2026
@zhangmo8 zhangmo8 marked this pull request as ready for review January 13, 2026 06:19
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In @src/renderer/src/components/message/MessageList.vue:
- Around line 244-245: Translate the Chinese comment above the early-return in
MessageList.vue to English; replace "如果正在 streaming,不参与 variant 计算" with an
English comment that clearly conveys the same meaning (e.g., "If currently
streaming, exclude from variant calculation") and keep it adjacent to the if
(isStreaming.value && message.status === 'pending') return '' line so it still
documents that pending streaming messages are not considered in variant
computation.
- Around line 173-178: Translate the Chinese comment above the mapped
computation into English; replace "如果正在 streaming,排除 pending 状态的消息,避免 minimap
频繁重新计算" with an English comment such as "If streaming, exclude messages with
pending status to avoid frequent minimap recalculations" and keep surrounding
code and symbols (mapped, props.items, isStreaming, item.message.status ===
'pending') unchanged.
- Around line 211-214: The inline Chinese comment above the streaming check in
MessageList.vue should be translated to English: replace "如果正在
streaming,返回固定值,避免频繁重新计算高度" with a concise English comment such as "If currently
streaming, return a fixed value to avoid recalculating height frequently"
immediately above the if block that checks isStreaming.value and message.status
=== 'pending' (the block that returns `streaming:${message.id}`) so the intent
is clear to all readers.
- Around line 550-551: Translate the Chinese inline comment above the
isStreaming check into English while preserving its meaning; replace "// 如果正在
streaming,跳过 dom info 记录,避免频繁计算" with an English comment such as "// If
currently streaming, skip DOM info logging to avoid expensive/redundant
calculations" immediately before the if (isStreaming.value) return line in the
MessageList component.
🧹 Nitpick comments (2)
src/renderer/src/components/message/MessageList.vue (2)

125-125: Consider translating existing Chinese comment to English.

This pre-existing comment should also be in English per coding guidelines.

Suggested fix
-// === Local State (需要先声明,因为 useMessageScroll 需要引用) ===
+// === Local State (must be declared first as useMessageScroll references these) ===

133-141: Unused refs satisfy the composable interface but could be simplified.

inputText and currentContextLength are initialized as static dummy refs ('' and 0) and never updated in this component. While useSendButtonState internally uses these parameters for its disabledSend computed, MessageList.vue only destructures isStreaming, which is derived solely from the chat store's generatingThreadIds. These refs could be removed if a simpler composable interface were created for streaming-state-only use cases, though keeping them is acceptable for interface consistency.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ed9235 and cbf2ed1.

📒 Files selected for processing (1)
  • src/renderer/src/components/message/MessageList.vue
🧰 Additional context used
📓 Path-based instructions (9)
src/renderer/**/*.vue

📄 CodeRabbit inference engine (CLAUDE.md)

src/renderer/**/*.vue: Use Vue 3 Composition API for all components
Use Tailwind CSS for styling with scoped styles
All user-facing strings must use i18n keys via vue-i18n

Files:

  • src/renderer/src/components/message/MessageList.vue
src/renderer/src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use usePresenter.ts composable for renderer-to-main IPC communication via direct presenter method calls

Ensure all code comments are in English and all log messages are in English, with no non-English text in code comments or console statements

Use VueUse composables for common utilities like useLocalStorage, useClipboard, useDebounceFn

Vue 3 renderer app code should be organized in src/renderer/src with subdirectories for components/, stores/, views/, i18n/, and lib/

Files:

  • src/renderer/src/components/message/MessageList.vue
**/*.{js,ts,tsx,jsx,vue,mjs,cjs}

📄 CodeRabbit inference engine (.cursor/rules/development-setup.mdc)

All logs and comments must be in English

Files:

  • src/renderer/src/components/message/MessageList.vue
**/*.{js,ts,tsx,jsx,vue,json,mjs,cjs}

📄 CodeRabbit inference engine (.cursor/rules/development-setup.mdc)

Use Prettier as the code formatter

Files:

  • src/renderer/src/components/message/MessageList.vue
src/renderer/src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/i18n.mdc)

src/renderer/src/**/*.{vue,ts,tsx}: Use vue-i18n framework for internationalization located at src/renderer/src/i18n/
All user-facing strings must use i18n keys, not hardcoded text

src/renderer/src/**/*.{vue,ts,tsx}: Use ref for primitives and references, reactive for objects in Vue 3 Composition API
Prefer computed properties over methods for derived state in Vue components
Import Shadcn Vue components from @/shadcn/components/ui/ path alias
Use the cn() utility function combining clsx and tailwind-merge for dynamic Tailwind classes
Use defineAsyncComponent() for lazy loading heavy Vue components
Use TypeScript for all Vue components and composables with explicit type annotations
Define TypeScript interfaces for Vue component props and data structures
Use usePresenter composable for main process communication instead of direct IPC calls

Files:

  • src/renderer/src/components/message/MessageList.vue
src/renderer/src/**/*.vue

📄 CodeRabbit inference engine (.cursor/rules/i18n.mdc)

Import useI18n from vue-i18n in Vue components to access translation functions t and locale

src/renderer/src/**/*.vue: Use <script setup> syntax for concise Vue 3 component definitions with Composition API
Define props and emits explicitly in Vue components using defineProps and defineEmits with TypeScript interfaces
Use provide/inject for dependency injection in Vue components instead of prop drilling
Use Tailwind CSS for all styling instead of writing scoped CSS files
Use mobile-first responsive design approach with Tailwind breakpoints
Use Iconify Vue with lucide icons as primary choice, following pattern lucide:{icon-name}
Use v-memo directive for memoizing expensive computations in templates
Use v-once directive for rendering static content without reactivity updates
Use virtual scrolling with RecycleScroller component for rendering long lists
Subscribe to events using rendererEvents.on() and unsubscribe in onUnmounted lifecycle hook

Files:

  • src/renderer/src/components/message/MessageList.vue
src/renderer/src/components/**/*.vue

📄 CodeRabbit inference engine (.cursor/rules/vue-stack-guide.mdc)

Name Vue components using PascalCase (e.g., ChatInput.vue, MessageItemUser.vue)

Files:

  • src/renderer/src/components/message/MessageList.vue
**/*.vue

📄 CodeRabbit inference engine (AGENTS.md)

Vue components must be named in PascalCase (e.g., ChatInput.vue) and use Vue 3 Composition API with Pinia for state management and Tailwind for styling

Files:

  • src/renderer/src/components/message/MessageList.vue
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Use camelCase for variable and function names; use PascalCase for types and classes; use SCREAMING_SNAKE_CASE for constants
Configure Prettier with single quotes, no semicolons, and line width of 100 characters. Run pnpm run format after completing features

Files:

  • src/renderer/src/components/message/MessageList.vue
🧠 Learnings (7)
📚 Learning: 2026-01-05T02:41:31.661Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-stack-guide.mdc:0-0
Timestamp: 2026-01-05T02:41:31.661Z
Learning: Applies to src/renderer/src/components/**/*.vue : Name Vue components using PascalCase (e.g., `ChatInput.vue`, `MessageItemUser.vue`)

Applied to files:

  • src/renderer/src/components/message/MessageList.vue
📚 Learning: 2026-01-05T02:41:31.661Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-stack-guide.mdc:0-0
Timestamp: 2026-01-05T02:41:31.661Z
Learning: Applies to src/renderer/src/**/*.vue : Use `v-once` directive for rendering static content without reactivity updates

Applied to files:

  • src/renderer/src/components/message/MessageList.vue
📚 Learning: 2026-01-05T02:41:31.661Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-stack-guide.mdc:0-0
Timestamp: 2026-01-05T02:41:31.661Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Use VueUse composables for common utilities like `useLocalStorage`, `useClipboard`, `useDebounceFn`

Applied to files:

  • src/renderer/src/components/message/MessageList.vue
📚 Learning: 2026-01-05T02:41:31.661Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-stack-guide.mdc:0-0
Timestamp: 2026-01-05T02:41:31.661Z
Learning: Applies to src/renderer/src/composables/**/*.ts : Name composables using camelCase with `use` prefix (e.g., `useChatState.ts`, `useMessageList.ts`)

Applied to files:

  • src/renderer/src/components/message/MessageList.vue
📚 Learning: 2026-01-05T02:41:31.661Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-stack-guide.mdc:0-0
Timestamp: 2026-01-05T02:41:31.661Z
Learning: Applies to src/renderer/src/components/ : Organize Vue component directories using lowercase with dashes (e.g., `chat-input/`, `message/`)

Applied to files:

  • src/renderer/src/components/message/MessageList.vue
📚 Learning: 2026-01-05T02:41:31.661Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-stack-guide.mdc:0-0
Timestamp: 2026-01-05T02:41:31.661Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx} : Use `usePresenter` composable for main process communication instead of direct IPC calls

Applied to files:

  • src/renderer/src/components/message/MessageList.vue
📚 Learning: 2026-01-05T02:41:31.661Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-stack-guide.mdc:0-0
Timestamp: 2026-01-05T02:41:31.661Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx} : Import Shadcn Vue components from `@/shadcn/components/ui/` path alias

Applied to files:

  • src/renderer/src/components/message/MessageList.vue

Comment on lines +173 to +178
// 如果正在 streaming,排除 pending 状态的消息,避免 minimap 频繁重新计算
const mapped = props.items
.filter((item) => {
if (!isStreaming.value) return true
return !item.message || item.message.status !== 'pending'
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Chinese comment should be translated to English.

Per coding guidelines, all comments must be in English.

Suggested fix
-  // 如果正在 streaming,排除 pending 状态的消息,避免 minimap 频繁重新计算
+  // During streaming, exclude pending messages to prevent frequent minimap recalculations
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// 如果正在 streaming,排除 pending 状态的消息,避免 minimap 频繁重新计算
const mapped = props.items
.filter((item) => {
if (!isStreaming.value) return true
return !item.message || item.message.status !== 'pending'
})
// During streaming, exclude pending messages to prevent frequent minimap recalculations
const mapped = props.items
.filter((item) => {
if (!isStreaming.value) return true
return !item.message || item.message.status !== 'pending'
})
🤖 Prompt for AI Agents
In @src/renderer/src/components/message/MessageList.vue around lines 173 - 178,
Translate the Chinese comment above the mapped computation into English; replace
"如果正在 streaming,排除 pending 状态的消息,避免 minimap 频繁重新计算" with an English comment such
as "If streaming, exclude messages with pending status to avoid frequent minimap
recalculations" and keep surrounding code and symbols (mapped, props.items,
isStreaming, item.message.status === 'pending') unchanged.

Comment on lines +211 to +214
// 如果正在 streaming,返回固定值,避免频繁重新计算高度
if (isStreaming.value && message.status === 'pending') {
return `streaming:${message.id}`
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Chinese comment should be translated to English.

Per coding guidelines, all comments must be in English.

Suggested fix
-  // 如果正在 streaming,返回固定值,避免频繁重新计算高度
+  // During streaming, return a stable key to avoid frequent height recalculations
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// 如果正在 streaming,返回固定值,避免频繁重新计算高度
if (isStreaming.value && message.status === 'pending') {
return `streaming:${message.id}`
}
// During streaming, return a stable key to avoid frequent height recalculations
if (isStreaming.value && message.status === 'pending') {
return `streaming:${message.id}`
}
🤖 Prompt for AI Agents
In @src/renderer/src/components/message/MessageList.vue around lines 211 - 214,
The inline Chinese comment above the streaming check in MessageList.vue should
be translated to English: replace "如果正在 streaming,返回固定值,避免频繁重新计算高度" with a
concise English comment such as "If currently streaming, return a fixed value to
avoid recalculating height frequently" immediately above the if block that
checks isStreaming.value and message.status === 'pending' (the block that
returns `streaming:${message.id}`) so the intent is clear to all readers.

Comment on lines +244 to +245
// 如果正在 streaming,不参与 variant 计算
if (isStreaming.value && message.status === 'pending') return ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Chinese comment should be translated to English.

Per coding guidelines, all comments must be in English.

Suggested fix
-  // 如果正在 streaming,不参与 variant 计算
+  // During streaming, skip variant calculation for pending messages
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// 如果正在 streaming,不参与 variant 计算
if (isStreaming.value && message.status === 'pending') return ''
// During streaming, skip variant calculation for pending messages
if (isStreaming.value && message.status === 'pending') return ''
🤖 Prompt for AI Agents
In @src/renderer/src/components/message/MessageList.vue around lines 244 - 245,
Translate the Chinese comment above the early-return in MessageList.vue to
English; replace "如果正在 streaming,不参与 variant 计算" with an English comment that
clearly conveys the same meaning (e.g., "If currently streaming, exclude from
variant calculation") and keep it adjacent to the if (isStreaming.value &&
message.status === 'pending') return '' line so it still documents that pending
streaming messages are not considered in variant computation.

Comment on lines +550 to +551
// 如果正在 streaming,跳过 dom info 记录,避免频繁计算
if (isStreaming.value) return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Chinese comment should be translated to English.

Per coding guidelines, all comments must be in English.

Suggested fix
-  // 如果正在 streaming,跳过 dom info 记录,避免频繁计算
+  // During streaming, skip DOM info recording to reduce computation
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// 如果正在 streaming,跳过 dom info 记录,避免频繁计算
if (isStreaming.value) return
// During streaming, skip DOM info recording to reduce computation
if (isStreaming.value) return
🤖 Prompt for AI Agents
In @src/renderer/src/components/message/MessageList.vue around lines 550 - 551,
Translate the Chinese inline comment above the isStreaming check into English
while preserving its meaning; replace "// 如果正在 streaming,跳过 dom info 记录,避免频繁计算"
with an English comment such as "// If currently streaming, skip DOM info
logging to avoid expensive/redundant calculations" immediately before the if
(isStreaming.value) return line in the MessageList component.

@zerob13 zerob13 changed the base branch from dev to zhangmo8/fix-code-block January 13, 2026 08:38
@zerob13 zerob13 merged commit 0c6cc3b into ThinkInAIXYZ:zhangmo8/fix-code-block Jan 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants