Skip to content

Conversation

@YuriNachos
Copy link

@YuriNachos YuriNachos commented Jan 17, 2026

Summary

  • Fixed non-functional "settings" hyperlink in Add MCP Server modal
  • Replaced CustomLink with a button that properly closes the modal and navigates to settings

Changes

  • Updated src/frontend/src/modals/addMcpServerModal/index.tsx
  • Changed CustomLink to button with onClick handler
  • Added useNavigate hook for programmatic navigation

Issue

Fixes #10460

Test Plan

  1. Open the Add MCP Server modal
  2. Click on the "settings" hyperlink in the description text
  3. Verify that the modal closes and you are navigated to /settings/mcp-servers

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved error message display for file upload failures.
    • Enhanced navigation flow when accessing MCP server settings from the modal.

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

YuriNachos and others added 2 commits January 17, 2026 11:05
Fixes langflow-ai#11293

Changed error response key from 'message' to 'detail' in SideBarFoldersButtonComponent to properly display error messages from the backend API when project upload fails.

Co-Authored-By: Claude <noreply@anthropic.com>
Fixes langflow-ai#10460

Changed CustomLink to a button with onClick handler that properly:
1. Closes the modal
2. Navigates to the MCP Servers settings page

This resolves the issue where clicking the "settings" hyperlink in the Add MCP Server dialog did nothing.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added the community Pull Request from an external contributor label Jan 17, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

These changes fix a bug in the MCP Server modal where the settings hyperlink was non-functional. One file replaces a declarative link component with programmatic button-based navigation, while another updates error message handling to reference a different response property.

Changes

Cohort / File(s) Summary
MCP Server Modal Navigation
src/frontend/src/modals/addMcpServerModal/index.tsx
Introduced useNavigate hook and replaced CustomLink with a button element that closes the modal and navigates to /settings/mcp-servers on click
Error Message Source Update
src/frontend/src/components/core/folderSidebarComponent/components/sideBarFolderButtons/index.tsx
Changed error detail reference from err.response.data.message to err.response.data.detail in upload error handling

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 3 warnings)
Check name Status Explanation Resolution
Test Coverage For New Implementations ❌ Error PR introduces functional changes to addMcpServerModal component without corresponding test file, violating established project testing conventions. Add test file src/frontend/src/modals/addMcpServerModal/tests/addMcpServerModal.test.tsx verifying button rendering, modal closure, and navigation functionality using project's Jest and React Testing Library patterns.
Out of Scope Changes check ⚠️ Warning The raw summary shows an unrelated error handling change in sideBarFolderButtons/index.tsx changing err.response.data.message to err.response.data.detail, which is outside the scope of fixing the MCP Server modal hyperlink. Remove the unrelated error handling change in sideBarFolderButtons/index.tsx or move it to a separate PR focused on that error handling update.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Quality And Coverage ⚠️ Warning Pull request lacks test coverage for settings hyperlink functionality and missing type="button" attribute on button element within form context. Add Jest and Playwright tests for the new navigation feature and include type="button" attribute on button to prevent unintended form submission.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and specifically describes the main fix: making the settings hyperlink functional in the Add MCP Server modal.
Linked Issues check ✅ Passed The code changes directly address issue #10460 by implementing programmatic navigation to /settings/mcp-servers when the settings link is clicked, resolving the non-functional hyperlink bug.
Test File Naming And Structure ✅ Passed The custom check regarding test file naming and structure is not applicable to this pull request. The PR only modifies two existing component files without adding or modifying any test files.
Excessive Mock Usage Warning ✅ Passed The custom check for excessive mock usage in test files is not applicable to this PR because no test files are included in the changes.
✨ Finishing touches
🧪 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.

@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Jan 17, 2026
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/frontend/src/components/core/folderSidebarComponent/components/sideBarFolderButtons/index.tsx (1)

157-162: Guard error detail access to avoid secondary exceptions.

err.response can be undefined on network failures; the current access can throw and prevent the alert from rendering. Add optional chaining and a fallback message.

🐛 Proposed fix
-                  setErrorData({
-                    title: `Error on uploading your project, try dragging it into an existing project.`,
-                    list: [err["response"]["data"]["detail"]],
-                  });
+                  setErrorData({
+                    title: `Error on uploading your project, try dragging it into an existing project.`,
+                    list: [
+                      err?.response?.data?.detail ??
+                        err?.response?.data?.message ??
+                        err?.message ??
+                        "Unknown upload error.",
+                    ],
+                  });
🤖 Fix all issues with AI agents
In `@src/frontend/src/modals/addMcpServerModal/index.tsx`:
- Around line 292-300: The "settings" button in addMcpServerModal currently has
no explicit type and can trigger a form submit if BaseModal renders a <form>;
update the button element used in the onClick handler that calls setOpen(false)
and navigate("/settings/mcp-servers") to include type="button" to prevent
unintended form submission.

Comment on lines 292 to 300
<button
className="underline cursor-pointer bg-transparent border-0 p-0 text-inherit"
onClick={() => {
setOpen(false);
navigate("/settings/mcp-servers");
}}
>
settings
</CustomLink>
</button>
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 | 🟠 Major

Set type="button" to prevent unintended form submit.

If BaseModal renders a <form> when onSubmit is provided, the default button type will submit the form when users click “settings”.

🐛 Proposed fix
-              <button
-                className="underline cursor-pointer bg-transparent border-0 p-0 text-inherit"
-                onClick={() => {
-                  setOpen(false);
-                  navigate("/settings/mcp-servers");
-                }}
-              >
+              <button
+                type="button"
+                className="cursor-pointer bg-transparent border-0 p-0 text-inherit underline"
+                onClick={() => {
+                  setOpen(false);
+                  navigate("/settings/mcp-servers");
+                }}
+              >
📝 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
<button
className="underline cursor-pointer bg-transparent border-0 p-0 text-inherit"
onClick={() => {
setOpen(false);
navigate("/settings/mcp-servers");
}}
>
settings
</CustomLink>
</button>
<button
type="button"
className="cursor-pointer bg-transparent border-0 p-0 text-inherit underline"
onClick={() => {
setOpen(false);
navigate("/settings/mcp-servers");
}}
>
settings
</button>
🤖 Prompt for AI Agents
In `@src/frontend/src/modals/addMcpServerModal/index.tsx` around lines 292 - 300,
The "settings" button in addMcpServerModal currently has no explicit type and
can trigger a form submit if BaseModal renders a <form>; update the button
element used in the onClick handler that calls setOpen(false) and
navigate("/settings/mcp-servers") to include type="button" to prevent unintended
form submission.

…ttings button

- Add optional chaining with fallbacks for err.response.data.detail access
- Add type="button" to settings button in addMcpServerModal to prevent form submit

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working community Pull Request from an external contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Add MCP Server dialog popup text hyperlink won't work

1 participant