Skip to content

Commit 29b0833

Browse files
Adebesin-Cellclaude
andcommitted
fix: improve OG image text visibility and fix lint issues
- Lighten version and /wk text in grid layout (#525252/#737373 → #a3a3a3) - Move findCategoryActionButton out of describe block (consistent-function-scoping) - Fix formatting in Compare.vue and compare.vue Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6019761 commit 29b0833

3 files changed

Lines changed: 17 additions & 23 deletions

File tree

app/components/OgImage/Compare.vue

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,10 @@ if (layoutTier.value !== 'summary') {
7575
`https://api.npmjs.org/downloads/point/last-week/${encoded}`,
7676
{ timeout: FETCH_TIMEOUT_MS },
7777
).catch(() => null),
78-
$fetch<{ 'dist-tags'?: { latest?: string } }>(
79-
`https://registry.npmjs.org/${encoded}`,
80-
{
81-
timeout: FETCH_TIMEOUT_MS,
82-
headers: { Accept: 'application/vnd.npm.install-v1+json' },
83-
},
84-
).catch(() => null),
78+
$fetch<{ 'dist-tags'?: { latest?: string } }>(`https://registry.npmjs.org/${encoded}`, {
79+
timeout: FETCH_TIMEOUT_MS,
80+
headers: { Accept: 'application/vnd.npm.install-v1+json' },
81+
}).catch(() => null),
8582
])
8683
return {
8784
name,
@@ -302,16 +299,13 @@ const summaryRemainder = computed(() =>
302299
}"
303300
>{{ pkg.name }}</span
304301
>
305-
<span
306-
v-if="pkg.version"
307-
class="text-xs text-[#525252]"
308-
>{{ pkg.version }}</span>
302+
<span v-if="pkg.version" class="text-xs text-[#a3a3a3]">{{ pkg.version }}</span>
309303
</span>
310304
<span class="flex items-baseline gap-0.5">
311305
<span class="text-2xl font-bold text-[#e5e5e5]">{{
312306
formatDownloads(pkg.downloads)
313307
}}</span>
314-
<span class="text-sm font-medium text-[#737373]">/wk</span>
308+
<span class="text-sm font-medium text-[#a3a3a3]">/wk</span>
315309
</span>
316310
</span>
317311
</div>

app/pages/compare.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ defineOgImageComponent('Compare', {
142142
packages: () => packages.value,
143143
emptyDescription: () => $t('compare.packages.meta_description_empty'),
144144
})
145-
145+
146146
const { announce } = useCommandPalette()
147147
148148
useCommandPaletteContextCommands(

test/nuxt/components/compare/FacetSelector.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ vi.mock('@vueuse/router', () => ({
100100
useRouteQuery: () => ref(''),
101101
}))
102102

103+
function findCategoryActionButton(
104+
component: Awaited<ReturnType<typeof mountSuspended>>,
105+
category: string,
106+
action: 'all' | 'none',
107+
) {
108+
return component.find(
109+
`button[data-facet-category="${category}"][data-facet-category-action="${action}"]`,
110+
)
111+
}
112+
103113
describe('FacetSelector', () => {
104114
beforeEach(() => {
105115
mockSelectedFacets.value = ['downloads', 'types']
@@ -232,16 +242,6 @@ describe('FacetSelector', () => {
232242
})
233243

234244
describe('category all/none buttons', () => {
235-
function findCategoryActionButton(
236-
component: Awaited<ReturnType<typeof mountSuspended>>,
237-
category: string,
238-
action: 'all' | 'none',
239-
) {
240-
return component.find(
241-
`button[data-facet-category="${category}"][data-facet-category-action="${action}"]`,
242-
)
243-
}
244-
245245
it('calls selectCategory when all button is clicked', async () => {
246246
const component = await mountSuspended(FacetSelector)
247247

0 commit comments

Comments
 (0)