Skip to content

Commit ab73a54

Browse files
committed
fix(mobile): announce thread refresh status changes
Signed-off-by: Tom Brow <[email protected]>
1 parent 4e5f606 commit ab73a54

2 files changed

Lines changed: 21 additions & 8 deletions

File tree

‎mobile/lib/features/channels/thread_detail_page/message_list.dart‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,17 @@ class _ThreadMessageList extends StatelessWidget {
151151
child: Row(
152152
children: [
153153
Flexible(
154-
child: Text(
155-
_replySummary,
156-
style: context.textTheme.labelMedium
157-
?.copyWith(
158-
color:
159-
context.colors.onSurfaceVariant,
160-
fontWeight: FontWeight.w600,
161-
),
154+
child: Semantics(
155+
liveRegion: true,
156+
child: Text(
157+
_replySummary,
158+
style: context.textTheme.labelMedium
159+
?.copyWith(
160+
color:
161+
context.colors.onSurfaceVariant,
162+
fontWeight: FontWeight.w600,
163+
),
164+
),
162165
),
163166
),
164167
const SizedBox(width: Grid.xxs),

‎mobile/test/features/channels/thread_reply_refresh_cases.dart‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ void threadReplyRefreshTests() {
109109
testWidgets('thread refresh error keeps cached replies visible', (
110110
tester,
111111
) async {
112+
final semantics = tester.ensureSemantics();
112113
var calls = 0;
113114
final refresh = Completer<List<NostrEvent>>();
114115
tester.view.physicalSize = const Size(320, 844);
@@ -132,8 +133,17 @@ void threadReplyRefreshTests() {
132133
);
133134
expect(find.text('0 replies'), findsNothing);
134135
expect(find.text('1 reply · Couldn’t refresh'), findsOneWidget);
136+
expect(
137+
tester
138+
.getSemantics(find.text('1 reply · Couldn’t refresh'))
139+
.getSemanticsData()
140+
.flagsCollection
141+
.isLiveRegion,
142+
isTrue,
143+
);
135144
expect(tester.takeException(), isNull);
136145
expect(container.read(threadRepliesProvider(args)).hasError, isTrue);
146+
semantics.dispose();
137147
});
138148

139149
testWidgets('thread reopen shows loading until the fresh query completes', (

0 commit comments

Comments
 (0)