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

Templates folder: In "New >" menu, the hierarchy of templates is flattened #2491

Open
teamcons opened this issue Sep 29, 2024 · 8 comments · May be fixed by #2506
Open

Templates folder: In "New >" menu, the hierarchy of templates is flattened #2491

teamcons opened this issue Sep 29, 2024 · 8 comments · May be fixed by #2506

Comments

@teamcons
Copy link

teamcons commented Sep 29, 2024

What Happened?

I have a folder in Templates which contains a folder named "data science", with:

  1. a few python files, as well as:
  2. the folder "Supervised ML"
  3. the folder "Unsupervised ML", themselves with Python templates

The menu "New..." presents Supervised and Unsupervised along the other folder templates,
not in a menu below "data science" as expected.

Steps to Reproduce

place populated folders and subfolders in Templates
check via the "New" menu how they appear, and if anything is missing

Expected Behavior

Show all templates, respect hierarchy of templates

OS Version

8.x (Early Access)

Session Type

Secure Session (Wayland)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

@jeremypw
Copy link
Collaborator

jeremypw commented Oct 2, 2024

I am not seeing any difference between OS7.1 and OS8 regarding which entries appear. Folders inside Templates will not be shown if they contain no files or only hidden files. I havent tried it with Python or .docx files but there is no reason to think those are treated differently. I'll try to reproduce your situation more closely.

@jeremypw
Copy link
Collaborator

jeremypw commented Oct 2, 2024

I can confirm that all entries in the templates part of the context menu are at the same level and do not follow the hierarchy of the Templates folder. This is the same as OS7.1. Not sure whether it followed the hierarchy in the past? Anyway, this is a separate issue to entries not appearing at all so needs to be raised in a separate report.

@teamcons teamcons changed the title Template folder support: In New menu, elements are moved or do not appear Template folder support: In "New >" menu, the hierarchy is flattened Oct 2, 2024
@teamcons
Copy link
Author

teamcons commented Oct 2, 2024

I am not seeing any difference between OS7.1 and OS8 regarding which entries appear. Folders inside Templates will not be shown if they contain no files or only hidden files. I havent tried it with Python or .docx files but there is no reason to think those are treated differently. I'll try to reproduce your situation more closely.

I am not expecting empty folders or hidden files to show up, but templates files
in the digital drawings folder it is mostly krita files (.kra)

other docx templates elsewhere also shows up, so it is definitively strange (and a bit disruptive:..)

I can confirm that all entries in the templates part of the context menu are at the same level and do not follow the hierarchy of the Templates folder. This is the same as OS7.1. Not sure whether it followed the hierarchy in the past? Anyway, this is a separate issue to entries not appearing at all so needs to be raised in a separate report.

Another issue has been filed for the missing entries, and this has been edited to focus on the flattened hierarchy.
missing entries is quite more disruptive

@teamcons teamcons changed the title Template folder support: In "New >" menu, the hierarchy is flattened Templates folder: In "New >" menu, the hierarchy of templates is flattened Oct 2, 2024
@jeremypw
Copy link
Collaborator

jeremypw commented Oct 3, 2024

Thanks for splitting the issues. Just had a look at the relevant code and files do not get added to template list if the list exceeds 32 items at the moment. Is that the case for you? Not sure why that limit was chosen - presumably to limit the size of the context menu. If the menu were not flattened then it would not be such an issue I guess.

@teamcons
Copy link
Author

teamcons commented Oct 3, 2024

There are ten file templates in the data science directory, in total, including all subfolders

In total, all folders and subfolders included, we have 31 templates files, so even if i slorped everything in the base folder without dividing it should appear

i removed the data science folder (the one whose hierarchy is flattened), because it is unused and not to be used in the foreseeable future.
this caused the missing templates in #2493 to appear normally

@jeremypw
Copy link
Collaborator

jeremypw commented Oct 3, 2024

It sounds like it is something to do the total number of templates then. Strange that it is less than MAX_TEMPLATES in the code. The simplest solution would be to increase the maximum items to 64 or more.

The flattening of the hierarchy only applies to folders for me. i.e. all folders appear at the top level. Templates appear either in the top-level or in the submenu of the folder item.

@teamcons
Copy link
Author

teamcons commented Oct 3, 2024

Ah... There seem to be a confusion here. My issue is that all folders are at top level. The files are in the right folders.

"top level" were the words i was missing (non native english, my apologies)

The flattening of the hierarchy only applies to folders for me. i.e. all folders appear at the top level. Templates appear either in the top-level or in the submenu of the folder item.

So this would be the issue. Not being able to organize folders beyond top level

the missing entries #2493 could be because folders are counted in the max items limit ?

@jeremypw
Copy link
Collaborator

jeremypw commented Oct 3, 2024

Yes, I checked the code again and the total number of items in the templates list, including folders, is compared to MAX_TEMPLATES.

@jeremypw jeremypw linked a pull request Oct 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants