Skip to content

fix(desktop-gpui): honor export preset height - #2494

Open
jatmn wants to merge 4 commits into
CapSoftware:mainfrom
jatmn:fix/274-export-height
Open

jatmn wants to merge 4 commits into
CapSoftware:mainfrom
jatmn:fix/274-export-height

Conversation

@jatmn

@jatmn jatmn commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Selecting 1080p for an ultrawide Studio project currently fits the canvas inside 1920×1080, so a 3840×1080 canvas exports at 1920×540. The GPUI export picker now derives width from the configured canvas and selected height, using the same dimensions for previews, estimates, file/clipboard exports, and share-link exports.

The change reuses the renderer’s crop, padding, aspect-ratio, and codec-alignment behavior. Unsupported sizes and zero-height canvases produce recoverable errors before rendering; alignment cannot overflow. Supported presets retain their selected height. Saved presets receive the same validation, and stale preview/estimate results cannot replace an error. Pending sign-in cancellation is handled before size validation, so changing to an unsupported preset does not block Cancel Sign In.

Validation on Linux:

  • The original height regression tests fail against the original sizing implementation.
  • Size-limit regressions fail with the guard disabled and pass with it enabled, covering positive narrow crops, supported lower-resolution controls, and codec alignment at the limit.
  • Zero-height crop and unalignable-width tests reproduce the debug overflow before repair and pass afterward. All 15 export-module tests pass in the actual GPUI test binary.
  • A source-extracted dispatcher probe reproduces the cancellation-ordering failure before repair and passes afterward, including a control proving unsupported dimensions still block new sign-in. This uses mocked window/auth boundaries; no browser session was launched.
  • Scoped Cargo formatting, cargo check -p cap-desktop-gpui, and git diff --check pass using Rust 1.95.0.
  • Manual GUI/encoded-video exports and macOS/Windows runtime validation were not performed locally.

Fixes #274.

Reviewed commit: 2bc38acb54af329f3bcc73e2852251e116cfc0be.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable defects were found.

Summary

The export picker now derives width from the project canvas and the selected height.

  • Export presets keep their selected height on every canvas shape.

The previous commit is an ancestor of the current head, but their merge bases differ. This review therefore covered the full PR diff. No previous review threads were supplied.

git diff --check passed. Builds, tests, GUI checks, and encoded-video exports were not run during this review.

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

@jatmn is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

@jatmn
jatmn marked this pull request as ready for review October 13, 2026 18:07
@richiemcilroy

Copy link
Copy Markdown
Member

@jatmn thanks for digging into this! A few things before we can merge: 1) apps/desktop-gpui/src/editor_export.rs:136 ExportResolution::size now returns an error when the computed width passes 8192, which blocks exports that work today (for example a 3840x600 crop on the 4K preset currently exports at 3840x600, and with this change it refuses). Main already clamps to the texture limit inside ProjectUniforms::get_output_size (crates/rendering/src/lib.rs MAX_OUTPUT_DIMENSION), so could you scale down to fit instead of erroring, keeping the aspect ratio? 2) The branch conflicts with main in start_export: sign-in moved to the global SignIn entity (SignIn::global(cx), is_pending(), cancel), so please rebase and keep that flow. 3) Wide canvases now export much larger (3840x1080 canvas on 4K becomes 7680x2160). Could you attach an actual MP4 export at that size on macOS (VideoToolbox) and Windows (Media Foundation) showing it encodes with the hardware H.264 path and plays back, plus the before/after output dimensions and export time? Thanks!

# Conflicts:
#	apps/desktop-gpui/src/editor_export.rs
@richiemcilroy

Copy link
Copy Markdown
Member

@greptileai review

This branch has not been deployed

No deployments
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.

Resolution picker should lock height, not width

2 participants