From 01011a49a2ab62dc96f1e1b5532110f8a1c3b920 Mon Sep 17 00:00:00 2001
From: Jonne Saloranta <72470168+JonneSaloranta@users.noreply.github.com>
Date: Fri, 1 May 2026 21:44:15 +0300
Subject: [PATCH] Replace success toast with info when no songs are added
(#1994)
---
src/i18n/locales/en.json | 1 +
.../actions/add-to-playlist-action.tsx | 22 +++++++++----------
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json
index b9cf6c366..f9a9e059b 100644
--- a/src/i18n/locales/en.json
+++ b/src/i18n/locales/en.json
@@ -347,6 +347,7 @@
"input_skipDuplicates": "skip duplicates",
"searchOrCreate": "search $t(entity.playlist, {\"count\": 2}) or type to create a new one",
"success": "added $t(entity.trackWithCount, {\"count\": {{message}} }) to $t(entity.playlistWithCount, {\"count\": {{numOfPlaylists}} })",
+ "noneAdded": "no tracks were added to $t(entity.playlist, {\"count\": 1}) '{{playlist}}'",
"title": "add to $t(entity.playlist, {\"count\": 1})"
},
"createPlaylist": {
diff --git a/src/renderer/features/context-menu/actions/add-to-playlist-action.tsx b/src/renderer/features/context-menu/actions/add-to-playlist-action.tsx
index 7d0ef9070..d215cd4f0 100644
--- a/src/renderer/features/context-menu/actions/add-to-playlist-action.tsx
+++ b/src/renderer/features/context-menu/actions/add-to-playlist-action.tsx
@@ -165,7 +165,7 @@ export const AddToPlaylistAction = ({ items, itemType }: AddToPlaylistActionProp
);
const handleAddToPlaylist = useCallback(
- async (playlistId: string) => {
+ async (playlistId: string, playlistName: string) => {
if (items.length === 0 || !serverId) return;
try {
@@ -202,10 +202,9 @@ export const AddToPlaylistAction = ({ items, itemType }: AddToPlaylistActionProp
}
if (allSongIds.length === 0) {
- toast.success({
- message: t('form.addToPlaylist.success', {
- message: 0,
- numOfPlaylists: 1,
+ toast.info({
+ message: t('form.addToPlaylist.noneAdded', {
+ playlist: playlistName,
postProcess: 'sentenceCase',
}),
});
@@ -245,10 +244,9 @@ export const AddToPlaylistAction = ({ items, itemType }: AddToPlaylistActionProp
}
if (songsToAdd.length === 0) {
- toast.success({
- message: t('form.addToPlaylist.success', {
- message: 0,
- numOfPlaylists: 1,
+ toast.info({
+ message: t('form.addToPlaylist.noneAdded', {
+ playlist: playlistName,
postProcess: 'sentenceCase',
}),
});
@@ -413,7 +411,9 @@ export const AddToPlaylistAction = ({ items, itemType }: AddToPlaylistActionProp
<>
handleAddToPlaylist(recentPlaylist.id)}
+ onSelect={() =>
+ handleAddToPlaylist(recentPlaylist.id, recentPlaylist.name)
+ }
>
{recentPlaylist.name}
@@ -428,7 +428,7 @@ export const AddToPlaylistAction = ({ items, itemType }: AddToPlaylistActionProp
{filteredPlaylists.map((playlist) => (
handleAddToPlaylist(playlist.id)}
+ onSelect={() => handleAddToPlaylist(playlist.id, playlist.name)}
>
{playlist.name}