diff --git a/docker-compose.yml b/docker-compose.yml index 41895f6..5cf8587 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: pediatric-scribe: - image: danielonyejesi/pediatric-ai-scribe-v3:v1.2 + image: danielonyejesi/pediatric-ai-scribe-v3:v1.3 ports: - "3552:3000" env_file: diff --git a/public/js/app.js b/public/js/app.js index 93ec882..2935bd9 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -5,18 +5,31 @@ document.addEventListener('DOMContentLoaded', function() { // --- TAB NAVIGATION --- + function activateTab(tabName) { + var btn = document.querySelector('.tab-btn[data-tab="' + tabName + '"]'); + if (!btn || btn.classList.contains('hidden')) return false; + document.querySelectorAll('.tab-btn').forEach(function(b) { b.classList.remove('active'); }); + document.querySelectorAll('.tab-content').forEach(function(c) { c.classList.remove('active'); }); + btn.classList.add('active'); + var tabEl = document.getElementById(tabName + '-tab'); + if (tabEl) tabEl.classList.add('active'); + window.location.hash = tabName; + document.dispatchEvent(new CustomEvent('tabChanged', { detail: { tab: tabName } })); + return true; + } + document.querySelectorAll('.tab-btn').forEach(function(btn) { btn.addEventListener('click', function() { - document.querySelectorAll('.tab-btn').forEach(function(b) { b.classList.remove('active'); }); - document.querySelectorAll('.tab-content').forEach(function(c) { c.classList.remove('active'); }); - btn.classList.add('active'); - var tabId = btn.getAttribute('data-tab') + '-tab'; - var tabEl = document.getElementById(tabId); - if (tabEl) tabEl.classList.add('active'); - document.dispatchEvent(new CustomEvent('tabChanged', { detail: { tab: btn.getAttribute('data-tab') } })); + activateTab(btn.getAttribute('data-tab')); }); }); + // Restore tab from URL hash on load + var hash = window.location.hash.replace('#', ''); + if (!hash || !activateTab(hash)) { + activateTab('encounter'); // default + } + // --- MODEL SELECTOR --- var modelSelect = document.getElementById('global-model-select'); var costBadge = document.getElementById('model-cost-badge');