fix: AI Suggestion list changing on item select/deselect
Always show full preset list instead of filtering to rearrange/ favorites when item selected. Prevents suggestion list from visually changing during selection/deselection.
This commit is contained in:
@@ -16177,7 +16177,7 @@ const App = () => {
|
|||||||
const selMidiInfo = getSelectedMidiItemInfo();
|
const selMidiInfo = getSelectedMidiItemInfo();
|
||||||
const hasSelItem = !!selMidiInfo;
|
const hasSelItem = !!selMidiInfo;
|
||||||
const promptMgr = window.PromptTemplateManager ? new window.PromptTemplateManager() : null;
|
const promptMgr = window.PromptTemplateManager ? new window.PromptTemplateManager() : null;
|
||||||
const suggestions = promptMgr ? (hasSelItem ? promptMgr.presets.filter(function(p) { return p.category === 'Rearrange / Variation' || p.is_favorite; }) : promptMgr.presets) : [];
|
const suggestions = promptMgr ? 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
@@ -694,3 +694,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:08] Task: Fix AI Suggestion list changing on item select/deselect
|
||||||
|
- **Tóm tắt thay đổi:** Xóa filter `hasSelItem ? ...` khỏi `suggestions` — luôn hiển thị toàn bộ preset list thay vì chỉ rearrange/favorites khi có item được chọn. Tránh tự động thêm/xóa suggestion khi click chọn/bỏ chọn item.
|
||||||
|
- **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