Skip to content

Conversation

@cybernova2
Copy link

Fixes: #1962

This PR improves accessibility by adding Semantics widgets around loading
indicators so screen readers (TalkBack / VoiceOver) announce that the app is
loading content.

What’s changed

  • Wrapped CircularProgressIndicator (and similar loading states) in:
    Semantics(label: 'Loading…', liveRegion: true)
  • Updated loading indicators in:
    • message_list.dart
    • topic_list.dart
    • home.dart / action_sheet.dart (where applicable)
  • Kept changes minimal and within existing widgets, as requested.

Why

Screen readers were not able to focus on or announce the loading state,
making the app inaccessible while fetching messages or topics.

Testing

  • All updated tests pass:
    -Verified that find.bySemanticsLabel(...) correctly locates the loading indicators.
    -Ensured no regressions in navigation or layout.
    -flutter analyze reports no new warnings.

Screenshot (TalkBack focus on loading indicator)

This shows the loading indicator now exposes an accessible label via Semantics().

WhatsApp Image 2025-12-04 at 18 48 43_94385035

Notes

  • Only minimal changes were made; no unrelated formatting or indentation changes.
  • The previous PR was closed because it unintentionally included formatting noise;
    this new PR contains only the intended accessibility changes.

Related

Replaces the earlier PR (#2017) with a clean version.

@MritunjayTiwari14
Copy link
Contributor

Thanks for the Pull Request, I can provide some insights on this PR as a contributor just like you.

? CircularProgressIndicator()
: Text(
? Semantics(
label: 'Loading…',
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make sure not to insert hardcoded strings and instead use the zulip localization to fetch those from app_en.arb, this helps zulip to make the app available to user across the globe with different languages.

Comment on lines 1040 to 1043
child: const CircularProgressIndicator(),
),
),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
child: const CircularProgressIndicator(),
),
),
);
child: const CircularProgressIndicator())));

See in this file (and other examples across the codebase).

Comment on lines 176 to 179
child: CircularProgressIndicator(),
),
),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
child: CircularProgressIndicator(),
),
),
);
child: CircularProgressIndicator())));

children: [
const CircularProgressIndicator(),
Semantics(
label: 'Loading…',
Copy link
Contributor

@MritunjayTiwari14 MritunjayTiwari14 Dec 10, 2025

Choose a reason for hiding this comment

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

Same as here, use ZulipLocalization.

padding: const EdgeInsets.symmetric(vertical: 16.0),
child: Semantics(
textDirection: Directionality.of(context),
label: 'Loading…', // plain string (not localized)
Copy link
Contributor

@MritunjayTiwari14 MritunjayTiwari14 Dec 10, 2025

Choose a reason for hiding this comment

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

Same as Here, use ZulipLocalization.

child: Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: Semantics(
label: 'Loading more messages',
Copy link
Contributor

Choose a reason for hiding this comment

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

Use ZulipLocalization.

Comment on lines 1305 to 1306
child: CircularProgressIndicator(),
))); // TODO perhaps a different indicator
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
child: CircularProgressIndicator(),
))); // TODO perhaps a different indicator
child: CircularProgressIndicator()))); // TODO perhaps a different indicator

@cybernova2
Copy link
Author

Thanks for taking the time to review this! @MritunjayTiwari14 .I’ll implement the changes you recommended and update the branch.

Add a localized 'loading' label in multiple widgets and apply it consistently across the UI. Update ARB files and regenerate localization outputs. Update widget tests to use the localized semantics label instead of hardcoded strings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Semantics for loading screen/indicator

2 participants