diff --git a/manual_trading_hub/static/app.css b/manual_trading_hub/static/app.css index 8630b61..4fbefe9 100644 --- a/manual_trading_hub/static/app.css +++ b/manual_trading_hub/static/app.css @@ -7982,7 +7982,9 @@ body.funds-fullscreen-open { color: var(--text); } .archive-quotes-panel, -.archive-main-panel { +.archive-main-panel, +.archive-viz-panel, +.archive-calendar-panel { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); @@ -8000,6 +8002,12 @@ body.funds-fullscreen-open { padding: 12px; overflow: visible; } +.archive-viz-panel.is-active, +.archive-calendar-panel.is-active { + gap: 10px; + padding: 12px; + overflow: visible; +} .archive-main-panel.is-active { gap: 10px; padding: 12px; @@ -8993,7 +9001,9 @@ body.funds-fullscreen-open { min-height: 0; } #page-archive .archive-quotes-panel, - #page-archive .archive-main-panel { + #page-archive .archive-main-panel, + #page-archive .archive-viz-panel, + #page-archive .archive-calendar-panel { flex: 0 0 auto; min-height: 0; max-height: none; diff --git a/manual_trading_hub/static/archive.js b/manual_trading_hub/static/archive.js index 9b9e8e0..402a8c7 100644 --- a/manual_trading_hub/static/archive.js +++ b/manual_trading_hub/static/archive.js @@ -35,6 +35,8 @@ const elQuoteContent = document.getElementById("archive-quote-content"); const elQuoteSubmit = document.getElementById("archive-quote-submit"); const elContentTabs = document.getElementById("archive-content-tabs"); + const elPanelViz = document.getElementById("archive-panel-viz"); + const elPanelCalendar = document.getElementById("archive-panel-calendar"); const elPanelTrades = document.getElementById("archive-panel-trades"); const elPanelQuotes = document.getElementById("archive-panel-quotes"); const elQuoteDayTradesMeta = document.getElementById("archive-quote-day-trades-meta"); @@ -559,8 +561,8 @@ if (elQuoteDate) elQuoteDate.value = day; if (elFilterSick) elFilterSick.checked = false; syncPeriodUI(); + setArchiveContentTab("trades"); void loadDailyTrades(); - if (archiveContentTab === "quotes") void loadQuoteDayTrades(); }, }); calendarWidget.ensureMonth(calendarRefDate()); @@ -968,9 +970,9 @@ } function setArchiveContentTab(tab) { - const next = tab === "quotes" ? "quotes" : "trades"; + const allowed = { viz: 1, calendar: 1, trades: 1, quotes: 1 }; + const next = allowed[tab] ? tab : "trades"; archiveContentTab = next; - const showQuotes = next === "quotes"; if (elContentTabs) { elContentTabs.querySelectorAll(".archive-content-tab").forEach(function (btn) { const on = btn.getAttribute("data-archive-tab") === next; @@ -978,18 +980,26 @@ btn.setAttribute("aria-selected", on ? "true" : "false"); }); } - if (elPanelTrades) { - elPanelTrades.classList.toggle("is-active", !showQuotes); - elPanelTrades.hidden = showQuotes; - } - if (elPanelQuotes) { - elPanelQuotes.classList.toggle("is-active", showQuotes); - elPanelQuotes.hidden = !showQuotes; - } - if (showQuotes) { + const panels = [ + [elPanelViz, "viz"], + [elPanelCalendar, "calendar"], + [elPanelTrades, "trades"], + [elPanelQuotes, "quotes"], + ]; + panels.forEach(function (pair) { + const el = pair[0]; + const key = pair[1]; + if (!el) return; + const on = key === next; + el.classList.toggle("is-active", on); + el.hidden = !on; + }); + if (next === "quotes") { syncQuoteDateFromTradingDay(false); void loadQuoteDayTrades(); - } else { + } else if (next === "calendar") { + void loadCalendar(); + } else if (next === "trades") { requestAnimationFrame(syncTradesLayout); } } diff --git a/manual_trading_hub/static/index.html b/manual_trading_hub/static/index.html index de7da2a..c181e9e 100644 --- a/manual_trading_hub/static/index.html +++ b/manual_trading_hub/static/index.html @@ -15,7 +15,7 @@ - + @@ -445,7 +445,7 @@