Skip to content

Commit ff6f142

Browse files
chrisbobbegnprice
authored andcommitted
inbox: Fix bug where VoiceOver focus lost on collapse/uncollapse
These DM, topic, and header rows shouldn't be leaking their semantics data up the semantics tree -- all their data has been propagating up to the SemanticsNode for each section, i.e., the all-DMs section and the channel sections. (Those SemanticsNodes are created for each section by the StickyHeaderListView, since that view's "items"/"children" are the sections.) Happily, somehow this fixes the following item in #537, in my testing with VoiceOver on iPhone 26.2.1: > When collapsing or uncollapsing a channel header, the focus > sometimes gets moved elsewhere unexpectedly. That description makes the symptom sound milder than what I've been seeing: it seems like the focus was being moved up to the app bar pretty much every time I collapsed a section, making the collapse/uncollapse feature basically unusable with VoiceOver. Now, the focus doesn't move at all; it just stays on the header that I just collapsed. Related: #537
1 parent 9d24c7b commit ff6f142

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/widgets/inbox.dart

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ abstract class _HeaderItem extends StatelessWidget {
269269
Widget build(BuildContext context) {
270270
final zulipLocalizations = ZulipLocalizations.of(context);
271271
final designVariables = DesignVariables.of(context);
272-
return Material(
272+
Widget result = Material(
273273
color: collapsed
274274
? designVariables.background // TODO(design) check if this is the right variable
275275
: uncollapsedBackgroundColor(context),
@@ -315,6 +315,9 @@ abstract class _HeaderItem extends StatelessWidget {
315315
channelIdForBackground: channelId,
316316
count: count)),
317317
])));
318+
319+
return Semantics(container: true,
320+
child: result);
318321
}
319322
}
320323

@@ -408,7 +411,7 @@ class _DmItem extends StatelessWidget {
408411
_ => narrow.otherRecipientIds.map(store.userDisplayName).join(', '),
409412
};
410413

411-
return Material(
414+
Widget result = Material(
412415
color: designVariables.background, // TODO(design) check if this is the right variable
413416
child: InkWell(
414417
onTap: () {
@@ -439,6 +442,9 @@ class _DmItem extends StatelessWidget {
439442
channelIdForBackground: null,
440443
count: count)),
441444
]))));
445+
446+
return Semantics(container: true,
447+
child: result);
442448
}
443449
}
444450

@@ -537,7 +543,7 @@ class _TopicItem extends StatelessWidget {
537543
final visibilityIcon = iconDataForTopicVisibilityPolicy(
538544
store.topicVisibilityPolicy(streamId, topic));
539545

540-
return Material(
546+
Widget result = Material(
541547
color: designVariables.background, // TODO(design) check if this is the right variable
542548
child: InkWell(
543549
onTap: () {
@@ -576,6 +582,9 @@ class _TopicItem extends StatelessWidget {
576582
channelIdForBackground: streamId,
577583
count: count)),
578584
]))));
585+
586+
return Semantics(container: true,
587+
child: result);
579588
}
580589
}
581590

0 commit comments

Comments
 (0)