Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6ecd448
implement ui for publish system prompt to hub
shatfield4 Jun 10, 2025
17b4b72
rework ui + add backend to upload to hub
shatfield4 Jun 11, 2025
2f905eb
add success modal view + publish menu item + translations
shatfield4 Jun 12, 2025
74828a6
normalize translations
shatfield4 Jun 12, 2025
c55d8d2
refactor PublishEntityModal + add hook
shatfield4 Jun 12, 2025
2014514
normalize translations
shatfield4 Jun 12, 2025
6ef96e8
Merge branch 'master' into 3975-feat-publish-system-prompt-via-ws-set…
shatfield4 Jun 12, 2025
929d70b
fix ui for success screen
shatfield4 Jun 13, 2025
a414e0d
Merge branch 'master' into 3975-feat-publish-system-prompt-via-ws-set…
timothycarambat Jun 13, 2025
cfe3e98
refactor, auth checks, UI/UX, and naming conventions to be more clear
timothycarambat Jun 13, 2025
fe28e0f
move components to CommunityHub folder + small ui tweak
shatfield4 Jun 13, 2025
a55917d
wip publish agent flows to community hub
shatfield4 Jun 14, 2025
09160c6
rework translations/implement uploading agent flows
shatfield4 Jun 16, 2025
6b5b6ac
normalize/restructure translations
shatfield4 Jun 16, 2025
7aa1640
Merge branch 'master' into publish-agent-flows-to-hub
shatfield4 Jun 16, 2025
2389edc
rename component/add jsdoc for consistency
shatfield4 Jun 16, 2025
8a7c67b
fix en translation
shatfield4 Jun 16, 2025
316cf47
remove comments/duplicate function from merge conf
shatfield4 Jun 16, 2025
b37a238
update styles of publish button in flow builder
shatfield4 Jun 16, 2025
2cc3538
resolve ssr icon issue
shatfield4 Jun 16, 2025
e6b0db3
UI linting
timothycarambat Jun 24, 2025
3a78b34
merge master
timothycarambat Jun 24, 2025
f609fc4
language diff
timothycarambat Jun 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
implement ui for publish system prompt to hub
  • Loading branch information
shatfield4 committed Jun 10, 2025
commit 6ecd4483f8f306cd341f8a1da4b96793ab0a0943
2 changes: 2 additions & 0 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
--theme-bg-chat-input: #27282a;
--theme-text-primary: #ffffff;
--theme-text-secondary: rgba(255, 255, 255, 0.6);
--theme-placeholder: #57585a;
--theme-sidebar-item-default: rgba(255, 255, 255, 0.1);
--theme-sidebar-item-selected: rgba(255, 255, 255, 0.3);
--theme-sidebar-item-hover: #3f3f42;
Expand Down Expand Up @@ -116,6 +117,7 @@
--theme-bg-chat-input: #eaeaea;
--theme-text-primary: #0e0f0f;
--theme-text-secondary: #7a7d7e;
--theme-placeholder: #9ca3af;
--theme-sidebar-item-default: #ffffff;
--theme-sidebar-item-selected: #ffffff;
--theme-sidebar-item-hover: #c8efff;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
import { useState } from "react";
import { X } from "@phosphor-icons/react";

export default function PublishPromptModal({ show, onClose, currentPrompt }) {
const [formData, setFormData] = useState({
name: "",
description: "",
prompt: currentPrompt || "",
tags: "",
visibility: "public",
});

if (!show) return null;

const handleSubmit = (e) => {
e.preventDefault();
onClose();
};

return (
<div className="fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50">
<div className="relative w-[900px] max-w-full bg-theme-bg-primary rounded-lg shadow border border-theme-modal-border">
<div className="relative p-6">
<div className="w-full flex gap-x-2 items-center">
<h3 className="text-xl font-semibold text-white">
Publish System Prompt
</h3>
</div>
<button
onClick={onClose}
type="button"
className="absolute top-4 right-4 transition-all duration-300 bg-transparent rounded-lg text-sm p-1 inline-flex items-center hover:bg-theme-modal-border hover:border-theme-modal-border hover:border-opacity-50 border-transparent border"
>
<X size={24} weight="bold" className="text-white" />
</button>
</div>

<form onSubmit={handleSubmit} className="flex">
<div className="w-1/2 p-6 pt-0 space-y-4">
<div>
<label className="block text-sm font-semibold text-white mb-1">
Name
</label>
<div className="text-xs text-white/60 mb-2">
This is the display name of your system prompt.
</div>
<input
type="text"
value={formData.name}
placeholder="My System Prompt"
onChange={(e) =>
setFormData({ ...formData, name: e.target.value })
}
className="w-full bg-theme-bg-secondary rounded-lg p-2 text-white text-sm focus:outline-primary-button active:outline-primary-button outline-none placeholder:text-theme-text-placeholder"
/>
</div>

<div>
<label className="block text-sm font-semibold text-white mb-1">
Description
</label>
<div className="text-xs text-white/60 mb-2">
This is the description of your system prompt. Use this to
describe the purpose of your system prompt.
</div>
<textarea
value={formData.description}
placeholder="This is the description of your system prompt. Use this to describe the purpose of your system prompt."
onChange={(e) =>
setFormData({ ...formData, description: e.target.value })
}
className="w-full bg-theme-bg-secondary rounded-lg p-2 text-white text-sm focus:outline-primary-button active:outline-primary-button outline-none min-h-[80px] placeholder:text-theme-text-placeholder"
/>
</div>

<div>
<label className="block text-sm font-semibold text-white mb-1">
Tags
</label>
<div className="text-xs text-white/60 mb-2">
Tags are used to label your system prompt for easier searching.
You can add multiple tags.
</div>
<input
type="text"
value={formData.tags}
placeholder="tag1, tag2, tag3"
onChange={(e) =>
setFormData({ ...formData, tags: e.target.value })
}
className="w-full bg-theme-bg-secondary rounded-lg p-2 text-white text-sm focus:outline-primary-button active:outline-primary-button outline-none placeholder:text-theme-text-placeholder"
/>
</div>

<div>
<label className="block text-sm font-semibold text-white mb-1">
Visibility
</label>
<div className="text-xs text-white/60 mb-2">
Public system prompts are visible to everyone. Private system
prompts are only visible to you and your team.
</div>
<div className="flex items-center space-x-4">
<label className="flex items-center">
<input
type="radio"
name="visibility"
value="public"
checked={formData.visibility === "public"}
onChange={(e) =>
setFormData({ ...formData, visibility: e.target.value })
}
className="mr-2"
/>
<span className="text-white text-sm">Public</span>
</label>
<label className="flex items-center">
<input
type="radio"
name="visibility"
value="private"
checked={formData.visibility === "private"}
onChange={(e) =>
setFormData({ ...formData, visibility: e.target.value })
}
className="mr-2"
/>
<span className="text-white text-sm">Private</span>
</label>
</div>
<div className="text-xs text-white/60 mt-2">
Private system prompts are currently in early access - you can
apply via email to contacting support.
</div>
</div>
</div>

<div className="w-1/2 p-6 pt-0 space-y-4">
<div>
<label className="block text-sm font-semibold text-white mb-1">
Prompt
</label>
<div className="text-xs text-white/60 mb-2">
This is the actual slash command that will be used to guide the
LLM.
</div>
<textarea
value={formData.prompt}
placeholder="Enter your system prompt here..."
onChange={(e) =>
setFormData({ ...formData, prompt: e.target.value })
}
className="w-full bg-theme-bg-secondary rounded-lg p-2 text-white text-sm focus:outline-primary-button active:outline-primary-button outline-none min-h-[300px] placeholder:text-theme-text-placeholder"
/>
</div>

<button
type="submit"
form="publish-form"
className="w-full bg-cta-button hover:bg-opacity-80 text-theme-bg-primary font-medium py-2 px-4 rounded-lg transition-colors"
>
Create slash command
</button>
</div>
</form>
</div>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Highlighter from "react-highlight-words";
import { Link, useSearchParams } from "react-router-dom";
import paths from "@/utils/paths";
import ChatPromptHistory from "./ChatPromptHistory";
import PublishPromptModal from "./PublishPromptModal";

// TODO: Move to backend and have user-language sensitive default prompt
const DEFAULT_PROMPT =
Expand All @@ -21,6 +22,7 @@ export default function ChatPromptSettings({ workspace, setHasChanges }) {
const promptHistoryRef = useRef(null);
const historyButtonRef = useRef(null);
const [searchParams] = useSearchParams();
const [showPublishModal, setShowPublishModal] = useState(false);

const handleRestore = (prompt) => {
setPrompt(prompt);
Expand Down Expand Up @@ -77,6 +79,11 @@ export default function ChatPromptSettings({ workspace, setHasChanges }) {
setShowPromptHistory(false);
}}
/>
<PublishPromptModal
show={showPublishModal}
onClose={() => setShowPublishModal(false)}
currentPrompt={prompt}
/>
<div>
<div className="flex flex-col">
<div className="flex items-center justify-between">
Expand Down Expand Up @@ -120,7 +127,7 @@ export default function ChatPromptSettings({ workspace, setHasChanges }) {
<button
ref={historyButtonRef}
type="button"
className="text-theme-text-secondary hover:text-white light:hover:text-black text-sm font-medium"
className="text-theme-text-secondary hover:text-white light:hover:text-black text-xs font-medium"
onClick={(e) => {
e.preventDefault();
setShowPromptHistory(!showPromptHistory);
Expand Down Expand Up @@ -186,13 +193,22 @@ export default function ChatPromptSettings({ workspace, setHasChanges }) {
</div>
<div className="w-full flex flex-row items-center justify-between pt-2">
{prompt !== DEFAULT_PROMPT && (
<button
type="button"
onClick={() => handleRestore(DEFAULT_PROMPT)}
className="text-theme-text-primary hover:text-white light:hover:text-black text-sm font-medium"
>
Clear
</button>
<>
<button
type="button"
onClick={() => handleRestore(DEFAULT_PROMPT)}
className="text-theme-text-primary hover:text-white light:hover:text-black text-xs font-medium"
>
Clear
</button>
<button
type="button"
onClick={() => setShowPublishModal(true)}
className="text-primary-button hover:text-white light:hover:text-black text-xs font-medium"
>
Publish to Community Hub
</button>
</>
)}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions frontend/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default {
text: {
primary: 'var(--theme-text-primary)',
secondary: 'var(--theme-text-secondary)',
placeholder: 'var(--theme-placeholder)',
},
sidebar: {
item: {
Expand Down