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
+52
View File
@@ -48,6 +48,58 @@ DEFAULT_PRESETS = [
"is_user_defined": False,
"is_favorite": False,
"created_at": "2026-07-23T16:00:00Z"
},
{
"id": "preset_rearrange_jazz_swing",
"name": "Jazz Swing Variation",
"keywords": ["jazz", "swing", "rearrange to jazz", "jazz improv"],
"category": "Rearrange / Variation",
"default_bars": 4,
"default_bpm": 120,
"default_scale": "C Major",
"system_instruction_template": "Rearrange the original melody into a rhythmic Jazz Swing style. Apply syncopation, 7th/9th chord extensions, and off-beat rhythmic feel.",
"is_user_defined": False,
"is_favorite": True,
"created_at": "2026-07-28T11:00:00Z"
},
{
"id": "preset_rearrange_synth_arpeggio",
"name": "80s Synthwave Arpeggiator",
"keywords": ["synthwave", "arpeggio", "arp", "16th variation", "80s synth"],
"category": "Rearrange / Variation",
"default_bars": 4,
"default_bpm": 120,
"default_scale": "C Minor",
"system_instruction_template": "Transform this sequence into a driving, shimmering 16th-note Arpeggio string in classic 80s Synthwave/Trance style.",
"is_user_defined": False,
"is_favorite": False,
"created_at": "2026-07-28T11:00:00Z"
},
{
"id": "preset_rearrange_harmonize",
"name": "Chords Harmonization (4-Note)",
"keywords": ["harmonize", "harmony", "add chord notes", "rich melody"],
"category": "Rearrange / Variation",
"default_bars": 4,
"default_bpm": 120,
"default_scale": "C Major",
"system_instruction_template": "Add harmonizing notes to create lush 4-note chord voicing extensions beneath the lead melody.",
"is_user_defined": False,
"is_favorite": False,
"created_at": "2026-07-28T11:00:00Z"
},
{
"id": "preset_rearrange_cinematic_strings",
"name": "Cinematic Strings Staccato",
"keywords": ["cinematic", "strings", "staccato", "staccato strings"],
"category": "Rearrange / Variation",
"default_bars": 4,
"default_bpm": 120,
"default_scale": "C Minor",
"system_instruction_template": "Rearrange the original line into a dramatic, driving Staccato rhythm for a Strings Ensemble.",
"is_user_defined": False,
"is_favorite": True,
"created_at": "2026-07-28T11:00:00Z"
}
]