aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler <tyler@tylerhoang.xyz>2026-03-30 18:05:04 -0700
committerTyler <tyler@tylerhoang.xyz>2026-03-30 18:05:04 -0700
commitfde921603425de36c6cbf583f1ec0e2f2ce034cb (patch)
treecaf24e29266a17ab61e7b858c6cb323996f8462a
parentbfa2ad1e839b88313a2abeae26ddcd7e9beacd85 (diff)
Remove default ticker and quick-pick buttons on launch
App now starts with no ticker selected and shows a prompt to search, avoiding unnecessary API calls on startup. Removed the AAPL/MSFT/NVDA/JPM quick-pick buttons from the sidebar. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rw-r--r--app.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/app.py b/app.py
index b1638cd..57e0161 100644
--- a/app.py
+++ b/app.py
@@ -66,7 +66,7 @@ from services.data_service import get_company_info, search_tickers
if "ticker" not in st.session_state:
- st.session_state["ticker"] = "AAPL"
+ st.session_state["ticker"] = None
# ── Sidebar ──────────────────────────────────────────────────────────────────
@@ -106,20 +106,16 @@ with st.sidebar:
if submitted and selected_symbol:
st.session_state["ticker"] = selected_symbol
- st.caption(f"Currently viewing: **{st.session_state['ticker']}**")
-
- quick_cols = st.columns(4)
- for col, symbol in zip(quick_cols, ["AAPL", "MSFT", "NVDA", "JPM"]):
- if col.button(symbol, use_container_width=True):
- st.session_state["ticker"] = symbol
+ if st.session_state["ticker"]:
+ st.caption(f"Currently viewing: **{st.session_state['ticker']}**")
ticker = st.session_state["ticker"]
# Quick company info in sidebar
st.divider()
- with st.spinner(""):
+ if ticker:
info = get_company_info(ticker)
- if info:
+ if ticker and info:
st.caption(info.get("longName", ticker))
st.caption(f"Exchange: {info.get('exchange', '—')}")
st.caption(f"Currency: {info.get('currency', 'USD')}")
@@ -140,6 +136,10 @@ st.divider()
# ── Main Content ──────────────────────────────────────────────────────────────
+if not ticker:
+ st.info("Search for a company or ticker in the sidebar to get started.")
+ st.stop()
+
tab_overview, tab_financials, tab_valuation, tab_insiders, tab_filings, tab_news = st.tabs([
"📈 Overview",
"📊 Financials",