aboutsummaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
authorTyler <tyler@tylerhoang.xyz>2026-05-17 00:24:43 -0700
committerTyler <tyler@tylerhoang.xyz>2026-05-17 00:24:43 -0700
commitfbf5bc37df61c0349647217cbbf0ad7a9d197fc5 (patch)
tree4a794a8ccd9eac74b00198073bff3975b9de043a /app.py
parent654b76c34d93f8d31b199afb84edb2742b26444a (diff)
Add QuoteTable as empty-state landing page
Renders watchlist tickers as a styled psm-card data table (Symbol, Sector, Last, Δ, % Day, Volume) when no ticker is selected. Falls back to the existing placeholder when the watchlist is empty. Uses the same JS hidden-input click pattern as the sidebar watchlist. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'app.py')
-rw-r--r--app.py37
1 files changed, 21 insertions, 16 deletions
diff --git a/app.py b/app.py
index 8145d03..c9f36a7 100644
--- a/app.py
+++ b/app.py
@@ -587,6 +587,7 @@ pio.templates.default = "prism"
from components.market_bar import render_market_bar
from components.top_movers import render_top_movers
from components.watchlist import render_watchlist
+from components.quotetable import render_quotetable
from components.overview import render_overview
from components.financials import render_financials
from components.valuation import render_valuation
@@ -765,22 +766,26 @@ st.divider()
# ── Main Content ──────────────────────────────────────────────────────────────
if not ticker:
- st.markdown("""
- <div style="padding:48px 0 32px;text-align:center;">
- <div style="
- font-family:'EB Garamond',Georgia,serif;
- font-style:italic;font-size:2.375rem;
- color:#F2ECDC;font-weight:400;
- letter-spacing:-0.01em;line-height:1.1;
- margin-bottom:12px;
- ">Search for a ticker to begin.</div>
- <div style="
- font-family:'IBM Plex Sans',sans-serif;
- font-size:0.875rem;color:#5E5849;
- letter-spacing:0.01em;
- ">Enter a company name or symbol in the sidebar.</div>
- </div>
- """, unsafe_allow_html=True)
+ _watchlist = st.session_state.get("watchlist", [])
+ if _watchlist:
+ render_quotetable(_watchlist)
+ else:
+ st.markdown("""
+ <div style="padding:48px 0 32px;text-align:center;">
+ <div style="
+ font-family:'EB Garamond',Georgia,serif;
+ font-style:italic;font-size:2.375rem;
+ color:#F2ECDC;font-weight:400;
+ letter-spacing:-0.01em;line-height:1.1;
+ margin-bottom:12px;
+ ">Search for a ticker to begin.</div>
+ <div style="
+ font-family:'IBM Plex Sans',sans-serif;
+ font-size:0.875rem;color:#5E5849;
+ letter-spacing:0.01em;
+ ">Enter a company name or symbol in the sidebar.</div>
+ </div>
+ """, unsafe_allow_html=True)
st.stop()
# ── Ticker Header + KPI Strip ─────────────────────────────────────────────────