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
+102
View File
@@ -0,0 +1,102 @@
body {
font-family: -apple-system, Segoe UI, sans-serif;
font-size: 13px;
margin: 0;
padding: 12px;
background: #1a1a1a;
color: #ddd;
}
#header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
#header strong { font-size: 15px; }
#mode-pill {
font-size: 11px;
font-weight: 700;
letter-spacing: 0.4px;
background: #1a2a3a;
color: #6ec1ff;
padding: 2px 8px;
border-radius: 3px;
border: 1px solid #2a4a6a;
}
#mode-pill[data-mode="CACHE"] {
background: #1a3a1a;
color: #afa;
border-color: #2a5a2a;
}
.help {
font-size: 12px;
color: #aaa;
line-height: 1.4;
margin-bottom: 8px;
}
.help code {
background: #0d0d0d;
padding: 1px 4px;
border-radius: 2px;
font-family: Consolas, monospace;
color: #ddd;
}
.dim { color: #777; }
textarea#bulk-id-input {
width: 100%;
height: 140px;
resize: vertical;
background: #0d0d0d;
color: #ddd;
border: 1px solid #444;
border-radius: 3px;
padding: 6px 8px;
font-size: 12px;
font-family: Consolas, monospace;
box-sizing: border-box;
}
textarea#bulk-id-input:focus { outline: none; border-color: #6ec1ff; }
.button-row {
display: flex;
align-items: center;
gap: 6px;
margin: 8px 0;
}
button {
background: #333;
color: #ddd;
border: 1px solid #555;
border-radius: 3px;
padding: 4px 10px;
cursor: pointer;
font-size: 12px;
}
button:hover { background: #444; }
button:disabled { opacity: 0.5; cursor: default; }
button.running { background: #3a1a1a; border-color: #722; color: #faa; }
#count-pill {
margin-left: auto;
font-size: 11px;
}
.mono-output {
background: #0d0d0d;
border: 1px solid #333;
border-radius: 3px;
padding: 8px 10px;
font-family: Consolas, monospace;
font-size: 12px;
line-height: 1.5;
max-height: 260px;
overflow-y: auto;
white-space: pre-wrap;
word-break: break-word;
}
.mono-output:empty { display: none; }