Anpassung Options & Sidebar
This commit is contained in:
parent
b333121570
commit
699c3c1dba
@ -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()
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user