aboutsummaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
authorTyler <tyler@tylerhoang.xyz>2026-05-17 01:24:31 -0700
committerTyler <tyler@tylerhoang.xyz>2026-05-17 01:24:31 -0700
commit039d09f5cfb8862c6601501f5d80e87f5d5eb7b5 (patch)
tree631b00ab7d6d260fcf8adc9a1009ad6e8b169691 /app.py
parent3920b4df983b89a752591ee61d7dd655f5d09f9c (diff)
parentf013bf1243c191b8d6d23db1f144cb2f7270d063 (diff)
Merge branch 'feature/topbar-phase1'
Diffstat (limited to 'app.py')
-rw-r--r--app.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/app.py b/app.py
index 073d629..87a6716 100644
--- a/app.py
+++ b/app.py
@@ -791,6 +791,27 @@ with st.container(key="market_bar_sticky"):
st.divider()
+# ── ⌘K / Ctrl+K shortcut — focuses sidebar ticker search ─────────────────────
+components.html(
+ "<script>"
+ "document.addEventListener('keydown', function(e) {"
+ " if (e.key === '/' && !e.metaKey && !e.ctrlKey && !e.altKey"
+ " && document.activeElement.tagName !== 'INPUT'"
+ " && document.activeElement.tagName !== 'TEXTAREA') {"
+ " var inputs = window.parent.document.querySelectorAll('input');"
+ " for (var i = 0; i < inputs.length; i++) {"
+ " if (inputs[i].placeholder && inputs[i].placeholder.indexOf('AAPL') > -1) {"
+ " e.preventDefault();"
+ " inputs[i].focus(); inputs[i].select(); break;"
+ " }"
+ " }"
+ " }"
+ "});"
+ "</script>",
+ height=0,
+ scrolling=False,
+)
+
# ── Main Content ──────────────────────────────────────────────────────────────
if st.session_state["active_tab"] == "macro":