Skip to content

ui: Custom Prompts library + improvements for System Message, MCP Prompts & Resources UI/UX#25034

Draft
allozaur wants to merge 27 commits into
ggml-org:masterfrom
allozaur:feat/custom-instructions
Draft

ui: Custom Prompts library + improvements for System Message, MCP Prompts & Resources UI/UX#25034
allozaur wants to merge 27 commits into
ggml-org:masterfrom
allozaur:feat/custom-instructions

Conversation

@allozaur

Copy link
Copy Markdown
Contributor

Overview

Demo

prompts-demo-h264.mp4

Prompts library (/prompts)

  • New landing route under the manage sidebar; prompts grouped by category, full-text search
  • "New chat" on a prompt card opens a conversation with a system message already referencing the prompt
  • Save any system message as a new prompt via DialogPromptAddNew (title, content, optional category)
  • Sync a system message from its library source with a CodeDiff preview before applying (DialogPromptSync)
  • Prompts persist across sessions (IndexedDB-backed)

System messages

  • One unified editor (ChatMessageEditForm) for user, assistant, and system messages; variant="system" wraps it in the dashed bubble so the read view matches the edit view
  • Three scenarios covered: library-referenced (with a "Newer version available" hint when stale), placeholder (keeps a prominent "Add to library" CTA), and a fresh in-chat system prompt
  • Compose-menu gets a system-message submenu: pick an existing library prompt or save a new one inline
  • Library references are tracked on the message itself (promptId extra), so the editor and the chat display can always look the referenced prompt up

MCP

  • Server prompt list is fetched eagerly on connect, so prompts, resources, completions, etc. are visible everywhere without an extra round trip
  • Resources browser dialog is usable on mobile
  • Removing an MCP server is reactive — its prompts/resources disappear from every UI surface (compose menu, prompts page, resources browser) automatically

UI primitives (new building blocks for future features)

  • Command (cmdk) palette
  • InputGroup (with addon / button / input / text / textarea parts)
  • Toggle, ToggleGroup

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES, MiniMax M3 on HF Inference Providers + Qwen3.6-35B-A3B / Qwen3.6-27B locally

@github-actions github-actions Bot added documentation Improvements or additions to documentation server/ui labels Jun 26, 2026
@allozaur allozaur force-pushed the feat/custom-instructions branch from fa43e12 to 6c1629a Compare June 26, 2026 08:51
@engrtipusultan

Copy link
Copy Markdown

I actually vibed an MCP to achieve such functionality. MCP would scan folder and list mark down files as prompts and through MCP they will be available as assistant prompts.
What I miss is cherry studio like functionality to list them as assistants and group chats under each assistant or to have workflow that will go through multiple assistants.
Would that be possibility going forward?

Comment on lines 96 to +256
@@ -134,6 +181,21 @@
get rawEditContent() {
return rawEditContent;
},
get isSystemMessage() {
return isSystemMessage;
},
get isSystemPlaceholder() {
return isSystemPlaceholder;
},
get canAddToLibrary() {
return canAddToLibrary;
},
get canUpdateLibraryPrompt() {
return canUpdateLibraryPrompt;
},
get libraryPromptTitle() {
return referencedPrompt?.title;
},
setContent: (content: string) => {
editedContent = content;
},
@@ -148,19 +210,50 @@
},
save: handleSaveEdit,
saveOnly: handleSaveEditOnly,
saveAsLibrary: handleSaveAsLibrary,
updateLibraryPrompt: handleUpdateLibraryPrompt,
cancel: handleCancelEdit,
startEdit: handleEdit
});

let mcpPromptExtra = $derived.by(() => {
if (message.role !== MessageRole.USER) return null;
if (message.content.trim()) return null;
if (!message.extra || message.extra.length !== 1) return null;
let mcpPromptExtra = $derived.by((): DatabaseMessageExtraMcpPrompt | null => {
if (message.role === MessageRole.USER) {
if (message.content.trim()) return null;
if (!message.extra || message.extra.length !== 1) return null;

const extra = message.extra[0];

if (extra.type === AttachmentType.MCP_PROMPT) {
return extra as DatabaseMessageExtraMcpPrompt;
}

return null;
}

if (message.role === MessageRole.SYSTEM) {
// System messages created from an MCP prompt carry the server/prompt
// identity through their synthetic `mcp:<server>:<prompt>` promptId.
// Treat them as MCP-prompt messages so they render with the same styled
// surface instead of a plain system textarea.
const custom = customPromptExtra;

if (!custom?.promptId.startsWith('mcp:')) return null;

const extra = message.extra[0];
const stripped = custom.promptId.slice('mcp:'.length);
const sepIndex = stripped.indexOf(':');

if (extra.type === AttachmentType.MCP_PROMPT) {
return extra as DatabaseMessageExtraMcpPrompt;
if (sepIndex <= 0) return null;

const serverName = stripped.slice(0, sepIndex);
const promptName = stripped.slice(sepIndex + 1);

return {
type: AttachmentType.MCP_PROMPT,
name: promptName,
serverName,
promptName,
content: message.content
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if possible, we should move this logic and related markup to somehow manage from ChatMessageCustomPrompt.svelte

Comment thread tools/ui/src/routes/(manage)/prompts/+page.svelte Outdated
Comment thread tools/ui/src/routes/(chat)/chat/[id]/+page.svelte
Comment thread tools/ui/src/lib/utils/diff.ts
Comment thread tools/ui/src/lib/stores/conversations.svelte.ts Outdated
Comment thread tools/ui/src/lib/components/app/forms/SearchInputMini.svelte Outdated
@awijshoff

Copy link
Copy Markdown

Very cool!

I think Importing/Exporting Prompts (or Prompt-collections), comparable to how chats can be imported/exported would be a nice feature for sharing prompts with other users. "Copying" prompts for A/B-tests might also be useful.

@allozaur

Copy link
Copy Markdown
Contributor Author

I actually vibed an MCP to achieve such functionality. MCP would scan folder and list mark down files as prompts and through MCP they will be available as assistant prompts. What I miss is cherry studio like functionality to list them as assistants and group chats under each assistant or to have workflow that will go through multiple assistants. Would that be possibility going forward?

we will develop this further to support skills in a similiar way. this PR is a beginning of this type of functionality

@allozaur

Copy link
Copy Markdown
Contributor Author

Very cool!

I think Importing/Exporting Prompts (or Prompt-collections), comparable to how chats can be imported/exported would be a nice feature for sharing prompts with other users. "Copying" prompts for A/B-tests might also be useful.

yeah, this one i can still squash in this PR

@allozaur allozaur force-pushed the feat/custom-instructions branch from 6c1629a to f9d2eba Compare June 28, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation server/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants