gutenberg
gutenberg copied to clipboard
Site Editor Add Template action includes existing templates
Description
In the Site Editor beta, when you choose add template it should
- list templates that don't already exist
- and not templates that do exist
- regardless of where they already exist - theme or database.
Step-by-step reproduction instructions
Set up steps
- Create an archive template if one doesn't already exist
- Export the template to the theme's block-templates folder
- Delete the template from the database.
Site Editor steps
- Open Site Editor
- Toggle Navigation
- Choose Template Add template icon
- See the List - mine showed Front page, Page and Archive
- While the popup is open hover over one of the listed templates
- See the template preview
Expected behaviour
In the Add template popup:
- Don't list templates do already exist in the theme's files
- Do list templates that haven't been created: eg Author
In the Templates list:
- Include templates that only exist in the theme's files
- as well as templates that have been customised
At some time in the future take into account child themes.
Actual behaviour
Templates that were already in the theme files were listed.
Screenshots or screen recording (optional)

Code snippet (optional)
WordPress information
- WordPress version: 5.7.1
- Gutenberg version: 10.5.4
- Are all plugins except Gutenberg deactivated? No
- Are you using a default theme (e.g. Twenty Twenty-One)? No - using ThisIs
Device information
- Device: Desktop
- Operating system: Windows 10
- Browser: Chrome
@bobbingwide is this still happening? Stumbled on this and had to check in :)
@bobbingwide just checking in. There have been a number of significant changes to the Site Editor since this issue was submitted. I am not able to replicate the issue you highlighted above using WordPress 6.1.1 and the latest version of Gutenberg. Are you able to confirm? Thanks!
