a11y: a skip link, color-blind safe charts
i18n::SkipLink holds a Tab stop in flow at zero size, first where it sits, and while focused raises a pill over the page; Enter, Space or a press hands focus to its target. gpui orders stops by tab_index before paint and registers none for an invisible element, so the stop stays in flow and only the pill is raised. Theme::set_color_blind_safe swaps Ely's chart hues for a set fitted to stay apart under Machado's protanopia, deuteranopia and tritanopia; a test holds every pair 0.10 apart in Oklab and each hue 3:1 on its page, and red against green shows the measure bites. KeyboardNavigationHelper points to interaction::RovingFocus. The announcer, labels and screen-reader text stay blocked: gpui 0.2.2 has no accessibility tree, and nothing here is trusted to observe VoiceOver. The i18n tests move under src/i18n/tests.
This commit is contained in:
1 parent
aa39fba87f
commit
1ac5c04fb0
10 files changed
+463
-7
No files matched your search
@@ -8,6 +8,8 @@ use ely_gpui_component::{
|
||||
use gpui::{AnyElement, App, IntoElement, ParentElement, Styled, Window, div, px};
|
||||
use jiff::{Timestamp, tz::TimeZone};
|
||||
|
||||
mod a11y;
|
||||
|
||||
use super::Page;
|
||||
use crate::probe::probe;
|
||||
use crate::script::Step;
|
||||
@@ -29,6 +31,19 @@ pub const PAGE: Page = Page {
|
||||
Step::Key("home"),
|
||||
Step::Key("enter"),
|
||||
Step::Wait(300),
|
||||
Step::Key("tab"),
|
||||
Step::HoverAt("skip-demo", 300.0, 70.0),
|
||||
Step::Wait(300),
|
||||
Step::Shot("skip-link"),
|
||||
Step::Key("enter"),
|
||||
Step::Key("tab"),
|
||||
Step::Wait(300),
|
||||
Step::Shot("skipped"),
|
||||
Step::Click("color-blind"),
|
||||
Step::Wait(300),
|
||||
Step::Shot("color-blind"),
|
||||
Step::Click("color-blind"),
|
||||
Step::Wait(300),
|
||||
],
|
||||
};
|
||||
|
||||
@@ -105,11 +120,13 @@ pub fn install(cx: &mut App) {
|
||||
);
|
||||
}
|
||||
|
||||
fn render(_: &mut Window, cx: &mut App) -> AnyElement {
|
||||
fn render(window: &mut Window, cx: &mut App) -> AnyElement {
|
||||
div()
|
||||
.child(messages(cx))
|
||||
.child(formats(cx))
|
||||
.child(mirrored(cx))
|
||||
.child(a11y::skip_link(window, cx))
|
||||
.child(a11y::color_blind(cx))
|
||||
.into_any_element()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user