Skip to content

Commit b4b4c55

Browse files
committed
fix(core): subdue the More apps and App store tiles, mark active
Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Jan C. Borchardt <925062+jancborchardt@users.noreply.github.com>
1 parent a6cc367 commit b4b4c55

4 files changed

Lines changed: 36 additions & 3 deletions

File tree

core/src/components/AppIcon.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,16 @@ $bevel:
9393
}
9494
}
9595
96+
// Utility entries ("More apps", "App store") stay subdued: a plain circle
97+
// with the icon in the same muted color as the label.
9698
&--outlined {
9799
background: transparent;
98100
background-image: none;
99-
box-shadow: inset 0 0 0 2px var(--color-border-maxcontrast);
101+
box-shadow: inset 0 0 0 2px var(--color-border);
100102
}
101103
102104
&--outlined &__img {
103-
background-color: var(--color-main-text);
105+
background-color: var(--color-text-maxcontrast);
104106
background-image: none;
105107
}
106108
}

core/src/components/AppItem.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
class="app-item"
99
:class="{
1010
'app-item--active': app.active,
11+
'app-item--outlined': outlined,
1112
}"
1213
:href="app.href"
1314
:target="newTab ? '_blank' : undefined"
@@ -125,5 +126,10 @@ const unreadLabel = computed(() => {
125126
&--active &__label {
126127
font-weight: bold;
127128
}
129+
130+
// Utility entries ("More apps", "App store") are subdued, they are not apps.
131+
&--outlined &__label {
132+
color: var(--color-text-maxcontrast);
133+
}
128134
}
129135
</style>

core/src/components/AppMenu.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ const SETTINGS_ACTION_IDS = new Set(['logout'])
9696
9797
const SETTINGS_SECTION_IDS = new Set(['settings_personal', 'settings_administration', 'accessibility_settings'])
9898
99+
// Entry of the app management page, the target of the "More apps" tile.
100+
const APP_MANAGEMENT_ID = 'appstore'
101+
99102
export default defineComponent({
100103
name: 'AppMenu',
101104
@@ -205,7 +208,9 @@ export default defineComponent({
205208
// utility tile is "More apps" (local app management) for admins and
206209
// "App store" (apps.nextcloud.com) for everyone else.
207210
gridItems(): INavigationEntry[] {
208-
const tail = this.isAdmin ? this.moreAppsEntry : this.appStoreEntry
211+
const tail = this.isAdmin
212+
? { ...this.moreAppsEntry, active: this.currentApp?.id === APP_MANAGEMENT_ID }
213+
: this.appStoreEntry
209214
return [...this.appList, tail]
210215
},
211216
},

core/src/tests/components/AppMenu.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,26 @@ describe('core: AppMenu', () => {
137137
expect(moreApps).toBeTruthy()
138138
})
139139

140+
it('marks the "More apps" tile active on the app management page', async () => {
141+
auth.getCurrentUser.mockReturnValue({ isAdmin: true })
142+
initialState.loadState.mockImplementation((_a: string, key: string, fallback: unknown) => {
143+
if (key === 'apps') {
144+
return [makeApp({ id: 'files', name: 'Files', active: false })]
145+
}
146+
if (key === 'settingsNavEntries') {
147+
return { appstore: makeApp({ id: 'appstore', name: 'Apps', type: 'settings', href: '/settings/apps', active: true }) }
148+
}
149+
return fallback
150+
})
151+
const wrapper = mount(AppMenu, { attachTo: document.body })
152+
await openPopover(wrapper)
153+
154+
const moreApps = Array.from(document.querySelectorAll('[role="menuitem"]'))
155+
.find((el) => el.textContent?.includes('More apps'))
156+
expect(moreApps?.classList.contains('app-item--active')).toBe(true)
157+
expect(moreApps?.getAttribute('aria-current')).toBe('page')
158+
})
159+
140160
it('ArrowRight moves the roving stop from index 0 to index 1 and focuses it', async () => {
141161
initialState.loadState.mockImplementation((_a: string, key: string, fallback: unknown) => key === 'apps' ? eightApps() : fallback)
142162
const wrapper = mount(AppMenu, { attachTo: document.body })

0 commit comments

Comments
 (0)