BAI-30: fix dashboard header layout

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
GSC-CODEX
2026-08-07 15:38:30 +08:00
co-authored by multica-agent
parent 24d645b77c
commit cea991cbdd
4 changed files with 44 additions and 11 deletions
+8 -2
View File
@@ -30,6 +30,7 @@ function animateView(view, { initial = false } = {}) {
return;
}
const selectors = [
".dashboard-head > *",
".page-heading > *",
".metric-card",
".period-ribbon",
@@ -159,6 +160,8 @@ function showView(view) {
});
const title = $("#currentViewName");
if (title) title.textContent = viewNames[view];
const topbar = $(".topbar[data-home-view]");
topbar?.classList.toggle("is-home-view", topbar.dataset.homeView === view);
closeNavigation({ restoreFocus: navigationWasOpen });
const activeView = $(`.app-view[data-page="${view}"]`);
requestAnimationFrame(() => animateView(activeView));
@@ -243,13 +246,16 @@ function initShell() {
$$("[data-toast]").forEach((button) => button.addEventListener("click", () => showToast(button.dataset.toast)));
$(".nav-item[data-view].is-active")?.setAttribute("aria-current", "page");
$("#globalSearch")?.addEventListener("input", (event) => {
$$(".global-search").forEach((search) => search.addEventListener("input", (event) => {
$$(".global-search").forEach((peer) => {
if (peer !== event.target) peer.value = event.target.value;
});
const view = $(`.app-view[data-page="${state.currentView}"]`);
const query = event.target.value.trim().toLowerCase();
$$(".data-table tbody tr, .company-ledger, .notification-list article, .account-directory article", view).forEach((item) => {
item.hidden = query ? !item.textContent.toLowerCase().includes(query) : false;
});
});
}));
document.addEventListener("click", (event) => {
if ($("#sidebar")?.classList.contains("is-open") && !event.target.closest("#sidebar") && !event.target.closest("#menuButton")) closeNavigation({ restoreFocus: true });