Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -32,27 +32,30 @@ if huggingface_api_key:
|
|
32 |
# Session State
|
33 |
# =======================
|
34 |
if "projects" not in st.session_state:
|
35 |
-
st.session_state.projects = {"
|
36 |
if "active_project" not in st.session_state:
|
37 |
-
st.session_state.active_project = "
|
38 |
|
39 |
|
40 |
# =======================
|
41 |
-
# Sidebar Project Manager
|
42 |
# =======================
|
43 |
st.sidebar.title("π Chats / Projects")
|
44 |
|
45 |
-
#
|
46 |
st.markdown(
|
47 |
"""
|
48 |
<style>
|
49 |
[data-testid="stSidebar"] {
|
50 |
-
|
|
|
|
|
|
|
51 |
height: 100vh !important;
|
|
|
|
|
52 |
}
|
53 |
-
[data-testid="
|
54 |
-
overflow-y: auto !important; /* Scroll only when hovered */
|
55 |
-
}
|
56 |
</style>
|
57 |
""",
|
58 |
unsafe_allow_html=True
|
|
|
32 |
# Session State
|
33 |
# =======================
|
34 |
if "projects" not in st.session_state:
|
35 |
+
st.session_state.projects = {"Chat 1": {"tab": "generate", "history": []}}
|
36 |
if "active_project" not in st.session_state:
|
37 |
+
st.session_state.active_project = "Chat 1"
|
38 |
|
39 |
|
40 |
# =======================
|
41 |
+
# Sidebar Project Manager (Fixed)
|
42 |
# =======================
|
43 |
st.sidebar.title("π Chats / Projects")
|
44 |
|
45 |
+
# π₯ Make sidebar fixed
|
46 |
st.markdown(
|
47 |
"""
|
48 |
<style>
|
49 |
[data-testid="stSidebar"] {
|
50 |
+
position: fixed !important;
|
51 |
+
top: 0;
|
52 |
+
left: 0;
|
53 |
+
bottom: 0;
|
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
|