Repository navigation
feat(chat): show live token speed beside the context meter - #385
Merged
Merged
Conversation
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.
Summary
ConnectionQuality.tokensPerSecond(ConnectionQualityMonitorがストリーミングデルタから計測する平滑値)をChatUiState.connectionQuality経由で流用し、isRunning && tokensPerSecond >= 0.05のときだけCompactTokenSpeedを表示します。chat_token_speed(%1$s tok/s)を既定と全ロケール(ar/es/fr/ja/pt-rBR/ru/zh-rCN)に追加しました。Test plan
./gradlew detekt spotlessCheck— BUILD SUCCESSFUL./gradlew :app:compileGithubDebugKotlin— BUILD SUCCESSFUL.github/workflows/i18n-check.ymlのロジック) — All translations complete.Pre-PR review
判定: APPROVE
ブロッカー
提案(非ブロッキング)
チェック済み項目
git diff origin/main...HEAD全体と追加コミット223972d1を確認。差分はChatHomeScreen.ktへのtokensPerSecond受け渡し&表示、およびvalues*/strings.xmlへのchat_token_speed追加のみ。223972d1は> 0.0→>= 0.05の1行変更に限定されていることをgit showで確認。formatTokenRateは 10.0 未満で"%.1f"(Java Formatter は HALF_UP)を使うため、0.05(実値 0.050000…)は0.1に丸められ、「0.0 tok/s」が表示されるケースは>= 0.05では発生しない。目的(丸めによる 0.0 表示回避)を達成していると確認。formatTokenRate/CompactTokenSpeedは直上のformatTokenCount/CompactContextMeterと同じstyle・fontSize = 9.sp・.format()パターンに従っており、既存規約と整合。values+ ar/es/fr/ja/pt-rBR/ru/zh-rCN の全8ファイルにchat_token_speedが存在することを grep で確認。values*ディレクトリは他に存在しない。i18n-check.ymlはキー存在のみを検査するため、翻訳文が同一でも問題なし。ChatComposer呼び出しは名前付き引数でtokensPerSecondを追加済み(675行目)。ChatComposerを呼ぶ箇所は当該1箇所のみで、Preview はChatHomeScreenを呼ぶため未指定引数によるコンパイルエラーはなし。ChatUiState.connectionQuality: ConnectionQuality?(ChatViewModel.kt:523)→ConnectionQuality.tokensPerSecond: Double(ConnectionQualityMonitor.kt:35)を確認。isRunning && …条件付き表示のため、実行中のみ表示される。.editorconfigで ktlint max-line-length は無効、detekt はMagicNumber無効・MaxLineLength140 で、追加行(2187行目)はいずれにも抵触しない。connectionQuality/tokensPerSecondはテストから参照されておらず、ConnectionQualityMonitor側に変更なし。UI表示のみの追加で既存テストへの影響なし。