Skip to content

feat(ai-create): let users choose brand colors or free AI colors for images#128

Open
dantaspaulo wants to merge 1 commit into
trypostit:mainfrom
dantaspaulo:feat/ai-brand-colors-toggle
Open

feat(ai-create): let users choose brand colors or free AI colors for images#128
dantaspaulo wants to merge 1 commit into
trypostit:mainfrom
dantaspaulo:feat/ai-brand-colors-toggle

Conversation

@dantaspaulo

Copy link
Copy Markdown

Problem

The AI image pipeline already threads an applyBrandVisuals flag all the way
through TemplateContextPostImagePipelineTemplateImageGenerator (when
off, the AI background is generated without the workspace brand color,
background, text color or brand description). But the flag was hardcoded to
true at the dispatch site, so users had no way to opt out — every generated
image was forced onto the workspace brand palette.

Change

Expose the choice in the create wizard as a "Brand colors" / "Let AI decide"
toggle, shown only when images are actually generated. The flag flows:

AiPostWizard (apply_brand_visuals)
  → StartPostCreationRequest (validation)
  → PostAiCreateController@start (dispatch)
  → StreamPostCreation (job)
  → TemplateContext.applyBrandVisuals
  → PostImagePipeline.forSingle/forCarousel
  → TemplateImageGenerator

It defaults to true, so behavior is unchanged when the field is absent (API
clients, existing callers). Only the AI-image templates (image_card /
carousel) honor the flag — tweet cards are brand-colored by design and their
pipeline path doesn't take applyBrandVisuals.

  • StreamPostCreation: new applyBrandVisuals constructor arg, passed into
    TemplateContext.
  • PostAiCreateController@start: reads apply_brand_visuals and forwards it.
  • StartPostCreationRequest: apply_brand_visuals['sometimes', 'boolean'].
  • AiPostWizard.vue: the toggle + sends the flag.
  • lang/{en,es,pt-BR}/posts.php: brand_colors_* strings.

Tests

PostAiCreateTest: the job carries applyBrandVisuals === false when the user
opts out, and defaults to true when the field is omitted.

…images

The image pipeline already threads `applyBrandVisuals` through
`TemplateContext` -> `PostImagePipeline` -> `TemplateImageGenerator`, but it was
hardcoded to `true` at the dispatch site, so generated images always used the
workspace brand palette with no way to opt out.

Expose the choice in the create wizard: a "Brand colors" / "Let AI decide"
toggle (shown only when images are generated). The flag flows
front -> `StartPostCreationRequest` (`apply_brand_visuals`) ->
`PostAiCreateController@start` -> `StreamPostCreation` -> `TemplateContext`,
defaulting to `true` so existing behavior is unchanged when the field is absent.
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