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

Command Center: Some templates don't appear in results. #51657

Closed
tjcafferkey opened this issue Jun 19, 2023 · 2 comments · Fixed by #53286
Closed

Command Center: Some templates don't appear in results. #51657

tjcafferkey opened this issue Jun 19, 2023 · 2 comments · Fixed by #53286
Assignees
Labels
[Package] Commands /packages/commands [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@tjcafferkey
Copy link
Contributor

Description

When testing the command center feature in the Site Editor against WooCommerce templates I noticed that they weren't appearing in the returned results.

It looks as if the template list is sliced and the resulting list of 10 is then used to filter against the input. If the expected template isn't in this ten then it looks like it won't be returned as a match.

Additionally if you save a customized version of a template e.g. Single product then it does get returned in the results. I'm guessing because databased entries feature earlier in the list of templates and don't get cut off after the slice method is used.

Removing the .slice on records does return the expected results based on the available templates on the site.

Step-by-step reproduction instructions

  1. Install WooCommerce plugin with block theme
  2. Go to Appearance > Editor > Select a template to edit
  3. Using the command center (Hit command + K, or hit the input at top of screen) enter a Woo template (e.g. Single product)
  4. See that this template isn't returned in the results.

Screenshots, screen recording, code snippet

No response

Environment info

  • GB trunk
  • WooCommerce 7.8.0
  • WP 6.2.2

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@richtabor richtabor added the [Package] Commands /packages/commands label Jun 20, 2023
@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Jul 18, 2023
@kathrynwp
Copy link

I ran into this as well in testing 6.3-RC1, without WooCommerce or any other plugin active, besides Beta Tester.

For example, when typing single into the Command Palette I expected to bring up the Single post template, but instead no results were found.

Blog_Home_‹_Template_Part_‹_Editor_‹_LearnWP_—_WordPress

Expected

Typing the name of any template present in the active theme into the Command Palette should bring up the corresponding template.

@tjcafferkey
Copy link
Contributor Author

I left a comment here on the original PR with some suggestions, hopefully this will provide more context as to why it is happening. I will likely try and open a PR soon with a proposed change to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Commands /packages/commands [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants