Repository navigation
Simplify golden PNG comparators and unify i18n completeness checks - #2981
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidates the five duplicated golden PNG comparators and unifies translation completeness, uniqueness, and placeholder checks across every supported interface language.
Before
rune_ui/tests.rs,meeting_capsules.rs,capture_capsule/tests.rs,screenshot_thumbnail/tests.rs,screenshot_thumbnail/editor/tests.rs) each re-implemented PNG decoding, channel tolerance (12), mismatch limits (w * h / 500),HEX_UPDATE_GOLDENS/HEX_GOLDEN_RENDERShandling, and-actual.pngoutput.src/desktop/i18n.rschecked only the 6-columnall_translations()table (except two ad-hoc overrides). Per-language test blocks infrench.rs,portuguese.rs,russian.rs, andhungarian.rsskipped the 16 overflow sections merged byscreenshots::merged(), and those four files carried 12–15 stale keys each while sitting at the 1,500-line ceiling.After
src/rune_ui/offscreen.rsowns one#[cfg(test)] compare_goldenhelper used by all five golden suites, preserving/tmp/rune-settings-*-actual.pngforcheck-linux.ymlandrelease.ymluploads and the exact message formatscripts/check-onboarding.shparses, plus a unit test covering tolerance, pixel limits, size changes, and missing goldens.src/desktop/i18n.rsenforces completeness, uniqueness, and{}/{name}placeholder preservation across all 11 non-English languages (6-column table, French, Portuguese, Russian, Hungarian including all 16 overflow sections, and Traditional Chinese) and rejects stale keys in the four standalone tables. All four standalone files drop below 1,490 non-test lines.Verification
cargo fmt --all --checkpython3 scripts/code-shape.py --checkcargo clippy --locked --bin hex --tests -- -D warningsscripts/check i18n offscreen capture_capsule::tests::capture_capsule_goldensRead:
src/rune_ui/offscreen.rsandsrc/desktop/i18n.rs.