Skip to content

Commit f452cc1

Browse files
authored
fix(ui): give code text the code roles instead of font-mono (#1339)
* fix(ui): give code text the code roles instead of font-mono Ten components wrote font-mono beside a body role. They now take md-code-small or md-code-medium, whichever matches the old text size, and leave the pending list of the code-role test and the style-gate baseline. Signed-off-by: TheMeinerLP <github@themeinerlp.dev> * fix(ui): keep monospace text whose size has no code role yet Signed-off-by: TheMeinerLP <github@themeinerlp.dev> --------- Signed-off-by: TheMeinerLP <github@themeinerlp.dev>
1 parent 46da541 commit f452cc1

8 files changed

Lines changed: 8 additions & 26 deletions

File tree

‎reposilite-frontend/src/components/audit/AuditEventRow.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('AuditEventRow actor', () => {
7878
const addressElement = row.find('[data-test="actor-address"]')
7979
expect(addressElement.attributes('title'), 'full address on hover').toBe(address)
8080
expect(addressElement.classes(), 'long addresses are cut with an ellipsis').toContain('truncate')
81-
expect(addressElement.classes(), 'the address is monospaced').toContain('font-mono')
81+
expect(addressElement.classes(), 'the address is in the small code role').toContain('md-code-small')
8282
expect(addressElement.element.parentElement!.classList.contains('flex'), 'the address line is its own block').toBe(true)
8383
})
8484

‎reposilite-frontend/src/components/audit/AuditEventRow.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const attempts = computed(() => (props.event.occurrences > 1 ? `${props.event.oc
7171
>
7272
<span class="shrink-0">from</span>
7373
<span
74-
class="min-w-0 truncate font-mono"
74+
class="min-w-0 truncate md-code-small"
7575
:title="event.actorAddress"
7676
data-test="actor-address"
7777
>{{ event.actorAddress }}</span>

‎reposilite-frontend/src/components/identity/SecretOnceDialog.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('SecretOnceDialog', () => {
5959
const input = dialog().querySelector('input[readonly]') as HTMLInputElement
6060

6161
expect(input.value).toBe(SECRET)
62-
expect(input.className, 'a secret is easier to compare in a monospace face').toContain('font-mono')
62+
expect(input.className, 'a secret is easier to compare in a monospace face').toContain('md-code-medium')
6363
})
6464

6565
it('warns that the secret will not be shown again', () => {

‎reposilite-frontend/src/components/identity/SecretOnceDialog.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const copySnippet = async (snippet: Snippet) => {
132132
aria-label="Token secret"
133133
spellcheck="false"
134134
autocomplete="off"
135-
class="md-focus-ring min-w-0 flex-1 rounded-corner-small border border-outline bg-surface-container-highest px-3 py-3 font-mono text-sm text-on-surface"
135+
class="md-focus-ring min-w-0 flex-1 rounded-corner-small border border-outline bg-surface-container-highest px-3 py-3 md-code-medium text-on-surface"
136136
@focus="selectAll"
137137
>
138138
<MdButton
@@ -175,7 +175,7 @@ const copySnippet = async (snippet: Snippet) => {
175175
</div>
176176
<pre
177177
:data-snippet="snippet.key"
178-
class="mt-1 overflow-x-auto rounded-corner-small border border-outline-variant bg-surface-container-highest px-3 py-3 font-mono text-xs text-on-surface"
178+
class="mt-1 overflow-x-auto rounded-corner-small border border-outline-variant bg-surface-container-highest px-3 py-3 md-code-small text-on-surface"
179179
>{{ snippet.text }}</pre>
180180
</div>
181181
</section>

‎reposilite-frontend/src/components/settings/RepositoryWizard.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ const onModalUpdate = (open: boolean) => {
876876
</p>
877877
<code
878878
data-test="address"
879-
class="break-all rounded-corner-small bg-surface-container-lowest p-3 font-mono md-body-small text-on-surface"
879+
class="break-all rounded-corner-small bg-surface-container-lowest p-3 md-code-small text-on-surface"
880880
>{{ addressOf }}</code>
881881
</section>
882882

@@ -912,7 +912,7 @@ const onModalUpdate = (open: boolean) => {
912912
</div>
913913
<pre
914914
:data-snippet="snippet.key"
915-
class="whitespace-pre-wrap break-words rounded-corner-small bg-surface-container-lowest p-3 font-mono md-body-small text-on-surface"
915+
class="whitespace-pre-wrap break-words rounded-corner-small bg-surface-container-lowest p-3 md-code-small text-on-surface"
916916
>{{ snippet.text(snippets) }}</pre>
917917
</div>
918918
</section>

‎reposilite-frontend/src/components/support/SystemInfoView.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ onMounted(() => {
320320
<template #summary>
321321
Input arguments
322322
</template>
323-
<ul class="font-mono text-sm">
323+
<ul class="md-code-medium">
324324
<li
325325
v-for="argument in info.jvm.inputArguments"
326326
:key="argument"

‎reposilite-frontend/src/style-gate/baseline/non-md3-default.json‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,6 @@
4949
"match": "text-xs",
5050
"count": 1
5151
},
52-
{
53-
"file": "src/components/identity/SecretOnceDialog.vue",
54-
"match": "text-sm",
55-
"count": 1
56-
},
57-
{
58-
"file": "src/components/identity/SecretOnceDialog.vue",
59-
"match": "text-xs",
60-
"count": 1
61-
},
6252
{
6353
"file": "src/components/layout/SkipLink.vue",
6454
"match": "focus:z-50",
@@ -84,11 +74,6 @@
8474
"match": "z-40",
8575
"count": 1
8676
},
87-
{
88-
"file": "src/components/support/SystemInfoView.vue",
89-
"match": "text-sm",
90-
"count": 1
91-
},
9277
{
9378
"file": "src/pages/IndexPage.vue",
9479
"match": "z-30",

‎reposilite-frontend/src/styles/md3/code-role.test.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ import { join, relative } from 'node:path'
2424
// list only shrinks. Reads the sources from disk and mounts nothing.
2525
const PENDING: readonly string[] = Object.freeze([
2626
'src/components/access/check/CheckPermissionView.vue',
27-
'src/components/audit/AuditEventRow.vue',
2827
'src/components/browser/AdjustmentsModal.vue',
2928
'src/components/browser/FileUpload.vue',
3029
'src/components/dashboard/FailuresSheet.vue',
31-
'src/components/identity/SecretOnceDialog.vue',
3230
'src/components/identity/TokenList.vue',
3331
'src/components/maintenance/CleanupPoliciesPanel.vue',
3432
'src/components/maintenance/IndexPanel.vue',
@@ -37,7 +35,6 @@ const PENDING: readonly string[] = Object.freeze([
3735
'src/components/access/nodes/NodeTreeView.vue',
3836
'src/components/md/MdListbox.vue',
3937
'src/components/settings/RepositoryWizard.vue',
40-
'src/components/support/SystemInfoView.vue',
4138
])
4239

4340
const SOURCE_ROOT = join(process.cwd(), 'src')

0 commit comments

Comments
 (0)