Skip to content

Commit 954839f

Browse files
pringelmannbackportbot[bot]
authored andcommitted
fix(core): collapse settings entries to 'Settings' in current-app trigger
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
1 parent 8a84c44 commit 954839f

1 file changed

Lines changed: 27 additions & 20 deletions

File tree

core/src/components/AppMenu.vue

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
aria-hidden="true">
6363
</template>
6464
<span class="app-menu__current-app-name">
65-
{{ currentApp.name }}
65+
{{ displayName }}
6666
</span>
6767
</NcButton>
6868
</nav>
@@ -160,11 +160,23 @@ export default defineComponent({
160160
?? Object.values(this.settingsList).find((entry) => entry.active && !SETTINGS_ACTION_IDS.has(entry.id))
161161
},
162162
163-
// aria-label overrides the inner span text, so the section name
163+
// Trigger label. Settings sub-section names ("Personal info",
164+
// "Appearance and accessibility", ...) are too long and varied to
165+
// surface in the header; collapse them all to a single "Settings".
166+
displayName(): string {
167+
if (!this.currentApp) {
168+
return ''
169+
}
170+
return this.currentApp.type === 'settings'
171+
? t('core', 'Settings')
172+
: this.currentApp.name
173+
},
174+
175+
// aria-label overrides the inner span text, so the displayed name
164176
// has to be duplicated here for screen readers.
165177
currentAppLabel(): string {
166178
return this.currentApp
167-
? t('core', 'Open apps menu, currently in {app}', { app: this.currentApp.name })
179+
? t('core', 'Open apps menu, currently in {app}', { app: this.displayName })
168180
: t('core', 'Open apps menu')
169181
},
170182
@@ -452,23 +464,18 @@ export default defineComponent({
452464
}
453465
454466
&__current-app-name {
455-
// Hidden by default so the icon-only trigger fits alongside the
456-
// centered search input. The button's aria-label still announces the
457-
// section name. At wide viewports we restore the label with a
458-
// truncation cap as a safety net for long localized names.
459-
display: none;
460-
461-
@media only screen and (min-width: 1400px) {
462-
display: inline-block;
463-
vertical-align: middle;
464-
font-size: var(--default-font-size);
465-
font-weight: 500;
466-
white-space: nowrap;
467-
letter-spacing: -0.5px;
468-
overflow: hidden;
469-
text-overflow: ellipsis;
470-
max-width: clamp(160px, 18vw, 360px);
471-
}
467+
// inline-block: inline elements ignore max-width + overflow.
468+
display: inline-block;
469+
vertical-align: middle;
470+
font-size: var(--default-font-size);
471+
font-weight: 500;
472+
white-space: nowrap;
473+
letter-spacing: -0.5px;
474+
overflow: hidden;
475+
text-overflow: ellipsis;
476+
// Cap width so long localized labels ellipsize instead of pushing
477+
// the header icons off-screen (.header-start doesn't shrink).
478+
max-width: clamp(80px, 22vw, 320px);
472479
}
473480
474481
&__popover {

0 commit comments

Comments
 (0)