Skip to content

fix(styles): persist and display custom style previews#153

Merged
Handanhhhy merged 2 commits into
mainfrom
feature/issue-152-style-upload-preview
Jul 20, 2026
Merged

fix(styles): persist and display custom style previews#153
Handanhhhy merged 2 commits into
mainfrom
feature/issue-152-style-upload-preview

Conversation

@Handanhhhy

Copy link
Copy Markdown
Collaborator

Summary

  • persist user-uploaded custom style reference images immediately, independently of AI analysis
  • return stable project media preview URLs for custom styles and render them in list/detail views
  • show the local image with an analysis spinner, reject unsupported formats, and stop on API error envelopes

Root cause

The upload flow treated an HTTP 200 error envelope as success and continued into analysis/style creation without a valid preview path. Custom style metadata also had no persisted preview path, and generated media URLs used the resolved project name instead of the requested project ID, causing 404 responses in the UI.

User impact

Preset previews remain bundled and read-only. User-uploaded custom style images are stored under the project, survive reloads, and appear in both the style list and detail panel as soon as upload succeeds; AI analysis remains a separate follow-up state.

Verification

  • uv run pytest tests/test_api_styles.py -q — 17 passed
  • uv run ruff check src/novelvideo/api/routes/styles.py src/novelvideo/services/style_service.py tests/test_api_styles.py
  • pnpm exec vitest run src/__tests__/routes/styles.ce.test.tsx — 4 passed
  • pnpm build
  • Docker Compose against an isolated clone of existing project data: upload/create/list/detail/media/delete all succeeded; media returned 200 image/png

Closes #152

@Handanhhhy
Handanhhhy marked this pull request as ready for review July 20, 2026 08:17
Signed-off-by: handan <handanhhhy@gmail.com>
@Handanhhhy
Handanhhhy force-pushed the feature/issue-152-style-upload-preview branch from 28a2129 to d9f2e32 Compare July 20, 2026 08:27
@Handanhhhy
Handanhhhy merged commit a56379f into main Jul 20, 2026
17 checks passed
@Handanhhhy
Handanhhhy deleted the feature/issue-152-style-upload-preview branch July 20, 2026 08:35
@NewYuee NewYuee mentioned this pull request Jul 21, 2026
11 tasks
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.

fix(styles): persist and display user-uploaded custom style previews

1 participant