Engr-Usman-Ali commited on
Commit
8988fb6
Β·
verified Β·
1 Parent(s): 55731be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
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 = {"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
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
  """,
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