mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[PR #14638] [CLOSED] fix: add (Clone) to title and -clone to id when cloning a workspace prompt
#39162
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/14638
Author: @silentoplayz
Created: 6/3/2025
Status: ❌ Closed
Base:
dev← Head:append-clone-to-cloned-prompts📝 Commits (1)
e92ebbbfix: append(Clone)to cloned prompt title andcloneto prompt id📊 Changes
2 files changed (+31 additions, -10 deletions)
View changed files
📝
src/lib/components/workspace/Prompts/PromptEditor.svelte(+13 -4)📝
src/routes/(app)/workspace/prompts/create/+page.svelte(+18 -6)📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
PromptEditorto provide a more consistent and user-friendly experience, similar to cloning features found in other workspace pages.(Clone), and its command will be modified (e.g.,/original-command-clone) to suggest a unique new command. This streamlines the duplication process and reduces manual input for the user.Added
cloneboolean prop has been added toPromptEditor.svelteto explicitly control the cloning behavior when loading prompts.PromptEditor.svelteto automatically adjust thetitleandcommandof a prompt when thecloneprop istrue, including appending(Clone)to the title and slugifying a new command from the base command, ensuring uniqueness for cloned prompts.Changed
src/lib/components/workspace/Prompts/PromptEditor.svelte:titleandcommandhas been updated to leverage the newcloneprop.hasManualEditflag is now consistently set totrueupon prompt initialization, regardless of whether it's a clone or a new prompt.src/routes/(app)/workspace/prompts/create/+page.svelte:PromptEditorcomponent now correctly receives and utilizes the newcloneprop.clone = truewhen a prompt is received viawindow.openermessages orsessionStorage, ensuring these imported prompts are treated as clones with the new naming conventions.promptvariable in theonSubmitfunction was renamed toresfor better clarity.sessionStorage.removeItem('prompt');call was repositioned for logical flow.promptvariable was added for improved code clarity and type safety.Additional Information
cloneprop inPromptEditorprovides clearer control over when these cloning-specific adjustments should be applied.Screenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.