feat: AI Copilot suggestion chips + typeahead dropdown

- Suggestion chips bar: context-aware (amber for rearrange, indigo for creation)
- Typeahead dropdown: keyword matching on ≥2 chars, Tab to select
- getSelectedMidiItemInfo helper for context detection
- Backend: 4 rearrange presets in ai_presets.py
- PromptTemplateManager: getContextualSuggestions(hasSelectedItem)
This commit is contained in:
2026-07-28 11:20:26 +07:00
parent 3f7abe0c95
commit cff3950670
5 changed files with 153 additions and 7 deletions
@@ -236,6 +236,14 @@ const PromptTemplateManager = (function() {
this.savePresets();
};
PromptTemplateManager.prototype.getContextualSuggestions = function(hasSelectedItem) {
if (hasSelectedItem) {
return this.presets.filter(p => p.category === 'Rearrange / Variation' || p.is_favorite);
} else {
return this.presets.filter(p => p.category !== 'Rearrange / Variation');
}
};
PromptTemplateManager.prototype.toggleFavorite = function(id) {
const preset = this.presets.find(p => p.id === id);
if (preset) {