From e693ba30f35ce944e34e1761ec59c6df2995d358 Mon Sep 17 00:00:00 2001 From: Deep Koluguri Date: Fri, 15 May 2026 15:47:49 -0400 Subject: [PATCH] new updates --- dashboard.css | 26 ++++++++++++++++++++++++-- dashboard.html | 2 +- dashboard.js | 44 +++++++++++++++++++++++++++++--------------- 3 files changed, 54 insertions(+), 18 deletions(-) diff --git a/dashboard.css b/dashboard.css index 1a5b680..61e4c58 100644 --- a/dashboard.css +++ b/dashboard.css @@ -172,9 +172,22 @@ } .patient-identity h1 { - font-size: 2.8rem; + font-size: clamp(1.75rem, 4vw, 2.8rem); font-family: 'Outfit', sans-serif; - color: #0F172A; + color: var(--text-main); + line-height: 1.2; +} + +.patient-identity h1 small { + font-size: 0.45em; + font-weight: 500; + color: var(--text-muted); +} + +.ai-nudge-box p { + color: var(--text-muted); + font-size: 0.9rem; + line-height: 1.5; } .action-center { @@ -280,6 +293,15 @@ text-align: center; } +/* Doctor role: hide reception/admin chrome */ +.dashboard-body.role-doctor .dash-header { + display: none; +} + +.dashboard-body.role-doctor .dashboard-main { + padding-top: 2rem; +} + /* --- Dashboard page layout & components --- */ .dash-header { display: flex; diff --git a/dashboard.html b/dashboard.html index 6942f7d..0457d99 100644 --- a/dashboard.html +++ b/dashboard.html @@ -427,6 +427,6 @@ - + diff --git a/dashboard.js b/dashboard.js index b43251e..8259b62 100644 --- a/dashboard.js +++ b/dashboard.js @@ -38,19 +38,17 @@ document.addEventListener("DOMContentLoaded", () => { // Apply Role-Based Filtering if (userRole === 'DOCTOR') { + document.body.classList.add('role-doctor'); + document.querySelectorAll('.side-nav a').forEach(link => { const text = link.innerText; if (text.includes('Billing') || text.includes('Staff') || text.includes('Overview')) { link.style.display = 'none'; } }); - - // Hide Admin Top Bar elements - const adminElements = ['.search-box', '.top-actions', '.btn-primary']; - adminElements.forEach(selector => { - const el = document.querySelector(selector); - if (el && !el.closest('.workspace-actions')) el.style.display = 'none'; - }); + + if (roleDisplay) roleDisplay.innerText = 'Dr. Sharma'; + if (emailDisplay) emailDisplay.innerText = userEmail; showSection('zen'); } else { @@ -113,7 +111,11 @@ window.showSection = (sectionId) => { document.querySelectorAll('.side-nav a').forEach(link => { link.classList.remove('active'); - if (link.innerText.toLowerCase().includes(sectionId)) link.classList.add('active'); + if (sectionId === 'zen' && link.innerText.includes('Queue')) { + link.classList.add('active'); + } else if (link.innerText.toLowerCase().includes(sectionId)) { + link.classList.add('active'); + } }); }; @@ -211,19 +213,31 @@ window.switchPatientContext = (name, token, triage) => { if (data.summary) document.getElementById("aiSummaryCard").classList.remove("hidden"); else document.getElementById("aiSummaryCard").classList.add("hidden"); - document.querySelector(".current-patient h1").innerHTML = `${name} (32y, Female)`; - document.querySelector(".patient-meta").innerHTML = `${token}${triage}00:00`; + const patientHeading = document.querySelector(".patient-identity h1"); + if (patientHeading) patientHeading.innerHTML = `${name} (32y, Female)`; + + const metaPills = document.querySelectorAll(".patient-identity .meta-pills"); + if (metaPills[1]) { + metaPills[1].innerHTML = ` + ${token} + ${triage} + `; + } }; // 5. Global Helpers & Modal Handlers window.openHistory = () => { - const name = document.querySelector(".current-patient h1").innerText.split(' (')[0]; + const heading = document.querySelector(".patient-identity h1"); + const name = heading ? heading.innerText.split(' (')[0] : 'Patient'; alert(`📂 Loading History for ${name}...\n\n- Visit (05/12/26): Chronic Gastritis`); }; window.openConsultation = () => { - document.getElementById("rxDiagnosis").value = document.querySelector(".patient-meta").innerText.split(' • ')[1] || ""; - modal.style.display = "block"; + const triagePills = document.querySelectorAll(".patient-identity .meta-pills .pill.time"); + const triage = triagePills[triagePills.length - 1]; + const rxField = document.getElementById("rxDiagnosis"); + if (rxField && triage) rxField.value = triage.innerText; + if (modal) modal.classList.add('open'); }; window.shareSummary = () => alert("📤 Summary sent to Patient's WhatsApp."); @@ -234,5 +248,5 @@ window.toggleSidebar = () => { }; // Global Listeners -if (closeModal) closeModal.onclick = () => modal.style.display = "none"; -window.onclick = (e) => { if (e.target == modal) modal.style.display = "none"; }; +if (closeModal) closeModal.onclick = () => modal.classList.remove('open'); +window.onclick = (e) => { if (e.target == modal) modal.classList.remove('open'); };