Nipun Claude commited on
Commit
2c04b84
·
1 Parent(s): 9c6a431

Major UI overhaul to follow mockup design

Browse files

Critical layout fixes:
- Fix processing indicator with proper gradient background and container
- Move footer to absolute bottom of page below all content
- Dramatically reduce excessive spacing throughout interface
- Improve visual hierarchy with tighter margins and padding

Mockup alignment:
- Better processing message styling matching design
- Fixed footer positioning (no longer above chat input)
- Reduced header separator margins
- Enhanced CSS for better space utilization

Space optimization:
- Reduced main container padding to 0.5rem top
- Added element spacing controls
- Better sidebar spacing management
- More professional and compact appearance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

Files changed (1) hide show
  1. app.py +28 -17
app.py CHANGED
@@ -40,11 +40,21 @@ st.markdown("""
40
 
41
  /* Reduce main container padding */
42
  .main .block-container {
43
- padding-top: 1rem;
44
- padding-bottom: 1rem;
45
  max-width: 100%;
46
  }
47
 
 
 
 
 
 
 
 
 
 
 
48
  /* Sidebar */
49
  [data-testid="stSidebar"] {
50
  background-color: #f8f9fa;
@@ -143,13 +153,12 @@ st.markdown("""
143
  .processing-indicator {
144
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
145
  color: #333;
146
- padding: 15px 20px;
147
- border-radius: 20px 20px 20px 5px;
148
- margin: 10px 0;
149
  margin-left: 0;
150
  margin-right: auto;
151
- max-width: 80%;
152
- position: relative;
153
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
154
  animation: pulse 2s infinite;
155
  }
@@ -515,7 +524,7 @@ with header_col2:
515
  label_visibility="collapsed"
516
  )
517
 
518
- st.markdown("<hr style='margin: 0.5rem 0; border: none; border-top: 1px solid #e2e8f0;'>", unsafe_allow_html=True)
519
 
520
 
521
  # Load data with error handling
@@ -672,12 +681,14 @@ def show_custom_response(response):
672
  return {"is_image": False}
673
 
674
  def show_processing_indicator(model_name, question):
675
- """Show processing indicator"""
676
  st.markdown(f"""
677
- <div class='processing-indicator'>
678
- <div class='assistant-info'>VayuChat • Processing with {model_name}</div>
679
- <strong>Question:</strong> {question}<br>
680
- <em>Generating response...</em>
 
 
681
  </div>
682
  """, unsafe_allow_html=True)
683
 
@@ -843,10 +854,10 @@ if st.session_state.get("processing"):
843
  feedbacks_given = len([r for r in st.session_state.get("responses", []) if r.get("role") == "assistant" and "feedback" in r])
844
  st.metric("Feedbacks Given", feedbacks_given)
845
 
846
- # Minimal footer
847
- st.markdown("---")
848
  st.markdown("""
849
- <div style='text-align: center; padding: 0.5rem; font-size: 0.75rem; color: #6b7280;'>
850
  © 2024 IIT Gandhinagar Sustainability Lab
851
  </div>
852
- """, unsafe_allow_html=True)
 
 
40
 
41
  /* Reduce main container padding */
42
  .main .block-container {
43
+ padding-top: 0.5rem;
44
+ padding-bottom: 3rem;
45
  max-width: 100%;
46
  }
47
 
48
+ /* Remove excessive spacing */
49
+ .element-container {
50
+ margin-bottom: 0.5rem !important;
51
+ }
52
+
53
+ /* Fix sidebar spacing */
54
+ [data-testid="stSidebar"] .element-container {
55
+ margin-bottom: 0.25rem !important;
56
+ }
57
+
58
  /* Sidebar */
59
  [data-testid="stSidebar"] {
60
  background-color: #f8f9fa;
 
153
  .processing-indicator {
154
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
155
  color: #333;
156
+ padding: 1rem 1.5rem;
157
+ border-radius: 12px;
158
+ margin: 1rem 0;
159
  margin-left: 0;
160
  margin-right: auto;
161
+ max-width: 70%;
 
162
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
163
  animation: pulse 2s infinite;
164
  }
 
524
  label_visibility="collapsed"
525
  )
526
 
527
+ st.markdown("<hr style='margin: 0.25rem 0; border: none; border-top: 1px solid #e2e8f0;'>", unsafe_allow_html=True)
528
 
529
 
530
  # Load data with error handling
 
681
  return {"is_image": False}
682
 
683
  def show_processing_indicator(model_name, question):
684
+ """Show processing indicator with gradient like mockup"""
685
  st.markdown(f"""
686
+ <div style='display: flex; justify-content: flex-start; margin: 1rem 0;'>
687
+ <div class='processing-indicator'>
688
+ <div style='font-size: 0.875rem; color: #6b7280; margin-bottom: 5px;'>VayuChat • Processing with {model_name}</div>
689
+ <strong>Question:</strong> {question}<br>
690
+ <em>Generating response...</em>
691
+ </div>
692
  </div>
693
  """, unsafe_allow_html=True)
694
 
 
854
  feedbacks_given = len([r for r in st.session_state.get("responses", []) if r.get("role") == "assistant" and "feedback" in r])
855
  st.metric("Feedbacks Given", feedbacks_given)
856
 
857
+ # Footer at absolute bottom
 
858
  st.markdown("""
859
+ <div style='position: fixed; bottom: 0; left: 0; right: 0; background: white; border-top: 1px solid #e2e8f0; text-align: center; padding: 0.5rem; font-size: 0.7rem; color: #6b7280; z-index: 1000;'>
860
  © 2024 IIT Gandhinagar Sustainability Lab
861
  </div>
862
+ """, unsafe_allow_html=True)
863
+