feat: generalized session side-issues with avatar indicator and account summary#1366
Merged
Conversation
…nt summary Introduce a generic "side issues" concept in session_status, independent of the primary signaling/connection status. Each issue has an id and a severity; the UI consumes the aggregated list generically so new issue sources can be added without touching the indicator widgets. - New SessionIssue model (id + severity) and SessionIssueL10n/color extension. - SessionStatusState carries a List<SessionIssue> with hasIssues/topIssue helpers. - SessionStatusCubit produces issues from sources; the first source is the limited standalone call mode (callkeep getCallDeliveryMode == standalone). - MainAppBar shows a generic "!" badge on the avatar when there is any issue, colored by the most severe (reusable SessionIssueBadge). - My account: avatar badge + a warning subtitle (top issue) on the status row, tapping through to Diagnostic for details. Connection status keeps its own signal (avatar ring / dot); side issues are purely additive. Standalone is just the first consumer of the registry.
f7f0c59 to
d1ccb2f
Compare
There was a problem hiding this comment.
Pull request overview
Generalizes session-level “side issues” (separate from primary signaling/connection status) and surfaces them via a reusable avatar/account warning indicator, starting with limited standalone call mode as the first issue source.
Changes:
- Added
SessionIssuemodel + severity/id enums, with localization and severity-driven UI helpers. - Extended
SessionStatusState/SessionStatusCubitto aggregate and expose session issues (incl.topIssue). - Updated UI (main app bar + My Account tiles) to show a generic “!” badge and top-issue subtitle; added unit tests for aggregation.
Reviewed changes
Copilot reviewed 21 out of 23 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/features/session_status/bloc/session_status_state_test.dart | Adds unit tests for hasIssues / topIssue aggregation behavior. |
| lib/widgets/main_app_bar.dart | Overlays the new issue badge on the top app bar avatar when issues exist. |
| lib/models/session_issue.dart | Introduces the SessionIssue model + enums. |
| lib/models/models.dart | Exports the new session_issue.dart model. |
| lib/extensions/session_issue.dart | Adds severity-to-color and issue l10n helpers used by UI. |
| lib/extensions/extensions.dart | Exports the new session_issue extensions. |
| lib/features/session_status/bloc/session_status_state.dart | Adds issues, hasIssues, and topIssue to session status state. |
| lib/features/session_status/bloc/session_status_cubit.dart | Fetches call delivery mode once and emits issues via _buildIssues(). |
| lib/features/session_status/bloc/session_status_cubit.freezed.dart | Regenerated for the new issues field. |
| lib/features/session_status/widgets/session_issue_badge.dart | Adds the reusable “!” badge widget. |
| lib/features/session_status/widgets/widgets.dart | Exports the new badge widget. |
| lib/features/session_status/session_status.dart | Re-exports session-status widgets. |
| lib/features/settings/view/settings_screen.dart | Wires topIssue into My Account header and session status row. |
| lib/features/settings/widgets/user_info_list_tile.dart | Adds optional badge overlay on the account avatar. |
| lib/features/settings/widgets/session_status_list_tile.dart | Shows top-issue subtitle in the session status row. |
| lib/l10n/arb/app_en.arb | Adds issue title/caption strings (English). |
| lib/l10n/arb/app_it.arb | Adds issue title/caption strings (Italian). |
| lib/l10n/arb/app_uk.arb | Adds issue title/caption strings (Ukrainian). |
| lib/l10n/app_localizations.g.dart | Regenerated localization getters for new keys. |
| lib/l10n/app_localizations_en.g.dart | Regenerated English localization implementation. |
| lib/l10n/app_localizations_it.g.dart | Regenerated Italian localization implementation. |
| lib/l10n/app_localizations_uk.g.dart | Regenerated Ukrainian localization implementation. |
| lib/l10n/app_localizations.g.mapper.dart | Regenerated mapper entries for new localization keys. |
Files not reviewed (2)
- lib/features/session_status/bloc/session_status_cubit.freezed.dart: Language not supported
- lib/l10n/app_localizations.g.mapper.dart: Language not supported
Comment on lines
+6
to
+18
| extension SessionIssueSeverityColor on SessionIssueSeverity { | ||
| // TODO(Serdun): Move to color scheme | ||
| Color color(BuildContext context) { | ||
| switch (this) { | ||
| case SessionIssueSeverity.critical: | ||
| return Colors.red; | ||
| case SessionIssueSeverity.warning: | ||
| return Colors.orange; | ||
| case SessionIssueSeverity.info: | ||
| return Colors.blueGrey; | ||
| } | ||
| } | ||
| } |
Comment on lines
3
to
7
| import 'package:webtrit_phone/models/models.dart'; | ||
|
|
||
| import 'package:webtrit_phone/extensions/extensions.dart'; | ||
| import 'package:webtrit_phone/features/session_status/session_status.dart'; | ||
| import 'package:webtrit_phone/utils/utils.dart'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Generalize how session-level problems are surfaced. Instead of hardcoding a single status,
session_statusnow carries a generic list of side issues (id + severity), independent of the primary signaling/connection status. The UI consumes the aggregated list generically, so new issue sources can be added without touching the indicator widgets.The first (and currently only) source is the limited standalone call mode (no Android Telecom). It is intentionally pluggable: more sources (battery, push, etc.) can be added later by producing more
SessionIssues.Behaviour (matches mockups)
Changes
SessionIssuemodel (id+severity) +SessionIssueL10n/severity-color extension.SessionStatusStategainsList<SessionIssue> issueswithhasIssues/topIssuehelpers.SessionStatusCubitfetches the call-delivery mode once at session start and produces the standalone issue.SessionIssueBadge; wired intoMainAppBarandUserInfoListTile;SessionStatusListTileshows the top-issue subtitle.sessionStatus_issue_*(English base; UK/IT via Localizely).topIssue/hasIssues).Relationship to other PRs
getCallDeliveryMode()(feat(android): expose call delivery mode (Telecom vs standalone) to Flutter webtrit_callkeep#310). Via the path dependency, CI here will not build until refactor: add optional WebViewController parameter to WebViewScaffold constructor #310 lands on callkeep develop. Verified locally against the callkeep branch.Scope
Deliberately minimal per the agreed direction: generic registry + avatar "!" + account summary, with standalone as the first consumer. Microphone permission keeps its existing dedicated badge for now; connection status is not duplicated as an issue. These can migrate into the registry later.