-
Notifications
You must be signed in to change notification settings - Fork 614
fix: optimize ModelScope MCP sync UI layout for consistent window height #741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughRefactors the ModelScopeMcpSync Vue component’s UI: replaces header and grid controls with a compact inline control row, updates badges and error rendering styles, adjusts icon/typography and spacing, and keeps syncing logic and APIs unchanged. No props or exported API changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🧹 Nitpick comments (4)
src/renderer/src/components/settings/ModelScopeMcpSync.vue (4)
135-139: Type syncOptions to ensure numeric payload and prevent regressionsMake the reactive object explicitly typed so TS helps catch any accidental string assignment from the UI.
-const syncOptions = reactive({ - page_number: 1, - page_size: 50 -}) +const syncOptions = reactive<{ page_number: number; page_size: number }>({ + page_number: 1, + page_size: 50, +})
84-89: Minor a11y: announce error messages to assistive techAdd role and aria-live so screen readers pick up error changes.
- <div - v-if="errorMessage" - class="p-2 bg-destructive/10 border border-destructive/20 rounded text-xs text-destructive" - > + <div + v-if="errorMessage" + class="p-2 bg-destructive/10 border border-destructive/20 rounded text-xs text-destructive" + role="alert" + aria-live="polite" + > {{ errorMessage }} </div>
5-5: Use English for comments per repo guidelineTemplate and script comments are in Chinese. Convert to English to align with the codebase convention.
- <!-- 标题行 --> + <!-- Header --> - <!-- 描述和控件行 --> + <!-- Description and controls --> - <!-- 内联控件行 --> + <!-- Inline controls --> - <!-- 同步状态与结果 --> + <!-- Sync status and results --> - <!-- 错误信息显示 --> + <!-- Error message display --> - <!-- 同步结果详情 --> + <!-- Sync result details --> -// 同步选项 +// Sync options - // 调用简化的同步API,所有的格式转换和导入都在服务端处理 + // Call simplified sync API; format transformation and import are handled on the serverAlso applies to: 15-15, 21-21, 57-57, 83-83, 91-91, 135-135, 152-152
141-166: Optional: guard user input before calling presenterConsider clamping values to valid ranges before sending them (defense-in-depth), even with min/controlled select.
If desired:
const clamp = (v: number, min: number, max: number) => Math.max(min, Math.min(max, v)) const normalized = { page_number: Math.max(1, Math.trunc(syncOptions.page_number || 1)), page_size: clamp(Math.trunc(syncOptions.page_size || 10), 1, 100), } const result = await llmP.syncModelScopeMcpServers(props.provider.id, normalized)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/renderer/src/components/settings/ModelScopeMcpSync.vue(2 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Use English for logs and comments
Files:
src/renderer/src/components/settings/ModelScopeMcpSync.vue
src/renderer/src/**/*.vue
📄 CodeRabbit Inference Engine (CLAUDE.md)
src/renderer/src/**/*.vue: Use Composition API for all Vue 3 components
Use Tailwind CSS with scoped styles for styling
Organize components by feature in src/renderer/src/
Follow existing component patterns in src/renderer/src/ when creating new UI components
Use Composition API with proper TypeScript typing for new UI components
Implement responsive design with Tailwind CSS for new UI components
Add proper error handling and loading states for new UI componentsUse scoped styles to prevent CSS conflicts between components
Files:
src/renderer/src/components/settings/ModelScopeMcpSync.vue
src/renderer/src/**/*.{ts,tsx,vue}
📄 CodeRabbit Inference Engine (CLAUDE.md)
src/renderer/src/**/*.{ts,tsx,vue}: Use Pinia for frontend state management
Renderer to Main: Use usePresenter.ts composable for direct presenter method calls
Files:
src/renderer/src/components/settings/ModelScopeMcpSync.vue
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/settings/ModelScopeMcpSync.vue
src/renderer/**/*.{vue,ts,js,tsx,jsx}
📄 CodeRabbit Inference Engine (.cursor/rules/project-structure.mdc)
渲染进程代码放在
src/renderer
Files:
src/renderer/src/components/settings/ModelScopeMcpSync.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/settings/ModelScopeMcpSync.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/settings/ModelScopeMcpSync.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/settings/ModelScopeMcpSync.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.
Files:
src/renderer/src/components/settings/ModelScopeMcpSync.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 (1)
src/renderer/src/components/settings/ModelScopeMcpSync.vue (1)
58-81: LGTM: concise sync status badgesThe compact badge cluster and conditional visibility read well and fit the new layout. Good use of outline + tinted backgrounds.
optimize ModelScope MCP sync UI layout for consistent window height

Summary by CodeRabbit
New Features
Refactor
Style
Behavior