Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Calypso Logo generator prompts #97171

Open
wants to merge 8 commits into
base: trunk
Choose a base branch
from

Conversation

CGastrell
Copy link
Contributor

@CGastrell CGastrell commented Dec 6, 2024

Proposed Changes

  • move first logo prompt to backend, we now only send a role: jetpack-ai message
  • change save-to-library hook so it can handle both remote and base64 URLs, perform the API request accordingly
  • as a first step to the transition, use the URL hash to allow switching to new FLUX requests by using a style

This will give us an important step where we can verify improvement, refine the prompt processing on backend, test/decide on a default generation style or just leave it as "none" (completely depending on the user prompt)

Why are these changes being made?

Because we're moving away from using Dall-E as FLUX is giving better results.

Testing Instructions

Depends on D167959-code being patched and sandboxing public-api.

Go to the home section /home/some.site.url and look for the Logo Generator among the quick links.

  • on first open, the logo generator modal will perform an AI request to build a prompt and generate the first logo
  • see the style selector is shown above the prompt input, to the right of "Enhance prompt" button
  • see the style selector and "Enhance prompt" button are nicely spaced
  • see the "Enhance prompt" button icon now has the same color as the button text, and this turns gray when disabled
  • use the generated prompt to generate a logo, select any style or leave "Select style" to just use the prompt
  • see the change in style compared to Dall-e results
  • logo should be saved to library
  • use the same prompt with different styles

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@CGastrell CGastrell requested a review from dhasilva December 6, 2024 14:42
@CGastrell CGastrell self-assigned this Dec 6, 2024
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 6, 2024
@matticbot
Copy link
Contributor

matticbot commented Dec 6, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~157 bytes added 📈 [gzipped])

name                   parsed_size           gzip_size
entry-stepper               +640 B  (+0.0%)     +157 B  (+0.0%)
entry-main                  +532 B  (+0.0%)     +123 B  (+0.0%)
entry-login                 +468 B  (+0.0%)      +91 B  (+0.0%)
entry-subscriptions         +252 B  (+0.0%)      +59 B  (+0.0%)
entry-domains-landing       +252 B  (+0.0%)      +59 B  (+0.0%)
entry-browsehappy           +252 B  (+0.1%)      +59 B  (+0.1%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~4653 bytes added 📈 [gzipped])

name              parsed_size           gzip_size
home                 +41957 B  (+2.5%)   +12703 B  (+2.7%)
plans                  +152 B  (+0.0%)      -62 B  (-0.0%)
devdocs                +108 B  (+0.1%)      +11 B  (+0.0%)
themes                  -91 B  (-0.0%)     +107 B  (+0.0%)
gutenberg-editor        -39 B  (-0.0%)      -40 B  (-0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~979 bytes removed 📉 [gzipped])

name                                    parsed_size           gzip_size
async-load-calypso-layout-popup-search       +196 B  (+1.3%)     +392 B  (+8.3%)
async-load-automattic-help-center            +196 B  (+0.0%)    +1261 B  (+0.6%)
async-load-design-blocks                     +183 B  (+0.0%)    +1394 B  (+0.2%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@CGastrell CGastrell requested review from a team and removed request for dhasilva December 9, 2024 14:06
@CGastrell CGastrell force-pushed the fix/jetpack-ai-logo-generator-prompts branch from ac420ea to bcbc091 Compare December 11, 2024 16:22
@matticbot
Copy link
Contributor

matticbot commented Dec 11, 2024

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/jetpack-ai-logo-generator-prompts on your sandbox.

@CGastrell CGastrell force-pushed the fix/jetpack-ai-logo-generator-prompts branch from bcbc091 to 2fa80b9 Compare December 11, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Site Logo [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants