Dmitry Beresnev commited on
Commit
444359f
Β·
1 Parent(s): a6e7f4a

fix news dashboard

Browse files
Files changed (1) hide show
  1. app/pages/05_Dashboard.py +63 -6
app/pages/05_Dashboard.py CHANGED
@@ -354,9 +354,28 @@ with col1:
354
  height="700px"
355
  )
356
  elif not twitter_df.empty or not reddit_df.empty:
357
- st.info("πŸ“­ No Twitter/Reddit news matches your current filters.")
 
 
 
 
 
 
358
  else:
359
- st.info("⏳ Fetching Twitter & Reddit news... This may take 30-60 seconds on first load.")
 
 
 
 
 
 
 
 
 
 
 
 
 
360
 
361
  with col2:
362
  # SECTION 2: Main Page News (Web-Scraped)
@@ -370,9 +389,28 @@ with col2:
370
  height="700px"
371
  )
372
  elif not rss_main_df.empty:
373
- st.info("πŸ“­ No main page news matches your filters.")
 
 
 
 
 
 
374
  else:
375
- st.info("⏳ Main page news will appear here...")
 
 
 
 
 
 
 
 
 
 
 
 
 
376
 
377
  with col3:
378
  # SECTION 3: RSS Feed News
@@ -386,9 +424,28 @@ with col3:
386
  height="700px"
387
  )
388
  elif not rss_all_df.empty:
389
- st.info("πŸ“­ No RSS news matches your current filters.")
 
 
 
 
 
 
390
  else:
391
- st.info("⏳ RSS feed news will appear here...")
 
 
 
 
 
 
 
 
 
 
 
 
 
392
 
393
  # Auto-refresh logic
394
  if auto_refresh:
 
354
  height="700px"
355
  )
356
  elif not twitter_df.empty or not reddit_df.empty:
357
+ st.markdown("""
358
+ <div style="background: linear-gradient(135deg, #1E222D 0%, #131722 100%); border: 1px solid #2A2E39; border-radius: 8px; padding: 30px; text-align: center;">
359
+ <div style="font-size: 48px; margin-bottom: 16px;">πŸ“­</div>
360
+ <div style="color: #D1D4DC; font-size: 16px; font-weight: 600; margin-bottom: 8px;">No matches found</div>
361
+ <div style="color: #787B86; font-size: 13px;">Try adjusting your filters to see Twitter/X & Reddit news</div>
362
+ </div>
363
+ """, unsafe_allow_html=True)
364
  else:
365
+ st.markdown("""
366
+ <div style="background: linear-gradient(135deg, #1E222D 0%, #131722 100%); border: 1px solid #2A2E39; border-radius: 8px; padding: 30px; text-align: center;">
367
+ <div style="font-size: 48px; margin-bottom: 16px; animation: pulse 2s ease-in-out infinite;">⏳</div>
368
+ <div style="color: #D1D4DC; font-size: 16px; font-weight: 600; margin-bottom: 8px;">Loading Twitter/X & Reddit News</div>
369
+ <div style="color: #787B86; font-size: 13px;">Fetching real-time news from premium sources...</div>
370
+ <div style="color: #787B86; font-size: 12px; margin-top: 8px; opacity: 0.7;">This may take 30-60 seconds on first load</div>
371
+ </div>
372
+ <style>
373
+ @keyframes pulse {
374
+ 0%, 100% { opacity: 1; transform: scale(1); }
375
+ 50% { opacity: 0.6; transform: scale(1.1); }
376
+ }
377
+ </style>
378
+ """, unsafe_allow_html=True)
379
 
380
  with col2:
381
  # SECTION 2: Main Page News (Web-Scraped)
 
389
  height="700px"
390
  )
391
  elif not rss_main_df.empty:
392
+ st.markdown("""
393
+ <div style="background: linear-gradient(135deg, #1E222D 0%, #131722 100%); border: 1px solid #2A2E39; border-radius: 8px; padding: 30px; text-align: center;">
394
+ <div style="font-size: 48px; margin-bottom: 16px;">πŸ“­</div>
395
+ <div style="color: #D1D4DC; font-size: 16px; font-weight: 600; margin-bottom: 8px;">No matches found</div>
396
+ <div style="color: #787B86; font-size: 13px;">Try adjusting your filters to see top headlines</div>
397
+ </div>
398
+ """, unsafe_allow_html=True)
399
  else:
400
+ st.markdown("""
401
+ <div style="background: linear-gradient(135deg, #1E222D 0%, #131722 100%); border: 1px solid #2A2E39; border-radius: 8px; padding: 30px; text-align: center;">
402
+ <div style="font-size: 48px; margin-bottom: 16px; animation: pulse 2s ease-in-out infinite;">⏳</div>
403
+ <div style="color: #D1D4DC; font-size: 16px; font-weight: 600; margin-bottom: 8px;">Loading Top Headlines</div>
404
+ <div style="color: #787B86; font-size: 13px;">Fetching latest news from major outlets...</div>
405
+ <div style="color: #787B86; font-size: 12px; margin-top: 8px; opacity: 0.7;">Web scraping main pages</div>
406
+ </div>
407
+ <style>
408
+ @keyframes pulse {
409
+ 0%, 100% { opacity: 1; transform: scale(1); }
410
+ 50% { opacity: 0.6; transform: scale(1.1); }
411
+ }
412
+ </style>
413
+ """, unsafe_allow_html=True)
414
 
415
  with col3:
416
  # SECTION 3: RSS Feed News
 
424
  height="700px"
425
  )
426
  elif not rss_all_df.empty:
427
+ st.markdown("""
428
+ <div style="background: linear-gradient(135deg, #1E222D 0%, #131722 100%); border: 1px solid #2A2E39; border-radius: 8px; padding: 30px; text-align: center;">
429
+ <div style="font-size: 48px; margin-bottom: 16px;">πŸ“­</div>
430
+ <div style="color: #D1D4DC; font-size: 16px; font-weight: 600; margin-bottom: 8px;">No matches found</div>
431
+ <div style="color: #787B86; font-size: 13px;">Try adjusting your filters to see RSS feed news</div>
432
+ </div>
433
+ """, unsafe_allow_html=True)
434
  else:
435
+ st.markdown("""
436
+ <div style="background: linear-gradient(135deg, #1E222D 0%, #131722 100%); border: 1px solid #2A2E39; border-radius: 8px; padding: 30px; text-align: center;">
437
+ <div style="font-size: 48px; margin-bottom: 16px; animation: pulse 2s ease-in-out infinite;">⏳</div>
438
+ <div style="color: #D1D4DC; font-size: 16px; font-weight: 600; margin-bottom: 8px;">Loading RSS Feed</div>
439
+ <div style="color: #787B86; font-size: 13px;">Aggregating news from all RSS sources...</div>
440
+ <div style="color: #787B86; font-size: 12px; margin-top: 8px; opacity: 0.7;">Bloomberg, Reuters, FT, WSJ & more</div>
441
+ </div>
442
+ <style>
443
+ @keyframes pulse {
444
+ 0%, 100% { opacity: 1; transform: scale(1); }
445
+ 50% { opacity: 0.6; transform: scale(1.1); }
446
+ }
447
+ </style>
448
+ """, unsafe_allow_html=True)
449
 
450
  # Auto-refresh logic
451
  if auto_refresh: