style: apply cargo fmt across workspace

This commit is contained in:
Karim Jerbi committed 2026-10-11 03:14:29 +01:00
1 parent 85710e5454
commit 9cf9ff2c5c
531 files changed
+57740 -33906

No files matched your search

+30 -17
View File
@@ -204,12 +204,8 @@ fn test_command_line_contrast() {
);
// 1b. Prompt ("Command:") text (normal text: >= 4.5:1)
let prompt_color = accessible_accent_threshold(
p.success.base.color,
cli_bg,
p.background.base.text,
4.5,
);
let prompt_color =
accessible_accent_threshold(p.success.base.color, cli_bg, p.background.base.text, 4.5);
let prompt_contrast = wcag_contrast(prompt_color, cli_bg);
assert!(
prompt_contrast >= 4.5,
@@ -519,8 +515,16 @@ fn test_block_palette_contrast() {
// hover — the background does not switch on hover while placing.
for status in [BtnStatus::Active, BtnStatus::Hovered, BtnStatus::Pressed] {
let (bg, fg) = block_card_colors(theme, true, status);
assert_eq!(bg, p.primary.base.color, "Theme {:?} placing card bg must be primary.base", theme);
assert_eq!(fg, p.primary.base.text, "Theme {:?} placing card label must be primary.base.text", theme);
assert_eq!(
bg, p.primary.base.color,
"Theme {:?} placing card bg must be primary.base",
theme
);
assert_eq!(
fg, p.primary.base.text,
"Theme {:?} placing card label must be primary.base.text",
theme
);
}
// ── 2. Card label contrast: normal / hover / pressed ──
@@ -529,7 +533,8 @@ fn test_block_palette_contrast() {
assert!(
normal_contrast >= 4.5,
"Theme {:?} block card label ({:.2}:1) fails WCAG AA on card background",
theme, normal_contrast
theme,
normal_contrast
);
let (hover_bg, hover_fg) = block_card_colors(theme, false, BtnStatus::Hovered);
@@ -537,7 +542,8 @@ fn test_block_palette_contrast() {
assert!(
hover_contrast >= 4.5,
"Theme {:?} block card hovered label ({:.2}:1) fails WCAG AA on hovered background",
theme, hover_contrast
theme,
hover_contrast
);
let (pressed_bg, pressed_fg) = block_card_colors(theme, false, BtnStatus::Pressed);
@@ -545,7 +551,8 @@ fn test_block_palette_contrast() {
assert!(
pressed_contrast >= 4.5,
"Theme {:?} block card pressed label ({:.2}:1) fails WCAG AA on pressed background",
theme, pressed_contrast
theme,
pressed_contrast
);
// ── 3. Placing card contrast ──
@@ -556,7 +563,8 @@ fn test_block_palette_contrast() {
assert!(
placing_contrast >= 3.0,
"Theme {:?} placing block card label ({:.2}:1) fails button threshold (>=3.0:1)",
theme, placing_contrast
theme,
placing_contrast
);
// Placing + hover must not silently drop contrast (bg is sticky).
let (placing_hover_bg, placing_hover_fg) =
@@ -565,7 +573,8 @@ fn test_block_palette_contrast() {
assert!(
placing_hover_contrast >= 3.0,
"Theme {:?} placing+hover block card label ({:.2}:1) fails button threshold (>=3.0:1)",
theme, placing_hover_contrast
theme,
placing_hover_contrast
);
// ── 4. Card border is theme-driven (no invisible borders) ──
@@ -590,7 +599,8 @@ fn test_block_palette_contrast() {
assert!(
icon_rest_contrast >= 4.5,
"Theme {:?} block palette icon button ({:.2}:1) fails WCAG AA on dock background",
theme, icon_rest_contrast
theme,
icon_rest_contrast
);
// Hovered/pressed buttons sit on the `strong` surface with its text.
for status in [BtnStatus::Hovered, BtnStatus::Pressed] {
@@ -604,7 +614,8 @@ fn test_block_palette_contrast() {
assert!(
c >= 4.5,
"Theme {:?} hovered icon button ({:.2}:1) fails WCAG AA on hovered background",
theme, c
theme,
c
);
}
@@ -612,7 +623,10 @@ fn test_block_palette_contrast() {
// Rendered as `base.text` at 0.72 alpha over the dock `base`
// background → secondary text threshold >= 3.0:1. (The old hardcoded
// 0.55-gray failed this on light themes.)
let empty_text = composite_over(p.background.base.text.scale_alpha(0.72), p.background.base.color);
let empty_text = composite_over(
p.background.base.text.scale_alpha(0.72),
p.background.base.color,
);
let empty_contrast = wcag_contrast(empty_text, p.background.base.color);
assert!(
empty_contrast >= 3.0,
@@ -636,4 +650,3 @@ fn test_block_palette_contrast() {
}
}
}