Engr-Usman-Ali commited on
Commit
7c0f9c0
·
verified ·
1 Parent(s): 9976ba7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -15
app.py CHANGED
@@ -38,29 +38,20 @@ if "active_project" not in st.session_state:
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>
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
- 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
  """,
@@ -94,7 +85,6 @@ with st.sidebar:
94
  st.session_state.active_project = new_name
95
  st.rerun()
96
 
97
-
98
  # =======================
99
  # Sidebar API Settings
100
  # =======================
 
38
 
39
 
40
  # =======================
41
+ # Sidebar Project Manager
42
  # =======================
43
  st.sidebar.title("📂 Chats / Projects")
44
 
45
+ # Sidebar only scrolls when hovered
46
  st.markdown(
47
  """
48
  <style>
49
  [data-testid="stSidebar"] {
50
+ overflow-y: hidden !important; /* No scroll by default */
 
 
 
51
  height: 100vh !important;
 
 
 
52
  }
53
+ [data-testid="stSidebar"]:hover {
54
+ overflow-y: auto !important; /* Scroll only when hovered */
 
 
 
55
  }
56
  </style>
57
  """,
 
85
  st.session_state.active_project = new_name
86
  st.rerun()
87
 
 
88
  # =======================
89
  # Sidebar API Settings
90
  # =======================