The design language that makes your AI harness better at design.
JavaScript
A control's undersized label keeps failing inside a marked mockup
Paul Bakaus4a12ac76d592
diff --git a/crates/core/src/browser/quality.rs b/crates/core/src/browser/quality.rsindex 67fe93ba2..5406039d5 100644--- a/crates/core/src/browser/quality.rs+++ b/crates/core/src/browser/quality.rs@@ -1566,10 +1566,10 @@ pub fn check_quality(dom: &dyn Dom, q: &QualityInput) -> Vec<RuleHit> {let excerpt = slice_utf16_prefix(&dt, 40);// A label with no reading job (taste call r5-p3) and// text in a mockup (r5-p26) report as advisory. A- // control's text is never a micro-label.- let advisory = (!is_interactive- && super::text_context::is_micro_label_dom(dom, el))- || in_mock();+ // control's text is neither: a framed demo's controls+ // keep failing too, since a visitor can use them.+ let advisory = !is_interactive+ && (super::text_context::is_micro_label_dom(dom, el) || in_mock());findings.push(advisory_if(RuleHit::new("undersized-ui-text",diff --git a/crates/html/src/quality.rs b/crates/html/src/quality.rsindex dc992bae1..43399428a 100644--- a/crates/html/src/quality.rs+++ b/crates/html/src/quality.rs@@ -711,9 +711,11 @@ pub fn check_quality(q: &QualityInput<'_, '_>) -> Vec<RuleHit> {let excerpt = slice_utf16_prefix(&direct_text, 40);// A label with no reading job (taste call r5-p3) and// text in a mockup (r5-p26) report as advisory. A- // control's text is never a micro-label.- let advisory = (!is_interactive && crate::text_context::is_micro_label(el))- || crate::text_context::in_mock_context(el);+ // control's text is neither: a framed demo's controls+ // keep failing too, since a visitor can use them.+ let advisory = !is_interactive+ && (crate::text_context::is_micro_label(el)+ || crate::text_context::in_mock_context(el));findings.push(advisory_if(RuleHit::new("undersized-ui-text",diff --git a/crates/html/tests/advisory_contexts.rs b/crates/html/tests/advisory_contexts.rsindex 4f57164c2..7384718f6 100644--- a/crates/html/tests/advisory_contexts.rs+++ b/crates/html/tests/advisory_contexts.rs@@ -174,3 +174,15 @@ fn a_class_marked_mockup_reports_small_text_as_advisory() {assert_eq!(severities(&f, "undersized-ui-text", "Ready"), ["advisory"], "{f:#?}");assert_eq!(severities(&f, "undersized-ui-text", "Queued"), ["warning"], "{f:#?}");}++#[test]+fn a_control_inside_a_marked_mockup_keeps_failing() {+ // A usable button in an illustrated card: its label is a control's, not+ // a picture's.+ let f = scan(+ "<div class=\"hero-illustration\"><span style=\"font-size: 9px\">Ready</span>\+ <button style=\"font-size: 9px\">Try it</button></div>",+ );+ assert_eq!(severities(&f, "undersized-ui-text", "Ready"), ["advisory"], "{f:#?}");+ assert_eq!(severities(&f, "undersized-ui-text", "Try it"), ["warning"], "{f:#?}");+}