Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
benandez
left a comment
There was a problem hiding this comment.
Thanks for continuing the Hebrew layout work. The same points as on the earlier PRs in this series (#1637–#1649) apply here:
- One shared helper, please. This uses
crate::i18n::current().code() == "he", a third pattern next toLang::Hebrewand the tag string. #1716 addsLang::Hebrew. Once it lands, please add a singleLang::is_rtl()(and ideally one ui-egui RTL row helper), and rebase the series on it rather than adding a per-dialog check each time. - Hebrew screenshots (light and dark) plus an English before/after, so we can see the LTR layout is unchanged.
- With 16+ one-dialog PRs open, could the rest be grouped into a few larger ones once the helper exists? It would make reviewing much quicker.
This one gets the height bound right (Align::Min, horizontal_top kept for LTR). Thanks. The test could also cover the Preview button and the checkbox, since they're the safety controls.
There was a problem hiding this comment.
🤖 Automated review of 8973c28
The change successfully implements the visual mirroring of the attachment safety prompt for Hebrew (RTL) using dedicated layout helper functions and includes comprehensive geometric tests. The code appears correct for its stated scope, but the RTL detection mechanism is limited only to the 'he' locale, which should be generalized for better maintainability.
Findings: 🔵 1 × [P4] MINOR (Quality)
⛔ Not approved: 1 unresolved finding(s) at [P4] MINOR (Quality) or above. I'll approve once they're fixed or resolved.
Model google/gemma-4-e4b · skill code-change-review · 2 files reviewed. Reply to an inline comment to discuss it.
| let tokens = crate::theme::Tokens::get(ui.ctx()); | ||
| let mut start = false; | ||
| let mut warn = app.attachment_selection.as_ref().is_none_or(|selection| selection.warn); | ||
| let rtl = crate::i18n::current().code() == "he"; |
There was a problem hiding this comment.
[P4] MINOR (Quality) RTL mirroring logic is hardcoded to Hebrew locale
[P4] MINOR (Quality) Limited to Hebrew locale for RTL mirroring
crates/ui-egui/src/attachment_preview.rs:529
Issue: The logic determining if the prompt should be mirrored only checks for the specific language code "he" (crate::i18n::current().code() == "he").
Why it matters: If MailCraft is extended to support other RTL languages (e.g., Arabic, Syriac), this logic will fail to mirror the prompt correctly because it only checks for Hebrew.
Suggested fix: Instead of checking for a single language code, check if the current locale's script directionality property indicates RTL. This would require integrating with crate::i18n or similar internationalization utilities that can determine general text directionality rather than just matching a specific ISO code.
Automated review. Reply here to discuss; this thread is resolved once a fix is confirmed.



What changes for the person using MailCraft
The attachment-preview safety prompt now follows the Hebrew reading direction: warning icon at the right edge, cautionary messages and preview/confirmation controls aligned to the right. The existing English/LTR row remains in the original branch of the layout, as do the real attachment safety restrictions, checkbox state and hit IDs.
This is an original source contribution to the official UCS MailCraft codebase. It does not add translations to the protected Hebrew catalogue. It is dormant on current official main until the proposed Hebrew locale in draft #1585 is registered.
Closes #1683. Related #1492 and #1585. Separate from deferred Unicode bidi work #483 and the reading-pane issue #603.
How it was checked
Exact official upstream
mainsource was fetched before editing; branch contains onlyattachment_preview.rsplus its focused standaloneattachment_preview_tests.rs.git diff --checkand Rust 2024 syntax parsing passed.Headless egui regression tests the warning icon versus two text bounds for both left-to-right and right-to-left, without opening an attachment.
Focused Cargo test on exact HEAD
8973c28ccd7563ecccd8b93bf8912ea319a54210: PASSED, 1/1, 0 failures (2,299 other tests filtered), Mac-Bedroom.local,cargo test --locked --offline -p mailcraft-ui-egui attachment_safety_warning_mirrors_reading_edge. Initial isolated test attempt revealed wrong egui APIctx.run; committed test was fixed toctx.run_ui, recompiled and passed. Headless layout regression only; Native Hebrew screenshot not done.Native Hebrew screenshot and full
cargo xtask ci: not run; no current integrated Hebrew UI exists on main.No real mailbox, file preview, content execution, mail send, user session or installed application was changed.
cargo xtask cipasses (not run)Focused LTR/RTL headless geometry test passes at exact HEAD
Native Hebrew/LTR screenshot check (not run)
Allow edits by maintainers (verify on PR readback)
I have personally signed the CLA (not verified; do not assume)
Summary by CodeRabbit