Feat/add page url#430
Conversation
Allows commands (tab/window/popup/sidePanel/pageAction) to embed the current page URL in their searchUrl via a %pageUrl token, alongside the existing %s selection-text placeholder. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Previously injected via OptionSettings as an immutable, always-present menu item. Move it into defaultSettings.ts so it behaves like any other user command (editable openMode, deletable, etc.), and add a settings migration so existing users receive it too, not just fresh installs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
コードレビュー: #430 Feat/add page url現在選択中のページURL( 🔴 重要な指摘1. バックグラウンド(Service Worker)経由の実行パスで
2.
3.
🟡 確認したい点4. デフォルトコマンド「Search Commands on Hub」の
🟢 軽微な指摘5. 変数名の衝突による可読性の低下
6.
✅ 良い点
このレビューはPRの差分とリポジトリの現在のコードを確認した上でClaudeが作成しました。 |
…xecution path location.href inside action modules (tab/popup/window/backgroundTab/pageAction/aiPrompt) resolved to the service worker's own URL, not the visited page, when invoked via the shortcut-key fallback path in background_script.ts. Thread pageUrl explicitly through ExecuteCommandParams instead: content script callers supply location.href, and the background fallback supplies the already-queried tab.url. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… guards
Previously only aiPrompt checked for selectedText/clipboard placeholders,
so search commands with a fixed URL were incorrectly flagged in SidePanel
mode, and pageAction steps using {{SelectedText}} were never flagged even
though selection can't be substituted by the clipboard fallback.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…e selection showNoSel was based solely on !isTextSelectionOnly, so commands that don't reference selected text or clipboard at all (e.g. a fixed searchUrl with no %s) still showed the dropdown, even though the setting has no effect on them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…and showNoSel logic isTextSelectionOnly now delegates its clipboard/selectedText placeholder detection to willUseClipboard, and gates the pageAction branch on PAGE_ACTION_OPEN_MODE.CURRENT_TAB. The no-selection-behavior field visibility now uses a dedicated referencesSelection helper that checks for the selectedText placeholder specifically. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #430 +/- ##
==========================================
+ Coverage 29.93% 30.11% +0.17%
==========================================
Files 322 322
Lines 33274 33435 +161
Branches 1943 1955 +12
==========================================
+ Hits 9962 10070 +108
- Misses 23312 23365 +53 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
レビュー結果
1.
|
…n-extension build contexts yarn build:e2e runs generate-e2e-urls.ts via vite-node, which imports defaultSettings.ts outside a Chrome extension runtime, causing ReferenceError: chrome is not defined when constructing the "Search Commands on Hub" default command. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…dePanel action - action/background.ts: execute() destructured params without pageUrl and never forwarded it to executeAction, so commands run via the background-direct fallback (e.g. chrome:// tabs) always got an empty pageUrl, defeating %pageUrl/srcUrl interpolation. - action/sidePanel.ts: accept pageUrl like every other action instead of reading location.href directly, for consistency and to avoid the same class of bug if SidePanel is ever invoked from a background context. - ShortcutList.tsx: deduplicate willUseClipboard/referencesSelection into a shared referencesPlaceholder helper parameterized by the placeholder predicate. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Test comment from review tool - checking gh pr comment with stdin |
|
レビュー概要 このPRは「Hub上でコマンドを検索する」デフォルトコマンドを追加し、そのための 以下、気になった点を挙げます。 潜在的な不具合
テストカバレッジ
軽微な指摘(Nits)
良い点
以上、大きな設計上の問題は見当たりませんでした。上記の |
close #429