Skip to content

fix(git): default file name from name on create & show file name for MCP in settings [INS-2630]#10022

Open
pavkout wants to merge 3 commits into
Kong:developfrom
pavkout:INS-2630
Open

fix(git): default file name from name on create & show file name for MCP in settings [INS-2630]#10022
pavkout wants to merge 3 commits into
Kong:developfrom
pavkout:INS-2630

Conversation

@pavkout

@pavkout pavkout commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What

When creating a workspace (collection, doc, mock server, environment, MCP client) in a Git-backed project, the form asks for both a Name and a File name. Previously the File name didn't follow the Name, so users had to type the same thing twice.

This PR:

  • Defaults the File name from the Name in the create modal. As you type the Name, the File name follows it (run through the existing safeToUseInsomniaFileName sanitizer, e.g. My Collectionmy_collection.yaml). Once you manually edit the File name, we stop overriding it so your custom value sticks.
  • Shows the File name field for MCP clients in the Workspace Settings modal. It was the only Git-backed type where the field was hidden (!isMcp), even though the create modal collects a file name for it and the update route already stores gitFilePath generically. This makes create/settings consistent and lets you rename the MCP file.

The File name field stays fully editable and we don't lock it down or block on duplicates — we're only defaulting it. This applies to all five workspace types via the shared Name field; no per-type handling.

How to test

  1. Open a Git-backed project.
  2. Create a Collection / Doc / Mock Server / Environment / MCP Client.
  3. Type a Name → the File name updates to match (sanitized).
  4. Manually edit the File name → it no longer follows the Name.
  5. Open Settings on an MCP client in a Git project → the File name field is now shown and editable.

Notes

  • Mock servers already showed the File name in both modals; the only type-based hiding was MCP-in-Settings, which this PR removes.
  • Import/clone flows are unaffected (the file name comes from the imported file).

@pavkout pavkout requested review from a team and Copilot June 3, 2026 16:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Git-backed workspace UX so users don’t have to type the same “Name” and “File name” twice when creating workspaces, and aligns MCP client settings with the other Git-backed workspace types by exposing the file name field in settings.

Changes:

  • Derive the “File name” from “Name” in the new workspace modal until the user manually edits the file name.
  • Show the “File name” field for MCP clients in the workspace settings modal (Git projects).
  • Keep using the existing safeToUseInsomniaFileName* sanitization path for Git file naming.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/insomnia/src/ui/components/modals/workspace-settings-modal.tsx Removes the MCP-specific hiding of the Git “File name” field in workspace settings.
packages/insomnia/src/ui/components/modals/new-workspace-modal.tsx Adds “name → fileName” defaulting behavior with a manual-edit opt-out flag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 140 to 144
{project &&
models.project.isGitProject(project) &&
gitRepoTreeFetcher.data &&
!models.workspace.isMcp(workspace) && (
gitRepoTreeFetcher.data && (
<TextField
name="fileName"
fiosman
fiosman previously approved these changes Jun 3, 2026
@pavkout pavkout force-pushed the INS-2630 branch 2 times, most recently from 74f20e4 to 898a433 Compare June 8, 2026 15:56
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.

3 participants