Commit Graph

5 Commits

Author SHA1 Message Date
admin d0a2def788 Step 6c: extract Diagnostics + Profiles + Rules Editors from options.js
Final options.js split. Three new files:

  options-diagnostics.js     245 lines
  options-profiles.js        265 lines
  options-rules-editors.js   328 lines  (adapters + ID normalizers
                                          + custom part detectors)

options.js: 1852 → 1014 lines (838 extracted, ~45% reduction).

Script-tag order in options.html now (load order matters for
top-level let bindings shared across files, e.g. _configuredScanRoots):

  options-cache.js
  options-dupe-review.js
  options-library-issues.js
  options-diagnostics.js
  options-profiles.js
  options-rules-editors.js
  options.js  (entry: IIFE bottom, escapeHtml, overlay previews,
               element picker, paths)

The picker, overlay-preview, and no-match overlay code stays in
options.js — those are tightly intertwined with multiple settings
panes and not worth further splitting today.

node --check passes on each file individually and on the concatenated
load-order stream. Line count of concat (3144) matches the pre-split
sum exactly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 11:17:55 +02:00
admin ad4df28a66 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>
2026-05-22 21:27:12 +02:00
admin e4ee06b19f Step 6b: extract Library Issues from options.js
Continues the options.js split. New file:

  options-library-issues.js  453 lines

After this step:

  options-cache.js            161 lines
  options-dupe-review.js      616 lines
  options-library-issues.js   453 lines
  options.js                 1903 lines  (was 2356 after step 6)

Library Issues block was fully self-contained (lastLibraryIssues,
_libraryIssuesDirty, renderLibraryIssues, _closeLibraryIssues, and the
bottom IIFE wrapping _optScanTimer / _setOptScanningState /
_pollOptProgress for optimization-scan progress polling). No external
callers of its identifiers.

Reads _configuredScanRoots / _cacheSkippedByRemote and calls
rememberConfiguredScanRoots from options-cache.js by bare reference —
same cross-file binding pattern proven in step 6.

node --check passes on each file and on the concatenation of all four
files in load order. Concat = 3133 lines, matching pre-split total.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 21:21:58 +02:00
admin da09434419 Step 6: extract Cache & Scans + Duplicate Review from options.js
Splits the 3133-line options.js into three vanilla scripts loaded in
order at the bottom of options.html:

  options-cache.js        161 lines  (Cache & Scans block)
  options-dupe-review.js  616 lines  (Duplicate Review + Keep Ranking)
  options.js             2356 lines  (everything else)

No behavior change. Cross-file references work because classic <script>
tags share the global declarative environment: top-level `let` bindings
in options-cache.js (_configuredScanRoots, _cacheSkippedByRemote) are
visible by bare reference in options.js, where Library Issues still
reads them. Calls into options.js from the extracted files
(escapeHtml, openModal/closeModal, keepActionViewport,
clearNativeRepairCard, renderNativeMessagingFailure) all occur inside
event handlers, resolved at call time after options.js parses.

node --check passes on each file individually and on the concatenation
of all three in load order. Brace counts balanced.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 21:10:04 +02:00
admin f8e781f0e9 Initial snapshot before step 6 options.js split 2026-05-22 21:05:21 +02:00