feat: display_name + placeholder picker for prompts (Issue #28)
Migration 018:
- Add display_name column to ai_prompts
- Migrate existing prompts from hardcoded SLUG_LABELS
- Fallback: name if display_name is NULL
Backend:
- PromptCreate/Update models with display_name field
- create/update/duplicate endpoints handle display_name
- Fallback: use name if display_name not provided
Frontend:
- PromptEditModal: display_name input field
- Placeholder picker: button + dropdown with all placeholders
- Shows example values, inserts {{placeholder}} on click
- Analysis.jsx: use display_name instead of SLUG_LABELS
User-facing changes:
- Prompts now show custom display names (e.g. '🍽️ Ernährung')
- Admin can edit display names instead of hardcoded labels
- Template editor has 'Platzhalter einfügen' button
- No more hardcoded SLUG_LABELS in frontend
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
7a8a5aee98
commit
0c4264de44
5 files changed
+133
-11
No files matched your search
@@ -134,6 +134,7 @@ class AdminProfileUpdate(BaseModel):
|
||||
class PromptCreate(BaseModel):
|
||||
name: str
|
||||
slug: str
|
||||
display_name: Optional[str] = None
|
||||
description: Optional[str] = None
|
||||
template: str
|
||||
category: str = 'ganzheitlich'
|
||||
@@ -143,6 +144,7 @@ class PromptCreate(BaseModel):
|
||||
|
||||
class PromptUpdate(BaseModel):
|
||||
name: Optional[str] = None
|
||||
display_name: Optional[str] = None
|
||||
description: Optional[str] = None
|
||||
template: Optional[str] = None
|
||||
category: Optional[str] = None
|
||||
|
||||
Reference in new issue
Block a user