Skip to content

Conversation

Copy link

Copilot AI commented Feb 8, 2026

Implementation Plan for Popup Auto-Close Delay

  • Explore codebase structure and understand current implementation
  • Add popupAutoCloseDelay setting to UserSettings type
  • Update default settings to include the new setting
  • Add UI field in SettingForm for delay configuration
  • Add translation keys for Japanese and English
  • Implement timeout logic in background_script.ts for delayed closing
  • Add tests for the new timeout behavior
  • Fix all code review feedback
  • Run security checks (no vulnerabilities found)
  • Simplify redundant timer clearing logic
  • Implementation complete and ready for review
Original prompt

This section details on the original issue you should resolve

<issue_title>ポップアップの自動クローズへ、遅延時間を指定可能にする</issue_title>
<issue_description>現在は、 packages/extension/src/background_script.tschrome.windows.onFocusChanged で、フォーカスが外れたポップアップウィンドは即座に消している。これを、フォーカスが外れてからあらかじめ設定した遅延時間を経過してから消すようにする。

機能の要点

  • ユーザの設定へ、ポップアップを消すまでの時間(A)を指定できるようにする
  • chrome.windows.onFocusChanged でフォーカスが外れたとき:
    • Aの時間が指定されていた場合は、Aの時間が経過してからポップアップウィンドウを消す
      • Aの時間が経過するまえにポップアップにフォーカスが戻った場合は、タイムアウトをキャンセルして、ウィンドウは消さない。
    • Aの時間が指定されていない場合は、即座にポップアップウィンドウを消す
      </issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 6 commits February 8, 2026 02:05
Co-authored-by: ujiro99 <677231+ujiro99@users.noreply.github.com>
Co-authored-by: ujiro99 <677231+ujiro99@users.noreply.github.com>
Co-authored-by: ujiro99 <677231+ujiro99@users.noreply.github.com>
Co-authored-by: ujiro99 <677231+ujiro99@users.noreply.github.com>
Co-authored-by: ujiro99 <677231+ujiro99@users.noreply.github.com>
Co-authored-by: ujiro99 <677231+ujiro99@users.noreply.github.com>
Copilot AI changed the title [WIP] Add configurable delay time for auto-closing popups Add configurable delay for popup auto-close Feb 8, 2026
Copilot AI requested a review from ujiro99 February 8, 2026 02:16
Comment on lines 370 to 383
// If there are no windows to close, cancel any pending auto-close timer
if (windowsToClose.length === 0) {
if (popupAutoCloseTimer !== null) {
clearTimeout(popupAutoCloseTimer)
popupAutoCloseTimer = null
}
return
}

// Cancel any existing timer
if (popupAutoCloseTimer !== null) {
clearTimeout(popupAutoCloseTimer)
popupAutoCloseTimer = null
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

処理が冗長に見えます。キレイのできますか?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

リファクタリングしました。タイマーのクリア処理を最初に一度だけ実行するように変更し、重複を削除しました。(commit: b3fb920)

Co-authored-by: ujiro99 <677231+ujiro99@users.noreply.github.com>
Copilot AI requested a review from ujiro99 February 12, 2026 22:32
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.

ポップアップの自動クローズへ、遅延時間を指定可能にする

2 participants