Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

New Document dialog: orientation toggle, size presets, and a guard against 0-size documents

Aperta
#4,843 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
design, frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

New Document dialog prototype: A4 portrait, A4 landscape, preset dropdown open, Infinite Canvas checked

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.

Lingua principale
Rust
Stelle
27.8k
Fork
1.3k
Merge medio
17h 32m
PR unite (30g)
171

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GraphiteEditor/Graphite

Tutte le issue di GraphiteEditor/Graphite

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.