[PR #7495] [MERGED] feat(card-browser): browse and import PlotLight characters and personas #7759

Closed
opened 2026-10-24 04:07:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7495
Author: @SpicyMarinara
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/plotlight-card-browser


📝 Commits (3)

  • 99f6ed9 feat(card-browser): browse and import PlotLight characters and personas
  • 5fb377f fix(card-browser): keep the download message out of PlotLight search errors
  • 2e72bc8 fix(card-browser): mark adult PlotLight results and resolve typed tags from its catalog

📊 Changes

5 files changed (+909 additions, -56 deletions)

View changed files

📝 docs/characters/bot-browser.md (+34 -11)
📝 packages/client/src/components/bot-browser/BotBrowserView.tsx (+204 -45)
➕ packages/client/src/lib/plotlight-content.ts (+341 -0)
📝 packages/client/src/localization/locales/en.json (+9 -0)
➕ scripts/regressions/bot-browser-plotlight.regression.ts (+321 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7480

Why this change

  • PlotLight now has a public, read-only content API. Until now, its characters and personas could only reach Marinara if you downloaded each file on the website and uploaded it by hand. That skips the in-app preview, filters and persona import the other Card Browser sources have.

What changed

Nothing that worked before stops working.

  • Two new Card Browser sources, PlotLight and PlotLight Personas. Search by name, sort by Popular, Recent or Top Rated, and filter by tags. Each result shows its creator, and the detail page has a View on PlotLight link.
  • Import as a character or a persona. Marinara downloads the file PlotLight offers. For a card, that's the PNG (portrait plus any lorebook the creator allows), falling back to V3 or V2 JSON. For a persona, it's the JSON, with the picture copied separately. When the file leaves out the creator or tags, the listing's are kept.
  • No account, no server proxy. PlotLight's API allows browser calls, so Marinara calls it straight from the browser with credentials omitted.
  • Adult-tagged results get the NSFW badge. Marinara loads PlotLight's tag catalog once per source, including its adult ("After Dark") tag labels. Listing those labels gives no access to adult content. The NSFW checkbox stays greyed out, since PlotLight decides what visitors without an account see, and its tooltip now says adult-tagged results are marked NSFW.
  • Tags use PlotLight's own slugs from its catalog. That works for tags picked from the list and for typed ones, so typing "Elf" filters by species_elf. Excluding a name that two PlotLight tags share (like "Superhero") removes both. Including one uses the first, because PlotLight has no "any of" filter.
  • Paging follows PlotLight's own cursor. PlotLight reports no total, so the header reads "Browsing PlotLight", and Next turns off only when PlotLight says there is no next page. Short or empty pages don't end paging. If a page comes back empty, the pager stays so you can go on. When a slow, older search finishes after a newer one, it no longer moves where the newer search's page 2 starts.
  • Rate limits are honored, and search and download limits are tracked separately, as PlotLight does. On a 429, Marinara says "PlotLight is busy. Try again in N seconds." and sends nothing more of that kind until Retry-After passes. It also waits for the reset when X-RateLimit-Remaining reaches 0.
  • Clear messages for files PlotLight won't hand out (401/403/404): "PlotLight doesn't offer this for download." The detail page stays open, so you can still see the picture, creator and the View on PlotLight link.
  • Downloaded data is untrusted. Items need a UUID id and a name, preview images must be https, and detail and download links must stay on plotlightstudios.com. Download formats come only from a fixed list.
  • Updated docs/characters/bot-browser.md. Translation follow-up: #7493, now updated to match.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Commands run by the agent (results as of 2e72bc874):

  • pnpm check: passed. The only lint output is the existing serverRun hook warning, which this PR doesn't touch.
  • node ./scripts/run-regressions.mjs --filter bot-browser-plotlight: passed. The regression runs a fake PlotLight server with a paged tag catalog. It covers item mapping, hostile links and images, paging through short and empty pages, and an empty page that still reports more. It also covers catalog slugs for listed, typed and shared tag names, and the adult (After Dark) marking. Then: the stale-search cursor, the catalog loading once, separate search and export limits, the png3-to-JSON download fallback, attribution fill-in, refused exports, and Retry-After blocking.
  • Mutation checks: with the stale-search guard removed, the regression fails ('500' vs '48'). With downloads sharing the search limit, it fails on the blocked download. Against the previous module, it fails on the typed elf tag.
  • node ./scripts/run-regressions.mjs --filter bot-browser: 3/3 passed (PlotLight, Pygmalion login, Chub route).
  • --filter persona-client-contract and --filter janny-character-import: passed. Both read BotBrowserView.tsx.
  • Ran a scratch script of the new client against the live API (not committed). The first search took about 1.8 s, with the 12-page catalog loading alongside it. Page 1 of Popular marked the six cards tagged Erotic or Dead Dove as adult. Typed elf sent species_elf (4 results), and excluding elf as well brought that to 0. Excluding superhero sent both slugs.
  • Live, as before: card search and downloads (png3, json3) work. Every persona download I tried returned 404 from PlotLight, so persona import shows "PlotLight doesn't offer this for download." until PlotLight serves those files. Marinara doesn't fall back to the listing text, because that would bypass the creator's download setting.
  • Local CodeRabbit at 2e72bc874: one finding. It asked for a docs-i18n follow-up, and one already exists: #7493, linked above and now updated to the new wording. Nothing else was flagged. The first two attempts hit the shared rate limit. An earlier local run gave two findings. Fixed: a 401/403/404 from search showed the download message, and now shows the generic PlotLight error. The same docs-i18n point was answered by #7493.
  • Review findings handled in 2e72bc874: adult-tagged cards had no NSFW badge, typed tags weren't resolved to slugs, the pager disappeared on an empty page, persona detail pages closed straight away, search and download shared one rate limit, a name shared by two slugs, and the stale-search cursor.

Manual verification notes

  • Open Card Browser, open the source menu, and confirm PlotLight and PlotLight Personas appear after DataCat.
  • Pick PlotLight: results load (the first search can take a second or two longer while the tag catalog loads), and the header reads "Browsing PlotLight".
  • Hover the greyed-out NSFW checkbox. The tooltip reads "PlotLight decides what you can see without an account, and adult-tagged results are marked NSFW."
  • On Popular, confirm that cards tagged Erotic or Dead Dove (for example Nero or Vena-san) show the red NSFW badge, and ordinary cards don't.
  • Switch sort between Popular, Recent and Top Rated, type a search, and include and exclude a tag from the Tags panel. Results change each time.
  • Type elf in the tag box before any elf card has shown up, and include it. Only elf cards appear. Then block elf instead, and no elf cards remain.
  • Click Next a few times, then Previous. Pages change, and Next turns off on the last page of a narrow search.
  • Open a card: its definition shows, the creator is listed, and View on PlotLight opens the card on plotlightstudios.com.
  • Import a card as a Character: the portrait, creator and tags arrive, and a card with a lorebook offers to import it too.
  • Import the same card as a Persona.
  • Pick PlotLight Personas and open a persona. Today PlotLight returns 404 for persona files, so expect the toast "PlotLight doesn't offer this for download.". The detail page stays open with the picture, creator and a working View on PlotLight link. Once PlotLight fixes that, import one as a persona and check its picture.
  • Search quickly many times in a row until PlotLight rate-limits you. The busy message shows a wait time, and searching works again after it. While searching is paused, importing an already-listed card still works.
  • Check the source menu, toolbar and NSFW badges on a phone-width window and in light and dark mode.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Docs: docs/characters/bot-browser.md is updated, and #7493 tracks the translations. No CHANGELOG edit, per the release-notes policy.

UI evidence (if applicable)

No screenshots taken. See the manual verification steps.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7495 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/plotlight-card-browser` --- ### 📝 Commits (3) - [`99f6ed9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/99f6ed9ff1d2b6ecb3ef970b08a072ab9e417588) feat(card-browser): browse and import PlotLight characters and personas - [`5fb377f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5fb377f67a47b8e268b100956a553f601d4e338d) fix(card-browser): keep the download message out of PlotLight search errors - [`2e72bc8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2e72bc8742028cd472e37d7abe89a2e2de3d7885) fix(card-browser): mark adult PlotLight results and resolve typed tags from its catalog ### 📊 Changes **5 files changed** (+909 additions, -56 deletions) <details> <summary>View changed files</summary> 📝 `docs/characters/bot-browser.md` (+34 -11) 📝 `packages/client/src/components/bot-browser/BotBrowserView.tsx` (+204 -45) ➕ `packages/client/src/lib/plotlight-content.ts` (+341 -0) 📝 `packages/client/src/localization/locales/en.json` (+9 -0) ➕ `scripts/regressions/bot-browser-plotlight.regression.ts` (+321 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #7480 ## Why this change - PlotLight now has a public, read-only content API. Until now, its characters and personas could only reach Marinara if you downloaded each file on the website and uploaded it by hand. That skips the in-app preview, filters and persona import the other Card Browser sources have. ## What changed Nothing that worked before stops working. - **Two new Card Browser sources, PlotLight and PlotLight Personas.** Search by name, sort by Popular, Recent or Top Rated, and filter by tags. Each result shows its creator, and the detail page has a **View on PlotLight** link. - **Import as a character or a persona.** Marinara downloads the file PlotLight offers. For a card, that's the PNG (portrait plus any lorebook the creator allows), falling back to V3 or V2 JSON. For a persona, it's the JSON, with the picture copied separately. When the file leaves out the creator or tags, the listing's are kept. - **No account, no server proxy.** PlotLight's API allows browser calls, so Marinara calls it straight from the browser with credentials omitted. - **Adult-tagged results get the NSFW badge.** Marinara loads PlotLight's tag catalog once per source, including its adult ("After Dark") tag labels. Listing those labels gives no access to adult content. The NSFW checkbox stays greyed out, since PlotLight decides what visitors without an account see, and its tooltip now says adult-tagged results are marked NSFW. - **Tags use PlotLight's own slugs from its catalog.** That works for tags picked from the list and for typed ones, so typing "Elf" filters by `species_elf`. Excluding a name that two PlotLight tags share (like "Superhero") removes both. Including one uses the first, because PlotLight has no "any of" filter. - **Paging follows PlotLight's own cursor.** PlotLight reports no total, so the header reads "Browsing PlotLight", and **Next** turns off only when PlotLight says there is no next page. Short or empty pages don't end paging. If a page comes back empty, the pager stays so you can go on. When a slow, older search finishes after a newer one, it no longer moves where the newer search's page 2 starts. - **Rate limits are honored, and search and download limits are tracked separately, as PlotLight does.** On a 429, Marinara says "PlotLight is busy. Try again in N seconds." and sends nothing more of that kind until `Retry-After` passes. It also waits for the reset when `X-RateLimit-Remaining` reaches 0. - **Clear messages for files PlotLight won't hand out** (401/403/404): "PlotLight doesn't offer this for download." The detail page stays open, so you can still see the picture, creator and the **View on PlotLight** link. - **Downloaded data is untrusted.** Items need a UUID id and a name, preview images must be `https`, and detail and download links must stay on plotlightstudios.com. Download formats come only from a fixed list. - Updated `docs/characters/bot-browser.md`. Translation follow-up: #7493, now updated to match. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Commands run by the agent (results as of `2e72bc874`): - `pnpm check`: passed. The only lint output is the existing `serverRun` hook warning, which this PR doesn't touch. - `node ./scripts/run-regressions.mjs --filter bot-browser-plotlight`: passed. The regression runs a fake PlotLight server with a paged tag catalog. It covers item mapping, hostile links and images, paging through short and empty pages, and an empty page that still reports more. It also covers catalog slugs for listed, typed and shared tag names, and the adult (After Dark) marking. Then: the stale-search cursor, the catalog loading once, separate search and export limits, the png3-to-JSON download fallback, attribution fill-in, refused exports, and Retry-After blocking. - Mutation checks: with the stale-search guard removed, the regression fails (`'500'` vs `'48'`). With downloads sharing the search limit, it fails on the blocked download. Against the previous module, it fails on the typed `elf` tag. - `node ./scripts/run-regressions.mjs --filter bot-browser`: 3/3 passed (PlotLight, Pygmalion login, Chub route). - `--filter persona-client-contract` and `--filter janny-character-import`: passed. Both read `BotBrowserView.tsx`. - Ran a scratch script of the new client against the live API (not committed). The first search took about 1.8 s, with the 12-page catalog loading alongside it. Page 1 of Popular marked the six cards tagged Erotic or Dead Dove as adult. Typed `elf` sent `species_elf` (4 results), and excluding `elf` as well brought that to 0. Excluding `superhero` sent both slugs. - Live, as before: card search and downloads (`png3`, `json3`) work. **Every persona download I tried returned 404 from PlotLight**, so persona import shows "PlotLight doesn't offer this for download." until PlotLight serves those files. Marinara doesn't fall back to the listing text, because that would bypass the creator's download setting. - Local CodeRabbit at `2e72bc874`: one finding. It asked for a docs-i18n follow-up, and one already exists: #7493, linked above and now updated to the new wording. Nothing else was flagged. The first two attempts hit the shared rate limit. An earlier local run gave two findings. Fixed: a 401/403/404 from search showed the download message, and now shows the generic PlotLight error. The same docs-i18n point was answered by #7493. - Review findings handled in `2e72bc874`: adult-tagged cards had no NSFW badge, typed tags weren't resolved to slugs, the pager disappeared on an empty page, persona detail pages closed straight away, search and download shared one rate limit, a name shared by two slugs, and the stale-search cursor. ### Manual verification notes - [ ] Open **Card Browser**, open the source menu, and confirm **PlotLight** and **PlotLight Personas** appear after **DataCat**. - [ ] Pick **PlotLight**: results load (the first search can take a second or two longer while the tag catalog loads), and the header reads "Browsing PlotLight". - [ ] Hover the greyed-out **NSFW** checkbox. The tooltip reads "PlotLight decides what you can see without an account, and adult-tagged results are marked NSFW." - [ ] On Popular, confirm that cards tagged Erotic or Dead Dove (for example Nero or Vena-san) show the red **NSFW** badge, and ordinary cards don't. - [ ] Switch sort between Popular, Recent and Top Rated, type a search, and include and exclude a tag from the Tags panel. Results change each time. - [ ] Type `elf` in the tag box before any elf card has shown up, and include it. Only elf cards appear. Then block `elf` instead, and no elf cards remain. - [ ] Click **Next** a few times, then **Previous**. Pages change, and **Next** turns off on the last page of a narrow search. - [ ] Open a card: its definition shows, the creator is listed, and **View on PlotLight** opens the card on plotlightstudios.com. - [ ] Import a card as a **Character**: the portrait, creator and tags arrive, and a card with a lorebook offers to import it too. - [ ] Import the same card as a **Persona**. - [ ] Pick **PlotLight Personas** and open a persona. Today PlotLight returns 404 for persona files, so expect the toast "PlotLight doesn't offer this for download.". The detail page stays open with the picture, creator and a working **View on PlotLight** link. Once PlotLight fixes that, import one as a persona and check its picture. - [ ] Search quickly many times in a row until PlotLight rate-limits you. The busy message shows a wait time, and searching works again after it. While searching is paused, importing an already-listed card still works. - [ ] Check the source menu, toolbar and NSFW badges on a phone-width window and in light and dark mode. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Docs: `docs/characters/bot-browser.md` is updated, and #7493 tracks the translations. No CHANGELOG edit, per the release-notes policy. ## UI evidence (if applicable) No screenshots taken. See the manual verification steps. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:07:14 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7759
No description provided.