Skip to content

Commit 746791f

Browse files
committed
inbox: Display realmEmptyTopicDisplayName on empty topic
Signed-off-by: Zixuan James Li <[email protected]>
1 parent 877ee32 commit 746791f

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) ? null : FontStyle.italic,
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
@@ -305,6 +305,20 @@ void main() {
305305
});
306306
});
307307

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

0 commit comments

Comments
 (0)