Skip to content

Add value-first integration plan for browser MP3 cleanse flow#7

Closed
ChrisAdamsdevelopment wants to merge 1 commit into
codex/improve-ui-designfrom
codex/integrate-in-browser-mp3-cleansing-feature-xt6g3j
Closed

Add value-first integration plan for browser MP3 cleanse flow#7
ChrisAdamsdevelopment wants to merge 1 commit into
codex/improve-ui-designfrom
codex/integrate-in-browser-mp3-cleansing-feature-xt6g3j

Conversation

@ChrisAdamsdevelopment
Copy link
Copy Markdown
Owner

@ChrisAdamsdevelopment ChrisAdamsdevelopment commented May 4, 2026

Closed as superseded planning work. The implementation path landed through PR #8 for stabilization and PR #9 for browser MP3 quick cleanse integration.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 4, 2026

Reviewer's Guide

Adds a new documentation file outlining a phased, value-first integration plan for a browser-based MP3 metadata cleanse flow into the existing SpectraCleanse app, including UX flows, frontend/backend architecture, implementation phases, technical guardrails, metrics, and acceptance criteria.

Sequence diagram for Quick Cleanse browser MP3 flow

sequenceDiagram
  actor User
  participant UI as BrowserUI
  participant Meta as MetadataUtils
  participant SEO as ApiGenerateSEO

  User->>UI: Upload MP3 file
  UI->>Meta: parseMetadata file
  Meta-->>UI: metadata + risk markers
  UI->>User: Display metadata and risk markers

  User->>UI: Click Generate SEO
  UI->>SEO: POST /api/generate-seo with context
  SEO-->>UI: seoData
  UI->>User: Show SEO Payload tab with editable fields

  User->>UI: Click Cleanse
  UI->>Meta: writeCleanMp3 file seoData
  Meta-->>UI: cleansedFileBlob
  UI->>User: Enable Download Processed File button
  User->>UI: Click Download
  UI->>User: Trigger manual download
  UI->>UI: Revoke previous blob URLs
Loading

Class diagram for metadata utilities and cleanse state machine

classDiagram
  class MetadataUtils {
    +parseMetadata fileBlob
    +detectRiskMarkers metadata
    +rewriteMp3Id3 fileBlob seoData
    +createBlobUrl fileBlob
    +revokeBlobUrl blobUrl
  }

  class CleanseStateMachine {
    -state string
    +setIdle()
    +setAnalyzing()
    +setGenerating()
    +setCleansing()
    +setReady()
    +canGenerateSEO() bool
    +canCleanse() bool
  }

  class SeoData {
    +title string
    +description string
    +tags string[]
    +lyrics string
  }

  class RiskMarker {
    +name string
    +severity string
    +sourceTag string
  }

  MetadataUtils "1" --> "*" RiskMarker : detects
  MetadataUtils --> SeoData : consumes
  CleanseStateMachine --> SeoData : guardsOperations
Loading

File-Level Changes

Change Details Files
Document a detailed architecture and rollout plan for integrating a browser-based MP3 cleanse flow alongside the existing server-based pipeline.
  • Describe product goals and user value hierarchy for a Quick (browser) vs Full (server) cleanse path.
  • Specify frontend architecture changes including adding browser-id3-writer/music-metadata-browser, a metadata utility module, and a new cleanse state machine.
  • Define backend contract updates such as replacing the mock SEO generator with an authenticated /api/generate-seo while keeping /api/process as a fallback.
  • Lay out phased implementation steps (dependencies/utilities, generation path replacement, dual cleanse paths, analysis enrichment, hardening/feature flagging).
  • Capture UX flow specs for Quick Cleanse and Full Server Cleanse, including tab structure (Context, SEO Payload, Analysis), technical guardrails, metrics, and acceptance criteria.
docs/mp3-browser-integration-plan.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider specifying the exact src/utils/metadata API shape (e.g., function names and return types) so future implementation remains consistent with the planned state machine and backend contracts.
  • It may help to explicitly document how the VITE_ENABLE_BROWSER_MP3_CLEANSE flag interacts with existing config/env loading in this app (e.g., expected default value and behavior when unset) to avoid inconsistent rollout behavior.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider specifying the exact `src/utils/metadata` API shape (e.g., function names and return types) so future implementation remains consistent with the planned state machine and backend contracts.
- It may help to explicitly document how the `VITE_ENABLE_BROWSER_MP3_CLEANSE` flag interacts with existing config/env loading in this app (e.g., expected default value and behavior when unset) to avoid inconsistent rollout behavior.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant