Skip to content

Conversation

@yyhhyyyyyy
Copy link
Collaborator

@yyhhyyyyyy yyhhyyyyyy commented Aug 22, 2025

close #768
CleanShot 2025-08-22 at 17 06 34@2x
CleanShot 2025-08-22 at 17 06 27@2x
CleanShot 2025-08-22 at 17 06 19@2x

Summary by CodeRabbit

  • Style

    • Item cards now have equal height for a cleaner grid.
    • Improved responsive layout: key and action stack on small screens, align horizontally on larger screens.
    • Truncated long keys with hover title to view full value.
    • Button adapts to installation state with icon and tooltip, full-width on small screens.
  • Bug Fixes

    • Prevented description overflow from breaking layout by constraining and hiding excess content.
    • Minor alignment adjustments for consistent spacing.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 22, 2025

Walkthrough

UI layout adjustments in McpBuiltinMarket.vue: grid items set to equal height, card content constrained to prevent overflow, server key and action row made responsive with stacking on small screens, button titles dynamic based on install state, and alignment refinements. No data fetching or business logic changes.

Changes

Cohort / File(s) Summary
MCP Market UI layout
src/renderer/src/components/settings/McpBuiltinMarket.vue
Added grid item stretching and full-height cards; constrained description with min-h-0 and overflow-hidden; refactored server_key + action into responsive stack (sm) and row (md+), with truncate and title; button gets dynamic title and responsive width; minor alignment tweaks.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Align install buttons consistently across MCP Market [#768]
Ensure proper layout at ~638px (single column) without truncation issues [#768]
Prevent element overflow/crossing in cards, including long server_key and descriptions [#768]

Assessment against linked issues: Out-of-scope changes

Poem

A rabbit straightens rows with care,
Buttons snug, no gaps to spare.
Cards stand tall, descriptions trim,
Keys now tuck with tidy vim.
At 638, the lanes align—
Hop! The market’s looking fine. 🐇✨

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
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/mcp-market-button-layout

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (4)
src/renderer/src/components/settings/McpBuiltinMarket.vue (4)

42-42: Grid stretch is on point; consider auto-rows-fr for more robust equal-height cards across rows

items-stretch + h-full aligns cards within a row. If you also want consistent track heights across auto-generated rows, add auto-rows-fr (Tailwind: grid-auto-rows: minmax(0,1fr)). This can further stabilize button alignment vertically when content lengths vary significantly.

Please verify your Tailwind config includes the auto-rows-fr utility (Tailwind ≥ v3). Also sanity-check at 638px and 640px widths.

- class="p-4 grid gap-3 grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 items-stretch"
+ class="p-4 grid gap-3 grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 items-stretch auto-rows-fr"

Minor: coding guidelines request English for comments/logs; consider translating in-file comments in a follow-up.


59-61: Resolve conflicting margins: mt-2 is overridden by mt-auto

Right now the container has both mt-2 and mt-auto. Due to identical specificity, one wins globally (build-order dependent), leading to unpredictable spacing. If the intent is “normal spacing on small screens, bottom-pinned on md+”, scope mt-auto to md.

Visually check on <640px that there’s a small gap above the action row; on ≥md it should pin to the bottom.

- class="mt-2 flex flex-col gap-2 md:flex-row md:items-center md:justify-between mt-auto"
+ class="mt-2 md:mt-auto flex flex-col gap-2 md:flex-row md:items-center md:justify-between"

62-66: Tiny UX win: make server_key easier to copy

Add select-all so users can click-and-copy the full key. Truncation + title is great; this complements it for copyability.

- class="text-xs font-mono px-2 py-0.5 bg-muted rounded truncate"
+ class="text-xs font-mono px-2 py-0.5 bg-muted rounded truncate select-all"

67-71: Prevent duplicate installs by disabling the button while a request is in flight

Currently the button disables only after install completes (when in installedServers). Rapid clicks can fire multiple installs and duplicate toasts. Track in-flight installs per server_key and disable accordingly. Also set aria-busy for a11y.

I can push a follow-up commit wiring this if you’d like.

Diff within this block:

- :disabled="installedServers.has(item.server_key)"
+ :disabled="installedServers.has(item.server_key) || installingKeys.has(item.server_key)"
@@
- class="w-full md:w-auto"
+ :aria-busy="installingKeys.has(item.server_key)"
+ class="w-full md:w-auto"

Additions outside this block (script setup):

// near other refs
const installingKeys = ref<Set<string>>(new Set())

// in install()
const install = async (item: MarketItem) => {
  try {
    if (installingKeys.value.has(item.server_key)) return
    installingKeys.value.add(item.server_key)

    if (!apiKeyInput.value.trim()) {
      toast({ title: t('mcp.market.apiKeyRequiredTitle'), description: t('mcp.market.apiKeyRequiredDesc'), variant: 'destructive' })
      return
    }
    await mcpP.setMcpRouterApiKey?.(apiKeyInput.value.trim())
    const ok = await mcpP.installMcpRouterServer?.(item.server_key)
    if (ok) {
      toast({ title: t('mcp.market.installSuccess') })
      installedServers.value.add(item.server_key)
    } else {
      toast({ title: t('mcp.market.installFailed'), variant: 'destructive' })
    }
  } catch (e) {
    toast({ title: t('mcp.market.installFailed'), description: String(e), variant: 'destructive' })
  } finally {
    installingKeys.value.delete(item.server_key)
  }
}

Also applies to: 72-78

📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 6cb27aa and 27c9a1b.

📒 Files selected for processing (1)
  • src/renderer/src/components/settings/McpBuiltinMarket.vue (1 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/McpBuiltinMarket.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 components

Use scoped styles to prevent CSS conflicts between components

Files:

  • src/renderer/src/components/settings/McpBuiltinMarket.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/McpBuiltinMarket.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/McpBuiltinMarket.vue
src/renderer/**/*.{vue,ts,js,tsx,jsx}

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

渲染进程代码放在 src/renderer

Files:

  • src/renderer/src/components/settings/McpBuiltinMarket.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/McpBuiltinMarket.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/McpBuiltinMarket.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/McpBuiltinMarket.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/McpBuiltinMarket.vue
🔇 Additional comments (2)
src/renderer/src/components/settings/McpBuiltinMarket.vue (2)

47-47: Card container change looks good

flex flex-col h-full on the card is the right call to let mt-auto work reliably.


53-56: Description overflow handling is correct

line-clamp-3 + min-h-0 overflow-hidden prevents text from pushing the layout. Good improvement for the reported overflow.

@zerob13 zerob13 merged commit 55b594e into dev Aug 23, 2025
2 checks passed
@zerob13 zerob13 mentioned this pull request Aug 26, 2025
@zerob13 zerob13 deleted the fix/mcp-market-button-layout branch January 6, 2026 12:16
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.

[BUG] element crossing the space

3 participants