Skip to content

EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust

Merge upstream/main into feat-gap25-a11y-audit

vangel7681f9d93b82b3
diff --cc crates/ui-egui/src/panels/render_queue.rs
index 76000f796,73bd92e80..8423666db
--- a/crates/ui-egui/src/panels/render_queue.rs
+++ b/crates/ui-egui/src/panels/render_queue.rs
@@@ -36,28 -35,35 +36,40 @@@ pub fn hms(secs: f64) -> String
format!("{}:{:02}:{:02}", s / 3600, s / 60 % 60, s % 60)
}
- /// Unix seconds → `YYYY-MM-DD hh:mm:ss` (UTC).
+ /// Unix seconds → (proleptic Gregorian year, the same wall-clock instant moved into chrono's range
+ /// by whole 400-year cycles). The Gregorian calendar repeats every 400 years (146_097 days), so
+ /// month, day and time of day come from chrono and only the year is carried, which keeps every
+ /// input exact instead of collapsing out-of-range years to the epoch. `unix` is `u64`, so `days`
+ /// always fits an `i64`.
+ fn utc_parts(unix: u64) -> (i64, chrono::NaiveDateTime) {
+ use chrono::Datelike;
+ let (days, sod) = ((unix / 86_400) as i64, (unix % 86_400) as i64);
+ let (cycles, rest) = (days.div_euclid(146_097), days.rem_euclid(146_097));
+ // `rest + 719_163` (1970-01-01 is CE day 719_163) is always a valid CE day, and `sod` < 86_400.
+ let date = i32::try_from(rest + 719_163).ok().and_then(chrono::NaiveDate::from_num_days_from_ce_opt);
+ let time = u32::try_from(sod).ok().and_then(|s| chrono::NaiveTime::from_num_seconds_from_midnight_opt(s, 0));
+ match (date, time) {
+ (Some(d), Some(t)) => {
+ let y = i128::from(d.year()) + i128::from(cycles) * 400;
+ (i64::try_from(y).unwrap_or(i64::MAX), d.and_time(t))
+ }
+ _ => (1970, chrono::NaiveDateTime::default()), // unreachable
+ }
+ }
+
+ /// Unix seconds → `YYYY-MM-DD hh:mm:ss` (UTC). Years far outside chrono's own range are preserved
+ /// (the old hand-rolled conversion kept them) rather than collapsing to the epoch.
pub fn utc_stamp(unix: u64) -> String {
- let days = (unix / 86_400) as i64;
- let rem = unix % 86_400;
- // Civil-from-days (proleptic Gregorian).
- let z = days + 719_468;
- let era = z.div_euclid(146_097);
- let doe = z - era * 146_097;
- let yoe = (doe - doe / 1460 + doe / 36_524 - doe / 146_096) / 365;
- let doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
- let mp = (5 * doy + 2) / 153;
- let d = doy - (153 * mp + 2) / 5 + 1;
- let m = if mp < 10 { mp + 3 } else { mp - 9 };
- let y = yoe + era * 400 + i64::from(m <= 2);
- format!("{y:04}-{m:02}-{d:02} {:02}:{:02}:{:02}", rem / 3600, rem / 60 % 60, rem % 60)
+ let (y, t) = utc_parts(unix);
+ // `{:04}` rather than `%Y`, which writes a `+` before years past 9999.
+ format!("{y:04}-{}", t.format("%m-%d %H:%M:%S"))
}
+/// A queue item's row: its click area, keyboard focus and accessibility node.
+fn row_id(item: u64) -> egui::Id {
+ egui::Id::new(("rq-row", item))
+}
+
fn status_color(t: &Tokens, s: &RenderStatus) -> Color32 {
match s {
RenderStatus::Done => Color32::from_rgb(0x6c, 0xc0, 0x6c),
diff --cc crates/ui-egui/src/panels/settings.rs
index 0af1b9d0f,8edc40b4d..6ce282c91
--- a/crates/ui-egui/src/panels/settings.rs
+++ b/crates/ui-egui/src/panels/settings.rs
@@@ -683,41 -663,35 +685,48 @@@ pub fn show(app: &mut EffectcraftApp, c
{
let ui = &mut body;
// Page list (left, like After Effects).
+ let widest_page = all
+ .iter()
+ .map(|p| ui.painter().layout_no_wrap(crate::i18n::settings_page_title(p.title).to_owned(), Tokens::ui(12.5), t.text).size().x)
+ .fold(0.0_f32, f32::max);
+ let page_width = (widest_page + 20.0).max(176.0).min((ui.available_width() * 0.42).min(300.0));
ui.vertical(|ui| {
- ui.set_width(180.0);
+ ui.set_width(page_width + 4.0);
egui::ScrollArea::vertical().id_salt("settings-pages").max_height(body_h).auto_shrink([false, false]).show(ui, |ui| {
+ // One Tab stop for the list (the open page); Up / Down / Home / End move
+ // between the pages and the focus goes with them.
// The rows touch, so the pointer never falls between two of them.
ui.spacing_mut().item_spacing.y = 0.0;
- for p in &all {
- let (r, resp) = ui.allocate_exact_size(vec2(page_width, 24.0), egui::Sense::click());
+ let ctx = ui.ctx().clone();
+ let page_item = |id: &str| egui::Id::new(("settings-page", id.to_string()));
+ let on_list = all.iter().any(|q| ctx.memory(|m| m.has_focus(page_item(q.id))));
+ for (n, p) in all.iter().enumerate() {
let sel = page == p.id;
- let r = ui.allocate_space(vec2(176.0, 24.0)).1;
++ let r = ui.allocate_space(vec2(page_width, 24.0)).1;
+ let resp = ui.interact(r, page_item(p.id), if sel { egui::Sense::click() } else { egui::Sense::CLICK });
- a11y::list_item(&resp, tr(p.title), sel, n + 1, all.len());
++ a11y::list_item(&resp, crate::i18n::settings_page_title(p.title), sel, n + 1, all.len());
+ if a11y::take_pending_focus(&ctx, "settings", resp.id) {
+ resp.request_focus();
+ }
if sel {
ui.painter().rect_filled(r, 3.0, t.accent);
} else if resp.hovered() {
ui.painter().rect_filled(r, 3.0, t.hover);
}
- ui.painter().text(
+ crate::widgets::text_fit(
+ ui.painter(),
r.left_center() + vec2(10.0, 0.0),
egui::Align2::LEFT_CENTER,
- tr(p.title),
+ crate::i18n::settings_page_title(p.title),
Tokens::ui(12.5),
+ (page_width - 20.0).max(0.0),
if sel { Color32::WHITE } else { t.text },
);
+ if resp.has_focus() {
+ ui.painter().rect_stroke(r.shrink(1.0), 3.0, egui::Stroke::new(2.0, t.text), egui::StrokeKind::Inside);
+ }
app.auto.add(&format!("settings.page.{}", p.id), r, p.title);
- if resp.clicked() {
+ if resp.on_hover_text(crate::i18n::settings_page_title(p.title)).clicked() {
page = p.id.to_string();
}
}
diff --cc docs/ui-parity.md
index efd002ec9,df4c5e0ea..03e012245
--- a/docs/ui-parity.md
+++ b/docs/ui-parity.md
@@@ -1,6 -1,6 +1,6 @@@
# UI parity
- > **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-13 · **Change:** minor (accessibility row: an AccessKit audit and a contrast test, three more panels named and keyboard-operable, #1335; earlier change: path-editing layer bounds, #1220; closed issue references re-audited against `upstream/main` 470ea7a3) · **Target:** Adobe After Effects 2026
-> **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-18 · **Change:** minor (shape group Contents row elided; path-editing layer bounds #1220; closed issue references re-audited against `upstream/main` 470ea7a3) · **Target:** Adobe After Effects 2026
++> **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-18 · **Change:** minor (accessibility row: an AccessKit audit and a contrast test, three more panels named and keyboard-operable, #1335; earlier changes: shape group Contents row elided; path-editing layer bounds #1220; closed issue references re-audited against `upstream/main` 470ea7a3) · **Target:** Adobe After Effects 2026
How closely EffectCraft's interaction matches After Effects: tools, handles, snapping, nudging,
modifier keys, shortcuts, drag behaviour, numeric entry, panels, context menus and feel. Evidence
@@@ -50,7 -50,7 +50,8 @@@ Effects running; most of the rest paral
| Date | Change | Summary |
|---|---|---|
+ | 2026-10-18 | minor | A shape group's inner Contents (After Effects' elided Vectors group) draws no row: the group's path, fill/stroke and Transform list directly under the group |
+| 2026-10-13 | minor | Accessibility row: AccessKit audit and contrast tests, Effects & Presets, Settings and Render Queue named and keyboard-operable (#1335); no screen reader tested |
| 2026-10-13 | patch | Layer bounds are suppressed during path-point editing (#1220); shape/mask interaction regressions |
| 2026-10-12 | minor | Closed issues (#302, #320, #491, #511, #553 and others) marked as closed instead of open; panels in their own windows (#486) |
| 2026-10-12 | minor | Percentage guides and effect colour labels (26.5) added; rows updated |