Add reset-to-default button and how-to docs to system prompt editor

Each service prompt card now shows:
- A collapsible how-to panel with placeholder docs, required JSON
  response keys, and usage notes
- A "Reset to Default" button (with confirmation step) that restores
  the built-in prompt without saving, letting the admin review first
- A "Using the built-in default prompt" indicator when unchanged

Backend includes default_system / default_user_template in the
system-prompts API response so the frontend never duplicates defaults.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
curo1305
2026-04-17 15:17:55 +02:00
parent 1d01cc3b0e
commit bc7a74062d
3 changed files with 266 additions and 16 deletions
+3 -1
View File
@@ -179,7 +179,7 @@ SYSTEM_PROMPT_SERVICES: dict[str, str] = {
def load_all_system_prompts() -> dict:
"""Return {service_id: {label, system, user_template}} for all registered services."""
"""Return {service_id: {label, system, user_template, default_system, default_user_template}}."""
result: dict = {}
for service_id, label in SYSTEM_PROMPT_SERVICES.items():
config = load_service_config(service_id)
@@ -189,6 +189,8 @@ def load_all_system_prompts() -> dict:
"label": label,
"system": prompts.get("system", defaults["system"]),
"user_template": prompts.get("user_template", defaults["user_template"]),
"default_system": defaults["system"],
"default_user_template": defaults["user_template"],
}
return result