fix(ui): address PR #30 review findings
- ViewportInfo.updateShouldNotify: compare layoutClass only (not width/height), avoiding unnecessary rebuilds on every resize frame within the same layout class. - ChatPanel: use BorderDirectional(start:) for RTL support. - ChatPanel: localize 'Close chat' tooltip via AppL10n.chatCloseAction. - Inline panel snackbar: localize via AppL10n.chatPanelCollapsedHint. New en/zh ARB entries added. - _saveCurrentDraft(): removed — it was a self-assignment no-op. Draft persistence relies on ChatDetailView's didUpdateWidget (fires onDraftChanged on target switch) and dispose (fires on panel tear-down), both of which already populate _chatDrafts correctly without an explicit save call. - _handleInlineChatViewport layout snackbar: use AppL10n. - Audio level-meter: switch from callback-count (% 3) to time-based gating (std::time::Duration::from_millis(33)), robust to cpal buffer-size or sample-rate changes. Remove level_decimation_counter. - chat_panel_test.dart: add AppL10n.localizationsDelegates so the test resolves l10n keys. Tests: 183 passed, 2 skipped. Dart analyze clean. cargo test -p chanora_audio --lib: 125 passed.
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
"retryAction": "Retry",
|
||||
"chatAction": "Chat",
|
||||
"chatCloseAction": "Close chat",
|
||||
"chatPanelCollapsedHint": "Tap the chat button to continue your conversation",
|
||||
"chatNewPrivateAction": "New private chat",
|
||||
"chatSearchClientsHint": "Search clients...",
|
||||
"chatDirectMessageAction": "Private message",
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
"retryAction": "重试",
|
||||
"chatAction": "聊天",
|
||||
"chatCloseAction": "关闭聊天",
|
||||
"chatPanelCollapsedHint": "点击聊天按钮以继续对话",
|
||||
"chatNewPrivateAction": "新建私聊",
|
||||
"chatSearchClientsHint": "搜索用户...",
|
||||
"chatDirectMessageAction": "私聊",
|
||||
|
||||
@@ -307,6 +307,12 @@ abstract class AppL10n {
|
||||
/// **'Close chat'**
|
||||
String get chatCloseAction;
|
||||
|
||||
/// No description provided for @chatPanelCollapsedHint.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Tap the chat button to continue your conversation'**
|
||||
String get chatPanelCollapsedHint;
|
||||
|
||||
/// No description provided for @chatNewPrivateAction.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
||||
@@ -123,6 +123,10 @@ class AppL10nEn extends AppL10n {
|
||||
@override
|
||||
String get chatCloseAction => 'Close chat';
|
||||
|
||||
@override
|
||||
String get chatPanelCollapsedHint =>
|
||||
'Tap the chat button to continue your conversation';
|
||||
|
||||
@override
|
||||
String get chatNewPrivateAction => 'New private chat';
|
||||
|
||||
|
||||
@@ -120,6 +120,9 @@ class AppL10nZh extends AppL10n {
|
||||
@override
|
||||
String get chatCloseAction => '关闭聊天';
|
||||
|
||||
@override
|
||||
String get chatPanelCollapsedHint => '点击聊天按钮以继续对话';
|
||||
|
||||
@override
|
||||
String get chatNewPrivateAction => '新建私聊';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user