Step 7a: Bulk ID Check moves to a detached popup window

New files:
  bulk-check.html, bulk-check.js, bulk-check.css

Popup gains a 📋 launcher button next to the ⚙ Options gear. Clicking
it sends `open-bulk-check` to background.js and closes the popup;
background.js owns window lifecycle:

  - chrome.storage.session.bulkCheckWindowId stashes the open window id
  - existing id → chrome.windows.update({ focused, drawAttention })
  - missing or stale id → chrome.windows.create({ type:'popup',
    width:640, height:540 }) and stash the new id
  - chrome.windows.onRemoved clears the stale id on close

Last-paste persisted to chrome.storage.local.bulkCheckLastPaste,
debounced 500ms on input, restored on window open. quickMode is read
from settings at run time, matching previous behavior. Ctrl/Cmd+Enter
inside the textarea triggers the check.

Options page no longer carries the Bulk ID Check fieldset: removed
from options.html (Library Review pdesc updated to note the
relocation) and the matching handlers from options.js
(1903 → 1852 lines). No manifest permission changes — own-page
chrome.windows.create needs no extra permission.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
admin
2026-05-22 21:27:12 +02:00
parent e4ee06b19f
commit ad4df28a66
9 changed files with 321 additions and 64 deletions
+1 -11
View File
@@ -410,7 +410,7 @@
<div class="pane" id="pane-maintenance">
<div class="pane-head">
<h1>Library Review</h1>
<div class="pdesc">Review duplicate groups, check IDs in bulk, and fix non-canonical filenames in your library.</div>
<div class="pdesc">Review duplicate groups and fix non-canonical filenames in your library. (Bulk ID Check now opens in its own window from the popup.)</div>
</div>
<div class="fieldset">
@@ -478,16 +478,6 @@
<div id="library-issues-results" class="mono-output"></div>
</div>
<div class="fieldset">
<div class="ftitle">Bulk ID check</div>
<div class="help">Paste IDs separated by lines, commas, or spaces. Uses the current LIVE/CACHE mode and active library profile.</div>
<textarea id="bulk-id-input" placeholder="BLK-474&#10;FC2-4865786&#10;PRTD-[027-030]"></textarea>
<div class="button-row" style="margin-top:8px;">
<button id="bulk-id-run" type="button">Check IDs</button>
<button id="bulk-id-clear" type="button">Clear</button>
</div>
<div id="bulk-id-results" class="mono-output"></div>
</div>
</div>
<!-- SETUP -->