Anpassung Options & Sidebar

This commit is contained in:
Irina Rueegg 2026-03-27 15:56:15 +01:00
parent b333121570
commit 699c3c1dba
2 changed files with 23 additions and 18 deletions

View File

@ -8,18 +8,9 @@ sys.path.insert(0, str(Path(__file__).parent.parent))
from frontend.sidebar import render_sidebar
from frontend.editor import render_editor
from frontend.chat import render_chat
from frontend.state import init_state
def init_state():
"""Initialize session state variables."""
if "selected_file" not in st.session_state:
st.session_state.selected_file = None
if "file_content" not in st.session_state:
st.session_state.file_content = ""
if "chat_history" not in st.session_state:
st.session_state.chat_history = []
if "code_output" not in st.session_state:
st.session_state.code_output = ""
init_state()
def main():
@ -37,13 +28,13 @@ def main():
choice = render_sidebar()
with right:
if choice == "Chat with AI Assistant":
if "Chat with AI Assistant" in choice:
render_chat()
elif choice == "Code Editor":
if "Code Editor" in choice:
render_editor()
elif choice == "File Explorer":
st.subheader("File Explorer")
st.info("File Explorer functionality is not implemented yet.")
#elif choice == "File Explorer":
# st.subheader("File Explorer")
# st.info("File Explorer functionality is not implemented yet.")
if __name__ == "__main__":
main()

View File

@ -3,8 +3,22 @@ import streamlit as st
def render_sidebar():
st.sidebar.title("Navigation")
options = ["Chat with AI Assistant", "Code Editor", "File Explorer"]
choice = st.sidebar.radio("Go to:", options)
navigation_section = st.sidebar.container()
file_explorer_section = st.sidebar.container()
with navigation_section:
options = ["Code Editor", "Chat with AI Assistant"]
choice = []
for option in options:
if st.sidebar.checkbox(option):
choice.append(option)
with file_explorer_section:
st.sidebar.subheader("File Explorer")
st.sidebar.info("File Explorer functionality is not implemented yet.")
# selected_file = st.sidebar.file_uploader("Upload a file", type=["py", "txt", "md"])
return choice