コマンド新規作成時、Hubへの共有を誘うToastを表示する - #444
Conversation
Shows a one-time toast on the options page after a command is created, inviting the user to share it to the Selection Command Hub. Once shown, it is never shown again (hasShownHubShareToast flag), following the same pattern as the existing review-request toast. Closes #443 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EJVeN7n8jzatkUy99SGyhG
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #444 +/- ##
==========================================
+ Coverage 39.56% 40.67% +1.10%
==========================================
Files 237 238 +1
Lines 25353 25443 +90
Branches 1886 1923 +37
==========================================
+ Hits 10032 10348 +316
+ Misses 15321 15095 -226 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
コードレビュー新規コマンド作成後にHub共有を促すToastを表示する機能追加、および 1. 「一度だけ表示」の保証が崩れるケースがある(中)
この場合 対応案としては、 2. 新規追加ロジックのテストが無い(軽微)
PRのTest planには手動でのPlaywright確認は含まれていますが、ロジック部分(特に 3. 軽微な指摘
良い点
以上、よろしくお願いします。 |
Co-authored-by: ujiro99 <677231+ujiro99@users.noreply.github.com>
onAutoClose was unhandled so the "shown once" flag never persisted when the toast timed out, letting it reappear on the next command. Also adds unit tests for isHubShareable, HubShareToast, and the new-command toast trigger branch in CommandList that were previously uncovered. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
コードレビュー実装全体としては、既存の 以下、気になった点です。 1. トーストのスワイプ/ドラッグでの手動クローズが
|
コードレビュー結果🔴 重大:
|
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…nimation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…oast. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
レビュー結果PR #444(コマンド新規作成時にHub共有Toastを表示する機能)を確認しました。全体的に既存の バグの可能性1.
onClick={() => {
shareCommandToHub(command)
sendEvent(
ANALYTICS_EVENTS.COMMAND_SHARE,
{ event_label: "hub-share-toast" },
SCREEN.OPTION,
)
toast.dismiss(toastId)
onShown()
}}
一方、既存の
という実害があります。 テスト( 軽微な懸念点(レースコンディション)2. 短時間に複数回コマンドを新規作成すると、Toastが重複して表示され得る
enhancedSettings
.getSection(CACHE_SECTIONS.USER_STATS)
.then((userStats) => {
if (!userStats.hasShownHubShareToast && isHubShareable(data as SelectionCommand)) {
showHubShareToast(data as SelectionCommand, () => {
Settings.update("hasShownHubShareToast", () => true)
})
}
})
良かった点
テストカバレッジ
パフォーマンス・セキュリティ
🤖 このレビューはClaude Codeによって生成されました。 |
Summary
hasShownHubShareToastフラグ、既存のhasShownReviewRequestと同じ配線パターン)isHubShareable()としてhubShare.tsに切り出し、Toast側と共通化実装内容
HubShareToast.tsx(新規):ReviewRequestToast.tsxを参考に、sonnerのtoast.custom()でToastを表示CommandList.tsx: コマンド新規作成時(commandUpsertのappend分岐)にToastをトリガーOption.tsx:sonnerの<Toaster/>をオプションページに追加(従来未マウントだった)messages.jsonにhub_share_toast_message/_button/_laterキーを追加Test plan
yarn buildが通ることyarn lintでエラーがないことyarn test:run(977件)が全てパスすることyarn test:run src/test/locales.test.tsで全ロケールのキー整合性が保たれていることCloses #443
🤖 Generated with Claude Code
https://claude.ai/code/session_01EJVeN7n8jzatkUy99SGyhG