Skip to content

feat: full Windows compatibility, mantis-ui compat crate, shots & bundle scripts - #3

Merged
sushilm20 merged 26 commits into
mainfrom
feat/windows-support
Dec 1, 2026
Merged

sushilm20 merged 26 commits into
mainfrom
feat/windows-support

Conversation

@sushilm20

@sushilm20 sushilm20 commented Dec 1, 2026 •

Copy link
Copy Markdown

What and why

  • Add full Windows compatibility across the Rust/GPUI workspace while preserving macOS/Unix code paths for upstream syncs (#[cfg(target_os = macos)] / #[cfg(unix)]).
  • Add mantis_core::paths for cross-platform home, app-data, cache, config, and projects directories.
  • Port agent CLI discovery and .cmd/.bat npm shim resolution (command_for / npm_node_command), Win32 PrintWindow/PostMessageW snapshot capture, DST-safe local_day, GetProcessTimes CPU timing, Windows keybindings, and pure-Rust hayro PDF rendering.
  • Add vendor/mantis-ui GPUI 0.2.2 compatibility crate, AGENTS.md, CLAUDE.md, .github/workflows/ci.yml, scripts/env.ps1, scripts/shots.ps1, and scripts/bundle.ps1.
  • Incorporates all fixes from the 15 review passes on feat: full Windows compatibility, mantis-ui compat crate, shots & bundle scripts #2 plus all subsequent PR feat: full Windows compatibility, mantis-ui compat crate, shots & bundle scripts #3 hardening fixes.

Screenshots

Captured with .\scripts\shots.ps1 -State theme=dark,tab=parts,chat=sample on Windows:

Mantis Windows (theme=dark,tab=parts,chat=sample)

Tests

  • cargo fmt --manifest-path vendor/mantis-ui/Cargo.toml --check (pass)
  • rustfmt --edition 2024 --check crates/mantis-core/src/paths.rs crates/mantis-app/src/snapshot.rs crates/mantis-agent/src/harness.rs (pass)
  • cargo clippy --workspace --all-targets (pass, exit 0)
  • cargo test -p mantis-ui (4 passed; 0 failed)
  • cargo test --workspace (209 additional crate unit/integration tests pass; 3 live-agent CLI tests ignored; 0 failed)
  • .\scripts\shots.ps1 -State theme=dark,tab=parts,chat=sample -Name shot-v23.png (pass)
  • .\scripts\bundle.ps1 (target\Mantis-windows-x64 and target\Mantis-windows-x64.zip, pass)

Copilot AI balanced review requested due to automatic review settings December 1, 2026 00:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@sushilm20

Copy link
Copy Markdown
Author

@loopyreviews-bot review

Comment thread .github/workflows/ci.yml Resolved
Comment thread scripts/bundle.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
Comment thread vendor/mantis-ui/src/components.rs Resolved
@loopyreviews-bot

loopyreviews-bot Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Loopy review

Confidence: 5/5 — No open findings.

Reviewed 2 of 38 changed files, skipping 1 ignored file(s).

This PR adds Windows support to the Mantis Rust/GPUI workspace. It adds a cross-platform mantis_core::paths module and agent CLI discovery with .cmd/.bat shim handling. It ports snapshot capture to Win32 and adds a vendor/mantis-ui compatibility crate, CI, and bundle.ps1/shots.ps1. I reviewed only scripts/bundle.ps1 and scripts/shots.ps1.

  • bundle.ps1 builds the release binaries, stages them in a temp directory, and zips them. It publishes with backup and rollback under a lock file. The binary names it copies (mantis, mantis-cli, mantis-server) match the Cargo [[bin]] entries.
  • shots.ps1 builds mantis-app and runs it with the MANTIS_* environment variables set. It captures to a temp file, enforces a timeout, and guards against orphaned processes with a PID marker. It restores the environment on exit.
  • I found no new defects in these two scripts. The issues already dismissed on this PR are not raised again.

Review passes: 3 ran (general, failure-paths, state) · 52 unit and lens pair(s) carried over from earlier reviews.

Ran on: Claude on a Mac. Muse on a Mac: its quota is spent until 1 December 22:50 UTC.

Reviews: 13 · last reviewed 0658da7 · harness claude/claude-sonnet-5-5 · Reply @loopyreviews-bot review to re-run · @loopyreviews-bot remember <rule> to teach Loopy

Comment thread crates/mantis-agent/src/harness.rs Resolved
Comment thread vendor/mantis-ui/src/anim.rs Resolved
Comment thread vendor/mantis-ui/src/toast.rs Resolved
@sushilm20

Copy link
Copy Markdown
Author

Fixed all 4 P2 findings in \4f57f04:\n- Aligned \AGENTS.md, \CLAUDE.md, and .github/workflows/ci.yml\ \ mt\ check across fork-owned files (\�endor/mantis-ui\ + \paths.rs/\snapshot.rs/\harness.rs).\n- Extracted \scripts/env.ps1\ to discover Cargo and CMake (VS 17/18 BuildTools, standalone CMake, \�swhere) instead of hardcoding VS 18.\n- Restored \PATH\ and \MANTIS_*\ env vars in \ inally\ blocks in \scripts/shots.ps1\ and \scripts/bundle.ps1.\n- Added .occlude()\ to both \Dialog\ and \AlertDialog\ modal backdrop overlays.\n\n@loopyreviews-bot review

Mantis Windows (theme=dark,tab=parts,chat=sample)

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread scripts/bundle.ps1 Resolved
Comment thread scripts/env.ps1 Resolved
Comment thread vendor/mantis-ui/src/components.rs Resolved
@sushilm20

Copy link
Copy Markdown
Author

Fixed all 5 P2 findings from review #3 in \9cbbdf6:\n- Pinned all GitHub Actions in .github/workflows/ci.yml\ to full 40-char commit SHAs and added \cargo test -p mantis-ui.\n- Resolved \ arget_directory\ dynamically via \cargo metadata\ in both \scripts/bundle.ps1\ and \scripts/shots.ps1.\n- Expanded \scripts/env.ps1\ CMake fallback search across both \ProgramFiles\ and \ProgramFiles(x86)\ for VS 18/2022 editions.\n- Rendered both checkmark and icon in \MenuItem::render\ when both are present.\n\n@loopyreviews-bot review

Mantis Windows (theme=dark,tab=parts,chat=sample)

Comment thread vendor/mantis-ui/src/components.rs Resolved
@sushilm20

Copy link
Copy Markdown
Author

Fixed the remaining slider endpoint P2 in \c772ba4\ with unit test \slider_reaches_unaligned_endpoints\ (4/4 \mantis-ui, full \cargo test --workspace, \cargo clippy --workspace --all-targets, \shot-v17.png, and \�undle.ps1\ passing).

@loopyreviews-bot review

Mantis Windows (theme=dark,tab=parts,chat=sample)

Comment thread .github/workflows/ci.yml Resolved
@sushilm20

Copy link
Copy Markdown
Author

Updated .github/workflows/ci.yml to use per-PR concurrency group ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} in 6312f3a.

@loopyreviews-bot review

Comment thread scripts/bundle.ps1 Resolved
Comment thread scripts/bundle.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
@sushilm20

Copy link
Copy Markdown
Author

Fixed all 5 P2 findings in \scripts/bundle.ps1\ and \scripts/shots.ps1\ in \94ed33c\ (atomic temp staging/zip swap so failures preserve prior packages, resolve relative paths before changing directory, restore caller cwd + env vars in \ inally, and bounded process wait + kill on timeout in \shots.ps1), verified from an external working directory.

@loopyreviews-bot review

Mantis Windows (theme=dark,tab=parts,chat=sample)

Comment thread scripts/bundle.ps1 Resolved
Comment thread scripts/bundle.ps1 Resolved
Comment thread scripts/bundle.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
@sushilm20

Copy link
Copy Markdown
Author

Fixed all 6 script failure-path/concurrency P2s in \669c296:\n- \scripts/bundle.ps1: acquires exclusive .mantis-bundle.lock, stages/zips on the same volume, rolls back both stage folder and archive on swap failure, and preserves $tmpRoot\ with a warning if rollback itself fails.\n- \scripts/shots.ps1: captures to a unique temporary PNG path (preserving prior screenshots and preventing stale reuse), and ensures timed-out processes are terminated and waited on cleanly.\n\n@loopyreviews-bot review

Mantis Windows (theme=dark,tab=parts,chat=sample)

Comment thread scripts/bundle.ps1 Resolved
Comment thread scripts/bundle.ps1 Resolved
Comment thread scripts/bundle.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
@sushilm20

Copy link
Copy Markdown
Author

Fixed all 6 findings in scripts/bundle.ps1 and scripts/shots.ps1 in 3560334:

  • scripts/bundle.ps1: track $publishedStage/$publishedZip so rollback also removes partial new artifacts when no prior backup existed, isolate stage/archive rollback in independent try blocks, and dispose .mantis-bundle.lock and temp backup BEFORE Set-Location $prevLocation.
  • scripts/shots.ps1: create nested -Name parent directories before capture, serialize concurrent writes with an exclusive lock disposed before Set-Location, and bound post-kill WaitForExit(5000) waits.

@loopyreviews-bot review

Mantis Windows (theme=dark,tab=parts,chat=sample)

Comment thread scripts/bundle.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
@sushilm20

Copy link
Copy Markdown
Author

@loopyreviews-bot review

@sushilm20

Copy link
Copy Markdown
Author

Fixed all 4 P2 findings from review #9 in 72e9a37:

  • scripts/bundle.ps1:111: wrap temp staging cleanup in try/catch and Write-Warning with the preserved $tmpRoot path if deletion fails instead of swallowing errors.
  • scripts/shots.ps1:70: validate $TimeoutSeconds with [ValidateRange(1, 3600)] so negative/zero values are rejected up front and reported timeout seconds always match actual wait duration.
  • scripts/shots.ps1:93: preserve $tmpOut ($preserveTmp = $true) and warn with the temp path when Move-Item publish fails.
  • scripts/shots.ps1:98: check WaitForExit(5000) return values and if mantis.exe ignores Kill() or hasn't exited (re-checked safely after Refresh()), preserve $tmpOut, keep $lockStream held, and warn clearly instead of deleting/unlocking under an orphan process.

@loopyreviews-bot review

Mantis Windows (theme=dark,tab=parts,chat=sample)

Comment thread scripts/shots.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
Comment thread scripts/shots.ps1 Resolved
@sushilm20

Copy link
Copy Markdown
Author

Fixed all 3 P2 findings from review #12 in scripts/shots.ps1 and scripts/bundle.ps1:

  • scripts/shots.ps1: reject empty/extensionless/non-.png -Name values up front before locking or building, matching image (png feature only) in Cargo.toml.
  • scripts/shots.ps1 & scripts/bundle.ps1: use [System.IO.Directory]::CreateDirectory(...), -LiteralPath across file checks/moves/removals, and System.IO.Compression.ZipFile::CreateFromDirectory(...) so bracketed filenames/directories like shot[1].png and mantis-bundle[1] work reliably without PowerShell wildcard misinterpretation.
  • scripts/shots.ps1: persist <OutFile>.pid (pid|StartTimeUtc) across script exits when an orphan mantis.exe survives Kill() and check process identity (ProcessName + StartTimeUtc) on startup, while cleanly disposing $lockStream on exit.

Verified locally with extensionless rejection (-Name shot), bracketed screenshot (-Name shot[1].png), bracketed bundle (-OutDir ...\mantis-bundle[1]), and shot-v24.png.

@loopyreviews-bot review

Mantis Windows (theme=dark,tab=parts,chat=sample)

@sushilm20
sushilm20 merged commit c3bb8d7 into main Dec 1, 2026
10 of 13 checks passed
@sushilm20
sushilm20 deleted the feat/windows-support branch December 1, 2026 20:56
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.

2 participants