Repository navigation
feat(ui): open the Script pane from Command Search - #3515
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| await js(`(() => { | ||
| const clipboardData = new DataTransfer(); | ||
| clipboardData.setData("text/plain", ${JSON.stringify(script)}); | ||
| document.dispatchEvent(new ClipboardEvent("paste", { clipboardData, cancelable: true })); |
There was a problem hiding this comment.
Low-confidence robustness note on the synthetic paste. new ClipboardEvent("paste", …) is created without bubbles: true, so it only reaches listeners on document itself. If eframe's paste handler is attached to window or to the hidden text input, the paste never arrives and the script never runs. The run is still fail-loud (the CSV wait times out), and the author reports ten passing runs, so this may already work. Adding bubbles: true (and dispatching on the focused element if eframe listens there) would remove the dependence on where the listener sits.
| document.dispatchEvent(new ClipboardEvent("paste", { clipboardData, cancelable: true })); | |
| document.dispatchEvent(new ClipboardEvent("paste", { clipboardData, bubbles: true, cancelable: true })); |
Category: quality
There was a problem hiding this comment.
Left for the release quality pass.
| bitmap.close(); | ||
| const pixels = new Uint32Array(ctx.getImageData(0, 0, width, height).data.buffer); | ||
| return { width, height, varied: pixels.some((pixel) => pixel !== pixels[0]) }; | ||
| })()`).catch(() => { throw new Error("PNG download could not be decoded"); }); |
There was a problem hiding this comment.
The .catch turns every failure of the decode script into "PNG download could not be decoded", including a page error or a Chrome stop that the js helper reports. That hides the cause in the failure message, which is what this smoke test exists to report. Keep the original error, or add it to the message:
| })()`).catch(() => { throw new Error("PNG download could not be decoded"); }); | |
| })()`).catch((e) => { throw new Error(`PNG download could not be decoded: ${e.message}`); }); |
Category: quality
There was a problem hiding this comment.
Left for the release quality pass.
Code reviewI read the full diff (3 files), the base-branch AGENTS.md, the PR metadata, and the surrounding code: the Script pane's focus handling, the Bugs: None found. The focus flag is consumed only after the pane draws, and it is set only when the palette command leaves the Script pane open, so a toggle that closes the pane does not set it. Security: None found. The smoke test passes its paste and script through Performance: None found. The browser smoke adds two downloads and a decode in Chrome, all of which wait on events, not fixed sleeps. Confidence: high. Quality:
AGENTS.md: No breaks found. No command was added or renamed, so the command-surface snapshot is unaffected. The change is not in a Earlier concerns: None. Change sizeCompared with the base branch: the whole PR against main (merge base 21e9aa5 to PR head a4c3e70).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
A warm local browser step took 71.32 s with upstream's smoke and 82.09 s with the export checks. The previous click-based export smoke took 81.68 s on the same base. The after timings include the median of three alternating smoke runs and the measured warm packaging time.
Command Search now lists Script under Analyze › Geoprocessing. Selecting it runs the ribbon's existing Script pane command and focuses the editor. The desktop and browser palettes and the desktop interface on mobile share the entry. The shortcut editor also lists Script through the same catalog. Close the pane as usual to return to the map.
The browser smoke opens the pane by name, pastes and runs a short script, and checks the downloaded files. It verifies the CSV header, three rows, and the edited value for parcel
00101. It also verifies the PNG signature, 320×240 dimensions, and pixel variation.Testing
Ten consecutive runs passed on the rebased dev package. Removing the palette entry failed both the palette regression and browser smoke. Separate product mutations made the smoke reject a stale CSV value and a correctly sized flat PNG. The UI and web suites, scoped Clippy and both command-list checks passed.
UI evidence
Before, and after:
Related issue
Regression coverage for #3124 and the browser file command path used by #3229.
Summary by CodeRabbit