Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1419,5 +1419,9 @@
"zulipAppTitle": "Zulip",
"@zulipAppTitle": {
"description": "The name of Zulip. This should be either 'Zulip' or a transliteration."
}
},
"loading": "Loading…",
"@loading": {
"description": "Label shown for loading indicators"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "Label shown for loading indicators" is misleading; this isn't shown in the app's visual UI. Rather, it's information presented to screen-reader software, to help create an interface for users with vision loss etc.

How about: "Semantic label for a loading indicator."

}
Comment on lines 1491 to 1495
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: follow indentation style

}
6 changes: 6 additions & 0 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2066,6 +2066,12 @@ abstract class ZulipLocalizations {
/// In en, this message translates to:
/// **'Zulip'**
String get zulipAppTitle;

/// Label shown for loading indicators
///
/// In en, this message translates to:
/// **'Loading…'**
String get loading;
}

class _ZulipLocalizationsDelegate
Expand Down
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1180,4 +1180,7 @@ class ZulipLocalizationsAr extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_de.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1206,4 +1206,7 @@ class ZulipLocalizationsDe extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_el.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1180,4 +1180,7 @@ class ZulipLocalizationsEl extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}

/// The translations for English, as used in the United Kingdom (`en_GB`).
Expand Down
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_es.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1180,4 +1180,7 @@ class ZulipLocalizationsEs extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1196,4 +1196,7 @@ class ZulipLocalizationsFr extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_he.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1180,4 +1180,7 @@ class ZulipLocalizationsHe extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_hu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1180,4 +1180,7 @@ class ZulipLocalizationsHu extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_it.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1200,4 +1200,7 @@ class ZulipLocalizationsIt extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1154,4 +1154,7 @@ class ZulipLocalizationsJa extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_nb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1180,4 +1180,7 @@ class ZulipLocalizationsNb extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_pl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1199,4 +1199,7 @@ class ZulipLocalizationsPl extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_ru.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1212,4 +1212,7 @@ class ZulipLocalizationsRu extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_sk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1182,4 +1182,7 @@ class ZulipLocalizationsSk extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_sl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1221,4 +1221,7 @@ class ZulipLocalizationsSl extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_uk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1201,4 +1201,7 @@ class ZulipLocalizationsUk extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}
3 changes: 3 additions & 0 deletions lib/generated/l10n/zulip_localizations_zh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,9 @@ class ZulipLocalizationsZh extends ZulipLocalizations {

@override
String get zulipAppTitle => 'Zulip';

@override
String get loading => 'Loading…';
}

/// The translations for Chinese, as used in China, using the Han script (`zh_Hans_CN`).
Expand Down
12 changes: 9 additions & 3 deletions lib/widgets/action_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,16 @@ class BottomSheetEmptyContentPlaceholder extends StatelessWidget {
@override
Widget build(BuildContext context) {
final designVariables = DesignVariables.of(context);

final loc = ZulipLocalizations.of(context);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
final loc = ZulipLocalizations.of(context);
final zulipLocalizations = ZulipLocalizations.of(context);

(Like everywhere else we do this.)

final child = loading
? CircularProgressIndicator()
: Text(
? Semantics(
label:loc.loading ,
textDirection: Directionality.of(context),
liveRegion: true,
focusable: true,
child: CircularProgressIndicator(),
)
: Text(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting of this code looks really messy; please follow the project's style in the use of spaces, indentation, newlines, etc. (here and throughout the PR).

textAlign: TextAlign.center,
style: TextStyle(
color: designVariables.labelSearchPrompt,
Expand Down
7 changes: 6 additions & 1 deletion lib/widgets/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,12 @@ class _LoadingPlaceholderPageState extends State<_LoadingPlaceholderPage> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const CircularProgressIndicator(),
Semantics(
label: zulipLocalizations.loading,
textDirection: Directionality.of(context),
liveRegion: true,
child:const CircularProgressIndicator(),
),
Visibility(
visible: showTryAnotherAccount,
maintainSize: true,
Expand Down
20 changes: 17 additions & 3 deletions lib/widgets/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,16 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
Widget build(BuildContext context) {
final zulipLocalizations = ZulipLocalizations.of(context);

if (!model.fetched) return const Center(child: CircularProgressIndicator());
if (!model.fetched) {
return Center(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add extra padding? That's not part of the issue.

child: Semantics(
label: zulipLocalizations.loading,
textDirection: Directionality.of(context),
liveRegion: true,
child: const CircularProgressIndicator())));
}

if (model.items.isEmpty && model.haveNewest && model.haveOldest) {
final String header;
Expand Down Expand Up @@ -1283,10 +1292,15 @@ class _MessageListLoadingMore extends StatelessWidget {

@override
Widget build(BuildContext context) {
return const Center(
final loc = ZulipLocalizations.of(context);
return Center(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 16.0),
child: CircularProgressIndicator())); // TODO perhaps a different indicator
child: Semantics(
textDirection: Directionality.of(context),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is textDirection needed? I'm surprised to see this.

label: loc.loading,
liveRegion: true,
child: CircularProgressIndicator()))); // TODO perhaps a different indicator
}
}

Expand Down
12 changes: 10 additions & 2 deletions lib/widgets/topic_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,16 @@ class _TopicListState extends State<_TopicList> with PerAccountStoreAwareStateMi
@override
Widget build(BuildContext context) {
if (lastFetchedTopics == null) {
return const Center(child: CircularProgressIndicator());
}
final loc = ZulipLocalizations.of(context);

return Center(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: Semantics(
textDirection: Directionality.of(context),
label: loc.loading,
liveRegion: true,
child: CircularProgressIndicator(),),),);}

// TODO(design) handle the rare case when `lastFetchedTopics` is empty

Expand Down
Loading