Skip to content

fix(ui): re-seed untouched wizard accent on style change and keep credit template extractable - #3056

Merged
jgregoriorincon merged 1 commit into
opengeos:mainfrom
ninhhaidang:fix/publication-wizard-accent-i18n
Nov 27, 2026
Merged

jgregoriorincon merged 1 commit into
opengeos:mainfrom
ninhhaidang:fix/publication-wizard-accent-i18n

Conversation

@ninhhaidang

@ninhhaidang ninhhaidang commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to the two review findings on #3041 in crates/ui-egui/src/publicationwizard.rs:

  1. Re-seed untouched accent on style change while ticked: When "Pick a colour of your own" is ticked on one style (seeding d.accent from that style's default) and the user goes back to Style and picks another style without having customised the colour, style_step now re-seeds d.accent to the new style's own accent. Editing the colour picker explicitly records d.picked = Some(*c), so a deliberately picked colour (even one equal to a style's default) is preserved across style switches and untick/retick, while an untouched style default is never saved as a stale custom colour.
  2. Keep the default credit line template extractable for i18n: Pass the literal "Made with RustGIS · {date}" to i18n::fmt (with tl_raw!("today's date")) so catalog extraction sees the template, while default_credit_matches_the_engines_constant asserts it stays equal to rustgis_engine::cmd::layout::PUBLICATION_DEFAULT_CREDIT.

Reach every surface

  • Desktop app & browser: both share crates/ui-egui/src/publicationwizard.rs (no platform-specific code).
  • CLI, Python, phone (ui-touch), Assistant, MCP, plugins: unaffected — no command, parameter, or schema changes.
  • The way back: unticking "Pick a colour of your own" returns to the style's own accent; switching styles with a custom colour keeps that custom colour.

Testing

  • cargo test -p rustgis-ui-egui --lib publicationwizard::tests (19/19 passed), including new test switching_style_while_accent_is_ticked_re_seeds_untouched_default and strengthened default_credit_matches_the_engines_constant.
  • cargo clippy -p rustgis-ui-egui -p rustgis -p rustgis-web -p rustgis-ui-touch -p rustgis-mobile --all-targets -- -D warnings
  • cargo test -p rustgis-ui-egui --test command_ids (2/2 passed)
  • cargo xtask layers, cargo xtask attribution, cargo xtask rows (768/768), cargo xtask test-hygiene, cargo fmt --all --check

UI evidence

No visible UI change.

Related issue

Follow-up to #3041 (#2874).

Summary by CodeRabbit

  • Bug Fixes
    • In the publication wizard, the accent color now follows the selected style when it hasn’t been customized. Styles without a defined accent use the application accent as a fallback.
    • Choosing a custom accent color preserves it when switching styles.

Copilot AI balanced review requested due to automatic review settings November 27, 2026 00:50

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.

@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 wizard now updates untouched accent defaults when the selected style changes and preserves user-picked colors. It also uses a literal default credit template and tests that the template matches the engine constant.

Changes: Publication wizard behavior

Layer / File(s) Summary
Accent selection and style changes
crates/ui-egui/src/publicationwizard.rs
The style step receives the application accent as a fallback. Untouched style-default accents follow style changes, while user-picked colors remain selected. Tests cover both cases.
Default credit template
crates/ui-egui/src/publicationwizard.rs
The wizard formats the default credit from a literal template. The test compares the template with the engine constant.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Possibly related issues

  • opengeos/RustGIS#2874: The issue covers the wizard’s style-based accent and default credit behavior, which this change updates.
  • opengeos/RustGIS#2850: The issue specifies the publication wizard’s accent and credit steps, which this change modifies.

Possibly related PRs

  • opengeos/RustGIS#3041: This PR introduced the wizard accent behavior that this change updates, and the credit template that it changes.
  • opengeos/RustGIS#2875: This PR introduced the wizard’s style, accent, and credit-line steps modified here.

Suggested reviewers: jgregoriorincon

Merge Risk: Minimal · up to 9c2b9

The publication wizard now re-seeds an untouched accent when the style changes and keeps a user-picked colour. The default credit text is extractable for translation. 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 wizard now re-seeds an untouched accent when the style changes. It also names the credit-template extractability change. The title is specific to the c…
Description check Passed The description follows the template sections: Summary, Testing, UI evidence, and Related issue. The Summary explains both changes and the reasoning. Testing lists the commands run and the new test. U…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the publication wizard now re-seeds an untouched accent when the style changes. It also names the credit-template extractability change. The title is specific to the changeset and maps to the two review findings in the description and objectives. It is long (93 characters), but it is not vague or off-topic.

Full details: Description check

Explanation

The description follows the template sections: Summary, Testing, UI evidence, and Related issue. The Summary explains both changes and the reasoning. Testing lists the commands run and the new test. UI evidence states 'No visible UI change.', which matches the template's allowed option. Related issue links #3041 as a follow-up, which fits the template's guidance. The template's HTML comments were removed, which is acceptable. The description is complete enough to pass.

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 checks the swatch with care,
The chosen style now guides it there.
A custom hue stays in its place,
A credit line keeps its template trace.
Then hops away with colors bright.

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: 853943a9-a872-42d6-a329-b0573a7bf387
Commits

Reviewing files that changed from the base of the PR and between c294550 and 9c2b96f.

Files selected for processing: 1

  • crates/ui-egui/src/publicationwizard.rs

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

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Reviewed the single changed file, crates/ui-egui/src/publicationwizard.rs, against the base-branch AGENTS.md, and read the surrounding wizard code, the engine's PUBLICATION_DEFAULT_CREDIT and publication_style_accent, and the i18n fmt helper. No prior review threads existed, so none were left alone.

Bugs

  • None found. I traced the accent state machine (style_step re-seed, accent_step tick/untick, picked set only by the picker). The re-seed fires only when the accent is still the old style's default and no colour was picked. Untick then stores nothing for an untouched default, so the stale-colour case the PR describes is fixed. A custom pick survives style switches. Confidence: high.

Security

  • None found. The change is UI-only and adds no input handling.

Performance

  • None found. default_credit() allocates on each frame it is drawn, as before.

Quality

  • default_credit() (line 328) now repeats the engine's "Made with RustGIS · {date}" literal. The duplication is deliberate for i18n extraction, and default_credit_matches_the_engines_constant (line 849) guards drift against the engine constant. A future engine change will fail the test rather than silently diverge, so this is acceptable. Confidence: medium that it is the right trade-off.
  • Pure style note, left for the release quality pass: picked is never cleared once set, so the "remembered" colour persists until the next picker change. This matches the new test's intent, so it is not a defect.

AGENTS.md

  • None found. The change adds no commands, parameters, saved fields, or new cfg-gated code, so the schema, command-surface, memory and wasm rules do not apply. It keeps the tl!/i18n::fmt translation rule, and the new literal is now visible to catalog extraction as the PR states.

Change size

Compared with the base branch (merge base c294550 to PR head 9c2b96f).

Measure Value
Files changed 1 (added 0, modified 1, removed 0, renamed 0)
Size before 36.7 KB
Size after 39.9 KB
Total size change +3.1 KB
Path Before After Change
crates/ui-egui/src/publicationwizard.rs 36.7 KB 39.9 KB +3.1 KB

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Commit 9c2b96f from a fork built, but isn'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 6b1baad Nov 27, 2026
28 checks passed
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.

3 participants