diff options
Diffstat (limited to 'makima/frontend/src/components/directives/DirectiveDetail.tsx')
| -rw-r--r-- | makima/frontend/src/components/directives/DirectiveDetail.tsx | 41 |
1 files changed, 5 insertions, 36 deletions
diff --git a/makima/frontend/src/components/directives/DirectiveDetail.tsx b/makima/frontend/src/components/directives/DirectiveDetail.tsx index 332a417..369cdaa 100644 --- a/makima/frontend/src/components/directives/DirectiveDetail.tsx +++ b/makima/frontend/src/components/directives/DirectiveDetail.tsx @@ -18,10 +18,12 @@ const CATEGORY_COLORS: Record<MemoryCategory, { text: string; border: string; bg context: { text: "text-cyan-400", border: "border-cyan-800", bg: "bg-cyan-900/20", label: "Context" }, preference: { text: "text-violet-400", border: "border-violet-800", bg: "bg-violet-900/20", label: "Preference" }, learning: { text: "text-emerald-400", border: "border-emerald-800", bg: "bg-emerald-900/20", label: "Learning" }, + issue: { text: "text-red-400", border: "border-red-800", bg: "bg-red-900/20", label: "Issue" }, + progress: { text: "text-blue-400", border: "border-blue-800", bg: "bg-blue-900/20", label: "Progress" }, other: { text: "text-[#7788aa]", border: "border-[#2a3a5a]", bg: "bg-[#1a2540]", label: "Other" }, }; -const ALL_CATEGORIES: MemoryCategory[] = ["decision", "context", "preference", "learning", "other"]; +const ALL_CATEGORIES: MemoryCategory[] = ["decision", "context", "preference", "learning", "issue", "progress", "other"]; interface DirectiveDetailProps { directive: DirectiveWithSteps; @@ -69,22 +71,18 @@ export function DirectiveDetail({ const [addingMemory, setAddingMemory] = useState(false); const [newCategory, setNewCategory] = useState<MemoryCategory>("context"); const [newContent, setNewContent] = useState(""); - const [newSource, setNewSource] = useState(""); const [confirmClear, setConfirmClear] = useState(false); const { grouped, - config: memoryConfig, loading: memoryLoading, error: memoryError, - toggleEnabled, add: addMemory, remove: removeMemory, clearAll: clearMemories, refresh: refreshMemories, } = useDirectiveMemories(directive.id); - const memoryEnabled = memoryConfig?.enabled ?? false; const totalMemories = Object.values(grouped).reduce((sum, arr) => sum + arr.length, 0); // Build task map from directive steps and orchestrator @@ -130,10 +128,8 @@ export function DirectiveDetail({ await addMemory({ category: newCategory, content: newContent.trim(), - source: newSource.trim() || undefined, }); setNewContent(""); - setNewSource(""); setAddingMemory(false); }; @@ -371,21 +367,7 @@ export function DirectiveDetail({ </span> )} </button> - <div className="flex items-center gap-2"> - {/* Enable/disable toggle */} - <button - type="button" - onClick={() => toggleEnabled(!memoryEnabled)} - className={`text-[9px] font-mono border rounded px-1.5 py-0.5 transition-colors ${ - memoryEnabled - ? "text-emerald-400 border-emerald-800 hover:text-emerald-300" - : "text-[#556677] border-[#2a3a5a] hover:text-[#7788aa]" - }`} - title={memoryEnabled ? "Disable memory" : "Enable memory"} - > - {memoryEnabled ? "ON" : "OFF"} - </button> - </div> + <div className="flex items-center gap-2" /> </div> {/* Collapsible content */} @@ -402,7 +384,6 @@ export function DirectiveDetail({ ) : totalMemories === 0 ? ( <div className="text-[10px] font-mono text-[#556677] py-2"> No memory entries yet. - {!memoryEnabled && " Enable memory to start capturing entries."} </div> ) : ( /* Grouped entries */ @@ -431,11 +412,6 @@ export function DirectiveDetail({ <p className="text-[10px] font-mono text-[#c0d0e0] whitespace-pre-wrap break-words"> {entry.content} </p> - {entry.source && ( - <span className="text-[9px] font-mono text-[#556677] mt-0.5 block"> - src: {entry.source} - </span> - )} </div> <button type="button" @@ -528,13 +504,6 @@ export function DirectiveDetail({ className="w-full bg-[#1a2540] border border-[rgba(117,170,252,0.2)] rounded px-2 py-1.5 text-[10px] font-mono text-white resize-y min-h-[40px] placeholder:text-[#556677]" rows={2} /> - <input - type="text" - value={newSource} - onChange={(e) => setNewSource(e.target.value)} - placeholder="Source (optional)" - className="w-full bg-[#1a2540] border border-[rgba(117,170,252,0.2)] rounded px-2 py-1 text-[10px] font-mono text-white placeholder:text-[#556677]" - /> <div className="flex gap-1.5"> <button type="button" @@ -546,7 +515,7 @@ export function DirectiveDetail({ </button> <button type="button" - onClick={() => { setAddingMemory(false); setNewContent(""); setNewSource(""); }} + onClick={() => { setAddingMemory(false); setNewContent(""); }} className="text-[10px] font-mono text-[#7788aa] hover:text-white border border-[#2a3a5a] rounded px-2 py-0.5" > Cancel |
