-
Notifications
You must be signed in to change notification settings - Fork 841
Social: Generate AI image for media from the sidebar #46147
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
Open
gmjuhasz
wants to merge
36
commits into
trunk
Choose a base branch
from
add/social/ai-image-generation-modal-poc
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+142
−19
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
377755c
Create a hook for getting the SIG preview properly
gmjuhasz 288f746
Move utils from GeneratedImagePreview to the newly created hook
gmjuhasz a3349ae
Add tests for SIG hook
gmjuhasz 3556045
changelog
gmjuhasz cce8eca
Refactor GeneratedImagePreview to use the useSigPreview hook
gmjuhasz b1f4d19
Add new media section and preview + dropdown components
gmjuhasz 2f4d636
changelog
gmjuhasz 60686c9
Hook up components + connect with new feature flag
gmjuhasz fd4c016
Hook up SIG preview hook with the new component
gmjuhasz 6df34c2
Move utils from GeneratedImagePreview to the newly created hook
gmjuhasz dc44786
Update styling
gmjuhasz a8a9871
Alignment changes
gmjuhasz 1c772d3
Merge branch 'trunk' into add/social/new-media-selector-ui
gmjuhasz 54e8787
Merge branch 'trunk' into add/social/new-media-selector-ui
gmjuhasz ea204e0
Fix race conditions with changes
gmjuhasz 814bcf4
Add tests
gmjuhasz dd1b671
Merge branch 'trunk' into add/social/new-media-selector-ui
gmjuhasz a00ce2a
Refactor logic + add extra toggle
gmjuhasz 3df3acd
changelog
gmjuhasz 3db835c
Handle empty featured image
gmjuhasz 2fd68b0
Fix test
gmjuhasz d631ef2
Merge branch 'trunk' into add/social/new-media-selector-ui
gmjuhasz 9ef10a3
Reuse GeneralPurposeImage component in the social sidebar
gmjuhasz 6e61216
Merge branch 'trunk' into add/social/ai-image-generation-modal-poc
gmjuhasz 0876eee
changelog
gmjuhasz 466133f
Use new naming
gmjuhasz 1fd994b
Fix AI image selection after generation
gmjuhasz 174e635
If url is available use that for preview
gmjuhasz a394ac1
Revert unintended change
gmjuhasz 7c66dd2
Merge branch 'trunk' into add/social/ai-image-generation-modal-poc
gmjuhasz afefa38
Fix type declarations
gmjuhasz 18e31a4
Fix minification issue
gmjuhasz e8b184a
changelog
gmjuhasz e4d1448
Simplify logic + add comment
gmjuhasz efc7a83
Extend image type
gmjuhasz 24f3b23
Rename mime_type to mime and use WPMediaObject
gmjuhasz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
projects/js-packages/ai-client/changelog/add-social-ai-image-generation-modal-poc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: patch | ||
| Type: fixed | ||
|
|
||
| Fixed minification issue with production build. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
projects/js-packages/publicize-components/changelog/add-social-ai-image-generation-modal-poc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: minor | ||
| Type: added | ||
|
|
||
| Reuse AI image generation in media section |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,8 +59,8 @@ export function usePostData() { | |
| }; | ||
| }; | ||
|
|
||
| for ( const { id } of attachedMedia ) { | ||
| const mediaDetails = getMediaDetails( id ); | ||
| for ( const attachedItem of attachedMedia ) { | ||
| const mediaDetails = getMediaDetails( attachedItem.id ); | ||
|
Comment on lines
+62
to
+63
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason for this change? |
||
| if ( mediaDetails ) { | ||
| media.push( mediaDetails ); | ||
| } | ||
|
|
||
4 changes: 4 additions & 0 deletions
4
projects/plugins/jetpack/changelog/add-social-ai-image-generation-modal-poc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: minor | ||
| Type: enhancement | ||
|
|
||
| Reuse AI image generation in media section |
4 changes: 4 additions & 0 deletions
4
projects/plugins/social/changelog/add-social-ai-image-generation-modal-poc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: minor | ||
| Type: added | ||
|
|
||
| Reuse AI image generation in media section |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You won't need to define these two separately if you use
useReducerabove instead ofuseState.You can then directly pass
toggleShowAiImageModalfor both open and close callbacks.