feat: Action Log hidden by default, click header to toggle

- showAIActionLog state defaults to false
- Action Log header clickable (cursor-pointer), shows '-' when
  visible, '+' when hidden
- Body always rendered with CSS class 'hidden' toggled, avoids
  deep ternary nesting that exceeded Babel 8 maxTargets limit
This commit is contained in:
2026-07-28 20:43:08 +07:00
parent a56c616817
commit 61f4b90af0
2 changed files with 11 additions and 9 deletions
+9 -7
View File
@@ -7234,6 +7234,7 @@ const App = () => {
const [aiSuggestions, setAiSuggestions] = useState([]); const [aiSuggestions, setAiSuggestions] = useState([]);
const [showAiTypeahead, setShowAiTypeahead] = useState(false); const [showAiTypeahead, setShowAiTypeahead] = useState(false);
const [showAISuggestions, setShowAISuggestions] = useState(true); const [showAISuggestions, setShowAISuggestions] = useState(true);
const [showAIActionLog, setShowAIActionLog] = useState(false);
const [selectedProviderId, setSelectedProviderId] = useState(''); const [selectedProviderId, setSelectedProviderId] = useState('');
const [exportSettings, setExportSettings] = useState({ const [exportSettings, setExportSettings] = useState({
sampleRate: '44100', sampleRate: '44100',
@@ -16206,21 +16207,22 @@ const App = () => {
}), "Undo"))), /*#__PURE__*/React.createElement("div", { }), "Undo"))), /*#__PURE__*/React.createElement("div", {
className: "flex-1 min-h-0 flex flex-col overflow-hidden mt-1" className: "flex-1 min-h-0 flex flex-col overflow-hidden mt-1"
}, /*#__PURE__*/React.createElement("div", { }, /*#__PURE__*/React.createElement("div", {
className: "text-[10px] font-bold text-zinc-400 uppercase shrink-0 pb-0.5" className: "text-[10px] font-bold text-zinc-400 uppercase shrink-0 pb-0.5 cursor-pointer hover:text-zinc-200 select-none",
onClick: () => setShowAIActionLog(!showAIActionLog)
}, /*#__PURE__*/React.createElement("span", { }, /*#__PURE__*/React.createElement("span", {
className: "inline-flex items-center gap-1" className: "inline-flex items-center gap-1"
}, /*#__PURE__*/React.createElement("i", { }, /*#__PURE__*/React.createElement("i", {
"data-lucide": "list", "data-lucide": "list",
className: "w-3 h-3" className: "w-3 h-3"
}), " Action Log")), /*#__PURE__*/React.createElement("div", { }), " Action Log", showAIActionLog ? " \u2212" : " +")), /*#__PURE__*/React.createElement("div", {
ref: actionLogContainerRef, ref: actionLogContainerRef,
className: "flex-1 overflow-y-auto no-scrollbar bg-[#0f0f0f] rounded border border-zinc-800 select-text" className: "flex-1 overflow-y-auto no-scrollbar bg-[#0f0f0f] rounded border border-zinc-800 select-text" + (showAIActionLog ? '' : ' hidden')
}, aiActionLog.length === 0 ? /*#__PURE__*/React.createElement("div", { }, aiActionLog.length === 0 ? /*#__PURE__*/React.createElement("div", {
className: "text-xs text-zinc-600 italic select-text" className: "text-xs text-zinc-600 italic select-text p-1"
}, "Chưa có hành động nào.") : aiActionLog.map((entry, i) => /*#__PURE__*/React.createElement("div", { }, "Ch\u01B0a c\u00F3 h\u00E0nh \u0111\u1ED9ng n\u00E0o.") : aiActionLog.map(function(entry, i) { return /*#__PURE__*/React.createElement("div", {
key: i, 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'}` 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)))), showAISuggestions ? /*#__PURE__*/React.createElement("div", { }, new Date(entry.time).toLocaleTimeString(), entry.text); }))), showAISuggestions ? /*#__PURE__*/React.createElement("div", {
className: "flex flex-col gap-1 mb-1 shrink-0" className: "flex flex-col gap-1 mb-1 shrink-0"
}, /*#__PURE__*/React.createElement("div", { }, /*#__PURE__*/React.createElement("div", {
className: "flex items-center gap-1 text-[10px] font-bold text-zinc-400 uppercase" className: "flex items-center gap-1 text-[10px] font-bold text-zinc-400 uppercase"
File diff suppressed because one or more lines are too long