collectives icon indicating copy to clipboard operation
collectives copied to clipboard

Template improvements

Open mejo- opened this issue 8 months ago • 2 comments

📝 Summary

This replaces the old templating system in Collectives with a new one. Instead of managing templates for subpages of each page separately, templates are managed globally per collective now. If at least one template exists, creating a new page will show a modal to pick a template.

Managing the templates is possible for everyone with editing permissions (not in public shares though) and opens the template list in a modal. Editing the content of a template happens in the viewer.

Templates that consist of several pages (i.e. a template page with subpages) are still working but I decided against supporting them in the template management modal for now. They're an edge case in my opinion and don't warrant the extra UI complexity for now. We can add it if requested later on. For now people can add subpages to a template via files app if they really need it.

  • Resolves: #267
  • Resolves: #1195

🖼️ Screencast

Screencast
screencast

🖼️ Screenshots

Menu action Manage templates dialog
image image
Pick emoji Edit template
image image
New page: pick a template
image

🚧 TODO

  • [x] Tests
  • [x] Copy full pages (with emojis etc,) not only page files
  • [ ] Add migration for existing templates

🏁 Checklist

  • [x] Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • [x] Sign-off message is added to all commits
  • [ ] Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • [ ] Documentation (README or documentation) has been updated or is not required

mejo- avatar Apr 22 '25 15:04 mejo-

I changed the title for the blank page item in template selection from "Blank" to "Blank page" in the meantime so it's more explicit.

mejo- avatar Apr 24 '25 19:04 mejo-

:heart_eyes: Just had a look at the screenshots and the screencast so far and I like them a lot! Super clean and seems very usable.

max-nextcloud avatar Apr 28 '25 06:04 max-nextcloud

When renaming a template I would expect any click outside the text input to save the new name rather than leaving the input active.

Good catch. Fixed this now along with some other problems I spotted in the frontend implementation. Also rebased on latest main.

mejo- avatar Apr 29 '25 10:04 mejo-

Also added the repair step for migrating old templates now. To test it, add some Template.md pages in your collectives, bump the app version in appinfo/info.xml and run occ upgrade.

mejo- avatar Apr 29 '25 17:04 mejo-

Icons should have no background

The icons are a button to edit the emoji for the template. I wonder whether that's still discoverable with a tertiary button without background.

mejo- avatar May 07 '25 12:05 mejo-

I think it's ok since this can be edited while editing the template. I would also be ok with removing this functionality here and simplify the interaction with this list

marcoambrosini avatar May 07 '25 12:05 marcoambrosini

I think it's ok since this can be edited while editing the template. I would also be ok with removing this functionality here and simplify the interaction with this list

Nope, unfortunately that's not the case. Now that we open the template markdown file in the viewer, there's no way to edit the emoji while editing the page.

mejo- avatar May 07 '25 12:05 mejo-

I think it's ok since this can be edited while editing the template. I would also be ok with removing this functionality here and simplify the interaction with this list

Nope, unfortunately that's not the case. Now that we open the template markdown file in the viewer, there's no way to edit the emoji while editing the page.

We could add an action "Set emoji" in the three-dots menu though to highlight the possibility of editing the emoji.

mejo- avatar May 07 '25 12:05 mejo-