From 0849ff574906dff021315179ffdd59294034001c Mon Sep 17 00:00:00 2001 From: clover caruso Date: Sat, 3 Oct 2026 00:28:37 -0700 Subject: [PATCH] fix: the browser build starts with screen reader support on, rather than stopping on a tree sent before the first frame Assisted-by: claude-opus-5.5 --- crates/ui/src/access.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/ui/src/access.rs b/crates/ui/src/access.rs index c6f482543b90a0b79534e95ae402aa7e3c854c1a..4c9549bdd4443d258b7f3694e916ffc69b388f66 100644 --- a/crates/ui/src/access.rs +++ b/crates/ui/src/access.rs @@ -153,10 +153,13 @@ impl Ui { let mut nodes = Vec::new(); let mut children = Vec::new(); let mut seen = HashSet::from([Id::ROOT]); - self.describe(0, scale, None, &mut children, &mut nodes, &mut seen); let mut root = Node::new(Role::Window); root.set_label(label); - root.set_bounds(bounds(self.nodes[0].rect, scale)); + // Before the first frame is built, the window is all there is. + if let Some(built) = self.nodes.first() { + self.describe(0, scale, None, &mut children, &mut nodes, &mut seen); + root.set_bounds(bounds(built.rect, scale)); + } root.set_children(children.into_iter().map(|(id, _)| id).collect::>()); nodes.push((Id::ROOT, root)); let focus = self.focus.filter(|focus| seen.contains(focus)); -- 2.54.0