Skip to content

Commit d9537d0

Browse files
committed
inbox: Display realmEmptyTopicDisplayName on empty topic
Signed-off-by: Zixuan James Li <[email protected]>
1 parent 2cd4487 commit d9537d0

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lib/widgets/inbox.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,13 +526,16 @@ class _TopicItem extends StatelessWidget {
526526
child: Text(
527527
style: TextStyle(
528528
fontSize: 17,
529+
// ignore: unnecessary_null_comparison // null topic names soon to be enabled
530+
fontStyle: (topic.displayName == null) ? FontStyle.italic : null,
529531
height: (20 / 17),
530532
// TODO(design) check if this is the right variable
531533
color: designVariables.labelMenuButton,
532534
),
533535
maxLines: 2,
534536
overflow: TextOverflow.ellipsis,
535-
topic.displayName))),
537+
// ignore: dead_null_aware_expression // null topic names soon to be enabled
538+
topic.displayName ?? store.realmEmptyTopicDisplayName))),
536539
const SizedBox(width: 12),
537540
if (hasMention) const _IconMarker(icon: ZulipIcons.at_sign),
538541
// TODO(design) copies the "@" marker color; is there a better color?

test/widgets/inbox_test.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,20 @@ void main() {
307307
});
308308
});
309309

310+
group('general chat', () {
311+
final channel = eg.stream();
312+
final subscription = eg.subscription(channel);
313+
314+
testWidgets('show general chat', (tester) async {
315+
await setupPage(tester,
316+
streams: [channel],
317+
subscriptions: [subscription],
318+
unreadMessages: [eg.streamMessage(stream: channel, topic: '')]);
319+
320+
check(find.text(eg.defaultRealmEmptyTopicDisplayName)).findsOne();
321+
}, skip: true); // null topic names soon to be enabled
322+
});
323+
310324
group('topic visibility', () {
311325
final channel = eg.stream();
312326
const topic = 'topic';

0 commit comments

Comments
 (0)