fix(desktop): sidebar tab animation + memory deduplication
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
1. Fix sidebar tab switching: replace containerVariants (staggerChildren without motion children) with simple fade variants. The previous staggerChildren:0.05 caused the container to stay at opacity:0 when switching to CloneManager because non-motion children couldn't participate in stagger animation. 2. Fix memory deduplication: add content+agentId based dedup check in fallbackMemory.store(). Previously same content was stored 4x with different IDs. Now updates importance/accessCount instead.
This commit is contained in:
@@ -6,7 +6,14 @@ import {
|
|||||||
import { ConversationList } from './ConversationList';
|
import { ConversationList } from './ConversationList';
|
||||||
import { CloneManager } from './CloneManager';
|
import { CloneManager } from './CloneManager';
|
||||||
import { useChatStore } from '../store/chatStore';
|
import { useChatStore } from '../store/chatStore';
|
||||||
import { containerVariants, defaultTransition } from '../lib/animations';
|
import { defaultTransition } from '../lib/animations';
|
||||||
|
|
||||||
|
// Simple fade variants for sidebar tab content (no staggerChildren)
|
||||||
|
const sidebarTabVariants = {
|
||||||
|
hidden: { opacity: 0 },
|
||||||
|
visible: { opacity: 1, transition: { duration: 0.15 } },
|
||||||
|
exit: { opacity: 0, transition: { duration: 0.1 } },
|
||||||
|
};
|
||||||
|
|
||||||
export type MainViewType = 'chat' | 'automation' | 'skills';
|
export type MainViewType = 'chat' | 'automation' | 'skills';
|
||||||
|
|
||||||
@@ -109,7 +116,7 @@ export function Sidebar({
|
|||||||
<AnimatePresence mode="wait">
|
<AnimatePresence mode="wait">
|
||||||
<motion.div
|
<motion.div
|
||||||
key={activeTab}
|
key={activeTab}
|
||||||
variants={containerVariants}
|
variants={sidebarTabVariants}
|
||||||
initial="hidden"
|
initial="hidden"
|
||||||
animate="visible"
|
animate="visible"
|
||||||
exit="exit"
|
exit="exit"
|
||||||
|
|||||||
@@ -46,6 +46,27 @@ export const fallbackMemory = {
|
|||||||
|
|
||||||
async store(entry: MemoryEntryInput): Promise<string> {
|
async store(entry: MemoryEntryInput): Promise<string> {
|
||||||
const store = getFallbackStore();
|
const store = getFallbackStore();
|
||||||
|
|
||||||
|
// Content-based deduplication: update existing entry with same agentId + content
|
||||||
|
const normalizedContent = entry.content.trim().toLowerCase();
|
||||||
|
const existingIdx = store.memories.findIndex(
|
||||||
|
m => m.agentId === entry.agent_id && m.content.trim().toLowerCase() === normalizedContent
|
||||||
|
);
|
||||||
|
|
||||||
|
if (existingIdx >= 0) {
|
||||||
|
// Update existing entry instead of creating duplicate
|
||||||
|
const existing = store.memories[existingIdx];
|
||||||
|
store.memories[existingIdx] = {
|
||||||
|
...existing,
|
||||||
|
importance: Math.max(existing.importance, entry.importance ?? 5),
|
||||||
|
lastAccessedAt: new Date().toISOString(),
|
||||||
|
accessCount: existing.accessCount + 1,
|
||||||
|
tags: [...new Set([...existing.tags, ...(entry.tags ?? [])])],
|
||||||
|
};
|
||||||
|
saveFallbackStore(store);
|
||||||
|
return existing.id;
|
||||||
|
}
|
||||||
|
|
||||||
const id = `mem_${Date.now()}_${generateRandomString(6)}`;
|
const id = `mem_${Date.now()}_${generateRandomString(6)}`;
|
||||||
const now = new Date().toISOString();
|
const now = new Date().toISOString();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user