Repository navigation
🤖 tests: close the MCP server popover with a retried Escape in story plays - #7656
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
🟢 e2e stories (Haiku): 14 passed22 agent steps · 7 replayed from cache · 15 model calls · 46.5k tokens (24% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 20s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 8.0k tokens (22% cached) All 3 tests in 3 files
e2e 0.20.0 · 18.4s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 5.3s · 2 targets (web, phone) · run artifacts |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The
ServerDetailsandPluginServerDetailsstory plays inApp.mcpToolIdentity.stories.tsxnow close the "About ..." server popover with a new helper,closeWithEscape(layer). The helper presses Escape again while the popover is still open, so an Escape that Radix ignores no longer fails the play. Story-only change, no product change.Fixes #7650
Background
#7651 added
waitForModalLayerfor modal dialogs and left these two plays out (#7650). The "About ..." element is a non-modal RadixPopover(MCPServerIdentityBadge.tsx:86).Radix ignores Escape until a new layer's second re-render (
@radix-ui/react-dismissable-layer/dist/index.mjs)::40computes the layer's index at render. It is -1 until the node is incontext.layers.:68-78adds the node in an effect and dispatchesdismissableLayer.update.:94re-renders on that update. Only then is:60isHighestLayertrue, so Escape dismisses.A modal layer shows step 3 as inline
pointer-events: auto(:104), whichwaitForModalLayerwaits on. A non-modal layer gets no inline style, and nothing else in the DOM changes on that re-render. Focus inside the content is not a safe signal either: the popover'sFocusScopeauto-focus (react-popover/dist/index.mjs:227) runs in the same effect flush, before the re-render.Implementation
closeWithEscape(layer)insrc/browser/stories/storyPlayHelpers.tsruns awaitFor(5 s). In each try it presses Escape only while the layer hasdata-state="open"(react-popover/dist/index.mjs:242), then fails until the layer is gone. An accepted Escape setsdata-state="closed"in the same discrete event, so the helper presses no Escape after the popover took one. It replaceskeyboard("{Escape}")pluswaitFor(not.toBeInTheDocument())at the three Escape presses in the two plays.Trade-off: the plays now prove "Escape closes the popover", not "the first Escape closes it". A bug that makes the first Escape do nothing would pass. Without a DOM signal for the Radix re-render (
:40,:60,:94above), I found no deterministic alternative short of a product change. Tracked in #7657.Validation
Same method as #7651: in the built Storybook asset I changed Radix's update listener from
const T=()=>f({})toconst T=()=>setTimeout(()=>f({}),1000), servedstorybook-static, and ranbun x test-storybook --url ... --testTimeout 60000 --maxWorkers=4 src/browser/stories/App.mcpToolIdentity.stories.tsx. I removed the patched build after the runs.origin/mainc7221acServerDetails,PluginServerDetails:expect(element).not.toBeInTheDocument())Local gates:
make static-check,make lint-eslint,make dry-check.Risks
Low. Only two story plays and one new story helper change.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$449.92