From 3216a9a5f6a277584480fcbba5ba7ba267393793 Mon Sep 17 00:00:00 2001 From: Livio Meuli Date: Thu, 28 May 2026 11:25:52 +0200 Subject: [PATCH] fix Merge Confict --- frontend/chat.py | 55 ++++++++++++------------------------------------ 1 file changed, 13 insertions(+), 42 deletions(-) diff --git a/frontend/chat.py b/frontend/chat.py index 872b7d9..6e8fc34 100644 --- a/frontend/chat.py +++ b/frontend/chat.py @@ -476,11 +476,19 @@ def render_normal_chat(): st.toggle("Agent Mode", key="agent_mode") with col_settings: with st.popover("⚙️ Settings", use_container_width=True): - st.toggle( - "Include current file as context", - key="include_file_context", - value=True, - ) + current_file = st.session_state.get("active_file") + if current_file: + st.toggle( + f"Include current file as context: **{Path(current_file).name}**", + key="include_file_context", + value=True, + ) + else: + st.toggle( + "Include current file as context", + key="include_file_context", + value=True, + ) st.divider() @@ -593,43 +601,6 @@ def render_normal_chat(): st.session_state.chat_history.append({"role": "assistant", "content": ai_response}) st.rerun() - # 5d — Clear Chat opens a confirmation dialog instead of deleting immediately. - if st.button("🗑️ Clear Chat"): - _clear_chat_dialog() - - # Toggle to switch to Agent Mode (render_normal_chat and render_agent_mode are - # mutually exclusive, so the same key here causes no DuplicateWidgetID conflict). - st.toggle("Agent Mode", key="agent_mode") - - # 5h — Settings expander: file context toggle, model, token limit, custom prompt. - with st.expander("⚙️ Settings", expanded=False): - current_file = st.session_state.get("active_file") - if current_file: - st.toggle(f"Include current file as context: **{Path(current_file).name}**", key="include_file_context", value=True) - - - st.divider() - - default_model = chat_manager.model or "" - model_options = [default_model] if default_model else [] - - st.selectbox("Model", model_options, key="selected_model") - - st.slider( - "Max Response Tokens", - min_value=256, max_value=8000, - value=chat_manager.max_tokens, - step=256, key="chat_max_tokens", - ) - - st.divider() - - st.text_area( - "Custom System Prompt (overrides default if set)", - key="custom_system_prompt", - height=120, - placeholder="Leave empty to use the default assistant prompt with optional file context.", - ) # ── Entry point ───────────────────────────────────────────────────────────────