Skip to content

Conversation

@Menrath
Copy link
Contributor

@Menrath Menrath commented Jul 22, 2025

This PR adds the snippet community repository.

Also changed that the snippets file-comment is stripped in the enabled used snippet scss.

Thoughts for potential reviewers:

  1. I decided to use a single filearea for all snippet files. I renamed it from "uploadedsnippets" to just "snippet". Using singular is recommended. I wrote migrations that move the files to the new filearea and adjust the itemid.
  2. The solutions I looked into where either using a enum-like itemid, where the itemid corresponds to the snippet source/repository, and where the itemid actually relates to the snippet id in the theme_boost_union_snippets table. I decided for the first one, even though it seemed more non-moodle like, since the other solutions actually required even more logic (e.g. it would require the uploadedsnippets setting to use an extra file area!).
  3. I also thought of adding the builtin snippets to the filearea too, this clean up the logic even more on retrieving the snippets, but would require extra work when populating them. Feedback is welcome here!
  4. I am not too happy yet with how I split up the responsibilities to the four files within classes/local/snippet.

@Menrath Menrath marked this pull request as ready for review August 7, 2025 11:43
@Menrath
Copy link
Contributor Author

Menrath commented Aug 13, 2025

The only tests failing seem not to be related with this PR, but with smartmenus instead.

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 this pull request may close these issues.

3 participants