Skip to content

Hub外部呼び出しでCommand編集ダイアログ起動と保存時Hub同期を追加#401

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-command-edit-dialog-launch
Draft

Hub外部呼び出しでCommand編集ダイアログ起動と保存時Hub同期を追加#401
Copilot wants to merge 3 commits intomainfrom
copilot/add-command-edit-dialog-launch

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 10, 2026

Selection Command Hub から拡張機能へ既存コマンド編集を要求できる経路がなく、編集後の更新も Hub 側へ反映されませんでした。
この変更で、Hub から対象コマンドの編集ダイアログを直接起動し、保存時に同コマンドを Hub に再送できるようにしています。

  • Hub→Extension 外部メッセージ拡張 (EditCommand)

    • onMessageExternalEditCommand アクションを追加。
    • options_pageeditCommand / syncHub クエリ付きで開き、編集対象と同期意図を明示的に渡すように変更。
  • Options画面での編集ダイアログ自動起動

    • CommandListlocation.search を解釈し、editCommand に一致するコマンドを特定して編集ダイアログを自動オープン。
    • 処理後にクエリパラメータを除去し、同一パラメータの再処理を防止。
  • 保存時のHub更新連携

    • syncHub=1 のときのみ、既存の shareCommandToHub を利用して更新済みコマンドを Hub に送信。
    • 通常の編集導線(Hub経由でない操作)には影響を与えない条件付き連携に限定。
  • 関連テスト更新

    • Hub外部メッセージ処理テストに EditCommand ケース(正常系/型不正系)を追加。
// Hub external message handling
if (action === "EditCommand" && typeof id === "string") {
  chrome.tabs.create({
    url: `${OPTION_PAGE_PATH}?editCommand=${encodeURIComponent(id)}&syncHub=1#commands`,
  })
  return true
}

Copilot AI changed the title [WIP] Add command edit dialog launch from Selection Command Hub Hub外部呼び出しでCommand編集ダイアログ起動と保存時Hub同期を追加 May 10, 2026
Copilot AI requested a review from ujiro99 May 10, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

外部からのCommand編集ダイアログの呼びだし

2 participants