fix: placeholder picker improvements + insight display names (Issue #28)
Backend:
- get_placeholder_catalog(): grouped placeholders with descriptions
- Returns {category: [{key, description, example}]} format
- Categories: Profil, Körper, Ernährung, Training, Schlaf, Vitalwerte, Zeitraum
Frontend - Placeholder Picker:
- Grouped by category with visual separation
- Search/filter across keys and descriptions
- Hover effects for better UX
- Insert at cursor position (not at end)
- Shows: key + description + example value
- 'Keine Platzhalter gefunden' message when filtered
Frontend - Insight Display Names:
- InsightCard receives prompts array
- Finds matching prompt by scope/slug
- Shows prompt.display_name instead of hardcoded SLUG_LABELS
- History tab also shows display_name in group headers
- Fallback chain: display_name → SLUG_LABELS → scope
User-facing improvements:
✓ Platzhalter zeigen echte Daten statt Zahlen
✓ Durchsuchbar + filterbar
✓ Einfügen an Cursor-Position
✓ Insights zeigen custom Namen (z.B. '🍽️ Meine Ernährung')
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
0c4264de44
commit
5e7ef718e0
4 files changed
+208
-43
No files matched your search
@@ -17,7 +17,8 @@ from placeholder_resolver import (
|
||||
resolve_placeholders,
|
||||
get_unknown_placeholders,
|
||||
get_placeholder_example_values,
|
||||
get_available_placeholders
|
||||
get_available_placeholders,
|
||||
get_placeholder_catalog
|
||||
)
|
||||
|
||||
# Environment variables
|
||||
@@ -204,13 +205,13 @@ def preview_prompt(data: dict, session: dict=Depends(require_auth)):
|
||||
@router.get("/placeholders")
|
||||
def list_placeholders(session: dict=Depends(require_auth)):
|
||||
"""
|
||||
Get list of available placeholders with example values.
|
||||
Get grouped catalog of available placeholders with descriptions and examples.
|
||||
|
||||
Returns:
|
||||
Dict mapping placeholder to example value using current user's data
|
||||
Dict mapping category to list of {key, description, example}
|
||||
"""
|
||||
profile_id = session['profile_id']
|
||||
return get_placeholder_example_values(profile_id)
|
||||
return get_placeholder_catalog(profile_id)
|
||||
|
||||
|
||||
# ── KI-Assisted Prompt Engineering ───────────────────────────────────────────
|
||||
|
||||
Reference in new issue
Block a user