feat(ui): make app header full-width and move Doctor into header controls

- Drop the fixed max-width on .header-container so the header spans the
  viewport while the card grid keeps its own content width
- Keep header icon click targets at 32px at all breakpoints and add
  role/tabindex/aria-label plus Enter/Space activation
- Relocate the Doctor trigger from the page toolbar to the header icon
  group (also available on the statistics page and in the hamburger
  menu), removing the now-unused .doctor-trigger styles
This commit is contained in:
Will Miao
2026-09-12 09:28:16 +08:00
parent 6d3f82976f
commit fe160134d0
5 changed files with 61 additions and 50 deletions
+19
View File
@@ -49,6 +49,18 @@ export class HeaderManager {
initializeCommonElements() {
this.initializeThemePopover();
// Header icon buttons are divs with role="button"; make Enter/Space activate them
const headerControls = document.getElementById('headerControls');
if (headerControls) {
headerControls.addEventListener('keydown', (e) => {
if (e.key !== 'Enter' && e.key !== ' ') return;
const target = e.target.closest('[role="button"]');
if (!target || !headerControls.contains(target)) return;
e.preventDefault();
target.click();
});
}
const settingsToggle = document.querySelector('.settings-toggle');
if (settingsToggle) {
settingsToggle.addEventListener('click', () => {
@@ -295,6 +307,13 @@ export class HeaderManager {
case 'notifications':
updateService.toggleUpdateModal();
break;
case 'doctor': {
const doctorToggle = document.getElementById('doctorTriggerBtn');
if (doctorToggle) {
doctorToggle.click();
}
break;
}
case 'support':
if (window.modalManager) {
window.modalManager.toggleModal('supportModal');