From fa3b0859f017c56a6410d185db3686613cc1c9ab Mon Sep 17 00:00:00 2001 From: Storme-bit Date: Sun, 19 Apr 2026 02:57:11 -0700 Subject: [PATCH] system prompt client global and project --- .../src/components/ProjectModal.jsx | 41 +++++- .../src/components/ProjectView.jsx | 4 +- .../src/components/SettingsView.jsx | 138 +++++++++++++----- .../chat-client/src/components/Sidebar.jsx | 5 +- 4 files changed, 144 insertions(+), 44 deletions(-) diff --git a/packages/chat-client/src/components/ProjectModal.jsx b/packages/chat-client/src/components/ProjectModal.jsx index bf63b22..71adef5 100644 --- a/packages/chat-client/src/components/ProjectModal.jsx +++ b/packages/chat-client/src/components/ProjectModal.jsx @@ -6,6 +6,7 @@ export default function ProjectModal({ project, mode, onSave, onDelete, onClose const [name, setName] = useState(project?.name ?? ''); const [description, setDescription] = useState(project?.description ?? ''); const [colour, setColour] = useState(project?.colour ?? COLOURS[0]); + const [systemPrompt, setSystemPrompt] = useState(project?.system_prompt ?? ''); const inputRef = useRef(null); useEffect(() => { @@ -15,13 +16,20 @@ export default function ProjectModal({ project, mode, onSave, onDelete, onClose function handleSubmit() { const trimmed = name.trim(); if (!trimmed) return; - onSave({ name: trimmed, description: description.trim() || null, colour, icon: null, isolated: 1 }); + onSave({ + name: trimmed, + description: description.trim() || null, + colour, + icon: null, + isolated: 1, + system_prompt: systemPrompt.trim() || null, + }); onClose(); } function handleKeyDown(e) { - if (e.key === 'Enter' && mode !== 'confirm-delete') handleSubmit(); if (e.key === 'Escape') onClose(); + // Don't submit on Enter — textarea fields make Enter ambiguous } return ( @@ -35,7 +43,8 @@ export default function ProjectModal({ project, mode, onSave, onDelete, onClose background: 'var(--bg-surface)', border: '1px solid var(--border)', borderRadius: 'var(--radius-lg)', - padding: '24px', width: '380px', + padding: '24px', width: '420px', + maxHeight: '90vh', overflowY: 'auto', display: 'flex', flexDirection: 'column', gap: '16px', }}> {mode === 'confirm-delete' ? ( @@ -122,6 +131,32 @@ export default function ProjectModal({ project, mode, onSave, onDelete, onClose + {/* System Prompt */} +
+ +

+ Overrides the global system prompt for conversations in this project. + Leave blank to use the global default. +

+