Repository navigation
fix(web): pressing Escape on the Environments map clears selection without closing Settings - #43017
Conversation
…thout closing Settings
|
This PR changes the test suite by +3 test cases (browser +3, unit 0, server 0). New browser test files: Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…map-escape-keeps-settings-open Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidenceChromium, 1280×800, light theme; fresh synthetic data on each commit. Opened Settings → Connections → Environments, Map view. Selected the environment node and pressed Escape twice. Repeated after selecting This browser and clicking empty space in Details. Base closed Settings on the first Escape in both paths. Head cleared selection on the first Escape and closed Settings on the second.
The comparison exited 0: fails on base and passes on head. Not shown:
|












Problem
When a machine, link or stack is selected on the Environments map (Settings → Connections → Environments) and Escape is pressed, the whole Settings dialog closes instead of only clearing the selection. The map's canvas lets Escape bubble to the dialog's document-level listener, and the details panel, which keeps focus after choosing a machine or link inside it, does not handle Escape.
Change
While something is selected, the canvas handles Escape and stops propagation, as the map's search field already does. The details panel does the same when the panel itself has focus, so Escape inside its fields and menus keeps its current behavior. With nothing selected, Escape bubbles as before, so a second Escape still closes Settings. Safari does not focus a clicked button, so a click on a map control now focuses it, as Chrome already does.
Scope
Small fix of an obvious bug (one Escape closes the dialog), so no issue. The map is web-only UI; desktop uses the same web UI, and mobile has no Environments map. Clicking a link's line (not its label) still leaves focus outside the map, as before, so Escape there closes Settings; making the canvas focusable is a separate change.
Verification
Setup: T3 web app from source (dev runner), Browser panel 2560x1600, light theme, isolated unseeded dev data (server labelled "Test machine").
Steps: open Settings → Connections → Environments (Map view) → click the Test machine node (its details show below the map) → press Escape.
On e242ed0 one Escape with Test machine selected closes Settings.
On 3d31e84 the same Escape returns the details to "1 machine" and Settings stays open (the ring is keyboard focus).
With Test machine selected and focus on the details panel (click its empty area), Escape on 3d31e84 also keeps Settings open:
An AI agent ran these checks. On 3d31e84 a second Escape closes Settings in both cases.
EnvironmentsMap.browser.test.tsxrenders the map inside the Settings dialog and covers Escape from the map, from the details panel, and after a click that does not move focus (as in Safari). All three pass in 3 of 3 runs and fail with e242ed0's map files; removing only the click focus, or only the details change, fails its own case. In the Browser panel with click focus blocked, Escape also kept Settings open.vp run check:changedexits 0.Not shown:
Generated with Claude Opus 5.5 in T3 Code Nightly