From 5fc66d4d1a72e70307afcf8060898f5ea3900b91 Mon Sep 17 00:00:00 2001 From: Irina Rueegg Date: Fri, 10 Apr 2026 15:06:20 +0200 Subject: [PATCH] Chat ui --- frontend/chat.py | 14 ++++++-------- frontend/sidebar.py | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/frontend/chat.py b/frontend/chat.py index c23fdfa..c39f4f5 100644 --- a/frontend/chat.py +++ b/frontend/chat.py @@ -6,7 +6,8 @@ from backend.managers.system_prompter import SystemPrompter # ── Agent Mode helpers ──────────────────────────────────────────────────────── def _start_agent(task: str): - """Initialise a fresh CodingAgent, start the task, and propose the first action.""" + """Initialise a fresh CodingAgent, start the task, + and propose the first action.""" from backend.agent.coding_agent import CodingAgent agent = CodingAgent() agent.start_task(task) @@ -18,7 +19,8 @@ def _start_agent(task: str): def _approve_action(): - """Execute the pending action, append it to the log, then propose the next step.""" + """Execute the pending action, + append it to the log, then propose the next step.""" agent = st.session_state.coding_agent pending = st.session_state.agent_pending_action @@ -158,7 +160,6 @@ def render_agent_mode(): def render_normal_chat(): chat_section = st.container() - setup_section = st.container() with chat_section: if st.session_state.chat_history: @@ -172,9 +173,9 @@ def render_normal_chat(): st.session_state.chat_input = "" st.session_state._clear_chat_input = False - user_input = st.text_input("Type your message here:", key="chat_input") + user_input = st.text_input("Type your message here:", key="chat_input", placeholder="Ask me anything or give me a task to do!", use_container_width=True) - if st.button("Send", key="send_button") and user_input: + if st.button("Send", key="send_button", use_container_width=True) and user_input: chat_manager = st.session_state.chat_manager # Inject system prompt on the first message @@ -193,9 +194,6 @@ def render_normal_chat(): st.session_state._clear_chat_input = True st.rerun() - with setup_section: - st.info("This is where you can set up your AI assistant. For now, this section is just a placeholder.") - st.toggle("Use debug system prompt", key="use_system_prompt", value=True) # ── Entry point ─────────────────────────────────────────────────────────────── diff --git a/frontend/sidebar.py b/frontend/sidebar.py index a824f09..8cc1975 100644 --- a/frontend/sidebar.py +++ b/frontend/sidebar.py @@ -179,7 +179,7 @@ def render_sidebar(): folder_rel = st.session_state.selected_folder_rel with st.container(border=True): - st.caption(f"📁 {folder_name}") + st.write(f"**Folder actions:** 📁 {folder_name}") if st.button("Add File", key="btn_add_file_in_folder", use_container_width=True): _add_file_dialog(folder_rel) if st.button("Add Folder", key="btn_add_folder_in_folder", use_container_width=True): @@ -188,7 +188,7 @@ def render_sidebar(): _delete_folder_dialog(folder_rel, folder_name) with add_more: - with st.popover("⚙️ Explorer Options", key="popover_options"): + with st.popover("⚙️ Explorer Options", key="popover_options", use_container_width=True): if st.button("Add File", key="btn_add_file", use_container_width=True): _add_file_dialog("")