diff --git a/app/frontend/ui_callbacks.py b/app/frontend/ui_callbacks.py index dff6cbf..93c2d6e 100644 --- a/app/frontend/ui_callbacks.py +++ b/app/frontend/ui_callbacks.py @@ -23,12 +23,12 @@ def switch_to_editor_callback(note_payload): origin_fname = f"{note_payload['note_id']}.md" # 3. Message in den Chat-Verlauf injecten - # Diese Nachricht dient als Datencontainer für den Editor im "Manuellen Modus" + # WICHTIG: query_id muss mit 'edit_' beginnen, damit render_manual_editor sie erkennt! st.session_state.messages.append({ "role": "assistant", "intent": "INTERVIEW", "content": content, - "query_id": f"edit_{note_payload['note_id']}", + "query_id": f"edit_{note_payload['note_id']}", # Trigger für Erkennung "origin_filename": origin_fname, "origin_note_id": note_payload['note_id'] }) diff --git a/app/frontend/ui_editor.py b/app/frontend/ui_editor.py index 43acedc..29e37bd 100644 --- a/app/frontend/ui_editor.py +++ b/app/frontend/ui_editor.py @@ -68,11 +68,16 @@ def render_draft_editor(msg): # --- UI LAYOUT --- - # Header Info + # Header Info (Debug Pfad anzeigen, damit wir sicher sind) origin_fname = st.session_state.get(f"{key_base}_origin_filename") + if origin_fname: + # Dateiname extrahieren für saubere Anzeige display_name = str(origin_fname).split("/")[-1] - st.success(f"📂 **Update-Modus**: `{origin_fname}`") + st.success(f"📂 **Update-Modus**: `{display_name}`") + # Debugging: Zeige vollen Pfad im Tooltip oder klein darunter + with st.expander("Pfad-Details", expanded=False): + st.code(origin_fname) st.markdown(f'