Skip to content

feat(files): choose personal template folder in Files settings - #64679

Open
juliusknorr wants to merge 6 commits into
masterfrom
codex/personal-template-settings
Open

juliusknorr wants to merge 6 commits into
masterfrom
codex/personal-template-settings

Conversation

@juliusknorr

@juliusknorr juliusknorr commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Managing the personal template folder was unintuitive and hard to explain. Files settings now has a dedicated "Templates" section to pick an existing folder, open it or clear the selection. Changing it never moves, copies or creates files. The "Create templates folder" entry in the New menu is removed.

API: GET/PUT /ocs/v2.php/apps/files/api/v1/templates/path read and set the folder (validated as an existing, readable folder inside the user's home).

First step towards #46455. Richdocuments needs nextcloud/richdocuments#6324 so it resolves templates from this folder.

Templates section in Files settings

Tested with unit tests and in a local instance. AI-assisted.

@elzody elzody left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I name the template directory something like "Personal Templates" it seems like richdocuments has a hard time with that, as it expects "Templates" or something by default. But if we are eventually removing the ability to change the personal template directory there and keeping it in Files, then we should just probably default to whatever the server tells us is the configured template directory (or a sane default). That said, I found this out because after creating a document from a template for the first time it fails to open, but then re-opening it is fine - I think richdocuments just can't find the template given.

Otherwise, a few comments, but looks OK so far.

Assisted-by: Codex:gpt-6-astra
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Assisted-by: Codex:gpt-6-astra
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Assisted-by: Codex:gpt-6-astra
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Assisted-by: Codex:gpt-6-astra
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Inject the user ID as nullable and throw NotLoggedInException when no
user is set. Mock IUserFolder in the tests to match the declared return
type of IRootFolder::getUserFolder and restructure setPath so psalm no
longer reports a redundant condition.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Pass the explanation as the description of NcAppSettingsSection so it
uses the same text offset as the heading instead of a plain paragraph.
Query the open folder action as a link in the spec, as NcButton with an
href renders an anchor.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Julius Knorr <jus@bitgrid.net>
@juliusknorr

Copy link
Copy Markdown
Member Author

Thanks for catching the richdocuments issue. richdocuments only looked for user templates in its own folder setting or Templates, so when Collabora fetched the template source on first open it couldn't find it. Later opens skip that step, which is why they work. Fix: nextcloud/richdocuments#6324, which falls back to the folder configured in Files.

@juliusknorr
juliusknorr marked this pull request as ready for review November 11, 2026 14:32
@juliusknorr
juliusknorr requested a review from a team as a code owner November 11, 2026 14:32
@juliusknorr
juliusknorr requested review from CarlSchwan, GhassenKefi, kristian-zendato and susnux and removed request for a team November 11, 2026 14:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants