Skip to content

Commit 19a02f8

Browse files
net0wellclaude
andcommitted
fix(painel): fontes como arquivo e v-row com density (spec 008)
- O Vite embutia como data: os subconjuntos pequenos da Roboto, e a CSP do painel (default-src 'self') os bloqueava: aparecia erro no console em toda tela. As fontes agora são sempre arquivos, e o check-bundle falha se alguma fonte voltar a ser embutida. O bundle inicial caiu de 280 para 265 KB gzip. - `v-row dense` está depreciado no Vuetify 4: as 8 telas que usavam passam a usar density="compact", que gera a mesma classe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 1847e72 commit 19a02f8

10 files changed

Lines changed: 21 additions & 9 deletions

File tree

‎panel/scripts/check-bundle.mjs‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Orçamento do bundle inicial (spec 008): ≤ 500 KB gzip para os arquivos que index.html carrega.
22
// Monaco e Vue Flow ficam em chunks carregados sob demanda e não entram na conta.
3-
import { readFile } from 'node:fs/promises'
3+
import { readdir, readFile } from 'node:fs/promises'
44
import { gzipSync } from 'node:zlib'
55
import { fileURLToPath } from 'node:url'
66

@@ -20,3 +20,12 @@ if (total > limit) {
2020
console.error('O bundle inicial passou do orçamento da spec 008.')
2121
process.exit(1)
2222
}
23+
24+
// A CSP do painel só aceita `data:` em imagens: uma fonte embutida seria bloqueada pelo navegador.
25+
const css = (await readdir(`${dist}assets`)).filter((f) => f.endsWith('.css'))
26+
for (const file of css) {
27+
if ((await readFile(`${dist}assets/${file}`, 'utf8')).includes('url(data:font/')) {
28+
console.error(`assets/${file} embute uma fonte como data:, que a CSP do painel bloqueia.`)
29+
process.exit(1)
30+
}
31+
}

‎panel/src/components/fields/FieldBuilder.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function setColumn(index: number, field: FieldDefinition, column: number, change
132132
</div>
133133
</v-expansion-panel-title>
134134
<v-expansion-panel-text>
135-
<v-row dense>
135+
<v-row density="compact">
136136
<v-col cols="12" md="5">
137137
<v-text-field
138138
:model-value="field.name"

‎panel/src/views/OverviewView.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function runTitle(run: Schemas['RunSummary']) {
4646
<v-btn variant="text" prepend-icon="mdi-refresh" :loading="busy" @click="load">{{ t('common.refresh') }}</v-btn>
4747
</PageHeader>
4848

49-
<v-row dense>
49+
<v-row density="compact">
5050
<v-col v-for="counter in counters" :key="counter.status" cols="6" md="4" lg="2">
5151
<v-card variant="tonal" :color="statusColor(counter.status)" :data-counter="counter.status">
5252
<v-card-text>

‎panel/src/views/audit/AuditView.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ onMounted(() => load(true))
6464
<PageHeader :title="t('audit.title')" :subtitle="t('audit.subtitle')" />
6565
<v-card class="mb-4">
6666
<v-card-text>
67-
<v-row dense>
67+
<v-row density="compact">
6868
<v-col cols="12" md="2"
6969
><v-text-field v-model="filters.actor" :label="t('audit.actor')" hide-details clearable
7070
/></v-col>

‎panel/src/views/pipelines/PipelineDetailView.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ const exportUrl = (v: number) => `${apiBase}/pipelines/${encodeURIComponent(key.
347347
t('common.save')
348348
}}</v-btn>
349349
<div class="text-subtitle-2 mt-6 mb-2">{{ t('pipelines.settings.retention') }}</div>
350-
<v-row dense>
350+
<v-row density="compact">
351351
<v-col cols="6">
352352
<v-text-field
353353
v-model="settings.artifactRetentionDays"

‎panel/src/views/pipelines/PipelineEditorView.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ function finishPublish() {
651651
>{{ publishError }}</v-alert
652652
>
653653

654-
<v-row v-if="form" dense>
654+
<v-row v-if="form" density="compact">
655655
<v-col cols="12" lg="2">
656656
<v-card :title="t('pipelines.editor.palette')" density="compact">
657657
<v-card-text class="pb-0">

‎panel/src/views/pipelines/RunPipelineDialog.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async function submit() {
6969
<v-card :title="t('pipelines.run.title', { name: pipeline.name })" data-testid="run-dialog">
7070
<v-card-text>
7171
<v-alert v-if="error" type="error" variant="tonal" density="compact" class="mb-3">{{ error }}</v-alert>
72-
<v-row dense>
72+
<v-row density="compact">
7373
<v-col cols="12" md="6">
7474
<v-select
7575
v-model="version"

‎panel/src/views/runs/RunListView.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function onScroll({ done: finish }: { done: (status: 'ok' | 'empty' | 'error') =
106106
<PageHeader :title="t('runs.title')" :subtitle="t('runs.subtitle')" />
107107
<v-card class="mb-4">
108108
<v-card-text>
109-
<v-row dense>
109+
<v-row density="compact">
110110
<v-col cols="12" md="3"
111111
><v-text-field v-model="filters.pipelineKey" :label="t('runs.filters.pipeline')" clearable hide-details
112112
/></v-col>

‎panel/src/views/stages/StageEditorView.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ function retry(): Schemas['RetryPolicy'] {
381381
@update:model-value="(v: string) => form && (form.memoryLimitMb = v === '' ? null : Number(v))"
382382
/>
383383
<div class="text-subtitle-2 mt-4 mb-2">{{ t('stages.editor.retry') }}</div>
384-
<v-row dense>
384+
<v-row density="compact">
385385
<v-col cols="4">
386386
<v-text-field
387387
:model-value="retry().maxAttempts"

‎panel/vite.config.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default defineConfig({
1717
outDir: 'dist',
1818
emptyOutDir: true,
1919
chunkSizeWarningLimit: 4096,
20+
// Fontes sempre como arquivo: a CSP do painel (default-src 'self') bloqueia fontes `data:`, e o Vite embutiria os
21+
// subconjuntos pequenos da Roboto.
22+
assetsInlineLimit: (file) => (/\.(woff2?|ttf|otf|eot)$/i.test(file) ? false : undefined),
2023
},
2124
worker: {
2225
format: 'es',

0 commit comments

Comments
 (0)