Skip to content

Conversation

@andifilhohub
Copy link
Member

@andifilhohub andifilhohub commented Dec 30, 2025

When the user is already on /settings/mcp-servers, clicking the “settings” link
inside the Add MCP Server modal results in no visible action, which feels broken
from a UX perspective.

This change explicitly closes the modal on link click, ensuring consistent
feedback regardless of whether a route change occurs.

  • No routing behavior changed
  • No side effects outside the modal
  • Improves UX for same-route navigation

Bug report: #10460

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Modal now properly closes when navigating to settings from the add MCP server dialog.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 30, 2025

Walkthrough

The change modifies the "settings" link in the add MCP server modal to close the modal when clicked while navigating to the settings page.

Changes

Cohort / File(s) Summary
Modal Click Handler
src/frontend/src/modals/addMcpServerModal/index.tsx
Adds onClick handler to CustomLink wrapping "settings" text. Handler calls setOpen(false) to close modal when the link is clicked, while preserving the existing navigation to /settings/mcp-servers.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 error, 2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Test Coverage For New Implementations ❌ Error PR introduces a bug fix for MCP modal not closing on same-route navigation but includes no test coverage for this regression. Add test file at src/frontend/src/modals/addMcpServerModal/tests/addMcpServerModal.test.tsx verifying modal closes when settings link is clicked, especially when already on the target route.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Test File Naming And Structure ⚠️ Warning The modified addMcpServerModal component lacks test coverage entirely, violating the repository's established pattern of test files in tests subdirectories for similar modal components. Create a test file at src/frontend/src/modals/addMcpServerModal/tests/AddMcpServerModal.test.tsx with tests for the onClick handler and modal closure behavior.
Test Quality And Coverage ❓ Inconclusive Cannot access PR code changes to verify if tests were added or modified for the modal close functionality. Review PR diff to confirm tests validate the modal close behavior when settings link is clicked.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the specific problem being fixed: the modal not closing when clicking the settings link while already on the settings route.
Excessive Mock Usage Warning ✅ Passed The PR contains no test files, so the custom check for excessive mock usage patterns is not applicable.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/mcp-modal-settings-link

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.

@github-actions
Copy link
Contributor

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 17%
16.68% (4707/28212) 9.98% (2177/21801) 10.96% (679/6193)

Unit Test Results

Tests Skipped Failures Errors Time
1830 0 💤 0 ❌ 0 🔥 25.24s ⏱️
@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 33.23%. Comparing base (9ce7d84) to head (6a1ebae).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...rc/frontend/src/modals/addMcpServerModal/index.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11172      +/-   ##
==========================================
- Coverage   33.23%   33.23%   -0.01%     
==========================================
  Files        1394     1394              
  Lines       66068    66069       +1     
  Branches     9778     9778              
==========================================
  Hits        21956    21956              
- Misses      42986    42987       +1     
  Partials     1126     1126              
Flag Coverage Δ
frontend 15.37% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rc/frontend/src/modals/addMcpServerModal/index.tsx 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants