Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -32,17 +32,17 @@ if huggingface_api_key:
|
|
32 |
# Session State
|
33 |
# =======================
|
34 |
if "projects" not in st.session_state:
|
35 |
-
st.session_state.projects = {"Chat
|
36 |
if "active_project" not in st.session_state:
|
37 |
-
st.session_state.active_project = "Chat
|
38 |
|
39 |
|
40 |
# =======================
|
41 |
-
# Sidebar Project Manager (Fixed)
|
42 |
# =======================
|
43 |
st.sidebar.title("π Chats / Projects")
|
44 |
|
45 |
-
# π₯
|
46 |
st.markdown(
|
47 |
"""
|
48 |
<style>
|
@@ -54,8 +54,14 @@ st.markdown(
|
|
54 |
height: 100vh !important;
|
55 |
overflow-y: auto !important; /* scroll if too many chats */
|
56 |
padding-bottom: 2rem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
-
[data-testid="stSidebarNav"] {display: none;} /* remove default nav spacing */
|
59 |
</style>
|
60 |
""",
|
61 |
unsafe_allow_html=True
|
@@ -88,6 +94,7 @@ with st.sidebar:
|
|
88 |
st.session_state.active_project = new_name
|
89 |
st.rerun()
|
90 |
|
|
|
91 |
# =======================
|
92 |
# Sidebar API Settings
|
93 |
# =======================
|
|
|
32 |
# Session State
|
33 |
# =======================
|
34 |
if "projects" not in st.session_state:
|
35 |
+
st.session_state.projects = {"Default Chat": {"tab": "generate", "history": []}}
|
36 |
if "active_project" not in st.session_state:
|
37 |
+
st.session_state.active_project = "Default Chat"
|
38 |
|
39 |
|
40 |
# =======================
|
41 |
+
# Sidebar Project Manager (Fixed + Independent Scroll)
|
42 |
# =======================
|
43 |
st.sidebar.title("π Chats / Projects")
|
44 |
|
45 |
+
# π₯ CSS fix: sidebar fixed + main content shifted
|
46 |
st.markdown(
|
47 |
"""
|
48 |
<style>
|
|
|
54 |
height: 100vh !important;
|
55 |
overflow-y: auto !important; /* scroll if too many chats */
|
56 |
padding-bottom: 2rem;
|
57 |
+
width: 300px !important; /* fixed sidebar width */
|
58 |
+
}
|
59 |
+
[data-testid="stSidebarNav"] {display: none;} /* remove extra nav space */
|
60 |
+
|
61 |
+
/* shift main content so itβs not hidden under sidebar */
|
62 |
+
.main {
|
63 |
+
margin-left: 300px !important;
|
64 |
}
|
|
|
65 |
</style>
|
66 |
""",
|
67 |
unsafe_allow_html=True
|
|
|
94 |
st.session_state.active_project = new_name
|
95 |
st.rerun()
|
96 |
|
97 |
+
|
98 |
# =======================
|
99 |
# Sidebar API Settings
|
100 |
# =======================
|