Skip to content

reworked gradient generation#131

Merged
peelar merged 7 commits into
mainfrom
fix/green-gradient
Feb 3, 2026
Merged

reworked gradient generation#131
peelar merged 7 commits into
mainfrom
fix/green-gradient

Conversation

@peelar

@peelar peelar commented Feb 3, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Gradient Playground added to preview palette-matched gradients.
    • Six new distinct gradient styles available.
  • Improvements

    • Palette-matched gradients driven by screenshot color signatures.
    • Adaptive lightness so gradients match screenshot brightness.
    • More colorful neutral/grayscale palettes and perceptually uniform color processing.
  • Behavior Changes

    • Playground hidden outside development builds; some gradient previews held while color analysis runs.

@cursor

cursor Bot commented Feb 3, 2026

Copy link
Copy Markdown

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on March 15.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@vercel

vercel Bot commented Feb 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
dopeshot Ready Ready Preview, Comment Feb 3, 2026 5:11pm
dopeshot-landing Ready Ready Preview, Comment Feb 3, 2026 5:11pm

Request Review

@changeset-bot

changeset-bot Bot commented Feb 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d5e5c61

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
dopeshot-app Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Feb 3, 2026

Copy link
Copy Markdown

Walkthrough

Replaces the previous screenshot-driven gradient pipeline with a palette-matched system. Removed the old gradient-generation domain (color-extraction, K‑means, chroma-js, node‑vibrant, sharp, server API route) and tests. Added image-side color analysis (extractColorPalette/signature), a deterministic palette builder (palette.ts), and generateGradientOptions producing six gradient styles. UI changes centralize gradients in a new gradientOptionsAtom, remove the isAnalyzingColors prop, add a Gradient Playground page, and adjust layout helpers (beam mask/direction). Dependency changes include removing chroma-js/culori/node-vibrant/sharp and adding mesh-gradient.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant PlaygroundUI as Playground UI
    participant ColorAnalysis as Color Analysis
    participant PaletteGen as Palette Generator
    participant Atoms as State (gradientOptionsAtom)
    participant GradientUI as Gradient Components

    User->>PlaygroundUI: Upload or select screenshot
    PlaygroundUI->>ColorAnalysis: extractColorSignatureFromImage(dataUrl)
    activate ColorAnalysis
    Note over ColorAnalysis: sample pixels → compute buckets\nderive dominant/accent hues, brightness, strength
    ColorAnalysis-->>PlaygroundUI: ColorSignature + ColorPalette
    deactivate ColorAnalysis

    PlaygroundUI->>PaletteGen: generateGradientOptions(signature)
    activate PaletteGen
    Note over PaletteGen: build 6 gradient styles\n(mesh, aurora, linear bold, radial glow, linear soft, muted wash)
    PaletteGen-->>PlaygroundUI: AdvancedGradient[]
    deactivate PaletteGen

    PlaygroundUI->>Atoms: set gradientOptionsAtom(AdvancedGradient[])
    Atoms-->>GradientUI: notify subscribers / provide gradients

    GradientUI->>GradientUI: render swatches (customGradientToCss)
    GradientUI-->>User: display gradient previews
Loading

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a59d007581

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +26 to +30
setGradientOptions([]);

try {
const colorPalette = await analyzeColors(dataUrl);
const analysis = await extractColorSignatureFromImage(dataUrl);
if (!analysis) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add fallback when color analysis returns null

If extractColorSignatureFromImage returns null, the function exits right after clearing gradientOptions, so the options stay empty. Downstream UI treats “no gradients” as “still analyzing” (the picker shows skeletons and the workspace hides the canvas when gradientOptions.length === 0), so a failed decode (e.g., corrupted image, SVG with external refs) leaves the user stuck with no gradients even though analysis has finished. Consider restoring previous options or setting a default fallback when analysis fails.

Useful? React with 👍 / 👎.

@peelar peelar merged commit fbdc8b0 into main Feb 3, 2026
5 checks passed
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