feat: AI Copilot panel - full scrollable preset list + MIDI item name

Replace horizontal suggestion chips (max 6/4) with vertical
scrollable list (max-h-36, no-scrollbar) showing ALL presets
from PromptTemplateManager (capped at 50). Header shows
'AI Suggestion' label. When MIDI item selected, MIDI item
name displayed in header. Each preset shows star/fav icon,
name, and category tag. Click fills the prompt textarea.
This commit is contained in:
2026-07-28 20:07:29 +07:00
parent bb49035bee
commit 2a9748e12e
2 changed files with 23 additions and 18 deletions
+22 -17
View File
@@ -16230,26 +16230,31 @@ const App = () => {
key: i,
className: `text-xs font-mono py-0.5 border-b border-zinc-900 last:border-0 ${entry.type === 'error' ? 'text-red-400' : entry.type === 'status' ? 'text-zinc-400 italic' : entry.type === 'undo' ? 'text-amber-400' : 'text-zinc-300'}`
}, new Date(entry.time).toLocaleTimeString(), entry.text)))), /*#__PURE__*/React.createElement("div", {
className: `flex items-center gap-1 px-1 py-0.5 rounded mb-1 shrink-0 ${hasSelItem ? 'bg-amber-950/30 border border-amber-800/40' : ''}`
}, hasSelItem ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
className: "flex items-center gap-1 text-[10px] text-amber-400 font-semibold shrink-0"
className: "flex flex-col gap-1 mb-1 shrink-0"
}, /*#__PURE__*/React.createElement("div", {
className: "flex items-center gap-1 text-[10px] font-bold text-zinc-400 uppercase"
}, /*#__PURE__*/React.createElement("span", {
className: "w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse"
}), "MIDI: ", /*#__PURE__*/React.createElement("strong", {
className: "truncate max-w-[80px]"
}, selMidiInfo.itemName || selMidiInfo.itemId)), /*#__PURE__*/React.createElement("div", {
className: "flex flex-wrap gap-1 overflow-x-auto"
}, suggestions.slice(0, 6).map(p => /*#__PURE__*/React.createElement("button", {
className: "inline-flex items-center shrink-0"
}, /*#__PURE__*/React.createElement("i", {
"data-lucide": "sparkles",
className: "w-3 h-3 text-purple-400"
})), " AI Suggestion", hasSelItem ? /*#__PURE__*/React.createElement("span", {
className: "flex-1 text-right text-[10px] text-amber-400 font-semibold uppercase normal-case truncate ml-2"
}, "MIDI: ", selMidiInfo.itemName || selMidiInfo.itemId) : null), /*#__PURE__*/React.createElement("div", {
className: "overflow-y-auto no-scrollbar max-h-36 bg-[#0f0f0f] rounded border border-zinc-800"
}, (promptMgr ? promptMgr.presets : []).slice(0, 50).map(p => /*#__PURE__*/React.createElement("button", {
key: p.id,
onClick: () => handleApplySuggestion(p),
className: "px-1.5 py-0.5 rounded-full bg-amber-950/40 border border-amber-800/50 text-[10px] text-amber-200 hover:bg-amber-800/50 whitespace-nowrap"
}, p.is_favorite ? "★" : "✨", " ", p.name)))) : /*#__PURE__*/React.createElement("div", {
className: "flex flex-wrap gap-1"
}, suggestions.slice(0, 4).map(p => /*#__PURE__*/React.createElement("button", {
key: p.id,
onClick: () => handleApplySuggestion(p),
className: "px-1.5 py-0.5 rounded-full bg-indigo-950/40 border border-indigo-800/50 text-[10px] text-indigo-200 hover:bg-indigo-800/50 whitespace-nowrap"
}, p.is_favorite ? "★" : "✨", " ", p.name)))), /*#__PURE__*/React.createElement("div", {
className: "w-full text-left px-2 py-1 text-[11px] hover:bg-zinc-800 border-b border-zinc-900 last:border-0 flex items-center justify-between gap-2"
}, /*#__PURE__*/React.createElement("span", {
className: "truncate flex-1"
}, /*#__PURE__*/React.createElement("span", {
className: "text-zinc-400"
}, p.is_favorite ? "★ " : "✨ "), /*#__PURE__*/React.createElement("span", {
className: "text-zinc-200 font-semibold"
}, p.name)), /*#__PURE__*/React.createElement("span", {
className: "text-[9px] text-zinc-500 shrink-0"
}, p.category))))), /*#__PURE__*/React.createElement("div", {
className: "border-t border-zinc-800 pt-1.5 mt-1 shrink-0"
}, /*#__PURE__*/React.createElement("div", {
className: "text-xs font-bold text-zinc-400 uppercase mb-1 flex items-center gap-1"
File diff suppressed because one or more lines are too long