From 7033569bed877964523cddc9aa437bff7d30f7e5 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sat, 18 Jul 2026 15:50:57 +0200 Subject: [PATCH 1/2] feat(standard-menu): add unified-search-input size handling --- src/menus/StandardMenu.vue | 23 +++++++++++++++++------ src/scss/menu.scss | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/menus/StandardMenu.vue b/src/menus/StandardMenu.vue index 81b9ff9..5e81c80 100644 --- a/src/menus/StandardMenu.vue +++ b/src/menus/StandardMenu.vue @@ -62,8 +62,9 @@ along with this program. If not, see . { const appLimit = () => { const headerStart = document.querySelector('#header .header-start') const headerEnd = document.querySelector('#header .header-end') + const unifiedSearch = document.querySelector('#header .unified-search-input') const body = document.querySelector('body') - let size = (headerEnd ? headerEnd.offsetWidth : 0) + 70 + let totalWidth = body.offsetWidth + let otherElementsWidth = headerEnd ? headerEnd.offsetWidth : 0 + + if (unifiedSearch && headerEnd.offsetWidth < unifiedSearch.offsetWidth) { + otherElementsWidth = totalWidth - unifiedSearch.getBoundingClientRect().left + } + + let maxWidth = totalWidth - otherElementsWidth if (headerStart) { Array.from(headerStart.children).forEach((child) => { if (child.id !== 'app-menu-container') { - size += child.offsetWidth + maxWidth -= child.offsetWidth } }) } - return Math.max(0, Math.floor((body.offsetWidth - size) / 70)) + return Math.max(0, Math.floor(maxWidth / 70)) } const makeStyle = (app) => { @@ -161,8 +170,9 @@ const computeLists = () => { } const reComputeLists = (delay) => { - window.clearTimeout(resizeTimeout) - resizeTimeout = window.setTimeout(computeLists, delay || 100) + window.clearTimeout(resizeTimeout) + resizeTimeout = window.setTimeout(computeLists, delay || 100) + document.querySelector('html').classList.toggle('cm-standardmenu-popover', popoverAppList.value.length > 0) } onMounted(async () => { @@ -177,6 +187,7 @@ onMounted(async () => { setApps(await navStore.getCoreApps()) + reComputeLists(500) window.addEventListener('resize', reComputeLists) }) diff --git a/src/scss/menu.scss b/src/scss/menu.scss index 29685d2..21e5d6f 100644 --- a/src/scss/menu.scss +++ b/src/scss/menu.scss @@ -395,6 +395,16 @@ padding: 10px 0; } } + + #header { + .unified-search-input { + width: 80px !important; + + .unified-search-input__label { + display: none; + } + } + } } @media screen and (min-width: 1024px) { @@ -609,3 +619,11 @@ $header-icon-size: 20px; display: none; } } + +.cm-standardmenu-popover { + #header { + .unified-search-input:not(.unified-search-input--mobile) { + position: unset !important; + } + } +} From e81f0e4b76d9cd94b1360c690f9b36ddb6653113 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sat, 18 Jul 2026 15:52:34 +0200 Subject: [PATCH 2/2] doc: update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3605c3a..5f091f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +### Added + +- feat(standard-menu): add unified-search-input size handling + ### Fixed - fix(ui): only apply always-displayed display css rules when the menu is displayed