-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Posts list powered by DataViews #62705
Conversation
Size Change: +589 B (+0.03%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
Flaky tests detected in cdf9efc. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9698872472
|
}; | ||
function PostsLayout() { | ||
// This ensures the edited entity id and type are initialized properly. | ||
useInitEditedEntityFromURL(); |
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.
How hard would it be to move away from this hook and instead of having postId postType and context in the site editor store, just pass it down as props to the Editor
component. (For the site editor, not the posts page, we could keep syncing these to the store for backwards compatibility)
@@ -1,3 +1,6 @@ | |||
// TODO: we need to examine if these styles could be the default styles | |||
// for every post type and/or how to have different styles for different post types. | |||
// Example is `posts` and `pages`. |
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.
The classnames seems wrong now right?
const isSiteEditorLoading = useIsSiteEditorLoading(); | ||
const { params = {} } = useLocation(); | ||
const { postType, layout, canvas } = params; | ||
const labels = useSelect( |
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 would prefer if we avoid useSelect and complex logic in the "router". Ideally this is actually just a global object (when we'll be able to define "paths" as part of the config). So I'd actually move these calls to dedicated components that I render in areas.
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.
Great start
Good question, I'm thinking we use the same "component", it doesn't matter if we call it post or site editor. That component will probably be the site editor one for a start because we're building this stuff in the site editor package today. The Global Styles question is a good one, I don't think we need to get everything right in the first PR. I think it's fine to keep it as is for now.
Good question as well, maybe "posts" is a top level menu item and you gave to go into it first (like pages in the site editor) but it raises the question of what is the "front page" of this experience. Also a design question mainly that can be addressed in a follow-up.
Definitely 💯 |
This comment was marked as outdated.
This comment was marked as outdated.
7493f95
to
013b627
Compare
@annezazu it's being tracked and in progress. I only hid your comment because I'm expecting too many of them in this PR and had big screenshots 😄 . |
|
||
// Prevent the default browser action for files dropped outside of dropzones. | ||
window.addEventListener( 'dragover', ( e ) => e.preventDefault(), false ); | ||
window.addEventListener( 'drop', ( e ) => e.preventDefault(), false ); |
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.
Feels like too much boilerplate. It's ok for now but might be good to take a look at this at some point to see where these things should be moved (or removed)
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.
Agreed. I'm just looking at site editor load(PHP + JS) and will need to investigate what are the things we need.
For me the ideal thing is to show a placeholder like many other similar apps/views do which could be something along |
…back button while on focus mode
84e4464
to
f412dbf
Compare
Hi @youknowriad, I think if there is a blog front page it should show it. |
Curious what happened here that affected the navigate metric so positively. Also the metric is more unstable now. |
This PR loads the post list under a new admin page and shouldn't affect any existing tests. 🤔 |
I'm talking about the pages list, that one was touched in this PR, no? |
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org>
What?
Part of: #62371
This PR explores the addition of Data Views for the new experimental
posts
list underGutenberg->posts
menu.This is just a starting point, but wanted to have it on GH to start some discussions.
What this PR does for now is the start of making an abstraction that could be used for any post type, but we need to do it at least for
posts
andpages
for now.Maybe the notable things for now to discuss are:
post
or thesite
editor? I've started by having as a goal to load the site editor. This has nuances though. Do we want to have for example global styles in a the editor of the post? Additionally the editor adds some extra settings during initialization (initializeEditor
) that are needed here too. How can we abstract this to be reused what's needed.categories, tags
, etc.. in the sidebar where we would load the lists for the taxonomies. How does this affect the currentviews
we have(drafts, published, etc..
)? Should we consider changing placement of these views into the frame, which might also simplify some shared information that were wanted for views. An example is the number of items per view, which is not possible right now.Notes
usePostActions
for fields. Now we are reusing the exact same code for theposts
list and the existingpages
list in site editor. So testing thepages
list that works as before is also part of this PR to avoid regressions.