{"record":{"id":"0280127c6365fab6","repo":"maotoumao/MusicFree","slug":"toast-remembertosave","errorCode":null,"errorMessage":"toast.rememberToSave","messagePattern":"toast\\.rememberToSave","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/pages/musicListEditor/components/bottom.tsx","lineNumber":94,"sourceCode":"                        resetSelectedIndices();\r\n                    }\r\n                }}\r\n            />\r\n            <BottomIcon\r\n                icon=\"trash-outline\"\r\n                title={t(\"common.delete\")}\r\n                color={\r\n                    selectedItems.length && musicSheet?.id\r\n                        ? \"text\"\r\n                        : \"textSecondary\"\r\n                }\r\n                onPress={() => {\r\n                    if (selectedItems.length && musicSheet?.id) {\r\n                        setEditingMusicList(\r\n                            produce(prev => prev.filter(_ => !_.checked)),\r\n                        );\r\n                        setMusicListChanged(true);\r\n                        Toast.warn(t(\"toast.rememberToSave\"));\r\n                    }\r\n                }}\r\n            />\r\n        </View>\r\n    );\r\n}\r\n\r\ninterface IBottomIconProps {\r\n    icon: IIconName;\r\n    title: string;\r\n    color?: \"text\" | \"textSecondary\";\r\n    onPress: () => void;\r\n}\r\nfunction BottomIcon(props: IBottomIconProps) {\r\n    const { icon, title, onPress, color = \"text\" } = props;\r\n    const colors = useColors();\r\n    return (\r\n        <Pressable\r","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/maotoumao/MusicFree/blob/d118b18b3d0c904400f7eea7bf99c0ceec6c1aee/src/pages/musicListEditor/components/bottom.tsx#L76-L112","documentation":"This is not a thrown exception but a localized warning toast: \"Remember to save~\" (zh: 请记得保存). The Bottom bar of the music list editor shows it after the user taps the button that removes all checked items from the draft playlist, warning them the removal only lives in the editor state and is not persisted until they explicitly save.","triggerScenarios":"User presses the removal button in the music list editor Bottom bar while selectedItems.length > 0 and musicSheet?.id is set; the checked rows are filtered out of the draft via produce() and musicListChanged is set true, then this warning toast fires.","commonSituations":"Bulk-removing songs from a playlist then closing the editor without saving and losing changes; users unfamiliar with the explicit save step expect the removal to persist immediately.","solutions":["After removing checked items, explicitly press the save button in the editor to persist the filtered playlist to the music sheet.","Check musicListChanged before leaving the editor and save or discard to avoid losing the removal.","If the toast is confusing UX, make the save flow automatic or navigate the user to save after batch removal.","If the toast text is wrong or untranslated, verify the \"toast.rememberToSave\" key exists in all files under src/core/i18n/languages/."],"exampleFix":"// before\nToast.warn(t(\"toast.rememberToSave\"));\n// after\n// keep the warning, then persist immediately if desired\nToast.warn(t(\"toast.rememberToSave\"));\nawait saveMusicList(musicSheet.id, nextList); // explicit persistence","handlingStrategy":"validation","validationCode":"if (selectedItems.length && musicSheet?.id) {\n    setEditingMusicList(produce(prev => prev.filter(_ => !_.checked)));\n    setMusicListChanged(true);\n    Toast.warn(t(\"toast.rememberToSave\"));\n}","typeGuard":"const canRemove =\n    Array.isArray(selectedItems) && selectedItems.length > 0 &&\n    typeof musicSheet?.id === \"string\" && musicSheet.id.length > 0;","tryCatchPattern":null,"preventionTips":["Treat the draft editor state as unsaved: always check musicListChanged before leaving the screen and prompt to save.","Persist the playlist immediately after batch operations if losing changes is unacceptable.","Ensure every locale file defines \"toast.rememberToSave\" so the toast never renders the raw key."],"tags":["i18n","ui-toast","unsaved-changes"],"backgroundTag":"unsaved-changes-warning","analyzedSha":"d118b18b3d0c904400f7eea7bf99c0ceec6c1aee","analyzedAt":"2026-08-30T11:49:12.932Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}