d65f0b2091
CI / lint (push) Successful in 3s
CI / frontend-build (push) Successful in 19s
CI / backend-lint-and-test (push) Successful in 20s
extension / lint (push) Successful in 13s
CI / intimp (push) Successful in 3m41s
CI / intapi (push) Successful in 7m11s
CI / intcore (push) Successful in 7m41s
Operator-asked 2026-05-31 (during sidecar synthetic anchor cleanup): "the add source/subscription button idea to the firefox extension so it can tell me if a source/artist is added or not and offer an option to add it if it isn't." Plan tracked in Scribe task #507. ## Backend - `ExtensionService.probe(url)` — read-only resolution. Reuses `_derive` for platform+slug, then 2 SELECTs. Returns one of: - `source_match` (exact (artist, platform, url) Source exists) - `artist_match` (artist exists, this URL isn't a Source yet; collapses the sidecar-synthetic-only case from v26.06.01.0) - `new` (neither exists) - `unknown_platform` (URL didn't match any artist-page regex) - `GET /api/extension/probe?url=...` route with `X-Extension-Key` auth posture matching `/quick-add-source`. Read-only, side-effect free. - 6 backend tests in tests/test_api_extension.py covering each state + auth + invalid URL. ## Extension - `api.js`: `probeSource(url)` mirroring `quickAddSource` shape. - `background.js`: `PROBE_SOURCE` + `OPEN_ARTIST_PAGE` handlers. The latter strips the `/api` suffix from configured `apiUrl` (placeholder format per options.html) and opens `${base}/artist/{slug}` in a new tab via `browser.tabs.create`. - `content-script.js`: probe-first render — on page-load and SPA navigation, asks the backend for the URL's state and renders the chip in the matching color/copy on FIRST paint instead of flashing generic "Add" and updating after. Click handler branches: `source_match` → OPEN_ARTIST_PAGE; `artist_match`/`new` → existing ADD_AS_SOURCE flow (then re-probes so the chip flips green immediately, no wait for next nav). - `content-script.css`: three state-color modifiers (--new, --artist-match, --source-match) on the FC parchment-on-slate palette. Sage for already-added, amber for artist-exists, accent orange for new. ## Versioning - `extension/manifest.json` + `extension/package.json` → 1.0.6. build.yml's sign-extension job will fire on push to main since no `ext-1.0.6` Forgejo/Gitea release exists yet — exercises the regenerated AMO keys end-to-end. ## Behavior on the sidecar-synthetic case Filesystem-imported "Dymkens"-style artist with only a sidecar synthetic Source: probe returns `artist_match` (not `new`), so the chip reads "+ Add Patreon source to Dymkens" rather than offering to recreate the artist. Clicking adds the real Source; existing `_source_for_sidecar` preference logic (v26.06.01.0) routes future gallery-dl Posts to the real one.
43 lines
1.6 KiB
CSS
43 lines
1.6 KiB
CSS
.fc-add-source-btn {
|
|
all: revert;
|
|
position: fixed; bottom: 24px; right: 24px; z-index: 2147483647;
|
|
padding: 10px 16px; border-radius: 999px; border: none;
|
|
background: rgb(20, 23, 26); color: rgb(244, 186, 122);
|
|
font: 500 14px/1.2 system-ui, sans-serif;
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); cursor: pointer;
|
|
transition: transform 100ms ease, background 150ms ease, color 150ms ease;
|
|
}
|
|
.fc-add-source-btn:hover { transform: translateY(-1px); }
|
|
.fc-add-source-btn:disabled { opacity: 0.6; cursor: wait; }
|
|
|
|
/* state colors map to the FC palette: parchment-on-slate base,
|
|
accent-orange for new, sage for already-subscribed, amber-warning for
|
|
artist-exists-but-source-missing. All readable on the dark base. */
|
|
.fc-add-source-btn--new {
|
|
background: rgb(20, 23, 26); color: rgb(244, 186, 122);
|
|
}
|
|
.fc-add-source-btn--artist-match {
|
|
background: rgb(28, 23, 16); color: rgb(255, 200, 120);
|
|
border: 1px solid rgb(180, 130, 60);
|
|
}
|
|
.fc-add-source-btn--source-match {
|
|
background: rgb(18, 28, 20); color: rgb(140, 220, 160);
|
|
border: 1px solid rgb(80, 160, 100);
|
|
}
|
|
|
|
.fc-toast {
|
|
all: revert;
|
|
position: fixed; bottom: 84px; right: 24px; z-index: 2147483647;
|
|
max-width: 360px; padding: 12px 16px; border-radius: 8px;
|
|
background: rgb(20, 23, 26); color: rgb(232, 228, 216);
|
|
font: 14px/1.4 system-ui, sans-serif;
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
|
animation: fc-toast-in 200ms ease;
|
|
}
|
|
.fc-toast--success { border-left: 3px solid rgb(244, 186, 122); }
|
|
.fc-toast--error { border-left: 3px solid rgb(220, 80, 80); }
|
|
@keyframes fc-toast-in {
|
|
from { transform: translateY(20px); opacity: 0; }
|
|
to { transform: translateY(0); opacity: 1; }
|
|
}
|