Skip to content

Commit ac7b78a

Browse files
authored
fix(ui): use the MD3 window classes in access, console, maintenance and support (#1271)
* fix(ui): use the MD3 window classes in access, console, maintenance and support Replace the default Tailwind breakpoint prefixes with the medium: and large: window classes in the eight components of these folders. Add a class-level test per folder that rejects default breakpoint prefixes. Signed-off-by: TheMeinerLP <github@themeinerlp.dev> * fix(ui): follow the window class mapping of the design The design maps md: (768) to expanded: (840), not to medium: (600). The danger zone card of the system info page used medium:. Signed-off-by: TheMeinerLP <github@themeinerlp.dev> --------- Signed-off-by: TheMeinerLP <github@themeinerlp.dev>
1 parent a9c6583 commit ac7b78a

12 files changed

Lines changed: 158 additions & 22 deletions

File tree

‎reposilite-frontend/src/components/access/LdapPanel.vue‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ onMounted(load)
189189
<p class="md-body-medium text-on-surface-variant">
190190
The service account the server uses to search. Leave both empty to search anonymously.
191191
</p>
192-
<div class="grid gap-4 sm:grid-cols-2">
192+
<div class="grid gap-4 medium:grid-cols-2">
193193
<MdTextField
194194
id="ldap-bind-dn"
195195
v-model="form.bindDn"
@@ -216,7 +216,7 @@ onMounted(load)
216216
heading-id="ldap-users-title"
217217
aria-labelledby="ldap-users-title"
218218
>
219-
<div class="grid gap-4 sm:grid-cols-2">
219+
<div class="grid gap-4 medium:grid-cols-2">
220220
<MdTextField
221221
id="ldap-user-base"
222222
v-model="form.userBaseDn"
@@ -279,7 +279,7 @@ onMounted(load)
279279
A team whose external reference is <code>ldap:&lt;group&gt;</code> is synced from the groups
280280
of this directory: its members follow the group, and they cannot be removed by hand.
281281
</p>
282-
<div class="grid gap-4 sm:grid-cols-2">
282+
<div class="grid gap-4 medium:grid-cols-2">
283283
<MdTextField
284284
id="ldap-group-base"
285285
v-model="form.groupBaseDn"
@@ -351,7 +351,7 @@ onMounted(load)
351351
? 'Save your changes first. The test reads the saved directory.'
352352
: 'Connects with the saved settings. A user name and password also check that the user signs in.'"
353353
>
354-
<div class="grid gap-4 sm:grid-cols-2">
354+
<div class="grid gap-4 medium:grid-cols-2">
355355
<MdTextField
356356
id="ldap-test-username"
357357
v-model="testUsername"

‎reposilite-frontend/src/components/access/SsoProviderDialog.vue‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ const validateDomain = (text: string, existing: string[]) => {
225225
novalidate
226226
@submit.prevent="save()"
227227
>
228-
<div class="grid gap-4 sm:grid-cols-2">
228+
<div class="grid gap-4 medium:grid-cols-2">
229229
<MdTextField
230230
id="sso-id"
231231
v-model="form.id"
@@ -299,7 +299,7 @@ const validateDomain = (text: string, existing: string[]) => {
299299
</div>
300300
</MdCard>
301301

302-
<div class="grid gap-4 sm:grid-cols-2">
302+
<div class="grid gap-4 medium:grid-cols-2">
303303
<MdTextField
304304
id="sso-client-id"
305305
v-model="form.clientId"
@@ -385,7 +385,7 @@ const validateDomain = (text: string, existing: string[]) => {
385385
<template #summary>
386386
Advanced
387387
</template>
388-
<div class="grid gap-4 sm:grid-cols-2">
388+
<div class="grid gap-4 medium:grid-cols-2">
389389
<MdTextField
390390
id="sso-claim-username"
391391
v-model="form.usernameClaim"

‎reposilite-frontend/src/components/access/TeamParentsCard.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ const save = async () => {
293293
data-test="parents-empty"
294294
/>
295295

296-
<div class="flex flex-col gap-2 sm:flex-row sm:items-start">
296+
<div class="flex flex-col gap-2 medium:flex-row medium:items-start">
297297
<div class="relative min-w-0 flex-1">
298298
<MdTextField
299299
:id="inputId"
@@ -323,7 +323,7 @@ const save = async () => {
323323
</div>
324324
<MdButton
325325
variant="outlined"
326-
class="shrink-0 self-start sm:mt-2"
326+
class="shrink-0 self-start medium:mt-2"
327327
:disabled="trimmed === ''"
328328
data-test="add-parent"
329329
@click="add(text)"

‎reposilite-frontend/src/components/access/nodes/NodeAddField.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const onFocus = () => {
132132

133133
<template>
134134
<div
135-
class="flex flex-col gap-2 sm:flex-row sm:items-start"
135+
class="flex flex-col gap-2 medium:flex-row medium:items-start"
136136
data-ingot-component="node-add-field"
137137
>
138138
<div class="relative min-w-0 flex-1">
@@ -165,7 +165,7 @@ const onFocus = () => {
165165
</div>
166166
<MdButton
167167
variant="tonal"
168-
class="shrink-0 self-start sm:mt-2"
168+
class="shrink-0 self-start medium:mt-2"
169169
:disabled="!canAdd"
170170
data-test="add-node"
171171
@click="submit"

‎reposilite-frontend/src/components/access/nodes/NodeEditor.vue‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ const stateWord = (allowed: boolean): string => (allowed ? 'Allow' : 'Deny')
219219

220220
<div
221221
v-if="nodes.length > 0"
222-
class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between"
222+
class="flex flex-col gap-3 medium:flex-row medium:items-start medium:justify-between"
223223
>
224224
<MdTextField
225225
v-model="query"
@@ -228,12 +228,12 @@ const stateWord = (allowed: boolean): string => (allowed ? 'Allow' : 'Deny')
228228
type="search"
229229
autocomplete="off"
230230
spellcheck="false"
231-
class="sm:max-w-sm"
231+
class="medium:max-w-sm"
232232
/>
233-
<div class="flex flex-col gap-3 sm:flex-row sm:items-start">
233+
<div class="flex flex-col gap-3 medium:flex-row medium:items-start">
234234
<div
235235
v-if="!readonly"
236-
class="w-full sm:w-56"
236+
class="w-full medium:w-56"
237237
>
238238
<SegmentedControl label="Filter by state">
239239
<SegmentedOption
@@ -259,7 +259,7 @@ const stateWord = (allowed: boolean): string => (allowed ? 'Allow' : 'Deny')
259259
</SegmentedOption>
260260
</SegmentedControl>
261261
</div>
262-
<div class="w-full sm:w-48">
262+
<div class="w-full medium:w-48">
263263
<SegmentedControl label="View">
264264
<SegmentedOption
265265
:on="view === 'list'"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2026 OneLiteFeather
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { describe, expect, it } from 'vitest'
18+
19+
const sources = import.meta.glob<string>(['./*.vue', './nodes/*.vue', './check/*.vue'], { query: '?raw', import: 'default', eager: true })
20+
21+
// The default Tailwind breakpoints (640, 768, 1024, 1280 and 1536 pixels) are not used by the dashboard, which follows
22+
// the MD3 window classes medium:, expanded:, large: and xlarge: instead.
23+
const defaultBreakpoint = /(?:^|[\s"'`:!([-])(?:sm|md|lg|xl|2xl):[\w[]/
24+
25+
describe('access window classes', () => {
26+
it('finds the single file components of the folder', () => {
27+
expect(Object.keys(sources).length, 'single file components found').toBeGreaterThan(0)
28+
})
29+
30+
it.each(Object.entries(sources))('%s uses no default Tailwind breakpoint prefix', (path, source) => {
31+
const offending = source.split('\n').filter((line) => defaultBreakpoint.test(line))
32+
expect(offending, `${path} lines with a default breakpoint prefix`).toEqual([])
33+
})
34+
})

‎reposilite-frontend/src/components/console/ConsoleView.vue‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ const SEND_ICON = 'M120-160v-640l760 320-760 320Zm80-120 474-200-474-200v140l240
203203

204204
<template>
205205
<div data-ingot-component="console-view">
206-
<div class="flex w-full flex-col gap-3 pb-3 xl:flex-row xl:items-start xl:justify-between">
207-
<div class="w-full xl:mr-5 xl:w-1/2">
206+
<div class="flex w-full flex-col gap-3 pb-3 large:flex-row large:items-start large:justify-between">
207+
<div class="w-full large:mr-5 large:w-1/2">
208208
<MdTextField
209209
v-model="filter"
210210
label="Filter log output"
@@ -214,7 +214,7 @@ const SEND_ICON = 'M120-160v-640l760 320-760 320Zm80-120 474-200-474-200v140l240
214214
<div
215215
role="group"
216216
aria-label="Log levels"
217-
class="flex w-full flex-row flex-wrap items-center gap-2 xl:w-1/2 xl:justify-end"
217+
class="flex w-full flex-row flex-wrap items-center gap-2 large:w-1/2 large:justify-end"
218218
>
219219
<MdChip
220220
v-for="entry in levels"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2026 OneLiteFeather
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { describe, expect, it } from 'vitest'
18+
19+
const sources = import.meta.glob<string>(['./*.vue'], { query: '?raw', import: 'default', eager: true })
20+
21+
// The default Tailwind breakpoints (640, 768, 1024, 1280 and 1536 pixels) are not used by the dashboard, which follows
22+
// the MD3 window classes medium:, expanded:, large: and xlarge: instead.
23+
const defaultBreakpoint = /(?:^|[\s"'`:!([-])(?:sm|md|lg|xl|2xl):[\w[]/
24+
25+
describe('console window classes', () => {
26+
it('finds the single file components of the folder', () => {
27+
expect(Object.keys(sources).length, 'single file components found').toBeGreaterThan(0)
28+
})
29+
30+
it.each(Object.entries(sources))('%s uses no default Tailwind breakpoint prefix', (path, source) => {
31+
const offending = source.split('\n').filter((line) => defaultBreakpoint.test(line))
32+
expect(offending, `${path} lines with a default breakpoint prefix`).toEqual([])
33+
})
34+
})

‎reposilite-frontend/src/components/maintenance/IndexPanel.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ onBeforeUnmount(stopPolling)
280280
data-state
281281
>{{ stateLabel }}</span>
282282
</p>
283-
<dl class="grid grid-cols-1 gap-x-6 gap-y-3 sm:grid-cols-2 md-body-medium">
283+
<dl class="grid grid-cols-1 gap-x-6 gap-y-3 medium:grid-cols-2 md-body-medium">
284284
<div class="flex flex-col">
285285
<dt class="text-on-surface-variant">
286286
Lag behind storage
@@ -433,7 +433,7 @@ onBeforeUnmount(stopPolling)
433433
Latest runs
434434
</h3>
435435
<ul
436-
class="grid gap-3 sm:grid-cols-2"
436+
class="grid gap-3 medium:grid-cols-2"
437437
aria-label="Latest index runs"
438438
>
439439
<MdCard
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2026 OneLiteFeather
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { describe, expect, it } from 'vitest'
18+
19+
const sources = import.meta.glob<string>(['./*.vue'], { query: '?raw', import: 'default', eager: true })
20+
21+
// The default Tailwind breakpoints (640, 768, 1024, 1280 and 1536 pixels) are not used by the dashboard, which follows
22+
// the MD3 window classes medium:, expanded:, large: and xlarge: instead.
23+
const defaultBreakpoint = /(?:^|[\s"'`:!([-])(?:sm|md|lg|xl|2xl):[\w[]/
24+
25+
describe('maintenance window classes', () => {
26+
it('finds the single file components of the folder', () => {
27+
expect(Object.keys(sources).length, 'single file components found').toBeGreaterThan(0)
28+
})
29+
30+
it.each(Object.entries(sources))('%s uses no default Tailwind breakpoint prefix', (path, source) => {
31+
const offending = source.split('\n').filter((line) => defaultBreakpoint.test(line))
32+
expect(offending, `${path} lines with a default breakpoint prefix`).toEqual([])
33+
})
34+
})

0 commit comments

Comments
 (0)