-
Notifications
You must be signed in to change notification settings - Fork 146
Fix floating auth tab strip for transparent-DCR OAuth connect modal #1202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+254
−169
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| // Selfhost (browser, recorded): the add-connection modal for a transparent-DCR | ||
| // OAuth MCP integration must render its body card, not just a floating tab | ||
| // strip. A remote MCP integration that declares an oauth2 method is DCR-capable | ||
| // (supportsDynamicRegistration), so the modal skips the app picker. When the | ||
| // integration also offers the custom-method "+" the method tab strip renders. | ||
| // | ||
| // The regression this guards: the OAuth tab's TabsContent card (the "No app to | ||
| // choose / automatic setup" explainer) was gated out whenever DCR was active, | ||
| // leaving the tab strip with no card under it and a detached-looking border. | ||
| // The same gate also made that explainer unreachable dead code. The per-step | ||
| // screenshots are the artifact. | ||
| import { randomBytes } from "node:crypto"; | ||
|
|
||
| import { Effect } from "effect"; | ||
| import { composePluginApi } from "@executor-js/api/server"; | ||
| import { mcpHttpPlugin } from "@executor-js/plugin-mcp/api"; | ||
| import { makeGreetingMcpServer, serveMcpServer } from "@executor-js/plugin-mcp/testing"; | ||
| import { IntegrationSlug } from "@executor-js/sdk/shared"; | ||
|
|
||
| import { scenario } from "../src/scenario"; | ||
| import { Api, Browser, Target } from "../src/services"; | ||
|
|
||
| const api = composePluginApi([mcpHttpPlugin()] as const); | ||
|
|
||
| scenario( | ||
| "Connections · the add-connection modal for a transparent-DCR OAuth MCP renders its body card under the tab strip", | ||
| {}, | ||
| Effect.scoped( | ||
| Effect.gen(function* () { | ||
| const target = yield* Target; | ||
| const browser = yield* Browser; | ||
| const { client: makeApiClient } = yield* Api; | ||
|
|
||
| // A remote MCP integration declaring an oauth2 method: remote + oauth2 is | ||
| // transparent-DCR (supportsDynamicRegistration true), so the modal skips | ||
| // the BYO-app picker. The server is never dialed here — opening the modal | ||
| // only reads the declared template. | ||
| const server = yield* serveMcpServer(() => makeGreetingMcpServer()); | ||
| const identity = yield* target.newIdentity(); | ||
| const client = yield* makeApiClient(api, identity); | ||
| const slug = `mcp-dcr-card-${randomBytes(3).toString("hex")}`; | ||
|
|
||
| yield* client.mcp.addServer({ | ||
| payload: { | ||
| transport: "remote", | ||
| name: "DCR OAuth MCP", | ||
| endpoint: server.endpoint, | ||
| slug, | ||
| authenticationTemplate: [{ kind: "oauth2" }], | ||
| }, | ||
| }); | ||
|
|
||
| // Remove the integration afterward — selfhost identities share one tenant, | ||
| // so a leaked integration would bleed into other scenarios. | ||
| yield* Effect.gen(function* () { | ||
| yield* browser.session(identity, async ({ page, step }) => { | ||
| const dialog = page.getByRole("dialog"); | ||
|
|
||
| await step("Open the integration's add-connection modal", async () => { | ||
| await page.goto(`/integrations/${slug}`, { waitUntil: "networkidle" }); | ||
| await page.getByRole("button", { name: "Add connection" }).first().click(); | ||
| await dialog.waitFor({ state: "visible" }); | ||
| }); | ||
|
|
||
| await step("The OAuth tab and the custom-method + are present", async () => { | ||
| await dialog.getByRole("tab", { name: "OAuth" }).waitFor(); | ||
| await dialog.getByRole("button", { name: "Add authentication method" }).waitFor(); | ||
| }); | ||
|
|
||
| await step("The OAuth tab has its body card, not a floating tab strip", async () => { | ||
| // The card the fix restores: the DCR explainer that anchors the tab | ||
| // strip. Before the fix the TabsContent was gated out for DCR, so | ||
| // this copy was unreachable and the tabs floated with no card. | ||
| await dialog.getByText("No app to choose").waitFor({ timeout: 15_000 }); | ||
| await dialog.getByText(/supports automatic setup/).waitFor({ timeout: 15_000 }); | ||
| }); | ||
| }); | ||
| }).pipe( | ||
| Effect.ensuring( | ||
| client.mcp | ||
| .removeServer({ params: { slug: IntegrationSlug.make(slug) } }) | ||
| .pipe(Effect.ignore), | ||
| ), | ||
| ); | ||
| }), | ||
| ), | ||
| ); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needscapability declared for browser dependencyThe scenario options are
{}but the test yieldsBrowserand drives a full browser session. Thee2e/AGENTS.mdanatomy examples declare required capabilities vianeeds(e.g.{ needs: ["api"] }). If the runner gates service provisioning on that field, the test could silently skip or error on an environment that doesn't wire upBrowserby default. Consider addingneeds: ["browser"](or the equivalent selfhost capability key) to make the dependency explicit and self-documenting.Context Used: e2e/AGENTS.md (source)