-
Notifications
You must be signed in to change notification settings - Fork 179
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
Dashboard: Now with Poster Images and Faster Content Rendering #8274
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
24a141f
wip, trying not loading story previews
BrittanyIRL 77bf8e6
separate card preview for stories now that they are using the poster …
BrittanyIRL cb71dcd
pull apart story grid view and story grid item and put them in the my…
BrittanyIRL 05af10f
catch list view up to poster changes
BrittanyIRL fa9c4e3
remove excess fetch when toggling between grid and list view, theres …
BrittanyIRL 2fb268c
fix tests after updating serializer, fix storybook warnings.
BrittanyIRL 0a57de4
first pass at cleaning up story grid now that we are using images, ad…
BrittanyIRL 9d9d53a
fix keyboard nav on story grid
BrittanyIRL b4a82c0
update karma tests now that grid navigation by keyboard isnt so intense
BrittanyIRL 154b39a
consistent aria labeling.
BrittanyIRL e966e13
restore grid
BrittanyIRL af060d0
Update assets/src/dashboard/app/views/myStories/karma/myStories.karma.js
BrittanyIRL b95a992
better refocus
BrittanyIRL 7732e48
clean up serializer post rebase
BrittanyIRL 1ba21b1
conditionally render poster as img based on if theres a url for it or…
BrittanyIRL 6698088
catch list view up
BrittanyIRL 0b2ac1e
better explaination of usePageView heights and making the storyMenu b…
BrittanyIRL 6d34c3b
whoops, gotta make sure were lookin for a class in the focus query.
BrittanyIRL 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
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
*/ | ||
import PropTypes from 'prop-types'; | ||
import { __, sprintf } from '@web-stories-wp/i18n'; | ||
import { UnitsProvider } from '@web-stories-wp/units'; | ||
import { | ||
Button, | ||
BUTTON_SIZES, | ||
|
@@ -31,7 +30,6 @@ import { | |
/** | ||
* Internal dependencies | ||
*/ | ||
import { TransformProvider } from '../../../../../edit-story/components/transform'; | ||
import { resolveRoute } from '../../../router'; | ||
import { APP_ROUTES } from '../../../../constants'; | ||
import { | ||
|
@@ -47,7 +45,6 @@ import { | |
SortPropTypes, | ||
ShowStoriesWhileLoadingPropType, | ||
} from '../../../../utils/useStoryView'; | ||
import FontProvider from '../../../font/fontProvider'; | ||
import { EmptyContentMessage } from '../../shared'; | ||
import StoriesView from './storiesView'; | ||
|
||
|
@@ -65,69 +62,58 @@ function Content({ | |
}) { | ||
return ( | ||
<Layout.Scrollable> | ||
<FontProvider> | ||
<TransformProvider> | ||
<UnitsProvider | ||
pageSize={{ | ||
width: view.pageSize.width, | ||
height: view.pageSize.height, | ||
}} | ||
> | ||
<StandardViewContentGutter> | ||
{stories.length > 0 ? ( | ||
<> | ||
<StoriesView | ||
filterValue={filter.value} | ||
isLoading={isLoading} | ||
sort={sort} | ||
storyActions={storyActions} | ||
stories={stories} | ||
view={view} | ||
loading={{ | ||
isLoading, | ||
showStoriesWhileLoading, | ||
}} | ||
/> | ||
<InfiniteScroller | ||
canLoadMore={!allPagesFetched} | ||
isLoading={isLoading} | ||
allDataLoadedMessage={__('No more stories', 'web-stories')} | ||
onLoadMore={page.requestNextPage} | ||
/> | ||
</> | ||
) : ( | ||
<EmptyContentMessage> | ||
<Headline | ||
size={THEME_CONSTANTS.TYPOGRAPHY.PRESET_SIZES.SMALL} | ||
as="h3" | ||
> | ||
{search?.keyword | ||
? sprintf( | ||
/* translators: %s: search term. */ | ||
__( | ||
'Sorry, we couldn\'t find any results matching "%s"', | ||
'web-stories' | ||
), | ||
search.keyword | ||
) | ||
: __('Start telling Stories.', 'web-stories')} | ||
</Headline> | ||
{!search?.keyword && ( | ||
<Button | ||
type={BUTTON_TYPES.PRIMARY} | ||
size={BUTTON_SIZES.MEDIUM} | ||
as="a" | ||
href={resolveRoute(APP_ROUTES.TEMPLATES_GALLERY)} | ||
> | ||
{__('Explore Templates', 'web-stories')} | ||
</Button> | ||
)} | ||
</EmptyContentMessage> | ||
)} | ||
</StandardViewContentGutter> | ||
</UnitsProvider> | ||
</TransformProvider> | ||
</FontProvider> | ||
<StandardViewContentGutter> | ||
{stories.length > 0 ? ( | ||
<> | ||
<StoriesView | ||
filterValue={filter.value} | ||
isLoading={isLoading} | ||
sort={sort} | ||
storyActions={storyActions} | ||
stories={stories} | ||
view={view} | ||
loading={{ | ||
isLoading, | ||
showStoriesWhileLoading, | ||
}} | ||
/> | ||
<InfiniteScroller | ||
canLoadMore={!allPagesFetched} | ||
isLoading={isLoading} | ||
allDataLoadedMessage={__('No more stories', 'web-stories')} | ||
onLoadMore={page.requestNextPage} | ||
/> | ||
</> | ||
) : ( | ||
<EmptyContentMessage> | ||
<Headline | ||
size={THEME_CONSTANTS.TYPOGRAPHY.PRESET_SIZES.SMALL} | ||
as="h3" | ||
> | ||
{search?.keyword | ||
? sprintf( | ||
/* translators: %s: search term. */ | ||
__( | ||
'Sorry, we couldn\'t find any results matching "%s"', | ||
'web-stories' | ||
), | ||
search.keyword | ||
) | ||
: __('Start telling Stories.', 'web-stories')} | ||
</Headline> | ||
{!search?.keyword && ( | ||
<Button | ||
type={BUTTON_TYPES.PRIMARY} | ||
size={BUTTON_SIZES.MEDIUM} | ||
as="a" | ||
href={resolveRoute(APP_ROUTES.TEMPLATES_GALLERY)} | ||
> | ||
{__('Explore Templates', 'web-stories')} | ||
</Button> | ||
)} | ||
</EmptyContentMessage> | ||
)} | ||
</StandardViewContentGutter> | ||
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. 😍 |
||
</Layout.Scrollable> | ||
); | ||
} | ||
|
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.
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.
I particularly love getting rid of this dependency on
edit-story
🎉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.
I'm not sure yet what to do about templates, but this will at least help with my stories.
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.
We should probably do that for templates too. We could host the preview images on the CDN.
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.
It's a matter of how we're generating the preview images, since the related image rendering for thumbnails is still being researched.
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.
For templates, I imagine poster generation is a matter of flattening/rasterizing the first page after removing elements that are duplicative with the story preview (i.e. title text/author/publisher logo). For example:
Before:
After (removed title, author, logo):
In many cases this might just be the background image of the first page, but some templates have stickers/scrims that may still be desired. I took screenshots of the editor above, but actual posters should be exported from Figma.
/cc @o-fernandez
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.
i suppose if we want to just export this from figma we could do this pretty quickly.
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.
@choumx @swissspidy following up on this, should we just export from figma and add asset paths to the templates for poster images and use those here or should we put a pin in this until later when we deal with text sets and page layouts?