Skip to content

feat(ui): open the Script pane from Command Search - #3515

Merged
Mavrick-F merged 2 commits into
opengeos:mainfrom
Mavrick-F:feat/script-command-search
Dec 1, 2026
Merged

Mavrick-F merged 2 commits into
opengeos:mainfrom
Mavrick-F:feat/script-command-search

Conversation

@Mavrick-F

@Mavrick-F Mavrick-F commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

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.

  • The fork's full Linux gate passed on this commit: run.

UI evidence

Before, and after:

Command Search without Script

Command Search with Script first

Related issue

Regression coverage for #3124 and the browser file command path used by #3229.

Summary by CodeRabbit

  • New Features
    • Added Script to Command Search. Selecting it opens the Script pane and focuses the editor.
  • Tests
    • Expanded smoke checks to verify editing a table, exporting CSV and PNG files, and validating their contents and dimensions.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Script pane is now available through Command Search, which requests focus for its editor. The browser smoke test runs a script that edits table values and exports CSV and PNG files, then validates the downloaded files.

Changes: Script Workflow

Layer / File(s) Summary
Script pane command and focus
crates/ui-egui/src/analysispane.rs, crates/ui-egui/src/chrome.rs
Command Search now lists the Script pane. Running the command requests focus for the script editor, and a test checks that the pane opens with the editor focused.
Script execution and export checks
apps/rustgis-web/smoke/run.mjs
The smoke test positions the pointer at the canvas center, waits for completed downloads, and validates the saved project and script exports. The script changes parcel assessment values, exports a CSV, zooms to full extent, and exports a 320×240 PNG. CSV and PNG checks verify the expected content and image properties.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related PRs

Suggested reviewers: giswqs

Merge Risk: Minimal · up to a4c3e

Command Search gains a Script entry that opens the pane and focuses its editor. Browser smoke coverage is extended to check exported CSV and PNG files. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(ui): open the Script pane from Command Search" matches the main change. Command Search now lists Script under Analyze › Geoprocessing, and selecting it opens the Script pane and focuse…
Description check Passed The description follows the template sections: Summary, Testing, UI evidence, and Related issue. The Summary explains the Command Search entry and the browser smoke changes. Testing lists the runs, mu…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(ui): open the Script pane from Command Search" matches the main change. Command Search now lists Script under Analyze › Geoprocessing, and selecting it opens the Script pane and focuses the editor. The title is short, specific, and follows the conventional-commit style.

Full details: Description check

Explanation

The description follows the template sections: Summary, Testing, UI evidence, and Related issue. The Summary explains the Command Search entry and the browser smoke changes. Testing lists the runs, mutations, and suites that passed. UI evidence includes before and after screenshots, as the template requires for changed UI. The Related issue section references #3124 and #3229. The Summary opens with warm-run timing figures that do not explain the change itself. The Related issue entry does not use the template's Closes/Part of wording.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit taps the Script pane key,
Then pastes commands for all to see.
A CSV hops out, rows in a line,
A bright PNG lands, its pixels fine.
“The test is done!” the rabbit sings with glee.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 3ae58c9d-b5fd-4fcb-af2b-5f7502dd4233
Commits

Reviewing files that changed from the base of the PR and between 21e9aa5 and a4c3e70.

Files selected for processing: 3

  • apps/rustgis-web/smoke/run.mjs
  • crates/ui-egui/src/analysispane.rs
  • crates/ui-egui/src/chrome.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

await js(`(() => {
const clipboardData = new DataTransfer();
clipboardData.setData("text/plain", ${JSON.stringify(script)});
document.dispatchEvent(new ClipboardEvent("paste", { clipboardData, cancelable: true }));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
document.dispatchEvent(new ClipboardEvent("paste", { clipboardData, cancelable: true }));
document.dispatchEvent(new ClipboardEvent("paste", { clipboardData, bubbles: true, cancelable: true }));

Category: quality

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"); });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
})()`).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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left for the release quality pass.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Code review

I 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 ui.pane.script dispatch, the script commands the smoke test runs, and the smoke harness's event, press and typing helpers. I found no bugs, security issues or AGENTS.md breaks. Two low-confidence quality points are posted inline on apps/rustgis-web/smoke/run.mjs.

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. ui.pane.script is already dispatched in lib.rs and ribbon.rs, so the new palette row points at a live command. Confidence: moderate-high.

Security: None found. The smoke test passes its paste and script through JSON.stringify and the base64 is alphanumeric, so the js template interpolation is safe. Confidence: high.

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:

  • run.mjs:474: the synthetic paste event lacks bubbles: true, so it only reaches document-level listeners. The test is fail-loud if it misses, and the author reports ten passing runs, so this is low confidence. (Posted inline.)
  • run.mjs:396: the .catch in checkPng replaces the real error with "could not be decoded", which hides the cause. (Posted inline.)
  • The new script_focus_requested field is pub(crate) while its neighbours are pub. Style only; left for the release quality pass.

AGENTS.md: No breaks found. No command was added or renamed, so the command-surface snapshot is unaffected. The change is not in a wasm32 branch and adds no file access, so the wasm and twin checks do not apply. The smoke test uses event waits, not timers.

Earlier concerns: None. prior-reviews.json has no threads, so nothing was left alone as already raised.

Change size

Compared with the base branch: the whole PR against main (merge base 21e9aa5 to PR head a4c3e70).

Measure Value
Files changed 3 (added 0, modified 3, removed 0, renamed 0)
Size before 415.1 KB
Size after 420.2 KB
Total size change +5.1 KB
Path Before After Change
apps/rustgis-web/smoke/run.mjs 21.3 KB 25.1 KB +3.8 KB
crates/ui-egui/src/chrome.rs 146.0 KB 147.0 KB +1.0 KB
crates/ui-egui/src/analysispane.rs 247.8 KB 248.1 KB +284 B

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3515/
Web app https://preview.rustgis.app/pr-3515/app/
Commit a4c3e70

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 preview label (once per commit).

@Mavrick-F
Mavrick-F added this pull request to the merge queue Dec 1, 2026
Merged via the queue into opengeos:main with commit bda8663 Dec 1, 2026
32 checks passed
@Mavrick-F
Mavrick-F deleted the feat/script-command-search branch December 1, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant