diff --git a/app/composables/usePlatformModifierKey.ts b/app/composables/usePlatformModifierKey.ts
deleted file mode 100644
index 9d960ecd35..0000000000
--- a/app/composables/usePlatformModifierKey.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-const APPLE_PLATFORM_RE = /Mac|iPhone|iPad|iPod/i
-
-function detectApplePlatform() {
- if (!import.meta.client) return false
-
- const nav = navigator as Navigator & {
- userAgentData?: {
- platform?: string
- }
- }
-
- const platform = nav.userAgentData?.platform ?? nav.platform ?? ''
- const userAgent = navigator.userAgent ?? ''
-
- return APPLE_PLATFORM_RE.test(platform) || APPLE_PLATFORM_RE.test(userAgent)
-}
-
-export function usePlatformModifierKey() {
- const { t } = useI18n()
- const isApplePlatform = useState('platform:is-apple', detectApplePlatform)
- const ctrlKeyLabel = computed(() => t('shortcuts.ctrl_key'))
-
- if (import.meta.client) {
- onMounted(() => {
- isApplePlatform.value = detectApplePlatform()
- })
- }
-
- return {
- isApplePlatform: computed(() => isApplePlatform.value),
- primaryModifierKeyLabel: computed(() => (isApplePlatform.value ? '⌘' : ctrlKeyLabel.value)),
- commandPaletteShortcutLabel: computed(() =>
- isApplePlatform.value ? '⌘ K' : `${ctrlKeyLabel.value}+K`,
- ),
- }
-}
diff --git a/app/pages/package/[[org]]/[name].vue b/app/pages/package/[[org]]/[name].vue
index 427b4da6bd..92cdc77fb8 100644
--- a/app/pages/package/[[org]]/[name].vue
+++ b/app/pages/package/[[org]]/[name].vue
@@ -592,10 +592,14 @@ const showSkeleton = shallowRef(false)
vulnTreeStatus === 'pending' ||
(installSizeStatus === 'pending' && !vulnTree)
"
- class="inline-flex items-center gap-1 text-fg-subtle"
+ class="text-fg-subtle"
+ >(
-)
- (
)
-
({{ numberFormatter.format(totalDepsCount)
@@ -694,7 +698,7 @@ const showSkeleton = shallowRef(false)
{{ numberFormatter.format(vulnCount) }}
-
+
{{ numberFormatter.format(0) }}
diff --git a/app/utils/prehydrate.ts b/app/utils/prehydrate.ts
index 13c92033c6..b050207556 100644
--- a/app/utils/prehydrate.ts
+++ b/app/utils/prehydrate.ts
@@ -37,6 +37,15 @@ export function initPreferencesOnPrehydrate() {
const validBackgroundThemes = new Set(['neutral', 'stone', 'zinc', 'slate', 'black'])
const validForegroundThemes = new Set(['muted', 'standard', 'contrast'])
+ const nav = navigator as Navigator & { userAgentData?: { platform?: string } }
+ const applePlatform = /Mac|iPhone|iPad|iPod/i
+ if (
+ applePlatform.test(nav.userAgentData?.platform ?? nav.platform ?? '') ||
+ applePlatform.test(nav.userAgent)
+ ) {
+ document.documentElement.dataset.platform = 'apple'
+ }
+
// Read settings from localStorage
const settings = JSON.parse(
localStorage.getItem('npmx-settings') || '{}',
@@ -99,5 +108,34 @@ export function initPreferencesOnPrehydrate() {
if (settings.codeLigatures === false) {
document.documentElement.dataset.codeLigatures = 'false'
}
+
+ // Runs before NuxtTime's own prehydrate script, which formats each