New Document dialog: orientation toggle, size presets, and a guard against 0-size documents
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Start in editor/src/messages/dialog/new_document_dialog/ and read how the dialog stores W/H, handles Infinite Canvas, and submits dimensions. The request specifies orientation toggling, screen and paper presets, and a 1 px minimum; keep changes within the dialog as described. Done means the controls behave as specified and submission creates a nonzero artboard when Infinite Canvas is off.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The New Document dialog (editor/src/messages/dialog/new_document_dialog/) currently has a name field, an Infinite Canvas checkbox, and W/H inputs. I'd like to propose a few small quality-of-life improvements that live entirely inside the dialog. PortfolioMessage::NewDocumentWithName, GraphOperationMessage::NewArtboard and the rest of Submit would stay as they are.
1. Portrait / Landscape toggle
An "Orientation" row with a two-option Portrait / Landscape radio, replacing the need to swap W and H by hand. The active option follows the dimensions (landscape when W > H). Clicking the inactive one swaps W and H, so one click toggles. A small swap button between W and H does the same toggle, for people who think in terms of swapping the two numbers. All of these are disabled while Infinite Canvas is checked, and the radio is also disabled for square sizes.
A plain swap-dimensions button was already attempted in #4138, which was closed in the backlog cleanup (#4647) rather than for a problem with the idea. Bot review feedback there was only that it should be disabled in infinite-canvas mode. I think a labeled toggle that shows the current orientation is clearer than an unlabeled swap icon, but I'm happy to go with only an icon button if you prefer.
2. Size presets
A dropdown above Dimensions with common sizes:
- Screen: 1920x1080, 1280x720, 3840x2160, 1080x1080
- Paper: A3, A4, A5, Letter
Picking one fills W/H in the current orientation. A preset stays selected when the orientation is toggled, and editing W/H by hand switches the dropdown to "Custom". Presets are plain dialog state and never reach the document code. Paper sizes are pixel values at an assumed 96 DPI (CSS px), which is open to discussion.
3. Guard against 0-size documents
W and H currently have a minimum of 0. If either is 0 with Infinite Canvas off, Submit skips creating the artboard (self.dimensions.x > 0 && self.dimensions.y > 0), so the user silently gets an empty document with no artboard. I'd raise the minimum to 1, so a typed 0 clamps to 1 px. Open to disabling OK instead if you prefer.
Related
- Enter doesn't confirm the dialog after editing values (#3601). I'd be glad to include a fix for this in the same PR, since it's the same dialog.
- Footer button mnemonics (#3605), which touches the same dialog.
Willingness to implement
I'd like to implement this myself if you approve. I already have a working prototype (about 80 lines, all inside new_document_dialog/), so the screenshot is the real dialog. I know the backlog is tight for 1.0, so I'd keep the PR small and dialog-only, with before/after screenshots. If you'd like it split (for example the guard and orientation toggle first, presets after), I'm happy to do that.
The mockup screenshots are generated with the help of AI.
- Ngôn ngữ chính
- Rust
- Star
- 27.8k
- Fork
- 1.3k
- Merge trung bình
- 17 giờ 32 phút
- Pull request đã merge (30 ngày)
- 171
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của GraphiteEditor/Graphite
-
`third-party-licenses` fails on Windows when the parent process is PowerShellCó thể đã có người làm @sahilshingate01 đã nhận 9 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
GraphiteEditor/Graphite#4745 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Resizing a text box by one edge handle incorrectly locks both Max Width and Max Height, silently clipping textCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
GraphiteEditor/Graphite#4396 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type hint is selected in node graph viewCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
GraphiteEditor/Graphite#4311 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`cargo run` fails on WebAssembly target due to `CARGO_BUILD_TARGET` leaking into `rustc_codegen_spirv` buildCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
GraphiteEditor/Graphite#3939 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
GraphiteEditor/Graphite#4853 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của GraphiteEditor/Graphite
Issue tương tự
-
good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
servo/rust-smallvec#827 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nowledge-co/hawdb#1400 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
calcit-lang/caps#16 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
penso/herdr-gpui#934 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🎉 Add BossanovaĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
jaywcjlove/awesome-mac#4096 ·
Maintainer thường phản hồi trong vòng 1 ngày