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

Add Data View Shortcuts: Manage Templates, Pages, and Patterns #66737

Conversation

karthick-murugan
Copy link
Contributor

What?

Part of #60806

Add data view shortcuts.

Why?

Currently there is no command to view data shortcuts.

How?

This PR adds shortcut for Pages/Drafts which will navigate to List view of Draft pages in Site Editor.

Testing Instructions

  • Log in to the Dashboard: Access your WordPress admin dashboard by entering your credentials.
  • Navigate to the Site Editor: From the dashboard, locate and click on the Site Editor option in the left-hand menu.
  • Initiate a Search: In the Site Editor, click on the search icon located at the top left corner of the interface.
  • Search for Drafts: Enter the term "Drafts" in the search bar. The search results will display the Drafts/Pages option.
  • Select Drafts/Pages: Click on the Drafts/Pages entry from the search results. This action will direct you to the List view of all draft pages within the Site Editor.

Screenshots or screencast

REC-20241105132146.mp4

Copy link

github-actions bot commented Nov 5, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: karthick-murugan <karthickmurugan@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Nov 5, 2024
Copy link

github-actions bot commented Nov 5, 2024

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @karthick-murugan! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@karthick-murugan karthick-murugan changed the title Enhancement/add command drafts Add data view shortcuts: Pages/Drafts Nov 5, 2024
@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Package] Editor /packages/editor labels Nov 8, 2024
@karthick-murugan
Copy link
Contributor Author

@t-hamano - Please have a look at this PR if you have some time. Thanks in advance.

@t-hamano
Copy link
Contributor

Thanks for the PR!

I assume that the intention of #60806 is not to add a single command for the draft page list. I think the aim is to detect all views available in the data view and add those commands automatically.

Before we move forward with this PR, let's clarify what #60806 is aiming to achieve.

cc @jameskoster

@karthick-murugan
Copy link
Contributor Author

Thanks for the PR!

I assume that the intention of #60806 is not to add a single command for the draft page list. I think the aim is to detect all views available in the data view and add those commands automatically.

Thank you for the feedback @t-hamano

You’re absolutely right that the aim of #60806 is to detect all views available in the data view and add those commands automatically. To begin with, I’ve added a single command for Draft pages in this PR as a starting point.

The idea here is to approach this incrementally, where each command could potentially have a separate PR for better focus and review. This will also allow us to refine and ensure the implementation is robust before adding more commands.

Looking forward to your thoughts!

cc @jameskoster

@jameskoster
Copy link
Contributor

Yeah the rough idea was to register commands automatically, based on existing data views.

That said, I don't know how/if data views are registered at a global level, so perhaps it's not possible to do that yet?

@karthick-murugan
Copy link
Contributor Author

Hi @jameskoster,

Following your suggestion in #60806, I’ve updated the command palette to include commands like "Manage templates", "Manage pages", and "Manage patterns". You can find the implementation in the video linked below:

🎥 [Implementation Video]

REC-20241219171514.mp4

I’d appreciate your feedback on whether these updates meet expectations or if additional commands should be included.

@t-hamano, I would also like your input on any additional commands to consider based on your suggestions, ensuring the implementation aligns with all use cases.

Looking forward to your thoughts!

@karthick-murugan karthick-murugan changed the title Add data view shortcuts: Pages/Drafts Add Data View Shortcuts to Command Palette: Manage Templates, Pages, and Patterns Dec 19, 2024
@karthick-murugan karthick-murugan changed the title Add Data View Shortcuts to Command Palette: Manage Templates, Pages, and Patterns Add Data View Shortcuts: Manage Templates, Pages, and Patterns Dec 19, 2024
@jameskoster
Copy link
Contributor

I noticed in your video that are already commands to access those dataviews, I don't know if they existed when #60806 was opened, but sorry for the wild goose chase in any case!

Perhaps instead of adding the new commands we just update the labels to read 'Manage Patterns', etc. Currently they just read 'Patterns', 'Templates', etc. which is a bit ambiguous.

@karthick-murugan
Copy link
Contributor Author

I noticed in your video that are already commands to access those dataviews, I don't know if they existed when #60806 was opened, but sorry for the wild goose chase in any case!

Perhaps instead of adding the new commands we just update the labels to read 'Manage Patterns', etc. Currently they just read 'Patterns', 'Templates', etc. which is a bit ambiguous.

@jameskoster - Removed the newly added commands and updated the labels to "Manage Pages", "Manage Patterns", "Manage Templates". Please have a look at this video.

REC-20241220112115.mp4

cc @t-hamano

@t-hamano
Copy link
Contributor

Thanks for addressing this issue.

Before moving forward with the code implementation, I think we need to investigate the current behavior and explore what would be ideal. Otherwise, we may end up rewriting the code multiple times.

Currently, there are already commands for all screens: Navigation, Styles, Pages, Templates, and Patterns. So, if we move forward with this PR, we will just need to add "Manage" to those command names.

However, when it comes to screen titles, the word "Manage" has been purposefully removed (See #62107). So at this point I'm not sure if it's OK to use the word "manage" in the command palette.

Personally, I prefer not to include a verb unless the command itself has some action. If it's simply navigating to a page, I expect the command palette to show only the page title.

Let's hear the opinions of other members of the @WordPress/gutenberg-design team as well.

@karthick-murugan
Copy link
Contributor Author

Let's hear the opinions of other members of the @WordPress/gutenberg-design team as well.

Thank you, @t-hamano, for taking the time to provide this detailed feedback. I appreciate the context and will hold off on further changes until we have additional input from the design team. I’ll proceed as per their recommendations once they’ve shared their thoughts.

@jameskoster
Copy link
Contributor

I don't have a strong opinion, I'm happy to defer to @t-hamano on this :)

We should make a decision on whether or not to close #60806 though.

@t-hamano
Copy link
Contributor

We should make a decision on whether or not to close #60806 though.

I searched past issues and found that #60806 may be part of #50407. Perhaps it would be better to close #60806 and discuss it more comprehensively in #50407. #50407 seems to be still under discussion, so it might be good to get a consensus on the basic direction first.

@karthick-murugan
Copy link
Contributor Author

#60806 - Original Issue has been closed with reason "Not Planned"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Editor /packages/editor [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants