Skip to content

Commit f981dd5

Browse files
committed
Merge upstream/main into vt/commands
Resolve conflict in app/pages/[...package].vue by combining: - Branch features: interactive copy button with group/installcmd hover state - Upstream improvements: overflow-x-auto, min-w-0, shrink-0 for responsive behavior
2 parents c8dbc91 + 3476c47 commit f981dd5

18 files changed

Lines changed: 317 additions & 238 deletions

app/assets/main.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ button {
157157
top: 0;
158158
}
159159

160+
/* Shiki theme colors */
161+
html.light .shiki,
162+
html.light .shiki span {
163+
color: var(--shiki-light) !important;
164+
background-color: var(--shiki-light-bg) !important;
165+
font-style: var(--shiki-light-font-style) !important;
166+
font-weight: var(--shiki-light-font-weight) !important;
167+
text-decoration: var(--shiki-light-text-decoration) !important;
168+
}
169+
160170
/* README prose styling */
161171
.readme-content {
162172
color: var(--fg-muted);
@@ -238,7 +248,7 @@ button {
238248
.readme-content pre,
239249
.readme-content .shiki {
240250
background: oklch(0.145 0 0) !important;
241-
border: 1px solid oklch(0.2686 0 0);
251+
border: 1px solid var(--border);
242252
border-radius: 8px;
243253
padding: 1rem;
244254
overflow-x: auto;

app/components/AccentColorPicker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { accentColors, selectedAccentColor, setAccentColor } = useAccentColor()
55
</script>
66

77
<template>
8-
<div role="listbox" aria-label="Accent colors" class="flex items-center justify-between">
8+
<div role="listbox" aria-label="Accent colors" class="flex items-center gap-4">
99
<button
1010
v-for="color in accentColors"
1111
:key="color.id"

app/components/AppFooter.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ onMounted(() => {
8989
<!-- On mobile, show disclaimer here instead of tagline -->
9090
<p class="text-xs text-fg-muted m-0 sm:hidden">{{ $t('non_affiliation_disclaimer') }}</p>
9191
<div class="flex items-center gap-4 sm:gap-6">
92+
<a
93+
href="https://docs.npmx.dev"
94+
target="_blank"
95+
rel="noopener noreferrer"
96+
class="link-subtle font-mono text-xs min-h-11 min-w- flex items-center"
97+
>
98+
{{ $t('footer.docs') }}
99+
</a>
92100
<a
93101
href="https://repo.npmx.dev"
94102
target="_blank"

app/components/AppHeader.vue

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ withDefaults(
1111
)
1212
1313
const { isConnected, npmUser } = useConnector()
14+
15+
const router = useRouter()
16+
onKeyStroke(',', e => {
17+
// Don't trigger if user is typing in an input
18+
const target = e.target as HTMLElement
19+
if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {
20+
return
21+
}
22+
23+
e.preventDefault()
24+
router.push('/settings')
25+
})
1426
</script>
1527

1628
<template>
@@ -64,9 +76,19 @@ const { isConnected, npmUser } = useConnector()
6476

6577
<!-- Right: User status + GitHub -->
6678
<div class="flex-shrink-0 flex items-center gap-6">
67-
<ClientOnly>
68-
<SettingsMenu />
69-
</ClientOnly>
79+
<NuxtLink
80+
to="/settings"
81+
class="link-subtle font-mono text-sm inline-flex items-center gap-2"
82+
aria-keyshortcuts=","
83+
>
84+
{{ $t('nav.settings') }}
85+
<kbd
86+
class="hidden sm:inline-flex items-center justify-center w-5 h-5 text-xs bg-bg-muted border border-border rounded"
87+
aria-hidden="true"
88+
>
89+
,
90+
</kbd>
91+
</NuxtLink>
7092

7193
<div v-if="showConnector">
7294
<ConnectorStatus />

app/components/PackageDownloadAnalytics.vue

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,16 @@ function safeMax(a: string, b: string): string {
191191
return a.localeCompare(b) >= 0 ? a : b
192192
}
193193
194+
function extractDates(dateLabel: string) {
195+
if (typeof dateLabel !== 'string') return []
196+
197+
const parts = dateLabel.trim().split(/\s+/).filter(Boolean)
198+
199+
if (parts.length < 2) return []
200+
201+
return [parts[0], parts[parts.length - 1]]
202+
}
203+
194204
/**
195205
* Two-phase state:
196206
* - selectedGranularity: immediate UI
@@ -448,17 +458,26 @@ const config = computed(() => ({
448458
},
449459
callbacks: {
450460
img: ({ imageUri }: { imageUri: string }) => {
451-
loadFile(imageUri, `${packageName}-${selectedGranularity.value}.png`)
461+
loadFile(
462+
imageUri,
463+
`${packageName}-${selectedGranularity.value}_${startDate.value}_${endDate.value}.png`,
464+
)
452465
},
453466
csv: (csvStr: string) => {
454467
const blob = new Blob([csvStr.replace('data:text/csv;charset=utf-8,', '')])
455468
const url = URL.createObjectURL(blob)
456-
loadFile(url, `${packageName}-${selectedGranularity.value}.csv`)
469+
loadFile(
470+
url,
471+
`${packageName}-${selectedGranularity.value}_${startDate.value}_${endDate.value}.csv`,
472+
)
457473
URL.revokeObjectURL(url)
458474
},
459475
svg: ({ blob }: { blob: Blob }) => {
460476
const url = URL.createObjectURL(blob)
461-
loadFile(url, `${packageName}-${selectedGranularity.value}.svg`)
477+
loadFile(
478+
url,
479+
`${packageName}-${selectedGranularity.value}_${startDate.value}_${endDate.value}.svg`,
480+
)
462481
URL.revokeObjectURL(url)
463482
},
464483
},
@@ -512,6 +531,13 @@ const config = computed(() => ({
512531
},
513532
zoom: {
514533
maxWidth: 500,
534+
customFormat:
535+
displayedGranularity.value !== 'weekly'
536+
? undefined
537+
: ({ absoluteIndex, side }: { absoluteIndex: number; side: 'left' | 'right' }) => {
538+
const parts = extractDates(chartData.value.dates[absoluteIndex] ?? '')
539+
return side === 'left' ? parts[0] : parts.at(-1)
540+
},
515541
highlightColor: isDarkMode.value ? '#2A2A2A' : '#E1E5E8',
516542
minimap: {
517543
show: true,

app/components/SettingsMenu.vue

Lines changed: 0 additions & 205 deletions
This file was deleted.

0 commit comments

Comments
 (0)