feat(portal): always show MCP section with inline create in run/profile flows - #1134
Cedric Vidal (cedricvidal) wants to merge 3 commits into
Conversation
|
Original author: @github-actions[bot] Test Results (Node.js 22)test: Run #1995
🎉 All tests passed! |
|
Original author: copilot-pull-request-reviewer[bot] Pull request overviewThis PR improves Portal run/profile creation UX by always rendering the “MCP Servers” section (including an empty state) and enabling inline MCP server creation via a reusable form + dialog, so users can add an MCP server without leaving Submit Run / Profile flows. Changes:
Reviewed changesCopilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment. Show a summary per file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started. |
|
Original author: Copilot The HTML |
|
|
|
|
…le flows Resolves #1105. The MCP Servers section on Submit Run, Profile create, and New Profile Version was gated on a non-empty server list, hiding it entirely when zero servers existed and breaking in-flow creation. Extract the CreateMcpServer form into a reusable McpServerForm component and a shared McpServerCreateDialog. Always render the MCP section with an empty-state affordance and a "New MCP server…" action that opens an in-place dialog. After creating a server inline it is added to the list and auto-selected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Port main's duplicate-slug guard from CreateMcpServer into the shared McpServerForm so both the page and the inline dialog block collisions. - Stop submit propagation from McpServerForm: React bubbles synthetic events through portals, so creating a server inline on Submit Run would also have submitted the run. - Mark "Create Server" with data-command-enter so Cmd/Ctrl+Enter inside the dialog is claimed by the dialog instead of the page-level run shortcut. - Centralize the ["mcp-servers"] cache upsert in McpServerForm; callers only auto-select the new server. - Submit Run: keep the agent-capability gate, show selected-but-unavailable servers (e.g. from a profile/resubmit) instead of a misleading empty state. - Add McpServerForm tests and McpServerCreateDialog stories; document the inline-create pattern in AGENTS.md. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
7b13158 to
0e31ddb
Compare
Test Results (Node.js 22)test: Run #173
🎉 All tests passed! |
Original author: Wassim Chegham (@manekinekko)
Resolves #1105.
Problem
On the Submit Run and Profile create / New Version screens, the "MCP Servers" section was only rendered when at least one MCP server was already registered. With zero servers, the section disappeared entirely, so there was no entry point to add one without leaving the run-creation flow.
Changes
CreateMcpServer.tsxinto a reusableMcpServerFormcomponent (callback-driven, no navigation) and a sharedMcpServerCreateDialogwrapper (scrollable body + sticky footer), matching the in-place creation pattern used for profiles.CreateMcpServerpage is now a thin wrapper aroundMcpServerForm— unchanged page UX, including the duplicate-slug guard that landed onmain(now lives inMcpServerForm, so the dialog gets it too).McpServerFormupserts the server into the shared["mcp-servers"]query (then invalidates), and the host flow auto-selects it.Rebase follow-ups (after rebasing onto
main)supportsMcpServers, from Discover workers dynamically and present registry agent names #1381) — the section is still hidden for agents that don't support MCP; only the "≥1 server" condition was removed.<form>, and React bubbles synthetic events through portals, so submitting the dialog form also firedSubmitRun.handleSubmit.McpServerFormnow stops submit propagation.data-command-enter, so the dialog claims the shortcut before the page-leveluseCommandEnterhandler.patternnow matchesSLUG_REGEX/ API (1-char slugs allowed).Acceptance criteria
CreateMcpServerform and keeps the user on the pagesupportsMcpServerscapability (consistent with Skills/Extensions)Verification
McpServerForm.test.tsx(new): duplicate slug blocked; create seeds cache beforeonCreated; submit does not propagate to an enclosing form across a portal; Cmd/Ctrl+Enter is claimed by the dialog. The last two fail without the fix.McpServerCreateDialog.stories.tsx(new):Default,DuplicateSlug,CreateAndSelect— play functions pass in Storybook.tsc -b✅,vite build✅,vitest run apps/portal→ 69 files / 471 tests ✅