From 93ac635835cfa61cabb20f1cd94ecc6bb0ce9706 Mon Sep 17 00:00:00 2001 From: Ulas Kalayci Date: Sun, 26 Apr 2026 23:13:55 +0200 Subject: [PATCH] feat(nav): show active secondary module name on More button When navigating to a secondary module (Budget, Recipes, Contacts, Settings), the More button now displays the module's label and icon instead of "More". This provides clearer navigation feedback to the user. Co-Authored-By: Claude Sonnet 4.6 --- public/router.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/public/router.js b/public/router.js index 865b5b7..60fa990 100644 --- a/public/router.js +++ b/public/router.js @@ -706,9 +706,22 @@ function updateNav(path) { const moreBtn = document.querySelector('#more-btn'); if (moreBtn) { - const inMoreSheet = navItems().slice(PRIMARY_NAV).some((n) => n.path === path); + const secondaryItems = navItems().slice(PRIMARY_NAV); + const activeSecondary = secondaryItems.find((n) => n.path === path); + const inMoreSheet = !!activeSecondary; + moreBtn.classList.toggle('nav-item--active', inMoreSheet); moreBtn.toggleAttribute('aria-current', inMoreSheet); + + const moreBtnLabel = moreBtn.querySelector('.nav-item__label'); + const moreBtnIcon = moreBtn.querySelector('.nav-item__icon'); + + if (moreBtnLabel) { + moreBtnLabel.textContent = activeSecondary ? activeSecondary.label : t('nav.more'); + } + if (moreBtnIcon) { + moreBtnIcon.dataset.lucide = activeSecondary ? activeSecondary.icon : 'grid-2x2'; + } } if (window.lucide) {