Skip to content

Conversation

@Simon-He95
Copy link
Collaborator

@Simon-He95 Simon-He95 commented Oct 3, 2025

Summary by CodeRabbit

  • New Features
    • Enhanced “Think” content rendering with Markdown support, code blocks, and Mermaid diagrams.
    • Cleaner code block UI with reduced controls.
  • Style
    • Removed global KaTeX styling; math expressions may appear differently.
  • Refactor
    • Switched from pre-rendered HTML to direct content rendering via a node-based renderer.
  • Chores
    • Reorganized dependencies between dependencies and devDependencies.
    • Updated markdown rendering library to a newer version.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 3, 2025

Walkthrough

Replaces HTML-based think content rendering with vue-renderer-markdown’s NodeRenderer and custom components, updates prop wiring from contentHtml to content, removes KaTeX CSS import, and adjusts dependencies (move UI libs to devDependencies; bump vue-renderer-markdown).

Changes

Cohort / File(s) Summary
Dependencies
package.json
Moved tanstack/vue-table, vee-validate, embla-carousel-vue, vaul-vue to devDependencies; removed duplicates from dependencies; bumped vue-renderer-markdown 0.0.54-beta.8 → 0.0.55-beta.2.
Think message wiring
src/renderer/src/components/message/MessageBlockThink.vue
Dropped markdown pre-rendering; removed vue-renderer-markdown imports; passes block.content as content prop to ThinkContent.
Think content renderer
src/renderer/src/components/think-content/ThinkContent.vue
Replaced contentHtml with content prop; integrated NodeRenderer with setCustomComponents(customId); custom handlers for code_block and mermaid; added customId and h usage; kept toggle/expand logic.
App entry cleanup
src/renderer/src/main.ts
Removed global KaTeX CSS import katex/dist/katex.min.css.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User
  participant MessageBlockThink
  participant ThinkContent
  participant NodeRenderer
  participant CustomComponents
  participant CodeBlock
  participant Mermaid

  User->>MessageBlockThink: View think message
  MessageBlockThink->>ThinkContent: props { content: block.content }
  ThinkContent->>NodeRenderer: render(content, customId)
  NodeRenderer->>CustomComponents: resolve node types
  alt code_block
    CustomComponents->>CodeBlock: render with hidden controls
  else mermaid
    CustomComponents->>Mermaid: render via PreCodeNode
  else other nodes
    CustomComponents-->>NodeRenderer: default rendering
  end
  NodeRenderer-->>ThinkContent: VNodes
  ThinkContent-->>User: Rendered think content
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • yyhhyyyyyy
  • zerob13

Poem

A nibble of nodes, a hop through the trees,
I render your thoughts with markdown breeze.
No KaTeX cloak, just clean new light,
Code blocks shimmer, mermaids write.
Thump-thump goes QA—looks neat, concise—
Carrots for commits, review’s precise! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly summarizes the main changes, highlighting dependency updates and rendering improvements in the specified components, and thus accurately reflects the pull request’s content.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 835cd07 and e870766.

📒 Files selected for processing (4)
  • package.json (4 hunks)
  • src/renderer/src/components/message/MessageBlockThink.vue (1 hunks)
  • src/renderer/src/components/think-content/ThinkContent.vue (2 hunks)
  • src/renderer/src/main.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • src/renderer/src/main.ts
🧰 Additional context used
📓 Path-based instructions (15)
src/renderer/src/**/*

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

src/renderer/src/**/*: All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
Use the 'vue-i18n' framework for all internationalization in the renderer
Ensure all user-visible text in the renderer uses the translation system

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
src/renderer/**/*.{vue,ts,js,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

渲染进程代码放在 src/renderer

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
src/renderer/src/**/*.{vue,ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/vue-best-practices.mdc)

src/renderer/src/**/*.{vue,ts,tsx,js,jsx}: Use the Composition API for better code organization and reusability
Implement proper state management with Pinia
Utilize Vue Router for navigation and route management
Leverage Vue's built-in reactivity system for efficient data handling

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
src/renderer/src/**/*.vue

📄 CodeRabbit inference engine (.cursor/rules/vue-best-practices.mdc)

Use scoped styles to prevent CSS conflicts between components

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
src/renderer/**/*.{ts,tsx,vue}

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

src/renderer/**/*.{ts,tsx,vue}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
Use TypeScript for all code; prefer types over interfaces.
Avoid enums; use const objects instead.
Use arrow functions for methods and computed properties.
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
src/renderer/**/*.{vue,ts}

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

Implement lazy loading for routes and components.

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
src/renderer/**/*.{ts,vue}

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

src/renderer/**/*.{ts,vue}: Use useFetch and useAsyncData for data fetching.
Implement SEO best practices using Nuxt's useHead and useSeoMeta.

Use Pinia for frontend state management (do not introduce alternative state libraries)

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
**/*.{ts,tsx,js,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use English for all logs and comments

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Enable and adhere to strict TypeScript typing (avoid implicit any, prefer precise types)

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
src/renderer/{src,shell,floating}/**/*.vue

📄 CodeRabbit inference engine (CLAUDE.md)

src/renderer/{src,shell,floating}/**/*.vue: Use Vue 3 Composition API for all components
All user-facing strings must use i18n keys via vue-i18n (no hard-coded UI strings)
Use Tailwind CSS utilities and ensure styles are scoped in Vue components

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
src/renderer/src/components/**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Organize UI components by feature within src/renderer/src/

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
src/renderer/src/**

📄 CodeRabbit inference engine (AGENTS.md)

Put application code for the Vue app under src/renderer/src (components, stores, views, i18n, lib)

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
src/renderer/src/**/*.{vue,ts}

📄 CodeRabbit inference engine (AGENTS.md)

All user-facing strings in the renderer must use vue-i18n keys defined in src/renderer/src/i18n

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
**/*.{js,jsx,ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

Apply Prettier formatting: single quotes, no semicolons, max width 100

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
src/renderer/**/*.vue

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • src/renderer/src/components/think-content/ThinkContent.vue
  • src/renderer/src/components/message/MessageBlockThink.vue
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Use Shadcn Vue, Radix Vue, and Tailwind for components and styling.
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Use template syntax for declarative rendering.
⏰ 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 (5)
src/renderer/src/components/think-content/ThinkContent.vue (2)

29-34: LGTM! NodeRenderer integration looks correct.

The switch from plain HTML rendering to NodeRenderer with a scoped customId aligns with the architecture shift away from pre-rendered HTML. The binding of :content and :customId is appropriate for the new rendering approach.


64-83: Verify and correct PreCodeNode usage
The h() call references PreCodeNode.vue, but the imported symbol is likely PreCodeNode. Remove the .vue suffix in the h() invocation and confirm you’ve imported PreCodeNode from the correct file or package (e.g. import PreCodeNode from './PreCodeNode.vue').

src/renderer/src/components/message/MessageBlockThink.vue (1)

6-6: Verify markdown input
Ensure block.content passed to ThinkContent.vue is raw markdown (not pre-rendered HTML), as NodeRenderer expects markdown. Confirm at the source of AssistantMessageBlock.content.

package.json (2)

111-111: Verify devDependencies move
I attempted to search non-renderer code for imports of @tanstack/vue-table, @vee-validate/zod, embla-carousel-vue, vaul-vue, and vee-validate but no files were checked; please manually confirm these packages are only required at build time in the renderer to avoid runtime errors in production.


168-168: Verify breaking changes in vue-renderer-markdown 0.0.55-beta.2
Consult the official changelog or release notes (GitHub repository or npm) for the jump from 0.0.54-beta.8 → 0.0.55-beta.2 and confirm there are no breaking changes to:

  • NodeRenderer component API
  • setCustomComponents function signature
  • CodeBlockNode/PreCodeNode props

Comment on lines +66 to +78
code_block: (_props) =>
h(
CodeBlockNode,
{
..._props,
isShowPreview: false,
showCopyButton: false,
showExpandButton: false,
showPreviewButton: false,
showFontSizeButtons: false
},
undefined
),
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 | 🔴 Critical

🧩 Analysis chain

Verify custom component props match CodeBlockNode signature.

The custom code_block component passes several boolean props to hide UI controls:

  • isShowPreview: false
  • showCopyButton: false
  • showExpandButton: false
  • showPreviewButton: false
  • showFontSizeButtons: false

Ensure these props are supported by the CodeBlockNode component in the current version of vue-renderer-markdown (0.0.55-beta.2). API changes could cause silent failures or TypeScript errors.


🌐 Web query:

What are the supported props for CodeBlockNode in vue-renderer-markdown version 0.0.55-beta.2?

💡 Result:

I couldn't find release notes for 0.0.55-beta.2, but the package README/docs for the 0.0.5x beta series documents the CodeBlockNode props. The supported CodeBlockNode props shown in the docs include:

  • showHeader (boolean)
  • showCopyButton (boolean)
  • showFontSizeButtons (boolean)
  • enableFontSizeControl (boolean)
  • codeBlockDarkTheme (string) / themes (theme-related props)
  • codeBlockMonacoOptions (object)
  • minWidth (number/string)
  • maxWidth (number/string)
  • header slots / ability to replace left/right header content (named slots)
  • ability to toggle header on/off and show/hide built-in toolbar buttons (copy, expand, preview, font-size controls)
  • codeBlockRenderer / custom code-block renderer support (receives highlight vnode + language)

These items and the header/toolbar customization API are described in the library documentation. See the docs for details and exact prop names/types. [1]

Sources
[1] vue-renderer-markdown / Code block and CodeBlockNode docs (library README/docs). (github.com)

Citations:


Remove unsupported isShowPreview prop
CodeBlockNode v0.0.55-beta.2 supports showCopyButton, showExpandButton, showPreviewButton, showFontSizeButtons (and related header/theme props) but does not define isShowPreview. Drop isShowPreview: false and rely on showPreviewButton: false to hide previews.

🤖 Prompt for AI Agents
In src/renderer/src/components/think-content/ThinkContent.vue around lines 66 to
78, the CodeBlockNode props include an unsupported isShowPreview prop which the
component does not define; remove the isShowPreview: false entry and rely on the
existing showPreviewButton: false (and other supported props) to control preview
behavior so the prop list only contains supported keys.

@zerob13 zerob13 merged commit ed3e2bd into ThinkInAIXYZ:dev Oct 4, 2025
2 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