Skip to content

feat(settings): add variant storage backend setting (BE-4 follow-up)#483

Merged
Zheaoli merged 1 commit into
mainfrom
feat/variant-storage-setting
May 30, 2026
Merged

feat(settings): add variant storage backend setting (BE-4 follow-up)#483
Zheaoli merged 1 commit into
mainfrom
feat/variant-storage-setting

Conversation

@Zheaoli

@Zheaoli Zheaoli commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Variant storage backend setting — the admin entry point to enable the variant pipeline

BE-4 (#477) added the variant_storage config key + backend resolution, but there was no admin UI to set it — so the variant pipeline couldn't be turned on through normal admin flow (@manjusaka flagged this). This adds the missing entry point. It's the last gate before the variant path (problem ⑤) can activate.

What

  • UI — a "Variant storage" card above the three storage tabs in /admin/settings/storages (it's a cross-backend global choice, not per-tab):
    • Select: Off / S3 / R2 (default Off).
    • Helper line: configure the chosen backend in its tab first.
    • Empty-state note when Off: "Variant pipeline disabled — gallery falls back to preview/blurhash."
  • APIGET/PUT /api/v1/settings/variant-storage, VariantStorageInfo type, toVariantStorageInfo transform, updateVariantStorageConfig (uses upsert so it works on installs predating the seed key).
  • i18n — keys added for zh / en / ja / zh-TW.

Safety

Off keeps the pipeline disabled, matching the loader's dormant preview/blurhash fallback — safe regardless of backfill state. Once set to S3/R2 (with that backend configured) and BE-3 backfill runs, variantBaseUrl resolves and the gallery serves variants.

Design / UX

Placement, control, helper text, empty state, and i18n follow @Picimpact-Design's guidance — requesting her design/a11y/i18n review.

Verification

  • tsc --noEmit: no errors in changed files. eslint --fix: clean (0 errors). All 4 message JSON files parse.

🤖 Generated with Claude Code

BE-4 added the `variant_storage` config + backend resolution but no admin UI
to set it, so the variant pipeline could not be enabled through normal admin
flow. This adds the missing entry point.

- A "Variant storage" card above the storage tabs in /admin/settings/storages
  with a Select (Off / S3 / R2; default Off), a helper line ("configure the
  backend in its tab first"), and an empty-state note when disabled.
- GET/PUT /api/v1/settings/variant-storage endpoints, VariantStorageInfo type,
  toVariantStorageInfo transform, and updateVariantStorageConfig (upsert, so it
  works on installs that predate the seed key).
- i18n keys for zh / en / ja / zh-TW.

Empty (Off) keeps the variant pipeline disabled, matching the loader's dormant
fallback to preview/blurhash — so it's safe regardless of backfill state.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented May 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
picimpact Ready Ready Preview, Comment May 30, 2026 12:07pm

@Zheaoli Zheaoli merged commit 37944dd into main May 30, 2026
6 checks passed
@Zheaoli Zheaoli deleted the feat/variant-storage-setting branch May 30, 2026 12:08
pull Bot pushed a commit to candies404/PicImpact that referenced this pull request May 30, 2026
Expose the variant preprocessing queue (the engine from besscroft#481) over the
protected /api/v1/preprocess-tasks routes, mirroring /api/v1/tasks:
preview-count, runs, runs/:id, runs (create), runs/:id/kick, runs/:id/cancel,
tick. Delegates to image-preprocess-service.ts; scope carries the `force`
flag; surfaces "not configured" / "already active" / "no images" as 4xx.

This is the drivable API the admin /tasks button and the CLI backfill
(following) use to create and drain a backfill run; it also enables the
real end-to-end backfill test once variant_storage is configured (besscroft#483).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant