Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/Package/WeeklyDownloadStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ const dataset = computed<VueUiSparklineDatasetItem[]>(() =>

const lastDatapoint = computed(() => dataset.value.at(-1)?.period ?? '')

const isLoop = shallowRef(false)
const isLoop = shallowRef(settings.value.enableGraphPulseLooping)
const showPulse = shallowRef(true)
const keyboardShortcuts = useKeyboardShortcuts()

Expand Down
3 changes: 3 additions & 0 deletions app/composables/useSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export interface AppSettings {
preferredBackgroundTheme: BackgroundThemeId | null
/** Hide platform-specific packages (e.g., @scope/pkg-linux-x64) from search results */
hidePlatformPackages: boolean
/** Enable weekly download graph pulse looping animation */
enableGraphPulseLooping: boolean
/** User-selected locale */
selectedLocale: LocaleObject['code'] | null
/** Search provider for package search */
Expand Down Expand Up @@ -52,6 +54,7 @@ const DEFAULT_SETTINGS: AppSettings = {
includeTypesInInstall: true,
accentColorId: null,
hidePlatformPackages: true,
enableGraphPulseLooping: false,
selectedLocale: null,
preferredBackgroundTheme: null,
searchProvider: import.meta.test ? 'npm' : 'algolia',
Expand Down
10 changes: 10 additions & 0 deletions app/pages/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ const setLocale: typeof setNuxti18nLocale = newLocale => {
:description="$t('settings.hide_platform_packages_description')"
v-model="settings.hidePlatformPackages"
/>

<!-- Divider -->
<div class="border-t border-border my-4" />

<!-- Enable weekly download graph pulse looping animation -->
<SettingsToggle
:label="$t('settings.enable_graph_pulse_loop')"
:description="$t('settings.enable_graph_pulse_loop_description')"
v-model="settings.enableGraphPulseLooping"
/>
</div>
</section>

Expand Down
2 changes: 2 additions & 0 deletions i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
"include_types_description": "Add {'@'}types package to install commands for untyped packages",
"hide_platform_packages": "Hide platform-specific packages in search",
"hide_platform_packages_description": "Hide native binary packages like {'@'}esbuild/linux-x64 from results",
"enable_graph_pulse_loop": "Enable looping of pulse effect on mini graph",
"enable_graph_pulse_loop_description": "Activate the repeated animation of the pulse effect on the weekly download graph",
"theme": "Theme",
"theme_light": "Light",
"theme_dark": "Dark",
Expand Down
6 changes: 6 additions & 0 deletions i18n/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,12 @@
"hide_platform_packages_description": {
"type": "string"
},
"enable_graph_pulse_loop": {
"type": "string"
},
"enable_graph_pulse_loop_description": {
"type": "string"
},
"theme": {
"type": "string"
},
Expand Down
Loading