Skip to content

Commit f80e3d9

Browse files
committed
fix: Resolve UnboundLocalError in dashboard view and remove duplicate code
1 parent 3ac77e3 commit f80e3d9

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

frontend/views/dashboard_view.py

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def render_dashboard():
2121

2222
# ... (Lines 22-37 omitted) ...
2323

24+
# Create layout for Tips & Notifications
25+
col_a, col_b = st.columns(2)
26+
2427
with col_a:
2528
st.subheader("💡 AI Health Tips")
2629
st.markdown("""
@@ -43,6 +46,8 @@ def render_dashboard():
4346
</div>
4447
""", unsafe_allow_html=True)
4548

49+
st.markdown("---")
50+
4651
st.subheader("📈 My Health Trends")
4752
records = api.fetch_records()
4853
if records:
@@ -52,28 +57,3 @@ def render_dashboard():
5257
with tab3: charts.render_trend_chart(records, "total_bilirubin", "Bilirubin")
5358
else:
5459
st.info("No test results found. Visit your specialist to upload new diagnostic data.")
55-
56-
st.markdown("---")
57-
col_a, col_b = st.columns(2)
58-
59-
with col_a:
60-
st.subheader("💡 AI Health Tips")
61-
st.markdown("""
62-
<div style="background: rgba(15, 23, 42, 0.6); padding: 1rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05);">
63-
<p style="color: #cbd5e1; font-size: 0.9rem;">Based on your recent activity:</p>
64-
<ul style="color: #94A3B8; margin-bottom: 0;">
65-
<li><b>Heart Health:</b> Your BMI is stable. Keep walking 30 mins/day.</li>
66-
<li><b>Diet:</b> Limit sugar intake before your next glucose test.</li>
67-
<li><b>Hydration:</b> Drink 2L water daily to support liver function.</li>
68-
</ul>
69-
</div>
70-
""", unsafe_allow_html=True)
71-
72-
with col_b:
73-
st.subheader("🔔 Notifications")
74-
st.markdown("""
75-
<div style="background: rgba(15, 23, 42, 0.6); padding: 1rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05);">
76-
<div style="font-size: 0.9rem; margin-bottom: 0.5rem; color: #cbd5e1;"><b>Next Appointment:</b> No upcoming visits.</div>
77-
<div style="font-size: 0.9rem; color: #cbd5e1;"><b>Report Status:</b> All reports are up to date.</div>
78-
</div>
79-
""", unsafe_allow_html=True)

0 commit comments

Comments
 (0)