fix: filter excludes non-rearrange presets in AI suggestion list
Remove || p.is_favorite from filter when MIDI item selected. Only presets with category === 'Rearrange / Variation' appear.
This commit is contained in:
@@ -16181,7 +16181,7 @@ const App = () => {
|
|||||||
aiPromptMgrRef.current = new window.PromptTemplateManager();
|
aiPromptMgrRef.current = new window.PromptTemplateManager();
|
||||||
}
|
}
|
||||||
const promptMgr = aiPromptMgrRef.current;
|
const promptMgr = aiPromptMgrRef.current;
|
||||||
const suggestions = promptMgr ? (hasSelItem ? promptMgr.presets.filter(function(p) { return p.category === 'Rearrange / Variation' || p.is_favorite; }) : promptMgr.presets) : [];
|
const suggestions = promptMgr ? (hasSelItem ? promptMgr.presets.filter(function(p) { return p.category === 'Rearrange / Variation'; }) : promptMgr.presets) : [];
|
||||||
const handleApplySuggestion = (preset) => {
|
const handleApplySuggestion = (preset) => {
|
||||||
if (hasSelItem) {
|
if (hasSelItem) {
|
||||||
setAiPrompt(`Rearrange this melody line in ${preset.name} style`);
|
setAiPrompt(`Rearrange this melody line in ${preset.name} style`);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -706,3 +706,9 @@
|
|||||||
- **Các file ảnh hưởng:** `app/static/js/app.jsx`
|
- **Các file ảnh hưởng:** `app/static/js/app.jsx`
|
||||||
- **Ghi chú/Test (nếu có):** `npm run build` — build passes.
|
- **Ghi chú/Test (nếu có):** `npm run build` — build passes.
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### [2026-07-29 10:17] Task: Fix filter including wrong presets in AI suggestion list
|
||||||
|
- **Tóm tắt thay đổi:** Xóa `|| p.is_favorite` khỏi filter khi có MIDI item selected — chỉ lọc theo `category === 'Rearrange / Variation'`, tránh preset favorite bị lọt vào list không đúng.
|
||||||
|
- **Các file ảnh hưởng:** `app/static/js/app.jsx`
|
||||||
|
- **Ghi chú/Test (nếu có):** `npm run build` — build passes.
|
||||||
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user