fix(chat): surface all disconnected states in reconnect banner (#491) (#493)

* fix(chat): surface all disconnected states in reconnect banner (issue #491)

The connection-status banner only appeared for RECONNECTING/DISCONNECTED,
so NO_NETWORK and AUTH_EXPIRED left the user staring at a silent chat with
no feedback and no way to recover — the core of the 'reconnecting is not
user-friendly' complaint.

ChatTopBanner now shows for every non-connected, non-connecting state:
- RECONNECTING: spinner + 'Reconnecting to Hermes…' (auto, no button)
- DISCONNECTED: 'Disconnected from Hermes' + Reconnect
- NO_NETWORK: 'No network connection' + Reconnect (force a retry)
- AUTH_EXPIRED: 'Session expired' + 'Sign in again' -> AuthLoginScreen

The auto-reconnect engine (backoff, network-return trigger, in-flight
message queue in HermesWsClient) is untouched — this only makes the stuck
states visible and actionable.

* fix(chat): use LocalHermesStatusColors for reconnect banner (review fix)

Per AGENTS.md, semantic status colors must come from
LocalHermesStatusColors, never MaterialTheme.colorScheme. The reconnect
banner used errorContainer/onErrorContainer directly, which is both a
semantic-color violation and inconsistent with the rest of the app
(Navigation.kt maps DISCONNECTED/NO_NETWORK/AUTH_EXPIRED -> .error;
TelegramOnboardingDialog uses .errorContainer for error surfaces).

Switch Surface bg to errorContainer and foreground (spinner, text,
button content) to error via LocalHermesStatusColors.current.
This commit is contained in:
M57 authored and GitHub committed 2026-07-08 01:00:56 +03:00
1 parent 089eaf06e5
commit 739ff4f62b
2 files changed
+58 -23

No files matched your search

+3
View File
@@ -82,11 +82,14 @@
<string name="chat_action_search">Search</string>
<string name="chat_action_close_search">Close search</string>
<string name="chat_action_reconnect">Reconnect</string>
<string name="chat_action_sign_in">Sign in again</string>
<string name="chat_empty_title">Ready to chat</string>
<string name="chat_empty_subtitle">Send a message to start a conversation</string>
<string name="chat_status_connecting">Connecting to Hermes\u2026</string>
<string name="chat_status_reconnecting">Reconnecting to Hermes\u2026</string>
<string name="chat_status_disconnected">Disconnected from Hermes</string>
<string name="chat_status_no_network">No network connection</string>
<string name="chat_status_auth_expired">Session expired \u2014 please sign in again</string>
<string name="chat_thinking">Thinking\u2026</string>
<string name="chat_thinking_param">Thinking: %1$s\u2026</string>
<string name="chat_input_placeholder_not_connected">Not connected\u2026</string>