Skip to content

Commit b4344c7

Browse files
committed
compose: Change topic input hint text
This is similar to web's behavior. When topics are not mandatory: - an alternative hint text "Enter a topic (skip for “general chat”)" is shown when the topic input has focus; - an opaque placeholder text (e.g.: "general chat") is shown if the user skipped to content input; Because the topic input is always shown in a message list page channel narrow (assuming permission to send messages), this also adds an initial state: - a short hint text, "Topic", is shown if the user hasn't interacted with topic or content inputs at all, or when the user unfocused topic input without moving focus to content input. This only changes the topic input's hint text. See CZO discussion for design details: https://chat.zulip.org/#narrow/channel/530-mobile-design/topic/general.20chat.20design.20.23F1297/near/2106736
1 parent 25eace6 commit b4344c7

13 files changed

+268
-10
lines changed

assets/l10n/app_en.arb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,13 @@
379379
"@composeBoxTopicHintText": {
380380
"description": "Hint text for topic input widget in compose box."
381381
},
382+
"composeBoxEnterTopicOrSkipHintText": "Enter a topic (skip for “{defaultTopicName}”)",
383+
"@composeBoxEnterTopicOrSkipHintText": {
384+
"description": "Hint text for topic input widget in compose box when topics are optional.",
385+
"placeholders": {
386+
"defaultTopicName": {"type": "String", "example": "general chat"}
387+
}
388+
},
382389
"composeBoxUploadingFilename": "Uploading {filename}…",
383390
"@composeBoxUploadingFilename": {
384391
"description": "Placeholder in compose box showing the specified file is currently uploading.",

lib/generated/l10n/zulip_localizations.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,12 @@ abstract class ZulipLocalizations {
622622
/// **'Topic'**
623623
String get composeBoxTopicHintText;
624624

625+
/// Hint text for topic input widget in compose box when topics are optional.
626+
///
627+
/// In en, this message translates to:
628+
/// **'Enter a topic (skip for “{defaultTopicName}”)'**
629+
String composeBoxEnterTopicOrSkipHintText(String defaultTopicName);
630+
625631
/// Placeholder in compose box showing the specified file is currently uploading.
626632
///
627633
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
316316
@override
317317
String get composeBoxTopicHintText => 'Topic';
318318

319+
@override
320+
String composeBoxEnterTopicOrSkipHintText(String defaultTopicName) {
321+
return 'Enter a topic (skip for “$defaultTopicName”)';
322+
}
323+
319324
@override
320325
String composeBoxUploadingFilename(String filename) {
321326
return 'Uploading $filename…';

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
316316
@override
317317
String get composeBoxTopicHintText => 'Topic';
318318

319+
@override
320+
String composeBoxEnterTopicOrSkipHintText(String defaultTopicName) {
321+
return 'Enter a topic (skip for “$defaultTopicName”)';
322+
}
323+
319324
@override
320325
String composeBoxUploadingFilename(String filename) {
321326
return 'Uploading $filename…';

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
316316
@override
317317
String get composeBoxTopicHintText => 'Topic';
318318

319+
@override
320+
String composeBoxEnterTopicOrSkipHintText(String defaultTopicName) {
321+
return 'Enter a topic (skip for “$defaultTopicName”)';
322+
}
323+
319324
@override
320325
String composeBoxUploadingFilename(String filename) {
321326
return 'Uploading $filename…';

lib/generated/l10n/zulip_localizations_nb.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
316316
@override
317317
String get composeBoxTopicHintText => 'Topic';
318318

319+
@override
320+
String composeBoxEnterTopicOrSkipHintText(String defaultTopicName) {
321+
return 'Enter a topic (skip for “$defaultTopicName”)';
322+
}
323+
319324
@override
320325
String composeBoxUploadingFilename(String filename) {
321326
return 'Uploading $filename…';

lib/generated/l10n/zulip_localizations_pl.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
323323
@override
324324
String get composeBoxTopicHintText => 'Wątek';
325325

326+
@override
327+
String composeBoxEnterTopicOrSkipHintText(String defaultTopicName) {
328+
return 'Enter a topic (skip for “$defaultTopicName”)';
329+
}
330+
326331
@override
327332
String composeBoxUploadingFilename(String filename) {
328333
return 'Przekazywanie $filename…';

lib/generated/l10n/zulip_localizations_ru.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
324324
@override
325325
String get composeBoxTopicHintText => 'Тема';
326326

327+
@override
328+
String composeBoxEnterTopicOrSkipHintText(String defaultTopicName) {
329+
return 'Enter a topic (skip for “$defaultTopicName”)';
330+
}
331+
327332
@override
328333
String composeBoxUploadingFilename(String filename) {
329334
return 'Загрузка $filename…';

lib/generated/l10n/zulip_localizations_sk.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
316316
@override
317317
String get composeBoxTopicHintText => 'Topic';
318318

319+
@override
320+
String composeBoxEnterTopicOrSkipHintText(String defaultTopicName) {
321+
return 'Enter a topic (skip for “$defaultTopicName”)';
322+
}
323+
319324
@override
320325
String composeBoxUploadingFilename(String filename) {
321326
return 'Uploading $filename…';

lib/generated/l10n/zulip_localizations_uk.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,11 @@ class ZulipLocalizationsUk extends ZulipLocalizations {
325325
@override
326326
String get composeBoxTopicHintText => 'Тема';
327327

328+
@override
329+
String composeBoxEnterTopicOrSkipHintText(String defaultTopicName) {
330+
return 'Enter a topic (skip for “$defaultTopicName”)';
331+
}
332+
328333
@override
329334
String composeBoxUploadingFilename(String filename) {
330335
return 'Завантаження $filename…';

0 commit comments

Comments
 (0)