Commit Graph

5 Commits

Author SHA1 Message Date
admin 87d3f6d12c Global hash strip: suppress re-scan on anchor-only URL changes 2026-05-27 00:50:15 +02:00
admin 2d6a95682f Sync working tree before initial Gitea push
- File reorg: popup/options/bulk-check moved to src/ subdirs
- Shared modules: src/shared/id-extract.js, src/options/options-shared.js
- Host updates: rcjav-host.py + register/install scripts
- .gitignore expanded
2026-05-26 22:42:15 +02:00
admin c17ac9e1e7 Step 10j (host + extension): cache contract three-state UX
Completes the two-tier cache contract from step 9 / docs/CACHE_CONTRACT.md
on the extension side. The Python side shipped in the Python repo at
33c495a.

Host (rcjav-host.py):
  - fetch_rules_info() memoizes per-script-path calls to
    `rc-jav.py --print-rules-info` so handle_cache_status doesn't pay
    the Python startup cost on every poll.
  - _cache_freshness_fields(data, rules_info) computes the new
    cache_schema / id_rules / id_rules_signature trio + their three
    *_match booleans + cache_state ('fresh' / 'stale_by_rules' /
    'schema_mismatch' / 'missing'). Legacy version:3 caches still on
    disk report as stale_by_rules with cache_schema_match=True (we'll
    migrate them at next load_cache).
  - New handle_reextract_ids() action forwards to
    `rc-jav.py --reextract --format json` with a 5-minute timeout.

background.js:
  - New `reextract-ids` message forwards to host with a 300s timeout.

options-cache.js + options-library-issues.js:
  - renderCacheContractBanner() paints a three-state banner above the
    per-remote list: green ✓ fresh / amber ! stale-by-rules (with
    "Re-extract IDs (fast, no rescan)" chip button) / red ✗ schema
    mismatch. Includes a snippet of the cache signature for diagnostics.
  - Delegated click handler in options-library-issues.js catches
    .cache-reextract, sends the message, shows transient
    "Re-extracting…" state, and replaces the button with a per-summary
    line ("Re-extracted N IDs · X changed · Y unchanged · Z dropped").
  - rules_info_error from the host surfaces as its own amber line above
    the banner.

node --check passes on background.js, options-cache.js,
options-library-issues.js individually and on the concatenation of all
four script files. python -m py_compile passes on rcjav-host.py.
Behavioral verification requires reloading the unpacked extension and
running through:
  - Check Cache → banner shows "stale by rules" amber (legacy v3 cache)
  - Click "Re-extract IDs" → fast path runs, summary appears
  - Check Cache again → banner now shows "Cache up to date" green

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 11:07:26 +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 f8e781f0e9 Initial snapshot before step 6 options.js split 2026-05-22 21:05:21 +02:00