File tree 2 files changed +20
-6
lines changed
2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -586,6 +586,10 @@ class _StreamContentInputState extends State<_StreamContentInput> {
586
586
final streamName = store.streams[widget.narrow.streamId]? .name
587
587
?? zulipLocalizations.unknownChannelName;
588
588
final topic = TopicName (widget.controller.topic.textNormalized);
589
+ // Until we support sending to empty topics, `topic.displayName` will remain
590
+ // non-null because the topic input text gets normalized to "(no topic)".
591
+ // ignore: unnecessary_null_comparison // null topic names soon to be enabled
592
+ assert (topic.displayName != null );
589
593
return _ContentInput (
590
594
narrow: widget.narrow,
591
595
destination: TopicNarrow (widget.narrow.streamId, topic),
@@ -658,7 +662,8 @@ class _FixedDestinationContentInput extends StatelessWidget {
658
662
// Zulip expresses channels and topics, not any normal English punctuation,
659
663
// so don't make sense to translate. See:
660
664
// https://github.com/zulip/zulip-flutter/pull/1148#discussion_r1941990585
661
- '#$streamName > ${topic .displayName }' );
665
+ // ignore: dead_null_aware_expression // null topic names soon to be enabled
666
+ '#$streamName > ${topic .displayName ?? store .realmEmptyTopicDisplayName }' );
662
667
663
668
case DmNarrow (otherRecipientIds: []): // The self-1:1 thread.
664
669
return zulipLocalizations.composeBoxSelfDmContentHint;
Original file line number Diff line number Diff line change @@ -370,11 +370,20 @@ void main() {
370
370
});
371
371
});
372
372
373
- testWidgets ('to TopicNarrow' , (tester) async {
374
- await prepare (tester,
375
- narrow: TopicNarrow (channel.streamId, TopicName ('topic' )));
376
- checkComposeBoxHintTexts (tester,
377
- contentHintText: 'Message #${channel .name } > topic' );
373
+ group ('to TopicNarrow' , () {
374
+ testWidgets ('with non-empty topic' , (tester) async {
375
+ await prepare (tester,
376
+ narrow: TopicNarrow (channel.streamId, TopicName ('topic' )));
377
+ checkComposeBoxHintTexts (tester,
378
+ contentHintText: 'Message #${channel .name } > topic' );
379
+ });
380
+
381
+ testWidgets ('with empty topic' , (tester) async {
382
+ await prepare (tester,
383
+ narrow: TopicNarrow (channel.streamId, TopicName ('' )));
384
+ checkComposeBoxHintTexts (tester, contentHintText:
385
+ 'Message #${channel .name } > ${eg .defaultRealmEmptyTopicDisplayName }' );
386
+ }, skip: true ); // null topic names soon to be enabled
378
387
});
379
388
380
389
testWidgets ('to DmNarrow with self' , (tester) async {
You can’t perform that action at this time.
0 commit comments