Skip to content

feat(ui): the Publication Layout Wizard draws each style's outline (#2850) - #3106

Merged
jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:feat/2850-wizard-outlines
Nov 27, 2026
Merged

jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:feat/2850-wizard-outlines

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Publication Layout Wizard's style step draws each style's outline beside its name and description: where its title, map and footer go, and the column or panel a style keeps for its locator and legend, on a portrait A4 page. The outlines follow layout.publication's arrangement of each style; a locator or legend over the map isn't drawn, as its corner follows the data. This is the second part of #2850.

  • Each outline shows the accent where its sheet takes it: the style's own colour, or the one picked in the Accent step, then on every outline. Classic's sheet draws the accent nowhere, so its outline has none. An accent only seeded from the selected style's default, never changed, isn't a picked colour, so each outline keeps its own (Draft::chosen_accent, used by the existing rule that re-seeds it on a style change).
  • A click on an outline picks the style, as on its name. Each outline is named "{style}: outline" for screen readers and takes no keyboard focus: the radio button is the keyboard's way. A style without an outline of its own takes Classic's.
  • Each description now sits beside the outline, under the radio button, without the indent it had.
  • It is an outline, not the sheet: laying the real one out six times on every change would run the placement six times. It stays portrait whatever the orientation picked.
  • The wizard's steps are 40 points taller (320 → 360) so the six styles still fit without scrolling in English.
  • The new "{style}: outline" string waits for the release translation pass.
  • Reach: the egui interface on desktop and web. No command, CLI, Python, phone, ribbon or command search, assistant or MCP, project or undo change.

Testing

  • New tests in publicationwizard/style.rs, written first and seen failing: each style has its own outline inside its page, with its title, accent marks and cards where its sheet has them, every filled mark at least a point thick; the fallback; the accent drawn on the style step with none picked, one picked and a seeded one; a click on an outline; Tab never stopping at one; its name in logical order in a right-to-left language; the picked frame not cut by the scroll area.
  • Checks on 20681a0: fmt, clippy, nextest (9937 passed, 29 skipped), doctests, layers and cargo xtask schema --check green.
  • The outlines were compared by eye with the sheet layout.publication makes in each style (ui_shot, A4 portrait, World Atlas), and the style step shot before and after.

UI evidence

Style step, before (left) and after (right):

Style step before and after

Poster picked:

Poster picked

Related issue

Closes #2850

Summary by CodeRabbit

  • New Features

    • Added clickable page-layout previews to the style-selection step. Each preview reflects the style’s layout and accent color, and selecting one chooses that style.
    • Updated the accent color when switching styles if it hasn’t been customized.
  • Documentation

    • Updated the user guide to describe the layout previews and how to select a style.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The publication style step now displays a page outline for each style. Users can select a style by clicking its outline or using its radio button. The previews use the picked accent or the style’s default accent, and the documentation describes the outlines.

Changes: Publication style outlines

Layer / File(s) Summary
Render style outlines
crates/ui-egui/src/publicationwizard/mod.rs, crates/ui-egui/src/publicationwizard/style.rs
A draft helper distinguishes a picked accent from a style’s default. The renderer draws scaled page previews for the publication styles. Tests cover preview geometry, layout, and accent behavior.
Integrate outlines into the style step
crates/ui-egui/src/publicationwizard/style.rs, crates/ui-egui/src/publicationwizard/mod.rs, docs/user-guide/layouts.md
The style step displays clickable, labeled outlines and frames the selected style. The radio button remains the keyboard selection control. A seeded accent changes to the new style’s default when the style changes. The wizard height increases, and the guide describes the outlines. Tests cover selection, focus, clipping, and accessible naming.

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant StyleStep
  participant Draft
  participant Outline
  User->>StyleStep: Click a style outline
  StyleStep->>Draft: Set selected style
  StyleStep->>Draft: Update seeded accent to new style default
  StyleStep->>Outline: Render from style and accent state
Loading

Possibly related issues

  • opengeos/RustGIS#2874 — This PR draws outlines using each style’s accent when no accent has been picked. It does not expose the engine’s Style::accent() method.
  • opengeos/RustGIS#3096 — This PR changes publicationwizard/style.rs, matching the requested per-step module layout, but does not implement the full file split described in the issue.

Possibly related PRs

  • opengeos/RustGIS#3099 — This PR modifies the wizard module structure and style file introduced by that PR.
  • opengeos/RustGIS#3056 — Both changes use the distinction between a seeded default accent and a picked accent when the style changes.
  • opengeos/RustGIS#2875 — This PR adds outlines to the wizard style step and uses the style and accent state established by that PR.

Suggested reviewers: giswqs, deniial00

Merge Risk: Minimal · up to 20681

The Publication Layout Wizard's style step now shows a page outline for each style, and clicking an outline selects that style. The change is confined to the desktop and web UI and has no data or command impact. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the Publication Layout Wizard's style step now draws an outline for each style. It is specific, a single sentence, and matches the raw summary and objectives. The issu…
Description check Passed The description follows the template. It has Summary, Testing, UI evidence (with before and after screenshots, which the template requires for visible UI changes), and Related issue (Closes #2850). Th…
Linked Issues check Passed Issue #2850 asks for a five-step wizard. Its second planned PR adds a drawn outline of each style, showing where the title, map, footer and locator/legend go, in the accent colour. The PR summary and …
Out of Scope Changes check Passed The changed areas are the publication wizard style step (style.rs), wizard constants and Draft accent helper (mod.rs), and the layouts user guide. Each change supports the outline objective of #2850: …
Full details: Title check

Explanation

The title names the main change: the Publication Layout Wizard's style step now draws an outline for each style. It is specific, a single sentence, and matches the raw summary and objectives. The issue number in the title is extra but harmless.

Full details: Description check

Explanation

The description follows the template. It has Summary, Testing, UI evidence (with before and after screenshots, which the template requires for visible UI changes), and Related issue (Closes #2850). The Summary explains the outlines, accent behaviour, accessibility, and size change. Testing lists the new tests and checks. The description is detailed and complete.

Full details: Linked Issues check

Explanation

Issue #2850 asks for a five-step wizard. Its second planned PR adds a drawn outline of each style, showing where the title, map, footer and locator/legend go, in the accent colour. The PR summary and description state that this part is implemented in crates/ui-egui/src/publicationwizard/style.rs and mod.rs. The style step draws a portrait A4 outline per style, with title, map, footer and column or panel. Accent handling follows the picked or default colour. Clicking an outline selects its style. Tests cover per-style geometry, accent states, click, Tab behaviour and right-to-left naming. The issue excludes a live preview of the real sheet, and the PR uses a simplified outline instead. Limitation: the repository diff could not be read because the changed blobs are missing from the checkout, so this verdict relies on the supplied PR summary and description, not on direct code inspection.

Full details: Out of Scope Changes check

Explanation

The changed areas are the publication wizard style step (style.rs), wizard constants and Draft accent helper (mod.rs), and the layouts user guide. Each change supports the outline objective of #2850: the outline drawing, the accent rule, the 320 to 360 point step height that fits the outlines, and the matching documentation. The PR states it excludes command, CLI, Python, phone, ribbon, command search, assistant/MCP, project and undo changes. No unrelated change is shown in the supplied evidence. Limitation: the file diffs could not be read directly, so this verdict relies on the supplied summary.

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 peeks at pages in a row
Each style reveals its shape to show
A chosen hue can color each preview
Or defaults tint the page anew
One click selects the style in view
Then off the rabbit hops, pleased through 🐇

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: bd2d43cc-1319-4b0f-8411-06c82707e1ce
Commits

Reviewing files that changed from the base of the PR and between 0235f78 and 20681a0.

Files selected for processing: 3

  • crates/ui-egui/src/publicationwizard/mod.rs
  • crates/ui-egui/src/publicationwizard/style.rs
  • docs/user-guide/layouts.md

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

const STEP_HEIGHT: f32 = 320.0;
/// The height every step takes: the style step's six styles, their outlines and descriptions,
/// with room for the rounding a high-density screen adds to each line.
const STEP_HEIGHT: f32 = 360.0;

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 quality note, not a defect. The description now sits in a ui.vertical beside the 34 pt outline, so its wrap width is narrower than the old indented label. The 360 pt step height is sized for the English text. Longer translations may wrap to more lines and make the style step scroll, which the existing scroll test does not cover. A translated-catalog check, or a note in the PR on how much room the longest locale needs, would settle it.

Category: quality

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Bugs: None found. I traced the accent logic against the old re-seed rule and the two are equivalent:

  • chosen_accent is computed before the loop, so a click mid-frame cannot change the colour of rows drawn after it.
  • A picked colour survives a style change; a seeded, never-picked accent is re-seeded to the new style's own colour.
  • Unticking the accent after a pick leaves each outline in its own colour.

Security: None. The change is pure egui drawing and adds no input handling, I/O or commands.

Performance: None significant. Each frame builds six small shape vectors and a few fmt_raw lookups. This is negligible, and the PR correctly avoids laying out the real sheet.

Quality:

  • Low confidence: the description now sits beside the 34 pt outline, which narrows its wrap width. The 360 pt step height is sized for English, so longer translations may scroll. Inline comment left on mod.rs:191.

AGENTS.md: No violations found.

  • The outline label goes through fmt_raw, which translates its template, so it is catalogued without a tl! wrapper. The PR defers the catalog entry to the release pass, as the rules allow.
  • Command ids and the command surface are unchanged. No assets were added, so ATTRIBUTION.md needs no change.
  • Reach is stated in the PR body: the egui desktop and web interface only. No command, CLI, Python, phone, ribbon or Assistant surface changes.
  • Test hygiene holds: no identical assert_eq! sides, and no timer waits.

Twins checked: The change touches no read routes, overlay tools, layer.add*/project.open* commands, or cfg(target_arch = "wasm32") branches, so none of those families apply. The ribbon's publication_style_buttons shares the same style names and fallback, and it needs no change.

Prior reviews: The thread list is empty, so there were no earlier concerns to skip.

Change size

Compared: the whole PR against main (merge base ac78a68 to PR head 20681a0).

Measure Value
Files changed 3 (0 added, 3 modified, 0 removed, 0 renamed)
Size before 99.1 KB
Size after 116.1 KB
Total size change +17.0 KB
Path Before After Change
crates/ui-egui/src/publicationwizard/style.rs 2.6 KB 18.9 KB +16.3 KB
crates/ui-egui/src/publicationwizard/mod.rs 22.4 KB 22.8 KB +396 B
docs/user-guide/layouts.md 74.2 KB 74.4 KB +253 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3106/
Web app https://preview.rustgis.app/pr-3106/app/
Commit 20681a0

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).

@jgregoriorincon
jgregoriorincon added this pull request to the merge queue Nov 27, 2026
Merged via the queue into opengeos:main with commit da4a833 Nov 27, 2026
28 checks passed
@jgregoriorincon
jgregoriorincon deleted the feat/2850-wizard-outlines branch November 27, 2026 11:24
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.

[Feature]: A step-by-step Publication Layout wizard: size, style, texts and accent before the sheet is made

1 participant