Update app.py
Browse files
app.py
CHANGED
@@ -675,22 +675,28 @@ def project_view_page():
|
|
675 |
st.metric(label="Total Files", value=file_count)
|
676 |
st.metric(label="Lines of Code", value=total_lines)
|
677 |
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
st.rerun()
|
682 |
|
683 |
-
|
684 |
-
st.
|
685 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
686 |
|
687 |
# Toggle file structure display (if required)
|
688 |
if "show_file_structure" not in st.session_state:
|
689 |
st.session_state.show_file_structure = False
|
690 |
|
691 |
-
if st.button("Show File Structure"):
|
692 |
-
st.session_state.show_file_structure = not st.session_state.show_file_structure
|
693 |
-
|
694 |
if st.session_state.show_file_structure:
|
695 |
user_folder = os.path.join("user_projects", st.session_state.username)
|
696 |
project_folder = os.path.join(user_folder, st.session_state.current_project)
|
@@ -699,7 +705,7 @@ def project_view_page():
|
|
699 |
|
700 |
for root, dirs, files in os.walk(project_folder):
|
701 |
level = root.replace(project_folder, "").count(os.sep)
|
702 |
-
indent = "
|
703 |
|
704 |
if level == 0:
|
705 |
st.write(f"📂 {os.path.basename(root)}")
|
|
|
675 |
st.metric(label="Total Files", value=file_count)
|
676 |
st.metric(label="Lines of Code", value=total_lines)
|
677 |
|
678 |
+
# Buttons for documentation functionality (side-by-side)
|
679 |
+
st.write("### Actions")
|
680 |
+
col1, col2, col3 = st.columns(3)
|
|
|
681 |
|
682 |
+
with col1:
|
683 |
+
if st.button("Generate Documentation"):
|
684 |
+
st.session_state.page = "generate_documentation"
|
685 |
+
st.rerun()
|
686 |
+
|
687 |
+
with col2:
|
688 |
+
if st.button("Saved Documentation"):
|
689 |
+
st.session_state.page = "saved_documentation"
|
690 |
+
st.rerun()
|
691 |
+
|
692 |
+
with col3:
|
693 |
+
if st.button("Show File Structure"):
|
694 |
+
st.session_state.show_file_structure = not st.session_state.show_file_structure
|
695 |
|
696 |
# Toggle file structure display (if required)
|
697 |
if "show_file_structure" not in st.session_state:
|
698 |
st.session_state.show_file_structure = False
|
699 |
|
|
|
|
|
|
|
700 |
if st.session_state.show_file_structure:
|
701 |
user_folder = os.path.join("user_projects", st.session_state.username)
|
702 |
project_folder = os.path.join(user_folder, st.session_state.current_project)
|
|
|
705 |
|
706 |
for root, dirs, files in os.walk(project_folder):
|
707 |
level = root.replace(project_folder, "").count(os.sep)
|
708 |
+
indent = "->" * 4 * level
|
709 |
|
710 |
if level == 0:
|
711 |
st.write(f"📂 {os.path.basename(root)}")
|