Skip to content

Commit 5bb5e1c

Browse files
committed
fix: announce package tarball download from command palette
1 parent 7efb8c4 commit 5bb5e1c

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

app/composables/useCommandPalettePackageCommands.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export function useCommandPalettePackageCommands(
1515
) {
1616
const { t } = useI18n()
1717
const route = useRoute()
18+
const { announce, close } = useCommandPalette()
1819

1920
function isCurrentPackageCompare(packageName: string) {
2021
const packages = route.query.packages
@@ -118,13 +119,19 @@ export function useCommandPalettePackageCommands(
118119
t('package.download.tarball'),
119120
],
120121
iconClass: 'i-lucide:download',
121-
action: () => {
122-
void downloadPackageTarball(resolvedContext.packageName, {
122+
action: async () => {
123+
await downloadPackageTarball(resolvedContext.packageName, {
123124
version: resolvedContext.resolvedVersion!,
124125
dist: {
125126
tarball: resolvedContext.tarballUrl!,
126127
},
127128
})
129+
close()
130+
announce(
131+
t('command_palette.announcements.download_started', {
132+
package: resolvedContext.packageName,
133+
}),
134+
)
128135
},
129136
})
130137
}

i18n/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@
175175
"relative_dates_off": "Relative dates off.",
176176
"theme_changed": "Theme set to {theme}.",
177177
"accent_color_changed": "Accent color set to {color}.",
178-
"background_theme_changed": "Background shade set to {theme}."
178+
"background_theme_changed": "Background shade set to {theme}.",
179+
"download_started": "Downloading {package} tarball."
179180
}
180181
},
181182
"nav": {

i18n/schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,9 @@
531531
},
532532
"background_theme_changed": {
533533
"type": "string"
534+
},
535+
"download_started": {
536+
"type": "string"
534537
}
535538
},
536539
"additionalProperties": false

0 commit comments

Comments
 (0)