[PR #4869] [CLOSED] Feat: Workspace Templates #4798

Closed
opened 2026-02-22 18:36:33 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4869
Author: @17ColinMiPerry
Created: 1/16/2026
Status: Closed

Base: masterHead: feat-workspace-templates


📝 Commits (9)

  • c00afd8 implemented saving and employing templates
  • b975135 add template management components
  • ae2d6e8 implement basic editing
  • 3b08be7 add edit template modal
  • c9e3113 fix edit template dropdown behavior
  • b638921 add new template button to template management page
  • 30a11c3 fix invalid template value handling
  • 39180b0 Merge branch 'master' into feat-workspace-templates
  • 7a04c3c refactor button position

📊 Changes

22 files changed (+1586 additions, -12 deletions)

View changed files

📝 frontend/src/components/Modals/NewWorkspace.jsx (+40 -2)
📝 frontend/src/components/SettingsSidebar/index.jsx (+6 -0)
📝 frontend/src/locales/en/common.js (+1 -0)
📝 frontend/src/main.jsx (+9 -0)
frontend/src/models/workspaceTemplate.js (+63 -0)
frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/CustomSelect/index.jsx (+85 -0)
frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/ModelSelect/index.jsx (+107 -0)
frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/ProviderSelect/index.jsx (+37 -0)
frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/index.jsx (+414 -0)
frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplateRow/index.jsx (+217 -0)
frontend/src/pages/GeneralSettings/WorkspaceTemplates/index.jsx (+128 -0)
📝 frontend/src/pages/WorkspaceSettings/AgentConfig/AgentLLMSelection/index.jsx (+1 -1)
frontend/src/pages/WorkspaceSettings/GeneralAppearance/SaveAsTemplate/index.jsx (+115 -0)
📝 frontend/src/pages/WorkspaceSettings/GeneralAppearance/index.jsx (+2 -0)
📝 frontend/src/utils/paths.js (+3 -0)
server/endpoints/workspaceTemplates.js (+136 -0)
📝 server/endpoints/workspaces.js (+22 -2)
📝 server/index.js (+4 -0)
📝 server/models/workspace.js (+9 -7)
server/models/workspaceTemplate.js (+169 -0)

...and 2 more files

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #4769

What is in this change?

Basic workspace templates were implemented. Templates can either be made by copying settings from an existing workspace, or an empty template can be made and edited from the WorkspaceTemplate general settings page. When users create a new workspace, they will be given the option to select either a template they have made in the past, or default. Any unedited template settings will use system defaults.

Frontend Changes

  • frontend/src/components/Modals/NewWorkspace.jsx - include the dropdown to allow users to select from their saved templates.
  • frontend/src/components/SettingsSidebar/index.jsx - include the workspace setting in the sidebar
  • frontend/src/main.jsx- added the new route to the workspace template settings page
  • NEW frontend/src/models/workspaceTemplate.js- created the frontend workspace template model
  • NEW frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/CustomSelect/index.jsx - this was necessary to allow for a dropdown in the right style with the AnythingLLM vertical scrollbar
  • NEW frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/ModelSelect/index.jsx - the specific dropdown logic for model selection
  • NEW frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/ProviderSelect/index.jsx - the specific dropdown logic for providers
  • NEW frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/index.jsx - the template preview modal for displaying and editing template data
  • NEW frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplateRow/index.jsx - this is the subcomponent for rows in the workspace template settings page table
  • NEW frontend/src/pages/GeneralSettings/WorkspaceTemplates/index.jsx - this is the general settings page for workspace templates
  • frontend/src/pages/WorkspaceSettings/AgentConfig/AgentLLMSelection/index.jsx - exported the ENABLED_PROVIDERS to be used in the template provider dropdown
  • NEW frontend/src/pages/WorkspaceSettings/GeneralAppearance/SaveAsTemplate/index.jsx - created the SaveAsTemplate component
  • frontend/src/pages/WorkspaceSettings/GeneralAppearance/index.jsx - implemented the SaveAsTemplate component into the workspace settings page
  • frontend/src/utils/paths.js- registered the workspae template path

Server Changes

  • NEW server/endpoints/workspaceTemplates.js - defined the workspace template endpoints
  • server/endpoints/workspaces.js - updated workspace endpoints to allow for creation from template
  • NEW server/index.js - registered the workspace template endpoints
  • server/models/workspace.js - updated workspace backend models
  • NEW server/models/workspaceTemplate.js- created workspace template backend model

Prisma Schema Change

A table was added to the DB (which stores workspace template information). This change necessitates a migration for template features to work.

Additional Information

make ws from template save as template modal ts modal

Additional Notes

This change does not implement including embedded files in templates. This change does not allow for overwriting existing workspaces with a template. Most strings are hardcoded in English.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4869 **Author:** [@17ColinMiPerry](https://github.com/17ColinMiPerry) **Created:** 1/16/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feat-workspace-templates` --- ### 📝 Commits (9) - [`c00afd8`](https://github.com/Mintplex-Labs/anything-llm/commit/c00afd8263a2a4addf01e0a23a8ba72e266de6af) implemented saving and employing templates - [`b975135`](https://github.com/Mintplex-Labs/anything-llm/commit/b975135bf4848cae2ba547f9bff4f78c99b15f15) add template management components - [`ae2d6e8`](https://github.com/Mintplex-Labs/anything-llm/commit/ae2d6e89975c287ea85c4ed34d0fa7ed06c94675) implement basic editing - [`3b08be7`](https://github.com/Mintplex-Labs/anything-llm/commit/3b08be715e0616e3cfddef6dc4218e8d16f0ac85) add edit template modal - [`c9e3113`](https://github.com/Mintplex-Labs/anything-llm/commit/c9e3113070bd4ec1780419388916af1a0f1bd9c6) fix edit template dropdown behavior - [`b638921`](https://github.com/Mintplex-Labs/anything-llm/commit/b6389215e9a4ea7380370e537d0807a303556dd0) add new template button to template management page - [`30a11c3`](https://github.com/Mintplex-Labs/anything-llm/commit/30a11c3be8b3e339a07423698bfc7f91f9ab4029) fix invalid template value handling - [`39180b0`](https://github.com/Mintplex-Labs/anything-llm/commit/39180b017d75f479d7514ccf803660b9998d840c) Merge branch 'master' into feat-workspace-templates - [`7a04c3c`](https://github.com/Mintplex-Labs/anything-llm/commit/7a04c3cf334316ed9757939c808c71d071a2eeb2) refactor button position ### 📊 Changes **22 files changed** (+1586 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/Modals/NewWorkspace.jsx` (+40 -2) 📝 `frontend/src/components/SettingsSidebar/index.jsx` (+6 -0) 📝 `frontend/src/locales/en/common.js` (+1 -0) 📝 `frontend/src/main.jsx` (+9 -0) ➕ `frontend/src/models/workspaceTemplate.js` (+63 -0) ➕ `frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/CustomSelect/index.jsx` (+85 -0) ➕ `frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/ModelSelect/index.jsx` (+107 -0) ➕ `frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/ProviderSelect/index.jsx` (+37 -0) ➕ `frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/index.jsx` (+414 -0) ➕ `frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplateRow/index.jsx` (+217 -0) ➕ `frontend/src/pages/GeneralSettings/WorkspaceTemplates/index.jsx` (+128 -0) 📝 `frontend/src/pages/WorkspaceSettings/AgentConfig/AgentLLMSelection/index.jsx` (+1 -1) ➕ `frontend/src/pages/WorkspaceSettings/GeneralAppearance/SaveAsTemplate/index.jsx` (+115 -0) 📝 `frontend/src/pages/WorkspaceSettings/GeneralAppearance/index.jsx` (+2 -0) 📝 `frontend/src/utils/paths.js` (+3 -0) ➕ `server/endpoints/workspaceTemplates.js` (+136 -0) 📝 `server/endpoints/workspaces.js` (+22 -2) 📝 `server/index.js` (+4 -0) 📝 `server/models/workspace.js` (+9 -7) ➕ `server/models/workspaceTemplate.js` (+169 -0) _...and 2 more files_ </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #4769 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> Basic workspace templates were implemented. Templates can either be made by copying settings from an existing workspace, or an empty template can be made and edited from the WorkspaceTemplate general settings page. When users create a new workspace, they will be given the option to select either a template they have made in the past, or default. Any unedited template settings will use system defaults. #### Frontend Changes - `frontend/src/components/Modals/NewWorkspace.jsx` - include the dropdown to allow users to select from their saved templates. - `frontend/src/components/SettingsSidebar/index.jsx` - include the workspace setting in the sidebar - `frontend/src/main.jsx`- added the new route to the workspace template settings page - ***NEW*** `frontend/src/models/workspaceTemplate.js`- created the frontend workspace template model - ***NEW*** `frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/CustomSelect/index.jsx` - this was necessary to allow for a dropdown in the right style with the AnythingLLM vertical scrollbar - ***NEW*** `frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/ModelSelect/index.jsx` - the specific dropdown logic for model selection - ***NEW*** `frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/ProviderSelect/index.jsx` - the specific dropdown logic for providers - ***NEW*** `frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/index.jsx` - the template preview modal for displaying and editing template data - ***NEW*** `frontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplateRow/index.jsx` - this is the subcomponent for rows in the workspace template settings page table - ***NEW*** `frontend/src/pages/GeneralSettings/WorkspaceTemplates/index.jsx` - this is the general settings page for workspace templates - `frontend/src/pages/WorkspaceSettings/AgentConfig/AgentLLMSelection/index.jsx` - exported the `ENABLED_PROVIDERS` to be used in the template provider dropdown - ***NEW*** `frontend/src/pages/WorkspaceSettings/GeneralAppearance/SaveAsTemplate/index.jsx` - created the SaveAsTemplate component - `frontend/src/pages/WorkspaceSettings/GeneralAppearance/index.jsx` - implemented the SaveAsTemplate component into the workspace settings page - `frontend/src/utils/paths.js`- registered the workspae template path #### Server Changes - ***NEW*** `server/endpoints/workspaceTemplates.js` - defined the workspace template endpoints - `server/endpoints/workspaces.js` - updated workspace endpoints to allow for creation from template - ***NEW*** `server/index.js` - registered the workspace template endpoints - `server/models/workspace.js` - updated workspace backend models - ***NEW*** `server/models/workspaceTemplate.js`- created workspace template backend model #### Prisma Schema Change A table was added to the DB (which stores workspace template information). This change necessitates a migration for template features to work. ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> <img width="2560" height="1440" alt="make ws from template" src="https://github.com/user-attachments/assets/052c34f5-491c-4c54-a209-8cf08af8accf" /> <img width="2560" height="1440" alt="save as template modal" src="https://github.com/user-attachments/assets/bb644f85-1a89-4545-9cb8-d52729b294ba" /> <img width="2560" height="1440" alt="ts modal" src="https://github.com/user-attachments/assets/3476d407-0451-4277-83b7-3fd2b5cc7813" /> ### Additional Notes This change does not implement including embedded files in templates. This change does not allow for overwriting existing workspaces with a template. Most strings are hardcoded in English. ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [ ] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:33 -05:00
yindo closed this issue 2026-02-22 18:36:33 -05:00
yindo changed title from [PR #4869] Feat: Workspace Templates to [PR #4869] [CLOSED] Feat: Workspace Templates 2026-06-05 15:20:25 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4798