🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
🔥 refactor(layout): remove the im_layout rail layout (#23084)
Arvin Xubbefd5f5237b
diff --git a/locales/ar/common.json b/locales/ar/common.jsonindex 84c1cd25d35..9d28cc7510c 100644--- a/locales/ar/common.json+++ b/locales/ar/common.json@@ -183,9 +183,6 @@"cmdk.video": "فيديو بالذكاء الاصطناعي","confirm": "تأكيد","contact": "اتصل بنا",- "contacts.create": "وكيل جديد",- "contacts.empty": "لا يوجد شيء بعد",- "contacts.groups": "المجموعات","continue": "متابعة","copy": "نسخ","copyFail": "فشل النسخ",@@ -349,9 +346,6 @@"makePrivate.error": "فشل في جعلها خاصة","makePrivate.success": "تم جعلها خاصة","manageOnlyCreator": "فقط المنشئ أو مالك مساحة العمل يمكنه القيام بذلك",- "messageList.empty": "لا توجد محادثات بعد",- "messageList.newChat": "محادثة جديدة",- "messageList.search": "بحث","messengerBanner.dismiss": "رفض","messengerBanner.title": "تحدث إلى Lobe AI عبر تطبيقات المراسلة المفضلة لديك","more": "المزيد",@@ -482,7 +476,6 @@"tab.audio": "الصوت","tab.chat": "الدردشة","tab.community": "المجتمع",- "tab.contacts": "جهات الاتصال","tab.create": "إنشاء","tab.dashboard": "لوحات التحكم","tab.discover": "اكتشف",@@ -496,8 +489,6 @@"tab.marketplace": "السوق","tab.me": "أنا","tab.memory": "الذاكرة",- "tab.messages": "الرسائل",- "tab.more": "المزيد","tab.pages": "الصفحات","tab.projects": "المشاريع","tab.resource": "الموارد",@@ -517,8 +508,6 @@"taskDock.status.running": "قيد التنفيذ","taskDock.status.success": "تم الانتهاء من الكل","taskDock.totalCount": "{{count}} عناصر",- "taskNav.all": "جميع المهام",- "taskNav.noProjects": "لا توجد مشاريع بعد","taskTemplate.action.connect.button": "اتصل بـ {{provider}}","taskTemplate.action.connect.error": "فشل الاتصال، يرجى المحاولة مرة أخرى.","taskTemplate.action.connect.popupBlocked": "تم حظر نافذة الاتصال المنبثقة. اسمح بالنوافذ المنبثقة في متصفحك للمتابعة.",diff --git a/locales/bg-BG/common.json b/locales/bg-BG/common.jsonindex dfb49841433..634264325e4 100644--- a/locales/bg-BG/common.json+++ b/locales/bg-BG/common.json@@ -183,9 +183,6 @@"cmdk.video": "AI Видео","confirm": "Потвърди","contact": "Свържете се с нас",- "contacts.create": "Нов агент",- "contacts.empty": "Все още няма",- "contacts.groups": "Групи","continue": "Продължи","copy": "Копирай","copyFail": "Копирането не бе успешно",@@ -349,9 +346,6 @@"makePrivate.error": "Неуспешно направено частно","makePrivate.success": "Направено частно","manageOnlyCreator": "Само създателят или собственикът на работното пространство може да направи това",- "messageList.empty": "Все още няма разговори",- "messageList.newChat": "Нов разговор",- "messageList.search": "Търсене","messengerBanner.dismiss": "Затвори","messengerBanner.title": "Говорете с Lobe AI в любимите си приложения за съобщения","more": "Още",@@ -482,7 +476,6 @@"tab.audio": "Аудио","tab.chat": "Чат","tab.community": "Общност",- "tab.contacts": "Контакти","tab.create": "Създаване","tab.dashboard": "Табла за управление","tab.discover": "Открий",@@ -496,8 +489,6 @@"tab.marketplace": "Пазар","tab.me": "Аз","tab.memory": "Памет",- "tab.messages": "Съобщения",- "tab.more": "Още","tab.pages": "Страници","tab.projects": "Проекти","tab.resource": "Ресурси",@@ -517,8 +508,6 @@"taskDock.status.running": "В процес на изпълнение","taskDock.status.success": "Всичко е готово","taskDock.totalCount": "{{count}} елемента",- "taskNav.all": "Всички задачи",- "taskNav.noProjects": "Все още няма проекти","taskTemplate.action.connect.button": "Свържете {{provider}}","taskTemplate.action.connect.error": "Свързването не бе успешно, моля опитайте отново.","taskTemplate.action.connect.popupBlocked": "Изскачащият прозорец за свързване е блокиран. Разрешете изскачащи прозорци в браузъра си, за да продължите.",diff --git a/locales/de-DE/common.json b/locales/de-DE/common.jsonindex a272731921f..0b90abe6c21 100644--- a/locales/de-DE/common.json+++ b/locales/de-DE/common.json@@ -183,9 +183,6 @@"cmdk.video": "KI-Video","confirm": "Bestätigen","contact": "Kontaktieren Sie uns",- "contacts.create": "Neuer Agent",- "contacts.empty": "Noch keine",- "contacts.groups": "Gruppen","continue": "Weiter","copy": "Kopieren","copyFail": "Kopieren fehlgeschlagen",@@ -349,9 +346,6 @@"makePrivate.error": "Privat machen fehlgeschlagen","makePrivate.success": "Privat gemacht","manageOnlyCreator": "Nur der Ersteller oder ein Workspace-Eigentümer kann dies tun",- "messageList.empty": "Noch keine Gespräche",- "messageList.newChat": "Neues Gespräch",- "messageList.search": "Suchen","messengerBanner.dismiss": "Schließen","messengerBanner.title": "Sprechen Sie mit Lobe AI über Ihre bevorzugten Messaging-Apps","more": "Mehr",@@ -482,7 +476,6 @@"tab.audio": "Audio","tab.chat": "Chat","tab.community": "Community",- "tab.contacts": "Kontakte","tab.create": "Erstellen","tab.dashboard": "Dashboards","tab.discover": "Entdecken",@@ -496,8 +489,6 @@"tab.marketplace": "Marktplatz","tab.me": "Ich","tab.memory": "Speicher",- "tab.messages": "Nachrichten",- "tab.more": "Mehr","tab.pages": "Seiten","tab.projects": "Projekte","tab.resource": "Ressourcen",@@ -517,8 +508,6 @@"taskDock.status.running": "In Bearbeitung","taskDock.status.success": "Alles erledigt","taskDock.totalCount": "{{count}} Elemente",- "taskNav.all": "Alle Aufgaben",- "taskNav.noProjects": "Noch keine Projekte","taskTemplate.action.connect.button": "Verbinden mit {{provider}}","taskTemplate.action.connect.error": "Verbindung fehlgeschlagen, bitte versuchen Sie es erneut.","taskTemplate.action.connect.popupBlocked": "Verbindungspopup blockiert. Erlauben Sie Popups in Ihrem Browser, um fortzufahren.",diff --git a/locales/en-US/common.json b/locales/en-US/common.jsonindex 62fd1a85f03..aae12cb1ee2 100644--- a/locales/en-US/common.json+++ b/locales/en-US/common.json@@ -185,23 +185,6 @@"cmdk.video": "AI Video","confirm": "Confirm","contact": "Contact Us",- "contacts.create": "New agent",- "contacts.editProfile": "Edit profile",- "contacts.empty": "None yet",- "contacts.groups": "Groups",- "contacts.info.bio": "Bio",- "contacts.info.handle": "Handle",- "contacts.info.mail": "Email",- "contacts.info.sendMail": "Send email",- "contacts.manage": "Manage",- "contacts.noDescription": "No description yet",- "contacts.notFound": "This contact no longer exists or is not visible to you",- "contacts.pinned": "Pinned",- "contacts.sendMessage": "Send message",- "contacts.sort.title": "Name",- "contacts.sort.tooltip": "Sort",- "contacts.sort.updatedAt": "Recently updated",- "contacts.viewProfile": "View profile","continue": "Continue","copy": "Copy","copyFail": "Copy failed",@@ -372,9 +355,6 @@"makePrivate.error": "Failed to make private","makePrivate.success": "Made private","manageOnlyCreator": "Only the creator or a workspace owner can do this",- "messageList.empty": "No conversations yet",- "messageList.newChat": "New conversation",- "messageList.search": "Search","messengerBanner.dismiss": "Dismiss","messengerBanner.title": "Talk to Lobe AI on your favorite messaging apps","more": "More",@@ -515,7 +495,6 @@"tab.audio": "Audio","tab.chat": "Chat","tab.community": "Community",- "tab.contacts": "Contacts","tab.create": "Create","tab.dashboard": "Dashboards","tab.discover": "Discover",@@ -529,8 +508,6 @@"tab.marketplace": "Marketplace","tab.me": "Me","tab.memory": "Memory",- "tab.messages": "Messages",- "tab.more": "More","tab.music": "Music","tab.pages": "Pages","tab.projects": "Projects",@@ -551,8 +528,6 @@"taskDock.status.running": "In progress","taskDock.status.success": "All done","taskDock.totalCount": "{{count}} items",- "taskNav.all": "All tasks",- "taskNav.noProjects": "No projects yet","taskTemplate.action.connect.button": "Connect {{provider}}","taskTemplate.action.connect.error": "Connection failed, please try again.","taskTemplate.action.connect.popupBlocked": "Connection popup blocked. Allow popups in your browser to continue.",diff --git a/locales/es-ES/common.json b/locales/es-ES/common.jsonindex 78902a514de..847b9c4cad0 100644--- a/locales/es-ES/common.json+++ b/locales/es-ES/common.json@@ -183,9 +183,6 @@"cmdk.video": "Video con IA","confirm": "Confirmar","contact": "Contáctanos",- "contacts.create": "Nuevo agente",- "contacts.empty": "Aún no hay ninguno",- "contacts.groups": "Grupos","continue": "Continuar","copy": "Copiar","copyFail": "Error al copiar",@@ -349,9 +346,6 @@"makePrivate.error": "Error al hacer privado","makePrivate.success": "Hecho privado","manageOnlyCreator": "Solo el creador o un propietario del espacio de trabajo pueden hacer esto",- "messageList.empty": "Aún no hay conversaciones",- "messageList.newChat": "Nueva conversación",- "messageList.search": "Buscar","messengerBanner.dismiss": "Cerrar","messengerBanner.title": "Habla con Lobe AI en tus aplicaciones de mensajería favoritas","more": "Más",@@ -482,7 +476,6 @@"tab.audio": "Audio","tab.chat": "Chat","tab.community": "Comunidad",- "tab.contacts": "Contactos","tab.create": "Crear","tab.dashboard": "Tableros","tab.discover": "Descubrir",@@ -496,8 +489,6 @@"tab.marketplace": "Mercado","tab.me": "Yo","tab.memory": "Memoria",- "tab.messages": "Mensajes",- "tab.more": "Más","tab.pages": "Páginas","tab.projects": "Proyectos","tab.resource": "Recursos",@@ -517,8 +508,6 @@"taskDock.status.running": "En progreso","taskDock.status.success": "Todo listo","taskDock.totalCount": "{{count}} elementos",- "taskNav.all": "Todas las tareas",- "taskNav.noProjects": "Aún no hay proyectos","taskTemplate.action.connect.button": "Conectar {{provider}}","taskTemplate.action.connect.error": "Conexión fallida, por favor inténtalo de nuevo.","taskTemplate.action.connect.popupBlocked": "Ventana emergente de conexión bloqueada. Permite ventanas emergentes en tu navegador para continuar.",diff --git a/locales/fa-IR/common.json b/locales/fa-IR/common.jsonindex 10a1175aab0..ac358171516 100644--- a/locales/fa-IR/common.json+++ b/locales/fa-IR/common.json@@ -183,9 +183,6 @@"cmdk.video": "ویدیوی هوش مصنوعی","confirm": "تأیید","contact": "تماس با ما",- "contacts.create": "عامل جدید",- "contacts.empty": "هنوز هیچکدام",- "contacts.groups": "گروهها","continue": "ادامه","copy": "کپی","copyFail": "کپی انجام نشد",@@ -349,9 +346,6 @@"makePrivate.error": "خصوصی کردن ناموفق بود","makePrivate.success": "خصوصی شد","manageOnlyCreator": "فقط سازنده یا مالک فضای کاری میتواند این کار را انجام دهد",- "messageList.empty": "هنوز مکالمهای وجود ندارد",- "messageList.newChat": "مکالمه جدید",- "messageList.search": "جستجو","messengerBanner.dismiss": "بستن","messengerBanner.title": "با Lobe AI در برنامههای پیامرسان محبوب خود صحبت کنید","more": "بیشتر",@@ -482,7 +476,6 @@"tab.audio": "صوت","tab.chat": "گفتوگو","tab.community": "جامعه",- "tab.contacts": "مخاطبین","tab.create": "ایجاد","tab.dashboard": "داشبوردها","tab.discover": "کشف",@@ -496,8 +489,6 @@"tab.marketplace": "بازار","tab.me": "من","tab.memory": "حافظه",- "tab.messages": "پیامها",- "tab.more": "بیشتر","tab.pages": "صفحات","tab.projects": "پروژهها","tab.resource": "منابع",@@ -517,8 +508,6 @@"taskDock.status.running": "در حال انجام","taskDock.status.success": "همه انجام شد","taskDock.totalCount": "{{count}} آیتم",- "taskNav.all": "همه وظایف",- "taskNav.noProjects": "هنوز پروژهای وجود ندارد","taskTemplate.action.connect.button": "اتصال به {{provider}}","taskTemplate.action.connect.error": "اتصال ناموفق بود، لطفاً دوباره تلاش کنید.","taskTemplate.action.connect.popupBlocked": "پنجره اتصال مسدود شده است. برای ادامه، پاپآپها را در مرورگر خود فعال کنید.",diff --git a/locales/fr-FR/common.json b/locales/fr-FR/common.jsonindex 8111171cd5f..694a805b211 100644--- a/locales/fr-FR/common.json+++ b/locales/fr-FR/common.json@@ -183,9 +183,6 @@"cmdk.video": "Vidéo IA","confirm": "Confirmer","contact": "Nous contacter",- "contacts.create": "Nouvel agent",- "contacts.empty": "Aucun pour l'instant",- "contacts.groups": "Groupes","continue": "Continuer","copy": "Copier","copyFail": "Échec de la copie",@@ -349,9 +346,6 @@"makePrivate.error": "Échec de la mise en privé","makePrivate.success": "Rendu privé","manageOnlyCreator": "Seul le créateur ou un propriétaire de l'espace de travail peut effectuer cette action",- "messageList.empty": "Aucune conversation pour l'instant",- "messageList.newChat": "Nouvelle conversation",- "messageList.search": "Rechercher","messengerBanner.dismiss": "Fermer","messengerBanner.title": "Discutez avec Lobe AI sur vos applications de messagerie préférées","more": "Plus",@@ -482,7 +476,6 @@"tab.audio": "Audio","tab.chat": "Discussion","tab.community": "Communauté",- "tab.contacts": "Contacts","tab.create": "Créer","tab.dashboard": "Tableaux de bord","tab.discover": "Découvrir",@@ -496,8 +489,6 @@"tab.marketplace": "Place de marché","tab.me": "Moi","tab.memory": "Mémoire",- "tab.messages": "Messages",- "tab.more": "Plus","tab.pages": "Pages","tab.projects": "Projets","tab.resource": "Ressources",@@ -517,8 +508,6 @@"taskDock.status.running": "En cours","taskDock.status.success": "Tout est terminé","taskDock.totalCount": "{{count}} éléments",- "taskNav.all": "Toutes les tâches",- "taskNav.noProjects": "Aucun projet pour l'instant","taskTemplate.action.connect.button": "Connecter {{provider}}","taskTemplate.action.connect.error": "Échec de la connexion, veuillez réessayer.","taskTemplate.action.connect.popupBlocked": "Fenêtre contextuelle de connexion bloquée. Autorisez les fenêtres contextuelles dans votre navigateur pour continuer.",diff --git a/locales/it-IT/common.json b/locales/it-IT/common.jsonindex bf22eab9aaf..f0d66d5c786 100644--- a/locales/it-IT/common.json+++ b/locales/it-IT/common.json@@ -183,9 +183,6 @@"cmdk.video": "Video AI","confirm": "Conferma","contact": "Contattaci",- "contacts.create": "Nuovo agente",- "contacts.empty": "Ancora nessuno",- "contacts.groups": "Gruppi","continue": "Continua","copy": "Copia","copyFail": "Copia non riuscita",@@ -349,9 +346,6 @@"makePrivate.error": "Impossibile rendere privato","makePrivate.success": "Reso privato","manageOnlyCreator": "Solo il creatore o un proprietario dello spazio di lavoro può farlo",- "messageList.empty": "Ancora nessuna conversazione",- "messageList.newChat": "Nuova conversazione",- "messageList.search": "Cerca","messengerBanner.dismiss": "Chiudi","messengerBanner.title": "Parla con Lobe AI sulle tue app di messaggistica preferite","more": "Altro",@@ -482,7 +476,6 @@"tab.audio": "Audio","tab.chat": "Chat","tab.community": "Comunità",- "tab.contacts": "Contatti","tab.create": "Crea","tab.dashboard": "Dashboard","tab.discover": "Scopri",@@ -496,8 +489,6 @@"tab.marketplace": "Mercato","tab.me": "Profilo","tab.memory": "Memoria",- "tab.messages": "Messaggi",- "tab.more": "Altro","tab.pages": "Pagine","tab.projects": "Progetti","tab.resource": "Risorse",@@ -517,8 +508,6 @@"taskDock.status.running": "In corso","taskDock.status.success": "Tutto completato","taskDock.totalCount": "{{count}} elementi",- "taskNav.all": "Tutte le attività",- "taskNav.noProjects": "Ancora nessun progetto","taskTemplate.action.connect.button": "Connetti {{provider}}","taskTemplate.action.connect.error": "Connessione fallita, riprova.","taskTemplate.action.connect.popupBlocked": "Popup di connessione bloccato. Consenti i popup nel tuo browser per continuare.",diff --git a/locales/ja-JP/common.json b/locales/ja-JP/common.jsonindex 340d21605b7..b2e1dddcb8c 100644--- a/locales/ja-JP/common.json+++ b/locales/ja-JP/common.json@@ -183,9 +183,6 @@"cmdk.video": "AIビデオ","confirm": "確認","contact": "お問い合わせ",- "contacts.create": "新しいエージェント",- "contacts.empty": "まだありません",- "contacts.groups": "グループ","continue": "続行","copy": "コピー","copyFail": "コピーに失敗しました",@@ -349,9 +346,6 @@"makePrivate.error": "非公開にすることに失敗しました","makePrivate.success": "非公開にしました","manageOnlyCreator": "これを行えるのは、作成者またはワークスペースの所有者のみです",- "messageList.empty": "まだ会話がありません",- "messageList.newChat": "新しい会話",- "messageList.search": "検索","messengerBanner.dismiss": "閉じる","messengerBanner.title": "お好きなメッセージングアプリでLobe AIと話しましょう","more": "もっと見る",@@ -482,7 +476,6 @@"tab.audio": "オーディオ","tab.chat": "チャット","tab.community": "コミュニティ",- "tab.contacts": "連絡先","tab.create": "作成","tab.dashboard": "ダッシュボード","tab.discover": "発見",@@ -496,8 +489,6 @@"tab.marketplace": "マーケットプレイス","tab.me": "自分","tab.memory": "メモリ",- "tab.messages": "メッセージ",- "tab.more": "その他","tab.pages": "ドキュメント","tab.projects": "プロジェクト","tab.resource": "リソース",@@ -517,8 +508,6 @@"taskDock.status.running": "進行中","taskDock.status.success": "すべて完了","taskDock.totalCount": "{{count}} 件",- "taskNav.all": "すべてのタスク",- "taskNav.noProjects": "プロジェクトはまだありません","taskTemplate.action.connect.button": "{{provider}}に接続","taskTemplate.action.connect.error": "接続に失敗しました。もう一度お試しください。","taskTemplate.action.connect.popupBlocked": "接続ポップアップがブロックされました。ブラウザでポップアップを許可して続行してください。",diff --git a/locales/ko-KR/common.json b/locales/ko-KR/common.jsonindex 9866ef03dec..f9ee41cab02 100644--- a/locales/ko-KR/common.json+++ b/locales/ko-KR/common.json@@ -183,9 +183,6 @@"cmdk.video": "AI 비디오","confirm": "확인","contact": "문의하기",- "contacts.create": "새 에이전트",- "contacts.empty": "아직 없음",- "contacts.groups": "그룹","continue": "계속","copy": "복사","copyFail": "복사 실패",@@ -349,9 +346,6 @@"makePrivate.error": "비공개로 설정하지 못했습니다","makePrivate.success": "비공개로 설정되었습니다","manageOnlyCreator": "이 작업은 생성자 또는 워크스페이스 소유자만 수행할 수 있습니다",- "messageList.empty": "아직 대화가 없습니다",- "messageList.newChat": "새 대화",- "messageList.search": "검색","messengerBanner.dismiss": "닫기","messengerBanner.title": "선호하는 메시징 앱에서 Lobe AI와 대화하세요","more": "더보기",@@ -482,7 +476,6 @@"tab.audio": "오디오","tab.chat": "채팅","tab.community": "커뮤니티",- "tab.contacts": "연락처","tab.create": "생성","tab.dashboard": "대시보드","tab.discover": "탐색",@@ -496,8 +489,6 @@"tab.marketplace": "마켓플레이스","tab.me": "내 정보","tab.memory": "기억",- "tab.messages": "메시지",- "tab.more": "더보기","tab.pages": "문서","tab.projects": "프로젝트","tab.resource": "자료",@@ -517,8 +508,6 @@"taskDock.status.running": "진행 중","taskDock.status.success": "모두 완료됨","taskDock.totalCount": "{{count}} 항목",- "taskNav.all": "모든 작업",- "taskNav.noProjects": "아직 프로젝트가 없습니다","taskTemplate.action.connect.button": "{{provider}} 연결","taskTemplate.action.connect.error": "연결에 실패했습니다. 다시 시도해 주세요.","taskTemplate.action.connect.popupBlocked": "연결 팝업이 차단되었습니다. 브라우저에서 팝업을 허용하여 계속 진행하세요.",diff --git a/locales/nl-NL/common.json b/locales/nl-NL/common.jsonindex 0a0eee781ae..2cf2683a497 100644--- a/locales/nl-NL/common.json+++ b/locales/nl-NL/common.json@@ -183,9 +183,6 @@"cmdk.video": "AI-video","confirm": "Bevestigen","contact": "Contacteer ons",- "contacts.create": "Nieuwe agent",- "contacts.empty": "Nog geen",- "contacts.groups": "Groepen","continue": "Doorgaan","copy": "Kopiëren","copyFail": "Kopiëren mislukt",@@ -349,9 +346,6 @@"makePrivate.error": "Privé maken mislukt","makePrivate.success": "Privé gemaakt","manageOnlyCreator": "Alleen de maker of een werkruimte-eigenaar kan dit doen",- "messageList.empty": "Nog geen gesprekken",- "messageList.newChat": "Nieuw gesprek",- "messageList.search": "Zoeken","messengerBanner.dismiss": "Sluiten","messengerBanner.title": "Praat met Lobe AI via je favoriete berichtenapps","more": "Meer",@@ -482,7 +476,6 @@"tab.audio": "Audio","tab.chat": "Chat","tab.community": "Community",- "tab.contacts": "Contacten","tab.create": "Maken","tab.dashboard": "Dashboards","tab.discover": "Ontdekken",@@ -496,8 +489,6 @@"tab.marketplace": "Marktplaats","tab.me": "Ik","tab.memory": "Geheugen",- "tab.messages": "Berichten",- "tab.more": "Meer","tab.pages": "Pagina's","tab.projects": "Projecten","tab.resource": "Bronnen",@@ -517,8 +508,6 @@"taskDock.status.running": "Bezig","taskDock.status.success": "Alles klaar","taskDock.totalCount": "{{count}} items",- "taskNav.all": "Alle taken",- "taskNav.noProjects": "Nog geen projecten","taskTemplate.action.connect.button": "Verbind {{provider}}","taskTemplate.action.connect.error": "Verbinding mislukt, probeer het opnieuw.","taskTemplate.action.connect.popupBlocked": "Verbindingspopup geblokkeerd. Sta popups toe in uw browser om door te gaan.",diff --git a/locales/pl-PL/common.json b/locales/pl-PL/common.jsonindex c0bd69b486a..d2ef0f2f393 100644--- a/locales/pl-PL/common.json+++ b/locales/pl-PL/common.json@@ -183,9 +183,6 @@"cmdk.video": "Wideo AI","confirm": "Potwierdź","contact": "Skontaktuj się z nami",- "contacts.create": "Nowy agent",- "contacts.empty": "Jeszcze brak",- "contacts.groups": "Grupy","continue": "Kontynuuj","copy": "Kopiuj","copyFail": "Nie udało się skopiować",@@ -349,9 +346,6 @@"makePrivate.error": "Nie udało się ustawić jako prywatne","makePrivate.success": "Ustawiono jako prywatne","manageOnlyCreator": "Tylko twórca lub właściciel przestrzeni roboczej może to zrobić",- "messageList.empty": "Brak rozmów",- "messageList.newChat": "Nowa rozmowa",- "messageList.search": "Szukaj","messengerBanner.dismiss": "Zamknij","messengerBanner.title": "Porozmawiaj z Lobe AI na swoich ulubionych aplikacjach do przesyłania wiadomości","more": "Więcej",@@ -482,7 +476,6 @@"tab.audio": "Audio","tab.chat": "Czat","tab.community": "Społeczność",- "tab.contacts": "Kontakty","tab.create": "Utwórz","tab.dashboard": "Pulpity","tab.discover": "Odkrywaj",@@ -496,8 +489,6 @@"tab.marketplace": "Rynek","tab.me": "Ja","tab.memory": "Pamięć",- "tab.messages": "Wiadomości",- "tab.more": "Więcej","tab.pages": "Strony","tab.projects": "Projekty","tab.resource": "Zasoby",@@ -517,8 +508,6 @@"taskDock.status.running": "W toku","taskDock.status.success": "Wszystko gotowe","taskDock.totalCount": "{{count}} elementów",- "taskNav.all": "Wszystkie zadania",- "taskNav.noProjects": "Brak projektów","taskTemplate.action.connect.button": "Połącz {{provider}}","taskTemplate.action.connect.error": "Połączenie nie powiodło się, spróbuj ponownie.","taskTemplate.action.connect.popupBlocked": "Okno połączenia zostało zablokowane. Zezwól na wyskakujące okna w przeglądarce, aby kontynuować.",diff --git a/locales/pt-BR/common.json b/locales/pt-BR/common.jsonindex bacd84618c5..5b8e96b5dfd 100644--- a/locales/pt-BR/common.json+++ b/locales/pt-BR/common.json@@ -183,9 +183,6 @@"cmdk.video": "Vídeo com IA","confirm": "Confirmar","contact": "Fale Conosco",- "contacts.create": "Novo agente",- "contacts.empty": "Nenhum ainda",- "contacts.groups": "Grupos","continue": "Continuar","copy": "Copiar","copyFail": "Falha ao copiar",@@ -349,9 +346,6 @@"makePrivate.error": "Falha ao tornar privado","makePrivate.success": "Tornado privado","manageOnlyCreator": "Somente o criador ou um proprietário do espaço de trabalho pode fazer isso",- "messageList.empty": "Nenhuma conversa ainda",- "messageList.newChat": "Nova conversa",- "messageList.search": "Pesquisar","messengerBanner.dismiss": "Fechar","messengerBanner.title": "Converse com a Lobe AI nos seus aplicativos de mensagens favoritos","more": "Mais",@@ -482,7 +476,6 @@"tab.audio": "Áudio","tab.chat": "Chat","tab.community": "Comunidade",- "tab.contacts": "Contatos","tab.create": "Criar","tab.dashboard": "Painéis","tab.discover": "Descobrir",@@ -496,8 +489,6 @@"tab.marketplace": "Mercado","tab.me": "Perfil","tab.memory": "Memória",- "tab.messages": "Mensagens",- "tab.more": "Mais","tab.pages": "Páginas","tab.projects": "Projetos","tab.resource": "Recursos",@@ -517,8 +508,6 @@"taskDock.status.running": "Em andamento","taskDock.status.success": "Tudo concluído","taskDock.totalCount": "{{count}} itens",- "taskNav.all": "Todas as tarefas",- "taskNav.noProjects": "Nenhum projeto ainda","taskTemplate.action.connect.button": "Conectar {{provider}}","taskTemplate.action.connect.error": "Falha na conexão, por favor tente novamente.","taskTemplate.action.connect.popupBlocked": "Popup de conexão bloqueado. Permita popups no seu navegador para continuar.",diff --git a/locales/ru-RU/common.json b/locales/ru-RU/common.jsonindex 8dc7bdc97c9..3735fe8dbb8 100644--- a/locales/ru-RU/common.json+++ b/locales/ru-RU/common.json@@ -183,9 +183,6 @@"cmdk.video": "Видео с ИИ","confirm": "Подтвердить","contact": "Связаться с нами",- "contacts.create": "Новый агент",- "contacts.empty": "Пока никого",- "contacts.groups": "Группы","continue": "Продолжить","copy": "Копировать","copyFail": "Не удалось скопировать",@@ -349,9 +346,6 @@"makePrivate.error": "Не удалось сделать приватным","makePrivate.success": "Сделано приватным","manageOnlyCreator": "Только создатель или владелец рабочего пространства может это сделать",- "messageList.empty": "Пока нет разговоров",- "messageList.newChat": "Новый разговор",- "messageList.search": "Поиск","messengerBanner.dismiss": "Закрыть","messengerBanner.title": "Общайтесь с Lobe AI в ваших любимых мессенджерах","more": "Ещё",@@ -482,7 +476,6 @@"tab.audio": "Аудио","tab.chat": "Чат","tab.community": "Сообщество",- "tab.contacts": "Контакты","tab.create": "Создать","tab.dashboard": "Панели управления","tab.discover": "Обзор",@@ -496,8 +489,6 @@"tab.marketplace": "Торговая площадка","tab.me": "Профиль","tab.memory": "Память",- "tab.messages": "Сообщения",- "tab.more": "Ещё","tab.pages": "Страницы","tab.projects": "Проекты","tab.resource": "Ресурсы",@@ -517,8 +508,6 @@"taskDock.status.running": "В процессе","taskDock.status.success": "Все выполнено","taskDock.totalCount": "{{count}} элементов",- "taskNav.all": "Все задачи",- "taskNav.noProjects": "Пока нет проектов","taskTemplate.action.connect.button": "Подключить {{provider}}","taskTemplate.action.connect.error": "Не удалось подключиться, попробуйте еще раз.","taskTemplate.action.connect.popupBlocked": "Всплывающее окно подключения заблокировано. Разрешите всплывающие окна в вашем браузере, чтобы продолжить.",diff --git a/locales/tr-TR/common.json b/locales/tr-TR/common.jsonindex 933af69fc27..7e86b0dbb3d 100644--- a/locales/tr-TR/common.json+++ b/locales/tr-TR/common.json@@ -183,9 +183,6 @@"cmdk.video": "Yapay Zekâ Videosu","confirm": "Onayla","contact": "Bize Ulaşın",- "contacts.create": "Yeni ajan",- "contacts.empty": "Henüz yok",- "contacts.groups": "Gruplar","continue": "Devam Et","copy": "Kopyala","copyFail": "Kopyalama başarısız",@@ -349,9 +346,6 @@"makePrivate.error": "Özel yapma işlemi başarısız oldu","makePrivate.success": "Özel yapıldı","manageOnlyCreator": "Bunu yalnızca oluşturucu veya bir çalışma alanı sahibi yapabilir",- "messageList.empty": "Henüz konuşma yok",- "messageList.newChat": "Yeni konuşma",- "messageList.search": "Ara","messengerBanner.dismiss": "Kapat","messengerBanner.title": "Lobe AI ile favori mesajlaşma uygulamalarınızda konuşun","more": "Daha Fazla",@@ -482,7 +476,6 @@"tab.audio": "Ses","tab.chat": "Sohbet","tab.community": "Topluluk",- "tab.contacts": "Kişiler","tab.create": "Oluştur","tab.dashboard": "Gösterge Tabloları","tab.discover": "Keşfet",@@ -496,8 +489,6 @@"tab.marketplace": "Pazar Yeri","tab.me": "Ben","tab.memory": "Hafıza",- "tab.messages": "Mesajlar",- "tab.more": "Daha fazla","tab.pages": "Sayfalar","tab.projects": "Projeler","tab.resource": "Kaynaklar",@@ -517,8 +508,6 @@"taskDock.status.running": "Devam ediyor","taskDock.status.success": "Hepsi tamamlandı","taskDock.totalCount": "{{count}} öğe",- "taskNav.all": "Tüm görevler",- "taskNav.noProjects": "Henüz proje yok","taskTemplate.action.connect.button": "{{provider}} ile Bağlan","taskTemplate.action.connect.error": "Bağlantı başarısız oldu, lütfen tekrar deneyin.","taskTemplate.action.connect.popupBlocked": "Bağlantı açılır penceresi engellendi. Devam etmek için tarayıcınızda açılır pencerelere izin verin.",diff --git a/locales/vi-VN/common.json b/locales/vi-VN/common.jsonindex 663fc2eab9a..ab0e28f7f8f 100644--- a/locales/vi-VN/common.json+++ b/locales/vi-VN/common.json@@ -183,9 +183,6 @@"cmdk.video": "Video AI","confirm": "Xác nhận","contact": "Liên hệ",- "contacts.create": "Tác nhân mới",- "contacts.empty": "Chưa có",- "contacts.groups": "Nhóm","continue": "Tiếp tục","copy": "Sao chép","copyFail": "Sao chép thất bại",@@ -349,9 +346,6 @@"makePrivate.error": "Không thể chuyển sang chế độ riêng tư","makePrivate.success": "Đã chuyển sang chế độ riêng tư","manageOnlyCreator": "Chỉ người tạo hoặc chủ sở hữu không gian làm việc mới có thể thực hiện điều này",- "messageList.empty": "Chưa có cuộc trò chuyện nào",- "messageList.newChat": "Cuộc trò chuyện mới",- "messageList.search": "Tìm kiếm","messengerBanner.dismiss": "Bỏ qua","messengerBanner.title": "Trò chuyện với Lobe AI trên các ứng dụng nhắn tin yêu thích của bạn","more": "Thêm",@@ -482,7 +476,6 @@"tab.audio": "Âm thanh","tab.chat": "Trò chuyện","tab.community": "Cộng đồng",- "tab.contacts": "Liên hệ","tab.create": "Tạo","tab.dashboard": "Bảng điều khiển","tab.discover": "Khám phá",@@ -496,8 +489,6 @@"tab.marketplace": "Chợ","tab.me": "Tôi","tab.memory": "Bộ nhớ",- "tab.messages": "Tin nhắn",- "tab.more": "Thêm","tab.pages": "Trang","tab.projects": "Dự án","tab.resource": "Tài nguyên",@@ -517,8 +508,6 @@"taskDock.status.running": "Đang tiến hành","taskDock.status.success": "Hoàn thành","taskDock.totalCount": "{{count}} mục",- "taskNav.all": "Tất cả nhiệm vụ",- "taskNav.noProjects": "Chưa có dự án nào","taskTemplate.action.connect.button": "Kết nối {{provider}}","taskTemplate.action.connect.error": "Kết nối thất bại, vui lòng thử lại.","taskTemplate.action.connect.popupBlocked": "Cửa sổ kết nối bị chặn. Hãy cho phép cửa sổ bật lên trong trình duyệt của bạn để tiếp tục.",diff --git a/locales/zh-CN/common.json b/locales/zh-CN/common.jsonindex 8b575a36d7e..714f7966f68 100644--- a/locales/zh-CN/common.json+++ b/locales/zh-CN/common.json@@ -185,23 +185,6 @@"cmdk.video": "AI 视频","confirm": "确认","contact": "联系我们",- "contacts.create": "新建助理",- "contacts.editProfile": "编辑档案",- "contacts.empty": "暂无",- "contacts.groups": "群组",- "contacts.info.bio": "简介",- "contacts.info.handle": "标识",- "contacts.info.mail": "邮箱",- "contacts.info.sendMail": "发邮件",- "contacts.manage": "管理",- "contacts.noDescription": "还没有简介",- "contacts.notFound": "该联系人不存在或你无权查看",- "contacts.pinned": "置顶",- "contacts.sendMessage": "发消息",- "contacts.sort.title": "名称",- "contacts.sort.tooltip": "排序",- "contacts.sort.updatedAt": "最近更新",- "contacts.viewProfile": "查看资料","continue": "继续","copy": "复制","copyFail": "复制失败",@@ -372,9 +355,6 @@"makePrivate.error": "改为私有失败","makePrivate.success": "已改为私有","manageOnlyCreator": "仅创建者或工作区 Owner 可操作",- "messageList.empty": "还没有会话",- "messageList.newChat": "新建会话",- "messageList.search": "搜索","messengerBanner.dismiss": "关闭","messengerBanner.title": "在你喜爱的聊天应用中,与 Lobe AI 畅聊","more": "更多",@@ -515,7 +495,6 @@"tab.audio": "音频","tab.chat": "会话","tab.community": "社区",- "tab.contacts": "通讯录","tab.create": "创建","tab.dashboard": "看板","tab.discover": "发现",@@ -529,8 +508,6 @@"tab.marketplace": "市场","tab.me": "我","tab.memory": "记忆",- "tab.messages": "消息",- "tab.more": "更多","tab.music": "音乐","tab.pages": "文稿","tab.projects": "项目",@@ -551,8 +528,6 @@"taskDock.status.running": "进行中","taskDock.status.success": "已完成","taskDock.totalCount": "{{count}} 项",- "taskNav.all": "全部任务",- "taskNav.noProjects": "还没有项目","taskTemplate.action.connect.button": "连接 {{provider}}","taskTemplate.action.connect.error": "连接失败,请重试。","taskTemplate.action.connect.popupBlocked": "连接弹出窗口被阻止。请在浏览器中允许弹出窗口以继续。",diff --git a/locales/zh-TW/common.json b/locales/zh-TW/common.jsonindex 6ba341fc125..d6bfa0c850c 100644--- a/locales/zh-TW/common.json+++ b/locales/zh-TW/common.json@@ -183,9 +183,6 @@"cmdk.video": "AI 影片","confirm": "確認","contact": "聯繫我們",- "contacts.create": "新增助手",- "contacts.empty": "尚無",- "contacts.groups": "群組","continue": "繼續","copy": "複製","copyFail": "複製失敗",@@ -349,9 +346,6 @@"makePrivate.error": "設為私人失敗","makePrivate.success": "已設為私人","manageOnlyCreator": "只有創建者或工作區擁有者可以執行此操作",- "messageList.empty": "尚無對話",- "messageList.newChat": "新對話",- "messageList.search": "搜尋","messengerBanner.dismiss": "關閉","messengerBanner.title": "在您喜愛的通訊應用程式上與 Lobe AI 對話","more": "更多",@@ -482,7 +476,6 @@"tab.audio": "音訊","tab.chat": "對話","tab.community": "社群",- "tab.contacts": "聯絡人","tab.create": "建立","tab.dashboard": "儀表板","tab.discover": "發現",@@ -496,8 +489,6 @@"tab.marketplace": "市場","tab.me": "我","tab.memory": "記憶",- "tab.messages": "訊息",- "tab.more": "更多","tab.pages": "文稿","tab.projects": "專案","tab.resource": "資源",@@ -517,8 +508,6 @@"taskDock.status.running": "進行中","taskDock.status.success": "全部完成","taskDock.totalCount": "{{count}} 項",- "taskNav.all": "所有任務",- "taskNav.noProjects": "尚無專案","taskTemplate.action.connect.button": "連接 {{provider}}","taskTemplate.action.connect.error": "連接失敗,請再試一次。","taskTemplate.action.connect.popupBlocked": "連接彈出窗口被阻止。請在瀏覽器中允許彈出窗口以繼續。",diff --git a/packages/app-config/src/featureFlags/schema.test.ts b/packages/app-config/src/featureFlags/schema.test.tsindex 1cdd13a11ee..132f3a787b4 100644--- a/packages/app-config/src/featureFlags/schema.test.ts+++ b/packages/app-config/src/featureFlags/schema.test.ts@@ -372,17 +372,6 @@ describe('mapFeatureFlagsEnvToState', () => {expect(mapFeatureFlagsEnvToState(config, 'user-456').enableAgentKnowledgeSpace).toBe(false);});- it('should keep the rail layout off by default and enable it per user or globally', () => {- expect(DEFAULT_FEATURE_FLAGS.im_layout).toBe(false);- expect(mapFeatureFlagsEnvToState(DEFAULT_FEATURE_FLAGS, 'user-1').enableImLayout).toBe(false);-- expect(mapFeatureFlagsEnvToState({ im_layout: true }).enableImLayout).toBe(true);-- const config = { im_layout: ['user-123'] };- expect(mapFeatureFlagsEnvToState(config, 'user-123').enableImLayout).toBe(true);- expect(mapFeatureFlagsEnvToState(config, 'user-456').enableImLayout).toBe(false);- });-it('should keep Channels off by default and enable them per user or globally', () => {expect(DEFAULT_FEATURE_FLAGS.channel).toBe(false);expect(mapFeatureFlagsEnvToState(DEFAULT_FEATURE_FLAGS, 'user-1').enableChannels).toBe(false);diff --git a/packages/app-config/src/featureFlags/schema.ts b/packages/app-config/src/featureFlags/schema.tsindex bb887c4b6cb..0ea5f12e54e 100644--- a/packages/app-config/src/featureFlags/schema.ts+++ b/packages/app-config/src/featureFlags/schema.ts@@ -98,15 +98,6 @@ export const FeatureFlagsSchema = z.object({*/agent_knowledge_space: FeatureFlagValue.optional(),- /**- * Trial gate for the rail layout: icon rail + one wrapped list column and- * content, the IM-style Messages list (Lobe AI opens by default), Contacts,- * the Tasks scope list and the agent profile side panel. Off keeps the- * current sidebar layout untouched. Array values are user ids, so it can be- * tried by an allowlist before anyone else sees it.- */- im_layout: FeatureFlagValue.optional(),-/*** Multi-agent Channels: the sidebar section, Channel pages and every Channel API, including* Agent history reads (`lobe-channel`, `lh channel`). Off: none of it is reachable. Work that@@ -225,9 +216,6 @@ export const DEFAULT_FEATURE_FLAGS: IFeatureFlags = {// Off until an admin publishes a user allowlist or flips it to true.dashboard: false,- // Off: a personal-trial layout, enabled per user id.- im_layout: false,-// Off until an admin publishes a user allowlist or flips it to true.mcp_apps: false,agent_knowledge_space: false,@@ -300,7 +288,6 @@ export const mapFeatureFlagsEnvToState = (userId,'agent_knowledge_space',),- enableImLayout: evaluateFeatureFlag(config.im_layout, userId, 'im_layout'),enableChannels: evaluateFeatureFlag(config.channel, userId, 'channel'),enableManagedCloudDevice: evaluateFeatureFlag(config.managed_cloud_device,diff --git a/packages/locales/src/default/common.ts b/packages/locales/src/default/common.tsindex 5d90ef21fa4..5ecff126816 100644--- a/packages/locales/src/default/common.ts+++ b/packages/locales/src/default/common.ts@@ -443,28 +443,6 @@ export default {'addNew': 'Add new','gotIt': 'Got it','more': 'More',- 'contacts.create': 'New agent',- 'contacts.editProfile': 'Edit profile',- 'contacts.empty': 'None yet',- 'contacts.groups': 'Groups',- 'contacts.info.bio': 'Bio',- 'contacts.info.handle': 'Handle',- 'contacts.info.mail': 'Email',- 'contacts.info.sendMail': 'Send email',- 'contacts.manage': 'Manage',- 'contacts.noDescription': 'No description yet',- 'contacts.notFound': 'This contact no longer exists or is not visible to you',- 'contacts.sendMessage': 'Send message',- 'contacts.viewProfile': 'View profile',- 'contacts.pinned': 'Pinned',- 'contacts.sort.title': 'Name',- 'contacts.sort.tooltip': 'Sort',- 'contacts.sort.updatedAt': 'Recently updated',- 'messageList.empty': 'No conversations yet',- 'messageList.newChat': 'New conversation',- 'messageList.search': 'Search',- 'taskNav.all': 'All tasks',- 'taskNav.noProjects': 'No projects yet','navPanel.agent': 'Agents','navPanel.createPrivateFolder': 'New private category','navPanel.createWorkspaceAgent': 'New workspace agent',@@ -642,9 +620,6 @@ export default {'tab.image': 'Image','tab.audio': 'Audio','tab.chat': 'Chat',- 'tab.contacts': 'Contacts',- 'tab.messages': 'Messages',- 'tab.more': 'More','tab.projects': 'Projects','recents': 'Recents','tab.community': 'Community',diff --git a/packages/types/src/serverConfig.ts b/packages/types/src/serverConfig.tsindex a1b0db5e2cf..b626b1eb61b 100644--- a/packages/types/src/serverConfig.ts+++ b/packages/types/src/serverConfig.ts@@ -38,12 +38,6 @@ export type IFeatureFlagsState = {*/enableDashboard: boolean | undefined;enableDevDock: boolean | undefined;- /**- * Rail layout trial (`im_layout`): icon rail, IM-style Messages list,- * Contacts, Tasks scope list and the agent profile side panel. Off keeps the- * current sidebar layout.- */- enableImLayout: boolean | undefined;/*** @deprecated The new subscription tiers are always on. Kept as a constant* `true` because released desktop clients still read it and fall back to thediff --git a/src/features/AgentSidebar/Header/index.tsx b/src/features/AgentSidebar/Header/index.tsxindex 45f0b1a9cc1..47bcb4fdcca 100644--- a/src/features/AgentSidebar/Header/index.tsx+++ b/src/features/AgentSidebar/Header/index.tsx@@ -3,17 +3,14 @@import { type PropsWithChildren } from 'react';import SideBarHeaderLayout from '@/features/NavPanel/SideBarHeaderLayout';-import { useContactBackUrl } from '@/features/NavRail/useContactBackUrl';import Agent from './Agent';import Nav from './Nav';const HeaderInfo = (_props: PropsWithChildren) => {- const backTo = useContactBackUrl();-return (<>- <SideBarHeaderLayout backTo={backTo} left={<Agent />} />+ <SideBarHeaderLayout left={<Agent />} /><Nav /></>);diff --git a/src/features/AgentTasks/AgentTaskList/TasksTabPage.tsx b/src/features/AgentTasks/AgentTaskList/TasksTabPage.tsxdeleted file mode 100644index 43613f646fc..00000000000--- a/src/features/AgentTasks/AgentTaskList/TasksTabPage.tsx+++ /dev/null@@ -1,23 +0,0 @@-'use client';--import { memo } from 'react';-import { useSearchParams } from 'react-router';--import { TASK_PROJECT_PARAM } from '@/features/TaskNav/taskScope';--import AgentTasksPage from './AgentTasksPage';--/**- * `/tasks` page. A project picked in the Tasks tab list column scopes the list- * through `?project=<id>`; without it the page lists every task as before.- */-const TasksTabPage = memo(() => {- const [searchParams] = useSearchParams();- const projectId = searchParams.get(TASK_PROJECT_PARAM) || undefined;-- return <AgentTasksPage key={projectId ?? 'all'} projectId={projectId} />;-});--TasksTabPage.displayName = 'TasksTabPage';--export default TasksTabPage;diff --git a/src/features/AgentViewAll/AgentViewAllPage.tsx b/src/features/AgentViewAll/AgentViewAllPage.tsxindex eaeb6a774f5..2dd367e67d6 100644--- a/src/features/AgentViewAll/AgentViewAllPage.tsx+++ b/src/features/AgentViewAll/AgentViewAllPage.tsx@@ -38,7 +38,6 @@ import { AgentModalProvider } from '@/features/HomeSidebar/Body/Agent/ModalProviimport { useSidebarItemVisibility } from '@/features/HomeSidebar/Body/Agent/useSidebarItemVisibility';import { useCreateMenuItems } from '@/features/HomeSidebar/hooks';import NavHeader from '@/features/NavHeader';-import { useImLayout } from '@/features/NavRail/useImLayout';import WideScreenContainer from '@/features/WideScreenContainer';import { useFetchAgentLabels } from '@/hooks/useFetchAgentLabels';import { useFetchAgentList } from '@/hooks/useFetchAgentList';@@ -500,10 +499,6 @@ const AgentViewAllPage = memo(() => {},[isListed, setSidebarItemVisible, t],);- // The `im_layout` rail has no agent sidebar, so its "in sidebar" curation- // (the section and every per-item toggle) does not apply there.- const imLayout = useImLayout();- const toggleSidebar = imLayout ? undefined : handleToggleSidebar;const renderCard = useCallback((item: SidebarAgentItem) => (@@ -512,10 +507,10 @@ const AgentViewAllPage = memo(() => {key={item.id}owner={showAuthor && item.userId ? authorByUserId.get(item.userId) : undefined}sidebarHidden={!isListed(item)}- onToggleSidebar={workspaceSidebarIds?.fixed.has(item.id) ? undefined : toggleSidebar}+ onToggleSidebar={workspaceSidebarIds?.fixed.has(item.id) ? undefined : handleToggleSidebar}/>),- [showAuthor, authorByUserId, toggleSidebar, isListed, workspaceSidebarIds],+ [showAuthor, authorByUserId, handleToggleSidebar, isListed, workspaceSidebarIds],);const renderRow = useCallback(@@ -526,10 +521,10 @@ const AgentViewAllPage = memo(() => {key={item.id}showAuthor={showAuthor}sidebarHidden={!isListed(item)}- onToggleSidebar={workspaceSidebarIds?.fixed.has(item.id) ? undefined : toggleSidebar}+ onToggleSidebar={workspaceSidebarIds?.fixed.has(item.id) ? undefined : handleToggleSidebar}/>),- [showAuthor, authorByUserId, toggleSidebar, isListed, workspaceSidebarIds],+ [showAuthor, authorByUserId, handleToggleSidebar, isListed, workspaceSidebarIds],);const { allowed: canCreate, reason: createBlockedReason } = usePermission('create_content');@@ -594,8 +589,8 @@ const AgentViewAllPage = memo(() => {paddingInline={16}wrapperStyle={{ flex: 1, overflowY: 'auto' }}>- {!imLayout && !isInit && !keyword.trim() && <AgentViewAllSidebarSectionSkeleton />}- {!imLayout && isInit && !keyword.trim() && sidebarItems.length > 0 && (+ {!isInit && !keyword.trim() && <AgentViewAllSidebarSectionSkeleton />}+ {isInit && !keyword.trim() && sidebarItems.length > 0 && (<SidebarAgentsSectionfixedIds={workspaceSidebarIds?.fixed}items={sidebarItems}diff --git a/src/features/ContactList/ContactAvatar.tsx b/src/features/ContactList/ContactAvatar.tsxdeleted file mode 100644index e1718c5faed..00000000000--- a/src/features/ContactList/ContactAvatar.tsx+++ /dev/null@@ -1,33 +0,0 @@-import type { SidebarAgentItem } from '@lobechat/types';-import { memo } from 'react';--import AgentAvatar from '@/components/AgentAvatar';-import AgentGroupAvatar from '@/features/AgentGroupAvatar';--/** An agent's or group's avatar, shared by the contact row and the contact card. */-const ContactAvatar = memo<{ item: SidebarAgentItem; name: string; size: number }>(- ({ item, name, size }) => {- const customAvatar = typeof item.avatar === 'string' ? item.avatar : undefined;-- return item.type === 'group' ? (- <AgentGroupAvatar- avatar={customAvatar}- backgroundColor={item.backgroundColor || undefined}- memberAvatars={Array.isArray(item.avatar) ? item.avatar : []}- size={size}- />- ) : (- <AgentAvatar- agentId={item.id}- avatar={customAvatar}- background={item.backgroundColor || undefined}- name={name}- size={size}- />- );- },-);--ContactAvatar.displayName = 'ContactAvatar';--export default ContactAvatar;diff --git a/src/features/ContactList/ContactDetail.tsx b/src/features/ContactList/ContactDetail.tsxdeleted file mode 100644index edf24aa618c..00000000000--- a/src/features/ContactList/ContactDetail.tsx+++ /dev/null@@ -1,289 +0,0 @@-'use client';--import { cx, DropdownMenu, Empty, Flexbox, Icon, Skeleton, Text } from '@lobehub/ui';-import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';-import * as stylex from '@stylexjs/stylex';-import type { LucideIcon } from 'lucide-react';-import {- MessageCircleIcon,- MoreHorizontalIcon,- PencilLineIcon,- Settings2Icon,- UserRoundIcon,- UserRoundXIcon,-} from 'lucide-react';-import { type CSSProperties, memo, type Ref } from 'react';-import { useTranslation } from 'react-i18next';-import { useParams } from 'react-router';--import AsyncError from '@/components/AsyncError';-import { cardStyles } from '@/features/AgentViewAll/AgentCard';-import { coverPattern } from '@/features/AgentViewAll/coverColor';-import { resolveAgentBadge } from '@/features/AgentViewAll/resolveAgentBadge';-import SidebarItemAvatar from '@/features/AgentViewAll/SidebarItemAvatar';-import { useAgentCoverColor } from '@/features/AgentViewAll/useAgentCoverColor';-import { useChannelsEnabled } from '@/features/Channels/useChannelsEnabled';-import { useAgentConversationLink } from '@/features/MessageList/useAgentConversationLink';-import NavHeader from '@/features/NavHeader';-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';-import WorkspaceLink from '@/features/Workspace/WorkspaceLink';-import { useCopyAgentIdMenuItem } from '@/hooks/useCopyAgentIdMenuItem';--import { ContactInfo } from './ContactInfo';-import { type ContactCardState, useContactCard } from './useContactCard';--const AVATAR_SIZE = 88;-const COVER_HEIGHT = 144;--const styles = stylex.create({- body: {- paddingBlockEnd: '48px',- paddingInline: '24px',- maxWidth: '520px',- width: '100%',- textAlign: 'center',- },- // The badge cover from the agents wall, widened into a profile header.- cover: {- position: 'relative',- overflow: 'hidden',- flexShrink: 0,- borderRadius: '12px',- height: `${COVER_HEIGHT}px`,- width: '100%',- },- // The avatar straddles the cover's bottom edge, as on the badge.- avatar: {- marginBlockStart: `-${AVATAR_SIZE / 2}px`,- },- actions: {- display: 'grid',- gridAutoColumns: 'minmax(0, 1fr)',- gridAutoFlow: 'column',- gap: '8px',- width: '100%',- marginBlockStart: '16px',- },- // An IM-profile action: icon over label, the whole tile clickable.- tile: {- display: 'flex',- flexDirection: 'column',- alignItems: 'center',- justifyContent: 'center',- gap: '4px',- paddingBlock: '12px',- paddingInline: '8px',- borderWidth: 0,- borderRadius: '12px',- fontFamily: 'inherit',- fontSize: '12px',- lineHeight: '18px',- color: cssVar.colorText,- textDecoration: 'none',- cursor: 'pointer',- backgroundColor: {- 'default': cssVar.colorFillTertiary,- ':hover': cssVar.colorFillSecondary,- },- transitionProperty: 'background-color',- transitionDuration: '0.15s',- },- state: {- paddingBlock: '48px',- paddingInline: '24px',- maxWidth: '520px',- width: '100%',- },-});--const TileContent = ({ icon, label }: { icon: LucideIcon; label: string }) => (- <>- <Icon icon={icon} size={20} />- <span>{label}</span>- </>-);--// Takes the ref and props a DropdownMenu trigger hands its child.-const MenuTile = ({- className,- label,- ref,- ...rest-}: {- className?: string;- label: string;- ref?: Ref<HTMLButtonElement>;-}) => (- <button- ref={ref}- type="button"- {...rest}- className={cx(stylex.props(styles.tile).className, className)}- >- <TileContent icon={MoreHorizontalIcon} label={label} />- </button>-);--const ContactCard = memo<Extract<ContactCardState, { status: 'ready' }>>(- ({ canEdit, chatUrl, item, profileUrl, role, slug, title }) => {- const { t } = useTranslation('common');- const navigate = useWorkspaceAwareNavigate();- const badge = resolveAgentBadge(item);- const coverColor = useAgentCoverColor(item, badge.cover, !!badge.coverImage);- const isGroup = item.type === 'group';- const agentId = isGroup ? undefined : item.id;- // With Channels on, "Message" opens the direct Channel and "View" the Agent's own page;- // without them both would land on that page, so only "Message" is offered.- const channelsEnabled = useChannelsEnabled();- const message = useAgentConversationLink(agentId, chatUrl);- const copyIdItem = useCopyAgentIdMenuItem(agentId);- const moreItems = [- {- icon: canEdit ? PencilLineIcon : UserRoundIcon,- key: 'profile',- label: t(canEdit ? 'contacts.editProfile' : 'contacts.viewProfile'),- onClick: () => navigate(profileUrl),- },- ...(copyIdItem ? [copyIdItem] : []),- ];-- return (- <>- <div {...stylex.props(styles.cover)}>- <div- className={cardStyles.cover}- data-cover-image={badge.coverImage ? '' : undefined}- data-pattern={badge.coverImage ? undefined : coverPattern(item)}- style={- {- '--agent-cover': coverColor,- 'backgroundImage': badge.coverImage- ? `url(${JSON.stringify(badge.coverImage)})`- : undefined,- 'height': '100%',- } as CSSProperties- }- />- </div>- <Flexbox align={'center'} gap={8} {...stylex.props(styles.body)}>- <span- className={cx(- stylex.props(styles.avatar).className,- cardStyles.avatarRing,- !badge.cover && cardStyles.avatarPlain,- isGroup && cardStyles.avatarRingGroup,- )}- >- <SidebarItemAvatar item={item} shape={'circle'} size={AVATAR_SIZE - 6} />- </span>- <Text- ellipsis- as={'h1'}- fontSize={22}- style={{ margin: 0, maxWidth: '100%' }}- weight={600}- >- {title}- </Text>- {role && (- <span className={cardStyles.role} title={role}>- {role}- </span>- )}- <div {...stylex.props(styles.actions)}>- <WorkspaceLink- to={message.url}- onClick={message.onClick}- {...stylex.props(styles.tile)}- >- <TileContent icon={MessageCircleIcon} label={t('contacts.sendMessage')} />- </WorkspaceLink>- {agentId && channelsEnabled && (- <WorkspaceLink to={chatUrl} {...stylex.props(styles.tile)}>- <TileContent icon={Settings2Icon} label={t('contacts.manage')} />- </WorkspaceLink>- )}- <DropdownMenu items={moreItems}>- <MenuTile label={t('more')} />- </DropdownMenu>- </div>- <ContactInfo agentId={agentId} description={item.description} slug={slug} />- </Flexbox>- </>- );- },-);--ContactCard.displayName = 'ContactCard';--/**- * A contact's card beside the Contacts list, laid out like an IM profile: the- * agents-wall badge widened into a header, Message / View / More actions, and an- * info list with the handle, mail addresses and bio. Opening a contact only- * previews it — the conversation and the profile are one click on.- */-const ContactDetail = memo<{ id: string }>(({ id }) => {- const { t } = useTranslation('common');- const card = useContactCard(id);-- switch (card.status) {- case 'ready': {- return <ContactCard {...card} />;- }- case 'error': {- return (- <Flexbox align={'center'} flex={1} justify={'center'} {...stylex.props(styles.state)}>- <AsyncError error={card.error} variant="inline" onRetry={card.retry} />- </Flexbox>- );- }- case 'missing': {- return (- <Flexbox align={'center'} flex={1} justify={'center'} {...stylex.props(styles.state)}>- <Empty description={t('contacts.notFound')} icon={UserRoundXIcon} />- </Flexbox>- );- }- default: {- return (- <>- <Skeleton height={COVER_HEIGHT} radius={12} width={'100%'} />- <Flexbox align={'center'} gap={12} {...stylex.props(styles.body)}>- <Skeleton.Avatar- shape={'circle'}- size={AVATAR_SIZE}- style={{ marginBlockStart: -AVATAR_SIZE / 2 }}- />- <Skeleton height={28} width={160} />- <Skeleton.Text rows={2} width={['100%', '60%']} />- </Flexbox>- </>- );- }- }-});--ContactDetail.displayName = 'ContactDetail';--export { ContactDetail };--/** `/agents/:id`: the contact card in the content column of the Contacts tab. */-const ContactDetailPage = () => {- const { id } = useParams<{ id: string }>();-- return (- <Flexbox flex={1} height={'100%'}>- <NavHeader />- <Flexbox- align={'center'}- flex={1}- paddingInline={16}- style={{ overflowY: 'auto', paddingBlockStart: 8 }}- >- {id && <ContactDetail id={id} key={id} />}- </Flexbox>- </Flexbox>- );-};--export default ContactDetailPage;diff --git a/src/features/ContactList/ContactInfo.tsx b/src/features/ContactList/ContactInfo.tsxdeleted file mode 100644index 4c77b6aa83d..00000000000--- a/src/features/ContactList/ContactInfo.tsx+++ /dev/null@@ -1,104 +0,0 @@-'use client';--import { ActionIcon, CopyButton, Flexbox } from '@lobehub/ui';-import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';-import * as stylex from '@stylexjs/stylex';-import { MailIcon } from 'lucide-react';-import { memo } from 'react';-import { useTranslation } from 'react-i18next';--import { useAgentAccounts } from '@/features/AgentMail/useAgentIdentity';--import { contactInfoRows } from './contactInfoRows';--const styles = stylex.create({- list: {- overflow: 'hidden',- marginBlockStart: '8px',- borderRadius: '12px',- width: '100%',- textAlign: 'start',- backgroundColor: cssVar.colorFillQuaternary,- },- row: {- paddingBlock: '12px',- paddingInline: '16px',- },- divided: {- borderBlockStartWidth: '1px',- borderBlockStartStyle: 'solid',- borderBlockStartColor: cssVar.colorBorderSecondary,- },- label: {- fontSize: '12px',- color: cssVar.colorTextTertiary,- },- value: {- overflow: 'hidden',- fontSize: '14px',- color: cssVar.colorText,- textOverflow: 'ellipsis',- whiteSpace: 'nowrap',- },- bio: {- lineHeight: '22px',- whiteSpace: 'pre-wrap',- overflowWrap: 'anywhere',- },-});--const LABELS = {- bio: 'contacts.info.bio',- handle: 'contacts.info.handle',- mail: 'contacts.info.mail',-} as const;--/**- * The contact's info list, like the username, numbers and bio on a phone contact: its handle,- * the mail addresses it owns and its bio. Groups pass no `agentId`, since they own no addresses.- * Rows it has nothing for are left out, so the card never shows an empty box.- */-export const ContactInfo = memo<{- agentId?: string;- description?: string | null;- slug?: string | null;-}>(({ agentId, description, slug }) => {- const { t } = useTranslation('common');- const { data } = useAgentAccounts(agentId ?? '');- const rows = contactInfoRows({ accounts: data, description, slug });-- if (rows.length === 0) return null;-- return (- <div {...stylex.props(styles.list)}>- {rows.map((row, index) => (- <Flexbox- horizontal- align={'center'}- gap={8}- key={row.key}- {...stylex.props(styles.row, index > 0 && styles.divided)}- >- <Flexbox flex={1} gap={2} style={{ minWidth: 0 }}>- <span {...stylex.props(styles.label)}>{t(LABELS[row.kind])}</span>- {row.kind === 'bio' ? (- <span {...stylex.props(styles.value, styles.bio)}>{row.value}</span>- ) : (- <span title={row.value} {...stylex.props(styles.value)}>- {row.value}- </span>- )}- </Flexbox>- {row.kind !== 'bio' && <CopyButton content={row.value} size={'small'} />}- {row.kind === 'mail' && (- <a aria-label={t('contacts.info.sendMail')} href={`mailto:${row.value}`}>- <ActionIcon icon={MailIcon} size={'small'} title={t('contacts.info.sendMail')} />- </a>- )}- </Flexbox>- ))}- </div>- );-});--ContactInfo.displayName = 'ContactInfo';diff --git a/src/features/ContactList/const.ts b/src/features/ContactList/const.tsdeleted file mode 100644index 06b00354946..00000000000--- a/src/features/ContactList/const.ts+++ /dev/null@@ -1,2 +0,0 @@-/** The contact card of an agent or group, shown beside the Contacts list. */-export const CONTACT_URL = (id: string) => `/agents/${id}`;diff --git a/src/features/ContactList/contactInfoRows.test.ts b/src/features/ContactList/contactInfoRows.test.tsdeleted file mode 100644index b7af867e85a..00000000000--- a/src/features/ContactList/contactInfoRows.test.ts+++ /dev/null@@ -1,31 +0,0 @@-import { describe, expect, it } from 'vitest';--import { contactInfoRows } from './contactInfoRows';--describe('contactInfoRows', () => {- it('lists the handle, every live mailbox and the bio, in that order', () => {- expect(- contactInfoRows({- accounts: [- { id: 'a1', identifier: '[email protected]', kind: 'mail', status: 'revoked' },- { id: 'a2', identifier: '0xabc', kind: 'wallet', status: 'active' },- { id: 'a3', identifier: '[email protected]', kind: 'mail', status: 'active' },- { id: 'a4', identifier: '[email protected]', kind: 'mail', status: 'provisioning' },- ],- description: 'Ships the lobe.id release\n',- slug: 'lobe-id',- }),- ).toEqual([- { key: 'handle', kind: 'handle', value: '@lobe-id' },- { key: 'a3', kind: 'mail', value: '[email protected]' },- { key: 'a4', kind: 'mail', value: '[email protected]' },- { key: 'bio', kind: 'bio', value: 'Ships the lobe.id release' },- ]);- });-- it('leaves out what the contact has nothing for', () => {- // A group, or another member's agent: no handle shown and no accounts listed.- expect(contactInfoRows({ accounts: [], description: ' ', slug: null })).toEqual([]);- expect(contactInfoRows({})).toEqual([]);- });-});diff --git a/src/features/ContactList/contactInfoRows.ts b/src/features/ContactList/contactInfoRows.tsdeleted file mode 100644index 2a2db939392..00000000000--- a/src/features/ContactList/contactInfoRows.ts+++ /dev/null@@ -1,33 +0,0 @@-export type ContactInfoRow =- | { key: string; kind: 'handle'; value: string }- | { key: string; kind: 'mail'; value: string }- | { key: string; kind: 'bio'; value: string };--/**- * The rows of a contact's info list, like the username, numbers and bio on a phone contact:- * the handle, then every mail address the agent still owns, then its bio. A row the contact has- * nothing for is left out rather than shown as "not set". The account read is scoped to the- * caller, so another member's agent simply lists no mail rows.- */-export const contactInfoRows = ({- accounts,- description,- slug,-}: {- accounts?: { id: string; identifier: string; kind: string; status: string }[];- description?: string | null;- slug?: string | null;-}): ContactInfoRow[] => {- const rows: ContactInfoRow[] = [];- if (slug) rows.push({ key: 'handle', kind: 'handle', value: `@${slug}` });-- for (const account of accounts ?? []) {- if (account.kind === 'mail' && account.status !== 'revoked')- rows.push({ key: account.id, kind: 'mail', value: account.identifier });- }-- const bio = description?.trim();- if (bio) rows.push({ key: 'bio', kind: 'bio', value: bio });-- return rows;-};diff --git a/src/features/ContactList/index.test.tsx b/src/features/ContactList/index.test.tsxdeleted file mode 100644index 0a04d2719a6..00000000000--- a/src/features/ContactList/index.test.tsx+++ /dev/null@@ -1,97 +0,0 @@-/**- * @vitest-environment happy-dom- */-import { fireEvent, render, screen } from '@testing-library/react';-import { createElement, type ReactNode } from 'react';-import { beforeEach, describe, expect, it, vi } from 'vitest';--import { ContactListBody } from './index';--const fetch = vi.hoisted(() => ({ error: undefined as unknown, mutate: vi.fn() }));-const agentList = vi.hoisted(() => ({ init: false, items: [] as object[] }));--vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));-vi.mock('@/business/client/hooks/useActiveWorkspaceSlug', () => ({- useActiveWorkspaceSlug: () => null,-}));-vi.mock('@/hooks/useActiveLocation', () => ({ useActiveLocation: () => ({ pathname: '/' }) }));-vi.mock('@/hooks/useFetchAgentList', () => ({ useFetchAgentList: () => fetch }));-vi.mock('@/store/home', () => ({- useHomeStore: (selector: (state: object) => unknown) => selector({}),-}));-vi.mock('@/store/home/selectors', () => ({- homeAgentListSelectors: {- allAgents: () => agentList.items,- isAgentListInit: () => agentList.init,- },-}));-vi.mock('@/features/Workspace/WorkspaceLink', () => ({- default: ({ children, to, ...rest }: { children: ReactNode; to: string }) =>- createElement('a', { href: to, ...rest }, children),-}));-vi.mock('@/components/Avatar', () => ({ default: () => createElement('span') }));-vi.mock('@/features/NavPanel/components/SkeletonList', () => ({- default: () => createElement('div', {}, 'Loading contacts'),-}));-vi.mock('@/components/AsyncError', () => ({- default: ({ onRetry }: { onRetry?: () => void }) =>- createElement('button', { onClick: onRetry, type: 'button' }, 'Retry contacts'),-}));--beforeEach(() => {- agentList.init = false;- agentList.items = [];- fetch.error = undefined;- fetch.mutate.mockReset();-});--describe('ContactListBody', () => {- it('shows the skeleton while the first load is in flight', () => {- render(createElement(ContactListBody));-- expect(screen.getByText('Loading contacts')).toBeInTheDocument();- });-- it('shows a retryable error when the first load fails', () => {- fetch.error = new Error('network');-- render(createElement(ContactListBody));-- expect(screen.queryByText('Loading contacts')).not.toBeInTheDocument();- fireEvent.click(screen.getByText('Retry contacts'));- expect(fetch.mutate).toHaveBeenCalled();- });-- it('shows each contact as avatar and name only, without the description', () => {- agentList.init = true;- agentList.items = [- { description: 'Turns ideas into product specs', id: 'agt_1', title: 'Product Helper' },- ];-- render(createElement(ContactListBody));-- expect(screen.getByRole('link', { name: 'Product Helper' })).toHaveTextContent(- /^Product Helper$/,- );- expect(screen.queryByText('Turns ideas into product specs')).not.toBeInTheDocument();- });-- it('opens the contact card instead of the profile editor', () => {- agentList.init = true;- agentList.items = [- { id: 'agt_1', title: 'Product Helper' },- { id: 'grp_1', title: 'Launch Crew', type: 'group' },- ];-- render(createElement(ContactListBody));-- expect(screen.getByRole('link', { name: 'Product Helper' })).toHaveAttribute(- 'href',- '/agents/agt_1',- );- expect(screen.getByRole('link', { name: 'Launch Crew' })).toHaveAttribute(- 'href',- '/agents/grp_1',- );- });-});diff --git a/src/features/ContactList/index.tsx b/src/features/ContactList/index.tsxdeleted file mode 100644index 1bd3e7caf29..00000000000--- a/src/features/ContactList/index.tsx+++ /dev/null@@ -1,231 +0,0 @@-'use client';--import { agentDisplayName, type SidebarAgentItem } from '@lobechat/types';-import {- AccordionHeader,- AccordionItem,- AccordionPanel,- AccordionRoot,- accordionStyles,- AccordionTrigger,- ActionIcon,- cx,- DropdownMenu,- Flexbox,- Icon,- Text,-} from '@lobehub/ui';-import * as stylex from '@stylexjs/stylex';-import isEqual from 'fast-deep-equal';-import { ArrowDownUpIcon, Pin, PinOff, UserRoundPlusIcon } from 'lucide-react';-import { memo, useMemo } from 'react';-import { useTranslation } from 'react-i18next';--import { useActiveWorkspaceSlug } from '@/business/client/hooks/useActiveWorkspaceSlug';-import AsyncError from '@/components/AsyncError';-import { DESKTOP_HEADER_ICON_SMALL_SIZE } from '@/const/layoutTokens';-import { AgentModalProvider } from '@/features/HomeSidebar/Body/Agent/ModalProvider';-import { useCreateMenuItems } from '@/features/HomeSidebar/hooks';-import { AVATAR_SIZE, ConversationRow, ListHeader } from '@/features/MessageList';-import SkeletonList from '@/features/NavPanel/components/SkeletonList';-import { NavPanelPortal } from '@/features/NavPanel/NavPanelPortal';-import { NAV_PANEL_CONTACTS_KEY } from '@/features/NavPanel/railRouteKey';-import SideBarLayout from '@/features/NavPanel/SideBarLayout';-import { useActiveLocation } from '@/hooks/useActiveLocation';-import { useFetchAgentList } from '@/hooks/useFetchAgentList';-import { useGlobalStore } from '@/store/global';-import { systemStatusSelectors } from '@/store/global/selectors';-import { useHomeStore } from '@/store/home';-import { homeAgentListSelectors } from '@/store/home/selectors';--import { CONTACT_URL } from './const';-import ContactAvatar from './ContactAvatar';-import { CONTACT_SORT_BYS, groupContacts } from './sortContacts';-import { styles } from './style';--const useActiveRouteId = () => {- const { pathname } = useActiveLocation();- const slug = useActiveWorkspaceSlug();- const segments = pathname.split('/').filter(Boolean);- const [root, id] = slug && segments[0] === slug ? segments.slice(1) : segments;-- return root === 'agents' || root === 'agent' || root === 'group' ? id : undefined;-};--const Contact = memo<{ active: boolean; item: SidebarAgentItem }>(({ active, item }) => {- const { t } = useTranslation('chat');- const { t: tCommon } = useTranslation('common');- const [pinAgent, pinAgentGroup] = useHomeStore((s) => [s.pinAgent, s.pinAgentGroup]);- const pinned = !!item.pinned;- const title =- item.type === 'group'- ? item.title || t('untitledAgent')- : agentDisplayName(item, t('untitledAgent'));-- return (- <ConversationRow- singleLine- active={active}- avatar={<ContactAvatar item={item} name={title} size={AVATAR_SIZE} />}- title={title}- url={CONTACT_URL(item.id)}- contextMenuItems={() => [- {- icon: <Icon icon={pinned ? PinOff : Pin} />,- key: 'pin',- label: tCommon(pinned ? 'pinOff' : 'pin'),- onClick: () =>- item.type === 'group' ? pinAgentGroup(item.id, !pinned) : pinAgent(item.id, !pinned),- },- ]}- />- );-});--Contact.displayName = 'Contact';--const Body = memo(() => {- const { t } = useTranslation('common');- const { t: tChat } = useTranslation('chat');- const { error, mutate } = useFetchAgentList();- const isInit = useHomeStore(homeAgentListSelectors.isAgentListInit);- const items = useHomeStore(homeAgentListSelectors.allAgents, isEqual);- const activeRouteId = useActiveRouteId();- const sortBy = useGlobalStore(systemStatusSelectors.contactListSortBy);- const updateSystemStatus = useGlobalStore((s) => s.updateSystemStatus);-- const { agents, groups, pinned } = useMemo(- () =>- groupContacts(- [...new Map(items.map((item) => [item.id, item])).values()],- sortBy,- tChat('untitledAgent'),- ),- [items, sortBy, tChat],- );-- const sortMenuItems = CONTACT_SORT_BYS.map((by) => ({- checked: sortBy === by,- key: by,- label: t(`contacts.sort.${by}`),- onCheckedChange: () => updateSystemStatus({ contactListSortBy: by }),- type: 'checkbox' as const,- }));-- if (!isInit && items.length === 0)- return error ? (- <AsyncError error={error} variant="inline" onRetry={() => void mutate()} />- ) : (- <SkeletonList paddingBlock={8} />- );-- const sections = [- // Pinned contacts lead, like the Messages list; the section is left out until one is pinned.- ...(pinned.length > 0 ? [{ items: pinned, key: 'pinned', title: t('contacts.pinned') }] : []),- // Groups next: there are few, and they would sink below every agent.- { items: groups, key: 'groups', title: t('contacts.groups') },- { items: agents, key: 'agents', title: t('navPanel.agent') },- ];-- // The standard sidebar accordion (same as the home sidebar sections), so- // each section collapses independently with the shared header styling.- return (- <Flexbox paddingBlock={'4px 12px'} paddingInline={4}>- <AccordionRoot- // Listed up front so a section that appears later, like the first pin, opens expanded.- defaultValue={['pinned', 'groups', 'agents']}- indicatorPlacement={'inline'}- style={{ gap: 8 }}- >- {sections.map((section) => (- <AccordionItem key={section.key} value={section.key}>- <AccordionHeader>- <AccordionTrigger style={{ paddingBlock: 4, paddingInline: '8px 4px' }}>- <Flexbox horizontal align={'center'} gap={4}>- <Text ellipsis fontSize={12} type={'secondary'} weight={500}>- {section.title}- </Text>- <Text fontSize={11} type={'secondary'}>- {section.items.length}- </Text>- </Flexbox>- </AccordionTrigger>- {/* One order for both sections; the hover action sits where the home sidebar keeps its section actions. */}- <Flexbox- horizontal- align={'center'}- className={cx(- 'accordion-action',- accordionStyles.action,- accordionStyles.actionBorderless,- )}- >- <DropdownMenu items={sortMenuItems} placement={'bottomRight'}>- <ActionIcon- icon={ArrowDownUpIcon}- size={'small'}- title={t('contacts.sort.tooltip')}- />- </DropdownMenu>- </Flexbox>- </AccordionHeader>- <AccordionPanel>- <Flexbox gap={1} paddingBlock={1} paddingInline={2}>- {section.items.length === 0 ? (- <div {...stylex.props(styles.empty)}>{t('contacts.empty')}</div>- ) : (- section.items.map((item) => (- <Contact active={item.id === activeRouteId} item={item} key={item.id} />- ))- )}- </Flexbox>- </AccordionPanel>- </AccordionItem>- ))}- </AccordionRoot>- </Flexbox>- );-});--Body.displayName = 'ContactListBody';--export { Body as ContactListBody };--const Header = memo(() => {- const { t } = useTranslation('common');- const { createTopLevelMenuItems, isLoading } = useCreateMenuItems();- const createItems = useMemo(() => createTopLevelMenuItems(), [createTopLevelMenuItems]);-- return (- <ListHeader- title={t('tab.contacts')}- actions={- <DropdownMenu items={createItems}>- <ActionIcon- icon={UserRoundPlusIcon}- loading={isLoading}- size={DESKTOP_HEADER_ICON_SMALL_SIZE}- title={t('contacts.create')}- />- </DropdownMenu>- }- />- );-});--Header.displayName = 'ContactListHeader';--/**- * Contacts tab list column: every agent and group, by name or most recently updated. A row opens- * the contact card (`/agents/:id`) and keeps the list in place; the card is- * where the user starts a chat or goes on to edit the profile.- */-const ContactListPortal = () => (- <NavPanelPortal navKey={NAV_PANEL_CONTACTS_KEY}>- <AgentModalProvider>- <SideBarLayout body={<Body />} header={<Header />} />- </AgentModalProvider>- </NavPanelPortal>-);--export default ContactListPortal;diff --git a/src/features/ContactList/sortContacts.test.ts b/src/features/ContactList/sortContacts.test.tsdeleted file mode 100644index c3abf0ee54b..00000000000--- a/src/features/ContactList/sortContacts.test.ts+++ /dev/null@@ -1,55 +0,0 @@-import type { SidebarAgentItem } from '@lobechat/types';-import { describe, expect, it } from 'vitest';--import { groupContacts, sortContacts } from './sortContacts';--const item = (id: string, title: string, updatedAt: string): SidebarAgentItem =>- ({ id, pinned: false, title, type: 'agent', updatedAt: new Date(updatedAt) }) as SidebarAgentItem;--const items = [- item('b', 'Beta', '2026-11-10T00:00:00Z'),- item('a', 'Alpha', '2026-11-01T00:00:00Z'),- item('c', 'Gamma', '2026-11-12T00:00:00Z'),- item('d', 'Delta', '2026-11-10T00:00:00Z'),-];--describe('sortContacts', () => {- it('orders by name', () => {- expect(sortContacts(items, 'title', 'Untitled').map((i) => i.id)).toEqual(['a', 'b', 'd', 'c']);- });-- it('orders the most recently updated first, ties by name', () => {- expect(sortContacts(items, 'updatedAt', 'Untitled').map((i) => i.id)).toEqual([- 'c',- 'b',- 'd',- 'a',- ]);- });-- it('does not mutate the input', () => {- sortContacts(items, 'updatedAt', 'Untitled');- expect(items.map((i) => i.id)).toEqual(['b', 'a', 'c', 'd']);- });-});--describe('groupContacts', () => {- it('leads with pinned contacts of either kind and leaves them out of their own section', () => {- const group = (id: string, title: string, pinned: boolean) =>- ({ ...item(id, title, '2026-11-01T00:00:00Z'), pinned, type: 'group' }) as SidebarAgentItem;- const sections = groupContacts(- [- { ...items[0], pinned: true },- items[1],- group('g', 'Omega', true),- group('h', 'Delta group', false),- ],- 'title',- 'Untitled',- );-- expect(sections.pinned.map((i) => i.id)).toEqual(['b', 'g']);- expect(sections.groups.map((i) => i.id)).toEqual(['h']);- expect(sections.agents.map((i) => i.id)).toEqual(['a']);- });-});diff --git a/src/features/ContactList/sortContacts.ts b/src/features/ContactList/sortContacts.tsdeleted file mode 100644index d9144afc78c..00000000000--- a/src/features/ContactList/sortContacts.ts+++ /dev/null@@ -1,39 +0,0 @@-import { agentDisplayName, type SidebarAgentItem } from '@lobechat/types';--import type { ContactListSortBy } from '@/store/global/initialState';--export const CONTACT_SORT_BYS: ContactListSortBy[] = ['title', 'updatedAt'];--const byTitle = (fallback: string) => (a: SidebarAgentItem, b: SidebarAgentItem) =>- agentDisplayName(a, fallback).localeCompare(agentDisplayName(b, fallback), 'zh-Hans-CN');--/** Newest first; equal times fall back to the name so the order stays stable. */-const byUpdatedAt = (fallback: string) => {- const title = byTitle(fallback);- return (a: SidebarAgentItem, b: SidebarAgentItem) =>- new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime() || title(a, b);-};--export const sortContacts = (- items: SidebarAgentItem[],- sortBy: ContactListSortBy,- fallback: string,-) => [...items].sort(sortBy === 'updatedAt' ? byUpdatedAt(fallback) : byTitle(fallback));--/**- * The contact list's sections, each in the chosen order: pinned contacts of either kind lead in- * their own section and are left out of the groups and agents below.- */-export const groupContacts = (- items: SidebarAgentItem[],- sortBy: ContactListSortBy,- fallback: string,-) => {- const sorted = sortContacts(items, sortBy, fallback);- const rest = sorted.filter((item) => !item.pinned);- return {- agents: rest.filter((item) => item.type !== 'group'),- groups: rest.filter((item) => item.type === 'group'),- pinned: sorted.filter((item) => item.pinned),- };-};diff --git a/src/features/ContactList/style.ts b/src/features/ContactList/style.tsdeleted file mode 100644index c3693997efb..00000000000--- a/src/features/ContactList/style.ts+++ /dev/null@@ -1,11 +0,0 @@-import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';-import * as stylex from '@stylexjs/stylex';--export const styles = stylex.create({- empty: {- paddingBlock: '8px',- paddingInline: '10px',- fontSize: '12px',- color: cssVar.colorTextQuaternary,- },-});diff --git a/src/features/ContactList/useContactCard.test.ts b/src/features/ContactList/useContactCard.test.tsdeleted file mode 100644index 168da39a4ed..00000000000--- a/src/features/ContactList/useContactCard.test.ts+++ /dev/null@@ -1,91 +0,0 @@-import { renderHook } from '@testing-library/react';-import { beforeEach, describe, expect, it, vi } from 'vitest';--import { useContactCard } from './useContactCard';--const fetch = vi.hoisted(() => ({ error: undefined as unknown, mutate: vi.fn() }));-const agentList = vi.hoisted(() => ({ init: true, items: [] as { id: string }[] }));-const access = vi.hoisted(() => ({ canEdit: true }));--vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));-vi.mock('@/hooks/useFetchAgentList', () => ({ useFetchAgentList: () => fetch }));-vi.mock('@/hooks/usePermission', () => ({ usePermission: () => ({ allowed: true }) }));-vi.mock('@/features/ResourcePermission/useResourceAccess', () => ({- useResourceAccess: () => ({ canEditResource: access.canEdit }),-}));-vi.mock('@/store/home', () => ({- useHomeStore: (selector: (state: object) => unknown) => selector({}),-}));-vi.mock('@/store/home/selectors', () => ({- homeAgentListSelectors: {- getAgentById: (id: string) => () => agentList.items.find((item) => item.id === id),- isAgentListInit: () => agentList.init,- },-}));--beforeEach(() => {- fetch.error = undefined;- fetch.mutate.mockReset();- access.canEdit = true;- agentList.init = true;- agentList.items = [- { id: 'agt_1', name: 'Ada', slug: 'ada', title: 'Product Helper' },- { id: 'grp_1', title: 'Launch Crew', type: 'group' },- ] as { id: string }[];-});--describe('useContactCard', () => {- it('opens an agent chat and its profile editor', () => {- const { result } = renderHook(() => useContactCard('agt_1'));-- expect(result.current).toMatchObject({- canEdit: true,- chatUrl: '/agent/agt_1',- profileUrl: '/agent/agt_1/profile',- role: 'Product Helper',- slug: 'ada',- status: 'ready',- title: 'Ada',- });- });-- it('opens a group chat and the group profile', () => {- const { result } = renderHook(() => useContactCard('grp_1'));-- expect(result.current).toMatchObject({- chatUrl: '/group/grp_1',- profileUrl: '/group/grp_1/profile',- role: undefined,- status: 'ready',- title: 'Launch Crew',- });- });-- it('does not offer the profile editor to viewers who cannot edit', () => {- access.canEdit = false;-- const { result } = renderHook(() => useContactCard('agt_1'));-- expect(result.current).toMatchObject({ canEdit: false, status: 'ready' });- });-- it('waits for the first load, then reports a contact that is not in the list', () => {- agentList.init = false;- expect(renderHook(() => useContactCard('agt_missing')).result.current.status).toBe('loading');-- agentList.init = true;- expect(renderHook(() => useContactCard('agt_missing')).result.current.status).toBe('missing');- });-- it('turns a failed first load into a retry instead of an endless skeleton', () => {- agentList.init = false;- agentList.items = [];- fetch.error = new Error('429');-- const { result } = renderHook(() => useContactCard('agt_1'));-- expect(result.current.status).toBe('error');- if (result.current.status === 'error') result.current.retry();- expect(fetch.mutate).toHaveBeenCalled();- });-});diff --git a/src/features/ContactList/useContactCard.ts b/src/features/ContactList/useContactCard.tsdeleted file mode 100644index f47837a1e64..00000000000--- a/src/features/ContactList/useContactCard.ts+++ /dev/null@@ -1,68 +0,0 @@-import { AGENT_CHAT_URL, AGENT_PROFILE_URL, GROUP_CHAT_URL } from '@lobechat/const';-import {- agentDisplayName,- agentSecondaryDisplayName,- type SidebarAgentItem,-} from '@lobechat/types';-import isEqual from 'fast-deep-equal';-import { useTranslation } from 'react-i18next';--import { useResourceAccess } from '@/features/ResourcePermission/useResourceAccess';-import { useFetchAgentList } from '@/hooks/useFetchAgentList';-import { usePermission } from '@/hooks/usePermission';-import { useHomeStore } from '@/store/home';-import { homeAgentListSelectors } from '@/store/home/selectors';--interface ContactCardData {- /** Who may open the profile editor; the server still checks every write. */- canEdit: boolean;- chatUrl: string;- item: SidebarAgentItem;- profileUrl: string;- /** The agent's role beside its personal name; absent for groups and unnamed agents. */- role?: string;- slug?: string;- title: string;-}--export type ContactCardState =- | { error: unknown; retry: () => void; status: 'error' }- | { status: 'loading' }- | { status: 'missing' }- | ({ status: 'ready' } & ContactCardData);--/**- * Everything the contact card shows for an agent or group, read from the- * already-loaded contact list. A failed first load is `error` rather than an- * endless `loading`: on mobile no Contacts list sits beside the card to offer- * the retry.- */-export const useContactCard = (id: string): ContactCardState => {- const { t } = useTranslation('chat');- const { error, mutate } = useFetchAgentList();- const isInit = useHomeStore(homeAgentListSelectors.isAgentListInit);- const item = useHomeStore(homeAgentListSelectors.getAgentById(id), isEqual);- const isGroup = item?.type === 'group';-- const { allowed: canEditContent } = usePermission('edit_own_content');- const { canEditResource } = useResourceAccess(- isGroup ? 'agentGroup' : 'agent',- item ? id : undefined,- );-- if (!item) {- if (isInit) return { status: 'missing' };- return error ? { error, retry: () => void mutate(), status: 'error' } : { status: 'loading' };- }-- return {- canEdit: !!canEditContent && canEditResource,- chatUrl: isGroup ? GROUP_CHAT_URL(id) : AGENT_CHAT_URL(id),- item,- profileUrl: isGroup ? `/group/${id}/profile` : AGENT_PROFILE_URL(id),- role: isGroup ? undefined : agentSecondaryDisplayName(item),- slug: isGroup ? undefined : item.slug || undefined,- status: 'ready',- title: isGroup ? item.title || t('untitledAgent') : agentDisplayName(item, t('untitledAgent')),- };-};diff --git a/src/features/Conversation/WorkingSidebar/__tests__/filesColdStart.test.tsx b/src/features/Conversation/WorkingSidebar/__tests__/filesColdStart.test.tsxindex 4798365f256..e4a56b29f92 100644--- a/src/features/Conversation/WorkingSidebar/__tests__/filesColdStart.test.tsx+++ b/src/features/Conversation/WorkingSidebar/__tests__/filesColdStart.test.tsx@@ -15,9 +15,6 @@ import {reviewState,} from './harness';-// The `im_layout` trial reads the server-config store; these tests cover the default layout.-vi.mock('@/features/NavRail/useImLayout', () => ({ useImLayout: () => false }));-// The first frame is what the cold start is about: the deferred follow-up pass// that gates the other panes has not run yet. Most cases assert the settled// state; the cold-mount case flips this to false.diff --git a/src/features/Conversation/WorkingSidebar/__tests__/index.test.tsx b/src/features/Conversation/WorkingSidebar/__tests__/index.test.tsxindex f19bbb0c59b..b8b3f6b96e2 100644--- a/src/features/Conversation/WorkingSidebar/__tests__/index.test.tsx+++ b/src/features/Conversation/WorkingSidebar/__tests__/index.test.tsx@@ -26,9 +26,6 @@ import {workspace,} from './harness';-// The `im_layout` trial reads the server-config store; these tests cover the default layout.-vi.mock('@/features/NavRail/useImLayout', () => ({ useImLayout: () => false }));-// Loaded after the mock harness so module mocks are registered first.let AgentWorkingSidebar: ComponentType<{ availableWidth?: number }>;diff --git a/src/features/DesktopLayoutContainer/index.tsx b/src/features/DesktopLayoutContainer/index.tsxindex b7c3e2fb9d3..80bfb5a5d0c 100644--- a/src/features/DesktopLayoutContainer/index.tsx+++ b/src/features/DesktopLayoutContainer/index.tsx@@ -1,4 +1,4 @@-import { cx, Flexbox } from '@lobehub/ui';+import { Flexbox } from '@lobehub/ui';import { type FC, type PropsWithChildren } from 'react';import { useEffect, useMemo, useRef } from 'react';@@ -10,15 +10,7 @@ import { getInnerCssVariables, getOuterCssVariables } from './cssVariables';import { LayoutContainerContext } from './LayoutContainerContext';import { styles } from './style';-interface DesktopLayoutContainerProps extends PropsWithChildren {- /**- * Fill the parent edge to edge, with no outer padding or own border: the- * `im_layout` rail wrap already draws the rounded border around it.- */- flush?: boolean;-}--const DesktopLayoutContainer: FC<DesktopLayoutContainerProps> = ({ children, flush }) => {+const DesktopLayoutContainer: FC<PropsWithChildren> = ({ children }) => {const innerContainerRef = useRef<HTMLDivElement>(null);const isDarkMode = useIsDark();const [expand] = useGlobalStore((s) => [systemStatusSelectors.showLeftPanel(s)]);@@ -46,14 +38,14 @@ const DesktopLayoutContainer: FC<DesktopLayoutContainerProps> = ({ children, flureturn (<Flexbox- className={cx(styles.outerContainer, flush && styles.outerFlush)}+ className={styles.outerContainer}height={'100%'}- padding={flush ? 0 : 8}- style={flush ? undefined : outerCssVariables}+ padding={8}+ style={outerCssVariables}width={'100%'}><Flexbox- className={cx(styles.innerContainer, flush && styles.innerFlush)}+ className={styles.innerContainer}height={'100%'}ref={innerContainerRef}style={innerCssVariables}diff --git a/src/features/DesktopLayoutContainer/style.ts b/src/features/DesktopLayoutContainer/style.tsindex 2790860c36c..6187735622e 100644--- a/src/features/DesktopLayoutContainer/style.ts+++ b/src/features/DesktopLayoutContainer/style.ts@@ -19,12 +19,6 @@ export const styles = createStaticStyles(({ css, cssVar }) => ({background: ${cssVar.colorBgContainer};`,- // `flush`: the rail wrap owns border, radius and spacing.- innerFlush: css`- border: none;- border-radius: 0;- `,-// Outer containerouterContainer: css`position: relative;@@ -36,10 +30,4 @@ export const styles = createStaticStyles(({ css, cssVar }) => ({background: ${isDesktop ? 'transparent' : cssVar.colorBgLayout};`,-- outerFlush: css`- min-width: 0;- padding: 0;- background: transparent;- `,}));diff --git a/src/features/Electron/titlebar/NavigationBar.test.tsx b/src/features/Electron/titlebar/NavigationBar.test.tsxindex d5efe3f5282..c4c892380a7 100644--- a/src/features/Electron/titlebar/NavigationBar.test.tsx+++ b/src/features/Electron/titlebar/NavigationBar.test.tsx@@ -4,7 +4,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';import NavigationBar from './NavigationBar';const mocks = vi.hoisted(() => ({- imLayout: false,isMac: false,handlers: new Map<string, () => void>(),leftPanelVisible: false,@@ -14,8 +13,6 @@ const mocks = vi.hoisted(() => ({openAllAgentsDrawer: vi.fn(),}));-vi.mock('@/features/NavRail/useImLayout', () => ({ useImLayout: () => mocks.imLayout }));-vi.mock('@lobechat/electron-client-ipc', () => ({useWatchBroadcast: (event: string, handler: () => void) => mocks.handlers.set(event, handler),}));@@ -67,7 +64,6 @@ vi.mock('./TrayMenu/useTrayMenuSync', () => ({ useTrayMenuSync: vi.fn() }));describe('NavigationBar tray broadcasts', () => {beforeEach(() => {mocks.handlers.clear();- mocks.imLayout = false;mocks.isMac = false;mocks.leftPanelVisible = false;mocks.leftPanelWidth = 0;@@ -106,16 +102,6 @@ describe('NavigationBar tray broadcasts', () => {expect(expanded.container.querySelector('.root')).toHaveStyle({ width: '268px' });});- it('spans the icon rail too under the im_layout trial', () => {- mocks.imLayout = true;- mocks.leftPanelVisible = true;- mocks.leftPanelWidth = 280;- const { container } = render(<NavigationBar />);-- // Icon rail (48) plus the list column, minus the 12px gutter.- expect(container.querySelector('.root')).toHaveStyle({ width: '316px' });- });-it('follows the sidebar width without a transition while it is being resized', () => {mocks.leftPanelVisible = true;mocks.leftPanelWidth = 280;diff --git a/src/features/Electron/titlebar/NavigationBar.tsx b/src/features/Electron/titlebar/NavigationBar.tsxindex 7c5228921f5..76e52a8d893 100644--- a/src/features/Electron/titlebar/NavigationBar.tsx+++ b/src/features/Electron/titlebar/NavigationBar.tsx@@ -7,8 +7,6 @@ import { memo, useCallback, useEffect, useState } from 'react';import { useTranslation } from 'react-i18next';import ToggleLeftPanelButton from '@/features/NavPanel/ToggleLeftPanelButton';-import { RAIL_WIDTH } from '@/features/NavRail/const';-import { useImLayout } from '@/features/NavRail/useImLayout';import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { electronSystemService } from '@/services/electron/system';import { useElectronStore } from '@/store/electron';@@ -40,13 +38,7 @@ const navPanelSelector = (s: GlobalState) => {return systemStatusSelectors.leftPanelWidth(s);};-const useNavPanelWidth = () => {- const width = useGlobalStore(navPanelSelector);- // Under `im_layout` the list column starts after the icon rail, so the- // titlebar spans both.- const imLayout = useImLayout();- return imLayout && width > 0 ? width + RAIL_WIDTH : width;-};+const useNavPanelWidth = () => useGlobalStore(navPanelSelector);const styles = createStaticStyles(({ css, cssVar }) => ({clock: css`diff --git a/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/useDropdownMenu.test.tsx b/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/useDropdownMenu.test.tsxindex f2cffeb60af..82abf4ce0bc 100644--- a/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/useDropdownMenu.test.tsx+++ b/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/useDropdownMenu.test.tsx@@ -159,12 +159,6 @@ describe('useGroupDropdownMenu', () => {expect(getMenuKeys(result.current())).not.toContain('hideFromSidebar');});- it('omits hide for lists that ignore the sidebar preference', () => {- const { result } = renderGroupMenu({ sidebarVisibilityEnabled: false });-- expect(getMenuKeys(result.current())).not.toContain('hideFromSidebar');- });-it('omits hide on a team-pinned workspace group, which every member sees', () => {mocks.activeWorkspaceId = 'workspace-1';mocks.isTeamPinned = true;diff --git a/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/useDropdownMenu.tsx b/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/useDropdownMenu.tsxindex d89a39e4313..8a580f71b31 100644--- a/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/useDropdownMenu.tsx+++ b/src/features/HomeSidebar/Body/Agent/List/AgentGroupItem/useDropdownMenu.tsx@@ -35,12 +35,6 @@ interface UseGroupDropdownMenuParams {id: string;memberAvatars?: { avatar?: string; background?: string }[];pinned: boolean;- /**- * Offer "Remove from sidebar". Off for lists that ignore the sidebar- * visibility preference (the `im_layout` Messages list), where it would- * change nothing visible. Defaults to on.- */- sidebarVisibilityEnabled?: boolean;title: string;userId?: string | null;visibility?: SidebarVisibility;@@ -54,7 +48,6 @@ export const useGroupDropdownMenu = ({id,memberAvatars,pinned,- sidebarVisibilityEnabled = true,title,userId,visibility,@@ -99,8 +92,7 @@ export const useGroupDropdownMenu = ({// groups through one membership predicate keyed by row id, so hiding a// group only needs the menu entry. Restore it from the Agents page.const { isSidebarItemVisible, setSidebarItemVisible } = useSidebarItemVisibility();- const isShownInSidebar =- sidebarVisibilityEnabled && isSidebarItemVisible({ id, type: 'group', userId });+ const isShownInSidebar = isSidebarItemVisible({ id, type: 'group', userId });return useMemo(() => () =>diff --git a/src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.test.tsx b/src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.test.tsxindex 51b49099450..f3fd5fde01e 100644--- a/src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.test.tsx+++ b/src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.test.tsx@@ -176,10 +176,7 @@ const getMenuItem = (};type PublicAgentMenuOptions = Partial<- Pick<- Parameters<typeof useAgentDropdownMenu>[0],- 'id' | 'labelsEnabled' | 'pinned' | 'sidebarVisibilityEnabled' | 'visibility'- >+ Pick<Parameters<typeof useAgentDropdownMenu>[0], 'id' | 'labelsEnabled' | 'pinned' | 'visibility'>>;const renderPublicAgentMenu = (@@ -188,7 +185,6 @@ const renderPublicAgentMenu = (id = 'agent-1',labelsEnabled,pinned = false,- sidebarVisibilityEnabled,visibility = 'public',}: PublicAgentMenuOptions = {},) =>@@ -199,7 +195,6 @@ const renderPublicAgentMenu = (...(labelsEnabled === undefined ? {} : { labelsEnabled }),openCreateGroupModal: vi.fn(),pinned,- ...(sidebarVisibilityEnabled === undefined ? {} : { sidebarVisibilityEnabled }),title: 'Public Agent',userId,visibility,@@ -371,15 +366,6 @@ describe('useAgentDropdownMenu', () => {expect(mocks.setSidebarItemVisible).toHaveBeenCalledWith('agent-1', false);});- it('omits the hide action for lists that ignore the sidebar preference', () => {- const { result } = renderPublicAgentMenu('member-1', { sidebarVisibilityEnabled: false });-- const keys = (result.current() ?? []).map((item) =>- item && typeof item === 'object' && 'key' in item ? item.key : undefined,- );- expect(keys).not.toContain('hideFromSidebar');- });-it('tells the user to wait when delete is refused by a pending history migration', async () => {// Regression: a 409 TRANSFER_IN_PROGRESS used to fall through to the// generic "operation failed, please try again", which invited immediatediff --git a/src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.tsx b/src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.tsxindex 2964550b400..616021a39a4 100644--- a/src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.tsx+++ b/src/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu.tsx@@ -70,12 +70,6 @@ interface UseAgentDropdownMenuParams {name?: string | null;openCreateGroupModal: () => void;pinned: boolean;- /**- * Offer "Remove from sidebar". Off for lists that ignore the sidebar- * visibility preference (the `im_layout` Messages list), where it would- * change nothing visible. Defaults to on.- */- sidebarVisibilityEnabled?: boolean;slug?: string | null;title: string;userId?: string | null;@@ -92,7 +86,6 @@ export const useAgentDropdownMenu = ({name,openCreateGroupModal,pinned,- sidebarVisibilityEnabled = true,slug,title,userId,@@ -151,8 +144,7 @@ export const useAgentDropdownMenu = ({const currentUserId = useUserStore(userProfileSelectors.userId);const { isSidebarItemVisible, setSidebarItemVisible } = useSidebarItemVisibility();const refreshWorkspaceUserPreference = useUserStore((s) => s.refreshWorkspaceUserPreference);- const isShownInSidebar =- sidebarVisibilityEnabled && isSidebarItemVisible({ id, slug, type: 'agent', userId });+ const isShownInSidebar = isSidebarItemVisible({ id, slug, type: 'agent', userId });const isPrivate = visibility === 'private';const isBuiltin = !!slug && BUILTIN_SLUGS.has(slug);const showPublishAction = Boolean(activeWorkspaceId) && isPrivate;diff --git a/src/features/HomeSidebar/Footer/index.test.tsx b/src/features/HomeSidebar/Footer/index.test.tsxindex 51c10ab3516..e19c12b5e30 100644--- a/src/features/HomeSidebar/Footer/index.test.tsx+++ b/src/features/HomeSidebar/Footer/index.test.tsx@@ -132,8 +132,6 @@ const renderFooter = async ({return selector(mockServerConfigState);}vi.doMock('@/store/serverConfig', () => ({- // `useActiveNavKey` reads the `im_layout` flag through these.- featureFlagsSelectors: () => ({}),serverConfigSelectors: {enableBusinessFeatures: (s: Record<string, unknown>) => !!s.enableBusinessFeatures,},diff --git a/src/features/MessageList/AgentConversation.test.tsx b/src/features/MessageList/AgentConversation.test.tsxdeleted file mode 100644index b42ae9385d1..00000000000--- a/src/features/MessageList/AgentConversation.test.tsx+++ /dev/null@@ -1,216 +0,0 @@-/**- * @vitest-environment happy-dom- */-import { render, screen } from '@testing-library/react';-import { createElement } from 'react';-import { describe, expect, it, vi } from 'vitest';--import { useChannelStore } from '@/store/channel';--import AgentConversation from './AgentConversation';--vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));-vi.mock('@/components/AgentAvatar', () => ({- default: ({- agentId,- animated,- avatar,- state,- }: {- agentId: string;- animated?: boolean;- avatar?: string;- state?: string;- }) =>- createElement(- 'span',- { 'data-animated': String(!!animated), 'data-state': state, 'data-testid': 'agent-avatar' },- `${agentId}:${avatar ?? 'generated'}`,- ),-}));-vi.mock('@/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu', () => ({- // An Agent's own menu ends with its Delete; the row must not clash with it.- useAgentDropdownMenu: () => () => [{ key: 'delete', label: 'delete' }],-}));-vi.mock('@/features/Channels/useChannelMenu', () => ({- useChannelMenu: () => (channel: { status?: string }) => [- { key: 'copyId', label: 'copyId' },- channel.status === 'archived'- ? { key: 'unarchive', label: 'unarchive' }- : { key: 'archive', label: 'archive' },- { type: 'divider' },- { key: 'delete', label: 'moveToTrash' },- ],-}));-vi.mock('@/features/HomeSidebar/Body/Agent/List/usePreservedAgentUrl', () => ({- usePreservedAgentUrl: (id: string) => `/agent/${id}`,-}));-vi.mock('@/features/HomeSidebar/Body/Agent/ModalProvider', () => ({- useAgentModal: () => ({ openCreateGroupModal: () => {} }),-}));-vi.mock('@/hooks/usePrefetchAgent', () => ({ usePrefetchAgent: () => () => {} }));-const chat = vi.hoisted(() => ({ running: false }));-vi.mock('@/store/chat', () => ({ useChatStore: () => chat.running }));-vi.mock('@/store/chat/selectors', () => ({- operationSelectors: { isAgentVisiblyRunning: () => () => false },-}));-vi.mock('./useAgentConversationLink', () => ({- useAgentConversationLink: (_: string, url: string) => ({ url }),-}));-vi.mock('./ConversationRow', () => ({- default: ({ avatar, contextMenuItems, title, typing }: any) =>- createElement(- 'div',- { 'data-testid': 'row', 'data-typing': String(!!typing) },- title,- avatar as never,- createElement(- 'span',- { 'data-testid': 'menu' },- (contextMenuItems?.() ?? []).map((item: any) => item.key ?? item.type).join(','),- ),- ),-}));--const conversation = (avatar?: string, channel?: { status?: string }) =>- ({- activeAt: new Date('2026-11-03'),- ...(channel ? { channel: { id: 'cht_cook', title: 'Cook', unreadCount: 0, ...channel } } : {}),- item: { avatar, id: 'agt_cook', name: 'Cook', title: 'Cook', type: 'agent' },- }) as never;--describe('AgentConversation avatar', () => {- // The row drew the legacy robot image while the agent's Channel showed its generated character.- it('draws the agent avatar seeded by its id when it has no image of its own', () => {- render(createElement(AgentConversation, { active: false, conversation: conversation() }));-- expect(screen.getByTestId('agent-avatar')).toHaveTextContent('agt_cook:generated');- expect(screen.getByTestId('menu')).toHaveTextContent('delete');- expect(screen.getByTestId('menu')).not.toHaveTextContent('channel-');- });-- it('keeps an agent’s own image or emoji', () => {- render(createElement(AgentConversation, { active: false, conversation: conversation('🍳') }));-- expect(screen.getByTestId('agent-avatar')).toHaveTextContent('agt_cook:🍳');- });-- // A direct conversation is the chat with one Agent: it cannot be archived or trashed.- it('offers no archive or trash for an open direct Channel', () => {- render(- createElement(AgentConversation, {- active: false,- conversation: conversation(undefined, {}),- }),- );-- expect(screen.getByTestId('menu').textContent).toBe('delete');- });-- it('offers unarchive instead for an archived direct Channel', () => {- render(- createElement(AgentConversation, {- active: false,- conversation: conversation(undefined, { status: 'archived' }),- }),- );-- expect(screen.getByTestId('menu')).toHaveTextContent('channel-unarchive');- });-});--describe('AgentConversation reply activity', () => {- const showReply = (job: Record<string, unknown>) =>- useChannelStore.setState({- detailMap: {- 'cht_cook:main:latest': {- channel: { agentId: 'agt_cook', id: 'cht_cook' },- jobs: [- {- id: 'job_1',- memberId: 'mem_cook',- publicationRevoked: false,- threadId: null,- writerHeld: false,- ...job,- },- ],- members: [],- messages: [],- },- } as never,- });-- // The header said "typing" while the row and its avatar stayed idle: the row only read chat- // operations, and a direct Channel replies through Channel jobs.- it('animates the avatar and says typing while the direct Channel replies', () => {- showReply({ status: 'running' });- render(- createElement(AgentConversation, { active: true, conversation: conversation(undefined, {}) }),- );-- expect(screen.getByTestId('agent-avatar')).toHaveAttribute('data-state', 'working');- expect(screen.getByTestId('agent-avatar')).toHaveAttribute('data-animated', 'true');- expect(screen.getByTestId('row')).toHaveAttribute('data-typing', 'true');- });-- it('shows a blocked reply as waiting', () => {- showReply({ blockedCode: 'device_offline', status: 'queued' });- render(- createElement(AgentConversation, { active: true, conversation: conversation(undefined, {}) }),- );-- expect(screen.getByTestId('agent-avatar')).toHaveAttribute('data-state', 'waiting');- expect(screen.getByTestId('row')).toHaveAttribute('data-typing', 'false');- });-- it('stays idle once the reply settles', () => {- showReply({ status: 'completed' });- render(- createElement(AgentConversation, { active: true, conversation: conversation(undefined, {}) }),- );-- expect(screen.getByTestId('agent-avatar')).not.toHaveAttribute('data-state');- expect(screen.getByTestId('agent-avatar')).toHaveAttribute('data-animated', 'false');- expect(screen.getByTestId('row')).toHaveAttribute('data-typing', 'false');- });-- // A row whose conversation is not open used to stay idle; it now reads the list's jobs.- it('reads a background row’s reply from the list instead of a cached view', () => {- showReply({ status: 'completed' });- render(- createElement(AgentConversation, {- active: false,- conversation: conversation(undefined, {- replyJobs: [- {- blockedCode: null,- id: 'job_2',- memberId: 'mem_cook',- publicationRevoked: false,- status: 'running',- threadId: null,- writerHeld: true,- },- ],- } as never),- }),- );-- expect(screen.getByTestId('agent-avatar')).toHaveAttribute('data-state', 'working');- expect(screen.getByTestId('row')).toHaveAttribute('data-typing', 'true');- });-- // The row said typing while the Channel was idle: the Agent was running in its other topics.- it('only animates the avatar while the Agent runs elsewhere', () => {- showReply({ status: 'completed' });- chat.running = true;- render(- createElement(AgentConversation, { active: true, conversation: conversation(undefined, {}) }),- );- chat.running = false;-- expect(screen.getByTestId('agent-avatar')).toHaveAttribute('data-state', 'working');- expect(screen.getByTestId('row')).toHaveAttribute('data-typing', 'false');- });-});diff --git a/src/features/MessageList/AgentConversation.tsx b/src/features/MessageList/AgentConversation.tsxdeleted file mode 100644index 7694e6dd699..00000000000--- a/src/features/MessageList/AgentConversation.tsx+++ /dev/null@@ -1,106 +0,0 @@-'use client';--import { agentDisplayName } from '@lobechat/types';-import { memo, useCallback, useMemo } from 'react';-import { useTranslation } from 'react-i18next';--import AgentAvatar from '@/components/AgentAvatar';-import { useAgentDropdownMenu } from '@/features/HomeSidebar/Body/Agent/List/AgentItem/useDropdownMenu';-import { usePreservedAgentUrl } from '@/features/HomeSidebar/Body/Agent/List/usePreservedAgentUrl';-import { useAgentModal } from '@/features/HomeSidebar/Body/Agent/ModalProvider';-import { usePrefetchAgent } from '@/hooks/usePrefetchAgent';-import { useChatStore } from '@/store/chat';-import { operationSelectors } from '@/store/chat/selectors';--import ConversationRow from './ConversationRow';-import { type Conversation } from './conversations';-import { AVATAR_SIZE } from './style';-import { useAgentConversationLink } from './useAgentConversationLink';-import { useDirectChannelRow } from './useDirectChannelRow';--interface AgentConversationProps {- active: boolean;- conversation: Conversation;-}--const AgentConversation = memo<AgentConversationProps>(({ active, conversation }) => {- const { item, preview, activeAt } = conversation;- const { id, avatar, backgroundColor, pinned, slug, userId, visibility } = item;- const { t } = useTranslation('chat');- const { openCreateGroupModal } = useAgentModal();- const prefetchAgent = usePrefetchAgent();- const chatRunning = useChatStore(operationSelectors.isAgentVisiblyRunning(id));- const agentUrl = usePreservedAgentUrl(id);- const { onClick, url } = useAgentConversationLink(id, agentUrl);- const { channelActions, replyState } = useDirectChannelRow(conversation.channel, active);- const avatarState = replyState ?? (chatRunning ? 'working' : undefined);- // Only the direct Channel's own reply says typing: a run in one of the Agent's other topics- // only animates the avatar. A blocked reply keeps the preview; its avatar shows it waiting.- const typing = !!replyState && replyState !== 'waiting';- const title = agentDisplayName(item, t('untitledAgent'));- const avatarSrc = typeof avatar === 'string' ? avatar : undefined;-- const handleOpenCreateGroupModal = useCallback(- () => openCreateGroupModal(id, visibility),- [id, openCreateGroupModal, visibility],- );-- const contextMenuItems = useAgentDropdownMenu({- avatar: avatarSrc,- backgroundColor: backgroundColor || undefined,- group: undefined,- id,- name: item.name,- openCreateGroupModal: handleOpenCreateGroupModal,- pinned: pinned ?? false,- // The Messages list ignores the sidebar visibility preference.- sidebarVisibilityEnabled: false,- slug,- title,- userId,- visibility,- });-- const menuItems = useMemo(- () => () => {- const agentItems = contextMenuItems();- const items = channelActions();- if (items.length === 0) return agentItems;- return [...agentItems, { type: 'divider' as const }, ...items];- },- [channelActions, contextMenuItems],- );-- return (- <ConversationRow- closeOnReselect- active={active}- activeAt={activeAt}- contextMenuItems={menuItems}- preview={preview}- title={title}- typing={typing}- unread={conversation.unread ?? item.unreadCount}- url={url}- avatar={- // Same avatar the agent has everywhere else, including its direct Channel: its own- // image or emoji, else the character generated from its id.- <AgentAvatar- agentId={id}- animated={!!avatarState}- avatar={avatarSrc}- background={backgroundColor || undefined}- name={title}- size={AVATAR_SIZE}- state={avatarState}- />- }- onClick={onClick}- onMouseEnter={() => prefetchAgent(id)}- />- );-});--AgentConversation.displayName = 'AgentConversation';--export default AgentConversation;diff --git a/src/features/MessageList/Body.test.tsx b/src/features/MessageList/Body.test.tsxdeleted file mode 100644index 18331c81c5a..00000000000--- a/src/features/MessageList/Body.test.tsx+++ /dev/null@@ -1,388 +0,0 @@-/**- * @vitest-environment happy-dom- */-import { fireEvent, render, screen } from '@testing-library/react';-import { createElement } from 'react';-import { beforeEach, describe, expect, it, vi } from 'vitest';--import Body from './Body';--const home = vi.hoisted(() => ({- channels: [] as Record<string, unknown>[],- channelsEnabled: true,- channelsError: undefined as unknown,- pathname: '/',- query: '',- error: undefined as unknown,- isInit: false,- items: [] as unknown[],- mutate: () => {},- recents: [] as unknown[],- recentsError: undefined as unknown,- revalidateRecents: vi.fn(async () => {}),-}));--vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));--vi.mock('@/business/client/hooks/useActiveWorkspaceSlug', () => ({- useActiveWorkspaceSlug: () => null,-}));-vi.mock('@/hooks/useActiveLocation', () => ({- useActiveLocation: () => ({ pathname: home.pathname }),-}));-vi.mock('@/store/channel', () => ({- channelActions: {- refreshList: () => {},- useFetchList: () => ({ error: home.channelsError }),- },- channelSelectors: { list: () => home.channels },- useChannelStore: (selector: (state: object) => unknown) => selector({}),-}));-vi.mock('@/store/project', () => ({- useCurrentProjectList: () => [{ avatar: null, id: 'pro_1', name: 'Apollo' }],- useProjectStore: (selector: (state: object) => unknown) =>- selector({ useFetchProjectList: () => ({}) }),-}));-vi.mock('@/features/Channels/useChannelsEnabled', () => ({- useChannelsEnabled: () => home.channelsEnabled,-}));-vi.mock('@/features/Channels/useChannelEvents', () => ({ useChannelEvents: () => {} }));-vi.mock('./SearchContext', () => ({- useMessageSearch: () => ({ query: home.query, setQuery: () => {} }),-}));-vi.mock('@/features/NavPanel/components/NavItem', () => ({- default: ({ onClick, title }: { onClick: () => void; title: string }) =>- createElement('button', { onClick }, title),-}));-vi.mock('@/hooks/useFetchAgentList', () => ({- useFetchAgentList: () => ({ error: home.error, mutate: home.mutate }),-}));-vi.mock('@/components/AsyncError', () => ({- default: ({ error, onRetry }: { error: unknown; onRetry: () => void }) =>- createElement('button', { onClick: onRetry }, `Failed: ${String(error)}`),-}));-vi.mock('@/features/AgentRoute/useResolvedAgentRouteId', () => ({- resolveInboxAgentRouteId: (id: string) => id,-}));--vi.mock('@/store/home', () => ({- useHomeStore: (selector: (state: object) => unknown) =>- selector({- useFetchConversationRecents: () => ({- error: home.recentsError,- revalidate: home.revalidateRecents,- }),- }),-}));-vi.mock('@/store/home/selectors', () => ({- homeAgentListSelectors: { allAgents: () => home.items, isAgentListInit: () => home.isInit },- homeRecentSelectors: { conversationRecents: () => () => home.recents },-}));-vi.mock('@/store/agent', () => ({- useAgentStore: (selector: (state: object) => unknown) => selector({ agentMap: {} }),-}));-vi.mock('@/store/agent/selectors', () => ({- agentSelectors: { getAgentMetaById: () => () => ({ title: 'Lobe AI' }) },- builtinAgentSelectors: { inboxAgentId: () => 'inbox' },-}));--vi.mock('./ChannelConversation', () => ({- default: ({ active, channel }: { active: boolean; channel: { title: string } }) =>- createElement('div', { 'aria-current': active ? 'page' : undefined }, `# ${channel.title}`),-}));-vi.mock('@/features/NavPanel/components/SkeletonList', () => ({- default: () => createElement('div', {}, 'Loading agents'),-}));-vi.mock('./InboxConversation', () => ({- default: () => createElement('div', {}, 'Lobe AI row'),-}));-vi.mock('./AgentConversation', () => ({- default: ({- active,- conversation,- }: {- active: boolean;- conversation: { item: { title: string } };- }) =>- createElement('div', { 'aria-current': active ? 'page' : undefined }, conversation.item.title),-}));-vi.mock('./GroupConversation', () => ({ default: () => null }));--beforeEach(() => {- home.channels = [- {- agentId: null,- createdAt: new Date('2026-10-01'),- id: 'chn_team',- projectId: null,- status: 'active',- title: 'Team',- },- ];- home.channelsEnabled = true;- home.channelsError = undefined;- home.pathname = '/';- home.query = '';- home.error = undefined;- home.isInit = false;- home.items = [];- home.recents = [];- home.recentsError = undefined;- home.revalidateRecents.mockClear();-});--describe('MessageList Body', () => {- it('keeps Lobe AI and Channels visible while the agent list is unresolved', () => {- render(createElement(Body));-- expect(screen.getByText('Lobe AI row')).toBeInTheDocument();- expect(screen.getByText('# Team')).toBeInTheDocument();- expect(screen.getByText('Loading agents')).toBeInTheDocument();- });-- it('replaces the agent skeleton with an error, keeping Lobe AI and Channels', () => {- home.error = new Error('network');-- render(createElement(Body));-- expect(screen.getByText('Failed: Error: network')).toBeInTheDocument();- expect(screen.queryByText('Loading agents')).not.toBeInTheDocument();- expect(screen.getByText('Lobe AI row')).toBeInTheDocument();- expect(screen.getByText('# Team')).toBeInTheDocument();- });-- it('drops the agent skeleton once the list arrives', () => {- home.isInit = true;- home.items = [- { id: 'a', pinned: false, title: 'Agent A', type: 'agent', updatedAt: new Date() },- ];- home.recents = [{ agentId: 'a', routePath: '/agent/a', type: 'topic', updatedAt: new Date() }];-- render(createElement(Body));-- expect(screen.getByText('Agent A')).toBeInTheDocument();- expect(screen.queryByText('Loading agents')).not.toBeInTheDocument();- expect(screen.getByText('# Team')).toBeInTheDocument();- });-- // Each pinned row used to paint its own tinted card, so the pinned rows read as separate items.- it('renders the pinned rows together in one block', () => {- home.isInit = true;- home.items = [- { id: 'p1', pinned: true, title: 'Pinned 1', type: 'agent', updatedAt: new Date() },- { id: 'p2', pinned: true, title: 'Pinned 2', type: 'agent', updatedAt: new Date() },- { id: 'a', pinned: false, title: 'Agent A', type: 'agent', updatedAt: new Date() },- ];-- render(createElement(Body));-- const group = screen.getByRole('group', { name: 'navPanel.pinned' });- expect(group).toHaveTextContent('Pinned 1');- expect(group).toHaveTextContent('Pinned 2');- expect(group).not.toHaveTextContent('Agent A');- expect(group).not.toHaveTextContent('Lobe AI row');- });-- // A failed recents request with nothing cached kept the skeleton up with no way to retry.- it('replaces the skeleton with a recents retry when recents fail', () => {- home.isInit = true;- home.items = [- { id: 'a', pinned: false, title: 'Agent A', type: 'agent', updatedAt: new Date() },- ];- home.recents = undefined as unknown as unknown[];- home.recentsError = 'recents down';-- render(createElement(Body));-- expect(screen.queryByText('Loading agents')).not.toBeInTheDocument();- fireEvent.click(screen.getByText('Failed: recents down'));- expect(home.revalidateRecents).toHaveBeenCalledTimes(1);- });-- // A first topic started in an idle agent never reached the recents, so leaving it dropped the row.- it('refreshes recents when the routed conversation changes, not on mount', () => {- home.isInit = true;- home.pathname = '/agent/a';-- const { rerender } = render(createElement(Body, { key: 'list' }));- expect(home.revalidateRecents).not.toHaveBeenCalled();-- home.pathname = '/agent/b';- // A new props object re-renders the memoized Body with the new route.- rerender(createElement(Body, { 'data-route': 'b', 'key': 'list' } as object));-- expect(home.revalidateRecents).toHaveBeenCalledTimes(1);- });-- it('waits for recents before deciding which agents have a conversation', () => {- home.isInit = true;- home.items = [- { id: 'a', pinned: false, title: 'Agent A', type: 'agent', updatedAt: new Date() },- ];- home.recents = undefined as unknown as unknown[];-- render(createElement(Body));-- expect(screen.getByText('Loading agents')).toBeInTheDocument();- });-- // Every agent and group got a row, so the list read like Contacts instead of open conversations.- it('lists only agents with a conversation, and every agent while searching', () => {- home.isInit = true;- home.items = [- { id: 'a', pinned: false, title: 'Talked', type: 'agent', updatedAt: new Date() },- { id: 'b', pinned: false, title: 'Idle', type: 'agent', updatedAt: new Date() },- { id: 'c', pinned: false, title: 'Direct', type: 'agent', updatedAt: new Date() },- ];- home.recents = [{ agentId: 'a', routePath: '/agent/a', type: 'topic', updatedAt: new Date() }];- home.channels = [{ agentId: 'c', createdAt: new Date(), id: 'chn_c', projectId: null }];-- const { unmount } = render(createElement(Body));-- expect(screen.getByText('Talked')).toBeInTheDocument();- expect(screen.getByText('Direct')).toBeInTheDocument();- expect(screen.queryByText('Idle')).not.toBeInTheDocument();-- unmount();- home.query = 'idle';- render(createElement(Body));-- expect(screen.getByText('Idle')).toBeInTheDocument();- });-});--describe('MessageList Body Channel rows', () => {- const channel = (patch: Record<string, unknown>) => ({- agentId: null,- createdAt: new Date('2026-10-01'),- projectId: null,- status: 'active',- ...patch,- });-- it('lists group and project Channels as rows, leaving out direct and archived ones', () => {- home.channels = [- channel({ id: 'chn_team', title: 'Team' }),- channel({ agentId: 'agt_nasa', id: 'chn_direct', title: 'Nasa' }),- channel({ id: 'chn_project', projectId: 'pro_1', title: 'Project' }),- channel({ id: 'chn_archived', status: 'archived', title: 'Old' }),- ];-- render(createElement(Body));-- expect(screen.getByText('# Team')).toBeInTheDocument();- expect(screen.queryByText('# Nasa')).not.toBeInTheDocument();- expect(screen.getByText('# Project')).toBeInTheDocument();- expect(screen.queryByText('# Old')).not.toBeInTheDocument();- });-- it('keeps an archived Channel listed while it is open, and highlights it', () => {- home.pathname = '/channels/chn_archived';- home.channels = [channel({ id: 'chn_archived', status: 'archived', title: 'Old' })];-- render(createElement(Body));-- expect(screen.getByText('# Old')).toHaveAttribute('aria-current', 'page');- });-- // Archiving a group Channel left the IM layout with no way back to it.- it('lists archived Channels behind the archived group at the end', () => {- home.channels = [- channel({ id: 'chn_team', title: 'Team' }),- channel({ id: 'chn_archived', status: 'archived', title: 'Old' }),- ];-- render(createElement(Body));- expect(screen.queryByText('# Old')).not.toBeInTheDocument();-- fireEvent.click(screen.getByText('archivedGroup'));- expect(screen.getByText('# Old')).toBeInTheDocument();- });-- it('finds archived Channels by search', () => {- home.query = 'old';- home.channels = [channel({ id: 'chn_archived', status: 'archived', title: 'Old' })];-- render(createElement(Body));-- expect(screen.getByText('# Old')).toBeInTheDocument();- expect(screen.queryByText('archivedGroup')).not.toBeInTheDocument();- });-- it('shows no Channel rows while Channels are off', () => {- home.channelsEnabled = false;-- render(createElement(Body));-- expect(screen.queryByText('# Team')).not.toBeInTheDocument();- });-});--describe('MessageList Body active row', () => {- const agent = {- id: 'agt_nasa',- pinned: false,- title: 'Nasa',- type: 'agent',- updatedAt: new Date(),- };-- it.each([- ['its Agent page', '/agent/agt_nasa'],- ['its direct Channel', '/channels/chn_000000000001'],- ])('highlights an Agent row while %s is open', (_, pathname) => {- home.isInit = true;- home.items = [agent];- home.pathname = pathname;- home.channels = [{ agentId: 'agt_nasa', id: 'chn_000000000001' }];-- render(createElement(Body));-- expect(screen.getByText('Nasa')).toHaveAttribute('aria-current', 'page');- });-- it('leaves Agent rows unhighlighted inside a group Channel', () => {- home.isInit = true;- home.items = [agent];- home.recents = [- { agentId: 'agt_nasa', routePath: '/agent/agt_nasa', type: 'topic', updatedAt: new Date() },- ];- home.pathname = '/channels/chn_000000000002';- home.channels = [{ agentId: null, id: 'chn_000000000002' }];-- render(createElement(Body));-- expect(screen.getByText('Nasa')).not.toHaveAttribute('aria-current');- });-});--describe('MessageList Body ordering', () => {- const row = (id: string, updatedAt: string) => ({- id,- pinned: false,- title: id,- type: 'agent',- updatedAt: new Date(updatedAt),- });- const topic = (agentId: string, updatedAt: string) => ({- agentId,- icon: '',- id: agentId + updatedAt,- routePath: `/agent/${agentId}`,- status: null,- title: 'topic',- type: 'topic',- updatedAt: new Date(updatedAt),- });-- it('moves Lobe AI up by its latest conversation, not its configuration time', () => {- home.items = [row('a', '2026-10-01')];- home.recents = [topic('inbox', '2026-10-06'), topic('a', '2026-10-03')];-- const { container } = render(createElement(Body));- const text = container.textContent ?? '';-- expect(text).toContain('Lobe AI row');- expect(text.indexOf('Lobe AI row')).toBeLessThan(text.indexOf('a'));- });-});diff --git a/src/features/MessageList/Body.tsx b/src/features/MessageList/Body.tsxdeleted file mode 100644index b1174cdd623..00000000000--- a/src/features/MessageList/Body.tsx+++ /dev/null@@ -1,284 +0,0 @@-'use client';--import { DEFAULT_INBOX_TITLE } from '@lobechat/const';-import { agentDisplayName } from '@lobechat/types';-import { Flexbox } from '@lobehub/ui';-import * as stylex from '@stylexjs/stylex';-import isEqual from 'fast-deep-equal';-import { Archive } from 'lucide-react';-import { memo, useEffect, useMemo, useRef, useState } from 'react';-import { useTranslation } from 'react-i18next';--import { useActiveWorkspaceSlug } from '@/business/client/hooks/useActiveWorkspaceSlug';-import AsyncError from '@/components/AsyncError';-import { resolveInboxAgentRouteId } from '@/features/AgentRoute/useResolvedAgentRouteId';-import { matchChannel } from '@/features/Channels/paths';-import { useChannelEvents } from '@/features/Channels/useChannelEvents';-import { useChannelsEnabled } from '@/features/Channels/useChannelsEnabled';-import NavItem from '@/features/NavPanel/components/NavItem';-import SkeletonList from '@/features/NavPanel/components/SkeletonList';-import { useActiveLocation } from '@/hooks/useActiveLocation';-import { useFetchAgentList } from '@/hooks/useFetchAgentList';-import { useAgentStore } from '@/store/agent';-import { agentSelectors, builtinAgentSelectors } from '@/store/agent/selectors';-import { channelActions, channelSelectors, useChannelStore } from '@/store/channel';-import { useHomeStore } from '@/store/home';-import { homeAgentListSelectors, homeRecentSelectors } from '@/store/home/selectors';-import { ALL_RECENTS_LIMIT } from '@/store/home/slices/recent/action';-import { createConversationRecentQueryKey } from '@/store/home/slices/recent/projection';-import { useCurrentProjectList, useProjectStore } from '@/store/project';--import AgentConversation from './AgentConversation';-import ChannelConversation from './ChannelConversation';-import {- buildConversationEntries,- buildConversationSections,- channelActivity,- type Conversation,- type ConversationEntry,- inboxActivity,- latestTopicOf,-} from './conversations';-import GroupConversation from './GroupConversation';-import InboxConversation from './InboxConversation';-import { useMessageSearch } from './SearchContext';-import { styles } from './style';--const RECENTS_QUERY_KEY = createConversationRecentQueryKey(ALL_RECENTS_LIMIT);--/**- * `/agent/:id/...`, `/group/:id/...` or `/channels/:id` → the routed conversation id. A direct- * Channel stands for its Agent, so opening one highlights that Agent's row.- */-const useActiveRouteId = () => {- const { pathname } = useActiveLocation();- const slug = useActiveWorkspaceSlug();- const channelId = matchChannel(pathname);- const directAgentId = useChannelStore((s) =>- channelId- ? channelSelectors.list(s)?.find((channel) => channel.id === channelId)?.agentId- : undefined,- );- if (channelId) return directAgentId ?? channelId;-- const segments = pathname.split('/').filter(Boolean);- const [root, id] = slug && segments[0] === slug ? segments.slice(1) : segments;-- return root === 'agent' || root === 'group' ? id : undefined;-};--const ConversationItem = memo<{ activeRouteId?: string; conversation: Conversation }>(- ({ activeRouteId, conversation }) => {- const active = conversation.item.id === activeRouteId;-- return conversation.item.type === 'group' ? (- <GroupConversation active={active} conversation={conversation} />- ) : (- <AgentConversation active={active} conversation={conversation} />- );- },-);--ConversationItem.displayName = 'ConversationItem';--/** Keeps the Channel list fresh while Channels are on; it has no row of its own. */-const ChannelSync = memo(() => {- const { error } = channelActions.useFetchList();- useChannelEvents();-- return error ? (- <AsyncError error={error} variant="inline" onRetry={() => void channelActions.refreshList()} />- ) : null;-});--ChannelSync.displayName = 'MessageListChannelSync';--const Body = memo(() => {- const { t } = useTranslation(['common', 'channel']);- const { error: agentsError, mutate: retryAgents } = useFetchAgentList();- const isInit = useHomeStore(homeAgentListSelectors.isAgentListInit);- const { error: recentsError, revalidate: revalidateRecents } = useHomeStore(- (s) => s.useFetchConversationRecents,- )(ALL_RECENTS_LIMIT);-- const items = useHomeStore(homeAgentListSelectors.allAgents, isEqual);- const recents = useHomeStore(homeRecentSelectors.conversationRecents(RECENTS_QUERY_KEY));- const activeRouteId = useActiveRouteId();- // The open conversation keeps its row, so a first topic started there only needs to reach the- // recents by the time the person moves on: refresh them whenever the routed conversation changes.- const lastRouteIdRef = useRef(activeRouteId);- useEffect(() => {- if (lastRouteIdRef.current === activeRouteId) return;- lastRouteIdRef.current = activeRouteId;- void revalidateRecents();- }, [activeRouteId, revalidateRecents]);- const channelsEnabled = useChannelsEnabled();- const allChannels = useChannelStore(channelSelectors.list);- useProjectStore((s) => s.useFetchProjectList)(channelsEnabled);- const projects = useCurrentProjectList();- const projectMap = useMemo(- () => new Map(projects.map((project) => [project.id, project] as const)),- [projects],- );- const { query } = useMessageSearch();- const [showArchived, setShowArchived] = useState(false);- // Group Channels, a project's included as that project's group chat; a direct Channel opens- // from its Agent's row. An archived one leaves the list unless it is open, but search still- // finds it and the archived group at the end lists it.- const directChannels = useMemo(- () =>- new Map(- channelsEnabled- ? (allChannels ?? [])- .filter((channel) => channel.agentId && !channel.projectId)- .map((channel) => [channel.agentId!, channel] as const)- : [],- ),- [allChannels, channelsEnabled],- );- const { archived, channels } = useMemo(() => {- const groups = channelsEnabled ? (allChannels ?? []).filter((channel) => !channel.agentId) : [];- const isHidden = (channel: (typeof groups)[number]) =>- channel.status === 'archived' && channel.id !== activeRouteId;- return {- archived: groups- .filter(isHidden)- .sort((a, b) => channelActivity(b).getTime() - channelActivity(a).getTime()),- channels: query.trim() ? groups : groups.filter((channel) => !isHidden(channel)),- };- }, [activeRouteId, allChannels, channelsEnabled, query]);-- const inboxAgentId = useAgentStore(builtinAgentSelectors.inboxAgentId);- const inboxUpdatedAt = useAgentStore((s) =>- inboxAgentId ? s.agentMap[inboxAgentId]?.updatedAt : undefined,- );- const inboxTitle = useAgentStore((s) =>- agentDisplayName(- agentSelectors.getAgentMetaById(resolveInboxAgentRouteId(inboxAgentId))(s),- DEFAULT_INBOX_TITLE,- ),- );-- // The inbox is not one of the sidebar rows, so its position comes from its- // own latest topic rather than from the agent's configuration timestamp.- const inboxTopic = useMemo(- () => latestTopicOf(recents, inboxAgentId ?? undefined),- [recents, inboxAgentId],- );-- const inboxChannel = inboxAgentId ? directChannels.get(inboxAgentId) : undefined;-- const entries = useMemo(- () =>- buildConversationEntries(- buildConversationSections(items, recents, directChannels, {- activeId: activeRouteId,- includeIdle: !!query.trim(),- }),- {- activeAt: inboxActivity(inboxUpdatedAt, inboxTopic, inboxChannel),- channel: inboxChannel,- title: inboxTitle,- },- query,- channels,- (channel) => (channel.projectId ? projectMap.get(channel.projectId)?.name : undefined),- ),- [- items,- recents,- directChannels,- activeRouteId,- inboxUpdatedAt,- inboxTitle,- inboxTopic,- inboxChannel,- query,- channels,- projectMap,- ],- );-- // Pinned rows lead the list; they render as one block rather than a card each.- const pinnedCount = entries.findIndex((entry) => entry.type !== 'item' || !entry.item.pinned);- const pinnedEntries = pinnedCount === -1 ? entries : entries.slice(0, pinnedCount);- const otherEntries = pinnedCount === -1 ? [] : entries.slice(pinnedCount);-- const renderEntry = (entry: ConversationEntry) =>- entry.type === 'inbox' ? (- <InboxConversation- activeAt={entry.activeAt}- activeRouteId={activeRouteId}- channel={entry.channel}- key={'inbox'}- topic={inboxTopic}- />- ) : entry.type === 'channel' ? (- <ChannelConversation- active={entry.channel.id === activeRouteId}- activeAt={entry.activeAt}- channel={entry.channel}- key={entry.channel.id}- />- ) : (- <ConversationItem activeRouteId={activeRouteId} conversation={entry} key={entry.item.id} />- );-- // Only the agent rows wait on the agent list and recents (which decide what has a conversation):- // Lobe AI and Channels load on their own, so a slow or failed request must not hide them.- const agentsLoading = (!isInit && items.length === 0) || recents === undefined;-- return (- <Flexbox gap={1} paddingBlock={'0 12px'} paddingInline={6}>- {pinnedEntries.length > 0 && (- <div aria-label={t('navPanel.pinned')} role="group" {...stylex.props(styles.pinnedGroup)}>- {pinnedEntries.map(renderEntry)}- </div>- )}- {otherEntries.map(renderEntry)}- {agentsLoading ? (- agentsError ? (- <AsyncError error={agentsError} variant="inline" onRetry={() => void retryAgents()} />- ) : recents === undefined && recentsError ? (- <AsyncError- error={recentsError}- variant="inline"- onRetry={() => void revalidateRecents()}- />- ) : (- <SkeletonList paddingBlock={8} />- )- ) : (- entries.length === 0 && (- <div {...stylex.props(styles.empty)}>- {query ? t('navPanel.searchResultEmpty') : t('messageList.empty')}- </div>- )- )}- {!query.trim() && archived.length > 0 && (- <>- <NavItem- aria-expanded={showArchived}- icon={Archive}- title={t('archivedGroup', { count: archived.length, ns: 'channel' })}- onClick={() => setShowArchived(!showArchived)}- />- {showArchived &&- archived.map((channel) => (- <ChannelConversation- active={false}- activeAt={channelActivity(channel)}- channel={channel}- key={channel.id}- />- ))}- </>- )}- {channelsEnabled && <ChannelSync />}- </Flexbox>- );-});--Body.displayName = 'MessageListBody';--export default Body;diff --git a/src/features/MessageList/ChannelConversation.test.tsx b/src/features/MessageList/ChannelConversation.test.tsxdeleted file mode 100644index 6c29e594065..00000000000--- a/src/features/MessageList/ChannelConversation.test.tsx+++ /dev/null@@ -1,71 +0,0 @@-/**- * @vitest-environment happy-dom- */-import type { ChannelListItem } from '@lobechat/types';-import { render, screen } from '@testing-library/react';-import { createElement } from 'react';-import { describe, expect, it, vi } from 'vitest';--import ChannelConversation from './ChannelConversation';--const store = vi.hoisted(() => ({- project: undefined as { id: string; name: string } | undefined,-}));--vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));-vi.mock('@/features/Channels/useChannelMenu', () => ({ useChannelMenu: () => () => [] }));-vi.mock('@/store/project', () => ({- projectListItemSelector: () => () => store.project,- useProjectStore: (selector: () => unknown) => selector(),-}));-vi.mock('@/features/Projects/ProjectAvatar', () => ({- default: () => createElement('span', { 'data-testid': 'project-avatar' }),-}));-vi.mock('@/features/GroupAvatar', () => ({- default: ({ avatars }: { avatars: { seed: string }[] }) =>- createElement('span', {- 'data-members': avatars.map((avatar) => avatar.seed).join(','),- 'data-testid': 'group-avatar',- }),-}));-vi.mock('@/features/Workspace/useWorkspaceAwareNavigate', () => ({- useWorkspaceAwareNavigate: () => () => {},-}));-vi.mock('@/features/Workspace/WorkspaceLink', () => ({- default: ({ to: _to, ...rest }: { to: string }) => createElement('a', rest),-}));--const channel = (patch: Partial<ChannelListItem>) =>- ({ id: 'chn_1', projectId: null, title: 'Marketing', ...patch }) as ChannelListItem;-const renderRow = (item: ChannelListItem) =>- render(- createElement(ChannelConversation, { active: false, activeAt: new Date(), channel: item }),- );-const member = (id: string) => ({- actorType: 'agent' as const,- avatar: null,- backgroundColor: null,- id,- name: id,-});--describe('ChannelConversation avatar', () => {- it('pictures the members of a standalone Channel', () => {- store.project = undefined;- renderRow(channel({ memberAvatars: [member('agt_a'), member('agt_b')] }));- expect(screen.getByTestId('group-avatar').dataset.members).toBe('agt_a,agt_b');- });-- it('keeps "#" while no one else has joined', () => {- store.project = undefined;- renderRow(channel({ memberAvatars: [] }));- expect(screen.queryByTestId('group-avatar')).toBeNull();- });-- it('keeps the project logo for a project Channel', () => {- store.project = { id: 'prj_1', name: 'Project' };- renderRow(channel({ memberAvatars: [member('agt_a')], projectId: 'prj_1' }));- expect(screen.getByTestId('project-avatar')).toBeTruthy();- expect(screen.queryByTestId('group-avatar')).toBeNull();- });-});diff --git a/src/features/MessageList/ChannelConversation.tsx b/src/features/MessageList/ChannelConversation.tsxdeleted file mode 100644index ebb400a2c26..00000000000--- a/src/features/MessageList/ChannelConversation.tsx+++ /dev/null@@ -1,89 +0,0 @@-'use client';--import { CHANNEL_URL } from '@lobechat/const';-import type { ChannelListItem } from '@lobechat/types';-import { Avatar, Icon } from '@lobehub/ui';-import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';-import * as stylex from '@stylexjs/stylex';-import { HashIcon } from 'lucide-react';-import { memo } from 'react';--import { useChannelMenu } from '@/features/Channels/useChannelMenu';-import GroupAvatar from '@/features/GroupAvatar';-import ProjectAvatar from '@/features/Projects/ProjectAvatar';-import { projectListItemSelector, useProjectStore } from '@/store/project';--import ConversationRow from './ConversationRow';-import { channelPreview } from './conversations';-import { AVATAR_SIZE, styles } from './style';--interface ChannelConversationProps {- active: boolean;- activeAt: Date;- channel: ChannelListItem;-}--/** A group Channel as one more conversation, ordered with the Agents by its latest message. */-const ChannelConversation = memo<ChannelConversationProps>(({ active, activeAt, channel }) => {- const menuItems = useChannelMenu();- // A Channel grouped under a project wears that project's logo; a standalone one pictures- // its members like a group chat, and keeps "#" until someone else joins.- const project = useProjectStore(projectListItemSelector(channel.projectId));- const members = channel.memberAvatars ?? [];- const channelMark = (- <span {...stylex.props(styles.channelMark)}>- <Icon color={cssVar.colorTextSecondary} icon={HashIcon} size={9} />- </span>- );-- return (- <ConversationRow- closeOnReselect- active={active}- activeAt={activeAt}- contextMenuItems={menuItems(channel)}- preview={channelPreview(channel)}- tag={project?.name}- title={channel.title}- unread={channel.unreadCount}- url={CHANNEL_URL(channel.id)}- avatar={- project ? (- <>- <ProjectAvatar- avatar={project.avatar}- id={project.id}- name={project.name}- size={AVATAR_SIZE}- />- {channelMark}- </>- ) : members.length ? (- <>- <GroupAvatar- size={AVATAR_SIZE}- avatars={members.map((member) => ({- avatar: member.avatar || (member.actorType === 'user' ? member.name : null),- background: member.backgroundColor ?? undefined,- seed: member.id,- title: member.name ?? undefined,- }))}- />- {channelMark}- </>- ) : (- <Avatar- avatar={<Icon color={cssVar.colorTextSecondary} icon={HashIcon} size={16} />}- background={cssVar.colorFillSecondary}- shape={'square'}- size={AVATAR_SIZE}- />- )- }- />- );-});--ChannelConversation.displayName = 'ChannelConversation';--export default ChannelConversation;diff --git a/src/features/MessageList/ConversationRow.test.tsx b/src/features/MessageList/ConversationRow.test.tsxdeleted file mode 100644index a13956eed85..00000000000--- a/src/features/MessageList/ConversationRow.test.tsx+++ /dev/null@@ -1,97 +0,0 @@-/**- * @vitest-environment happy-dom- */-import { fireEvent, render, screen } from '@testing-library/react';-import { createElement } from 'react';-import { beforeEach, describe, expect, it, vi } from 'vitest';--import ConversationRow from './ConversationRow';--const navigate = vi.fn();--vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));-vi.mock('@/features/Workspace/useWorkspaceAwareNavigate', () => ({- useWorkspaceAwareNavigate: () => navigate,-}));-vi.mock('@/features/Workspace/WorkspaceLink', () => ({- default: ({ to, ...rest }: { to: string }) => createElement('a', { href: to, ...rest }),-}));--const renderRow = (active: boolean, onClick = vi.fn(), closeOnReselect = true) => {- render(- createElement(ConversationRow, {- active,- avatar: null,- closeOnReselect,- onClick,- title: 'Dario',- url: '/channels/chn_dario',- }),- );- return { onClick, row: screen.getByRole('link', { name: 'Dario' }) };-};--describe('ConversationRow', () => {- beforeEach(() => navigate.mockClear());-- it('closes the open conversation when it is clicked again', () => {- const { onClick, row } = renderRow(true);-- const event = new MouseEvent('click', { bubbles: true, button: 0, cancelable: true });- fireEvent(row, event);-- expect(event.defaultPrevented).toBe(true);- expect(navigate).toHaveBeenCalledWith('/');- expect(onClick).not.toHaveBeenCalled();- });-- it('opens an inactive conversation through its own click handling', () => {- const { onClick, row } = renderRow(false);-- fireEvent.click(row);-- expect(navigate).not.toHaveBeenCalled();- expect(onClick).toHaveBeenCalledTimes(1);- });-- // Directory rows (the contacts tab) open a profile, so a second click must not leave it.- it('keeps the open row selected when it does not close on reselect', () => {- const { onClick, row } = renderRow(true, vi.fn(), false);-- fireEvent.click(row);-- expect(navigate).not.toHaveBeenCalled();- expect(onClick).toHaveBeenCalledTimes(1);- });-- it('leaves a modified click on the open conversation to the link', () => {- const { row } = renderRow(true);-- fireEvent.click(row, { metaKey: true });-- expect(navigate).not.toHaveBeenCalled();- });-- // A row with no chat yet kept a blank preview line, so its title sat high instead of centered.- it('leaves out the preview line when there is no preview', () => {- const { row } = renderRow(false);-- expect(row.textContent).toBe('Dario');- });-- // The row said a green "running" with a spinner; it now reads like the header's typing line.- it('says typing in place of the preview while the Agent replies', () => {- render(- createElement(ConversationRow, {- avatar: null,- preview: 'last message',- title: 'Dario',- typing: true,- url: '/channels/chn_dario',- }),- );-- expect(screen.getByRole('status')).toHaveTextContent('activity.typing');- expect(screen.queryByText('last message')).toBeNull();- });-});diff --git a/src/features/MessageList/ConversationRow.tsx b/src/features/MessageList/ConversationRow.tsxdeleted file mode 100644index a5828c08df3..00000000000--- a/src/features/MessageList/ConversationRow.tsx+++ /dev/null@@ -1,150 +0,0 @@-'use client';--import { ContextMenuTrigger, Flexbox } from '@lobehub/ui';-import * as stylex from '@stylexjs/stylex';-import { type ComponentProps, memo, type MouseEvent, type ReactNode, type Ref } from 'react';-import { useTranslation } from 'react-i18next';--import { activityLabel } from '@/features/Channels/activityLabel';-import { TypingDots } from '@/features/Channels/TypingDots';-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';-import WorkspaceLink, { type WorkspaceLinkProps } from '@/features/Workspace/WorkspaceLink';--import { formatConversationTime, isPlainClick } from './conversations';-import { styles } from './style';--export interface ConversationRowProps {- active?: boolean;- activeAt?: Date;- avatar: ReactNode;- /**- * Clicking the open conversation again closes it, back to the Messages home with no row- * selected. Off for directory lists, whose rows open a profile rather than a conversation.- */- closeOnReselect?: boolean;- contextMenuItems?: ComponentProps<typeof ContextMenuTrigger>['items'];- onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;- onMouseEnter?: () => void;- preview?: string;- /** The row element, e.g. the anchor for an inline rename popover. */- ref?: Ref<HTMLElement>;- /** Title only, no preview line — for directory lists like the contacts tab. */- singleLine?: boolean;- /** A muted label after the title, e.g. the project a Channel belongs to. */- tag?: string;- title: string;- /** The Agent is replying: the preview line says "typing" like the conversation header. */- typing?: boolean;- unread?: number;- url: string;-}--/** A row link that leaves the conversation when it is already open. Modified clicks keep the link. */-const CloseOnReselectLink = ({- active,- onClick,- ...rest-}: WorkspaceLinkProps & { active?: boolean }) => {- const navigate = useWorkspaceAwareNavigate();- return (- <WorkspaceLink- {...rest}- onClick={(event) => {- if (active && isPlainClick(event)) {- event.preventDefault();- navigate('/');- return;- }- onClick?.(event);- }}- />- );-};--const ConversationRow = memo<ConversationRowProps>(- ({- active,- closeOnReselect,- activeAt,- avatar,- contextMenuItems,- onClick,- onMouseEnter,- preview,- ref,- singleLine,- tag,- title,- typing,- unread,- url,- }) => {- const { t } = useTranslation('channel');- const link: WorkspaceLinkProps = {- 'aria-current': active ? 'page' : undefined,- 'aria-label': title,- ref,- ...stylex.props(styles.row, active && styles.rowActive),- 'to': url,- onClick,- onMouseEnter,- };-- const content = (- <>- <span {...stylex.props(styles.avatar)}>- {avatar}- {!!unread && unread > 0 && (- <span {...stylex.props(styles.unread)}>{unread > 99 ? '99+' : unread}</span>- )}- </span>- <Flexbox- flex={1}- gap={2}- justify={'center'}- {...stylex.props(styles.rowText, singleLine && styles.rowTextSingleLine)}- >- <Flexbox horizontal align={'center'} gap={8}>- <span {...stylex.props(styles.title)}>- {title}- {tag && <span {...stylex.props(styles.tag)}>{tag}</span>}- </span>- {activeAt && (- <span {...stylex.props(styles.time)}>{formatConversationTime(activeAt)}</span>- )}- </Flexbox>- {/* No preview: the title sits centered at the full row height, not over a blank line. */}- {!singleLine && (typing || preview) && (- <Flexbox horizontal align={'center'} gap={8}>- {typing ? (- <span role="status" {...stylex.props(styles.preview, styles.typing)}>- {activityLabel(t('activity.typing'))}- <TypingDots />- </span>- ) : (- <span {...stylex.props(styles.preview)}>{preview}</span>- )}- </Flexbox>- )}- </Flexbox>- </>- );- const row = closeOnReselect ? (- <CloseOnReselectLink {...link} active={active}>- {content}- </CloseOnReselectLink>- ) : (- <WorkspaceLink {...link}>{content}</WorkspaceLink>- );-- return contextMenuItems ? (- <ContextMenuTrigger items={contextMenuItems}>{row}</ContextMenuTrigger>- ) : (- row- );- },-);--ConversationRow.displayName = 'ConversationRow';--export default ConversationRow;diff --git a/src/features/MessageList/GroupConversation.test.tsx b/src/features/MessageList/GroupConversation.test.tsxdeleted file mode 100644index 8af75dd856f..00000000000--- a/src/features/MessageList/GroupConversation.test.tsx+++ /dev/null@@ -1,43 +0,0 @@-/**- * @vitest-environment happy-dom- */-import { render, waitFor } from '@testing-library/react';-import { createElement } from 'react';-import { describe, expect, it, vi } from 'vitest';--import GroupConversation from './GroupConversation';--const menu = vi.hoisted(() => ({ anchors: [] as (HTMLElement | null)[] }));--vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));-vi.mock('@/features/AgentGroupAvatar', () => ({ default: () => null }));-vi.mock('@/features/HomeSidebar/Body/Agent/List/AgentGroupItem/useDropdownMenu', () => ({- useGroupDropdownMenu: ({ anchor }: { anchor: HTMLElement | null }) => {- menu.anchors.push(anchor);- return () => [];- },-}));-vi.mock('@/features/Workspace/useWorkspaceAwareNavigate', () => ({- useWorkspaceAwareNavigate: () => () => {},-}));-vi.mock('@/features/Workspace/WorkspaceLink', () => ({- default: ({ ref, to: _to, ...rest }: { ref?: (el: HTMLElement | null) => void; to: string }) =>- createElement('a', { ...rest, ref }),-}));--describe('GroupConversation', () => {- it('anchors the row menu (inline rename) on the row element', async () => {- const { container } = render(- createElement(GroupConversation, {- active: false,- conversation: {- activeAt: new Date(),- item: { id: 'cg_1', pinned: false, title: 'Group', type: 'group', updatedAt: new Date() },- } as never,- }),- );-- const row = container.querySelector('a');- await waitFor(() => expect(menu.anchors.at(-1)).toBe(row));- });-});diff --git a/src/features/MessageList/GroupConversation.tsx b/src/features/MessageList/GroupConversation.tsxdeleted file mode 100644index 887cc089092..00000000000--- a/src/features/MessageList/GroupConversation.tsx+++ /dev/null@@ -1,69 +0,0 @@-'use client';--import { GROUP_CHAT_URL } from '@lobechat/const';-import { memo, useState } from 'react';-import { useTranslation } from 'react-i18next';--import AgentGroupAvatar from '@/features/AgentGroupAvatar';-import { useGroupDropdownMenu } from '@/features/HomeSidebar/Body/Agent/List/AgentGroupItem/useDropdownMenu';--import ConversationRow from './ConversationRow';-import { type Conversation } from './conversations';-import { AVATAR_SIZE } from './style';--interface GroupConversationProps {- active: boolean;- conversation: Conversation;-}--const GroupConversation = memo<GroupConversationProps>(({ active, conversation }) => {- const { item, preview, activeAt } = conversation;- const { id, avatar, backgroundColor, description, pinned, userId, visibility } = item;- const { t } = useTranslation('chat');- const title = item.title || t('untitledAgent');- const customAvatar = typeof avatar === 'string' ? avatar : undefined;- const memberAvatars = Array.isArray(avatar) ? avatar : [];- // Rename opens an inline popover anchored on the row.- const [anchor, setAnchor] = useState<HTMLElement | null>(null);-- const contextMenuItems = useGroupDropdownMenu({- anchor,- avatar: customAvatar,- backgroundColor: backgroundColor || undefined,- description,- id,- memberAvatars,- pinned: pinned ?? false,- // The Messages list ignores the sidebar visibility preference.- sidebarVisibilityEnabled: false,- title,- userId,- visibility,- });-- return (- <ConversationRow- closeOnReselect- active={active}- activeAt={activeAt}- contextMenuItems={contextMenuItems}- preview={preview}- ref={setAnchor}- title={title}- unread={item.unreadCount}- url={GROUP_CHAT_URL(id)}- avatar={- <AgentGroupAvatar- avatar={customAvatar}- backgroundColor={backgroundColor || undefined}- memberAvatars={memberAvatars}- size={AVATAR_SIZE}- />- }- />- );-});--GroupConversation.displayName = 'GroupConversation';--export default GroupConversation;diff --git a/src/features/MessageList/Header.tsx b/src/features/MessageList/Header.tsxdeleted file mode 100644index 7624e91c882..00000000000--- a/src/features/MessageList/Header.tsx+++ /dev/null@@ -1,99 +0,0 @@-'use client';--import { CHANNEL_URL } from '@lobechat/const';-import { ActionIcon, DropdownMenu, Flexbox, Icon, SearchBar, Text } from '@lobehub/ui';-import { HashIcon, PlusIcon } from 'lucide-react';-import { memo, type ReactNode, useMemo } from 'react';-import { useTranslation } from 'react-i18next';--import { DESKTOP_HEADER_ICON_SMALL_SIZE } from '@/const/layoutTokens';-import { openCreateChannel } from '@/features/Channels/CreateChannel';-import { useChannelsEnabled } from '@/features/Channels/useChannelsEnabled';-import { useCreateMenuItems } from '@/features/HomeSidebar/hooks';-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';--import { useMessageSearch } from './SearchContext';--interface ListHeaderProps {- actions?: ReactNode;- title: string;-}--/** List column header: tab title on the left, column actions on the right. */-export const ListHeader = memo<ListHeaderProps>(({ title, actions }) => (- <Flexbox- horizontal- align={'center'}- gap={4}- justify={'space-between'}- paddingBlock={12}- paddingInline={'14px 10px'}- >- <Text ellipsis fontSize={15} weight={600}>- {title}- </Text>- <Flexbox horizontal align={'center'} gap={2}>- {actions}- </Flexbox>- </Flexbox>-));--ListHeader.displayName = 'ListHeader';--const Header = memo(() => {- const { t } = useTranslation(['common', 'channel']);- const { query, setQuery } = useMessageSearch();- const { createTopLevelMenuItems, isLoading } = useCreateMenuItems();- const channelsEnabled = useChannelsEnabled();- const navigate = useWorkspaceAwareNavigate();- // Group Channels are rows of this list too, so they are created from the same entry.- const createItems = useMemo(() => {- const items = createTopLevelMenuItems();- if (!channelsEnabled) return items;- const [agent, group, ...rest] = items;- return [- agent,- group,- {- icon: <Icon icon={HashIcon} />,- key: 'newChannel',- label: t('create', { ns: 'channel' }),- onClick: () => openCreateChannel((id) => navigate(CHANNEL_URL(id))),- },- ...rest,- ];- }, [channelsEnabled, createTopLevelMenuItems, navigate, t]);-- // WeChat-style header: a search box that filters the list, and one "+" entry.- return (- <Flexbox- horizontal- align={'center'}- gap={6}- paddingBlock={'12px 8px'}- paddingInline={'10px 8px'}- >- <SearchBar- allowClear- placeholder={t('messageList.search')}- size={'small'}- style={{ flex: 1 }}- value={query}- variant={'filled'}- onChange={(e) => setQuery(e.target.value)}- />- <DropdownMenu items={createItems}>- <ActionIcon- icon={PlusIcon}- loading={isLoading}- size={DESKTOP_HEADER_ICON_SMALL_SIZE}- title={t('messageList.newChat')}- />- </DropdownMenu>- </Flexbox>- );-});--Header.displayName = 'MessageListHeader';--export default Header;diff --git a/src/features/MessageList/InboxConversation.tsx b/src/features/MessageList/InboxConversation.tsxdeleted file mode 100644index db1198c4d88..00000000000--- a/src/features/MessageList/InboxConversation.tsx+++ /dev/null@@ -1,79 +0,0 @@-'use client';--import { DEFAULT_INBOX_AVATAR, DEFAULT_INBOX_TITLE } from '@lobechat/const';-import type { ChannelListItem, RecentItem } from '@lobechat/types';-import { agentDisplayName } from '@lobechat/types';-import { memo } from 'react';-import { useTranslation } from 'react-i18next';--import AgentAvatar from '@/components/AgentAvatar';-import { resolveInboxAgentRouteId } from '@/features/AgentRoute/useResolvedAgentRouteId';-import { usePrefetchAgent } from '@/hooks/usePrefetchAgent';-import { useAgentStore } from '@/store/agent';-import { agentSelectors, builtinAgentSelectors } from '@/store/agent/selectors';-import { useChatStore } from '@/store/chat';-import { operationSelectors } from '@/store/chat/selectors';--import ConversationRow from './ConversationRow';-import { conversationPreview } from './conversations';-import { AVATAR_SIZE } from './style';-import { useInboxConversationLink } from './useAgentConversationLink';-import { useDirectChannelRow } from './useDirectChannelRow';--/** The built-in Lobe AI conversation, always first in the list. */-const InboxConversation = memo<{- activeAt?: Date;- activeRouteId?: string;- /** The inbox Agent's direct Channel, when the row opens it. */- channel?: ChannelListItem;- /** Its latest topic, previewed like any other Agent row's while it has no direct Channel. */- topic?: RecentItem;-}>(({ activeAt, activeRouteId, channel, topic }) => {- const { t } = useTranslation('chat');- const inboxAgentId = useAgentStore(builtinAgentSelectors.inboxAgentId);- const routeId = resolveInboxAgentRouteId(inboxAgentId);- const meta = useAgentStore(agentSelectors.getAgentMetaById(routeId));- const running = useChatStore(- inboxAgentId ? operationSelectors.isAgentVisiblyRunning(inboxAgentId) : () => false,- );- const prefetchAgent = usePrefetchAgent();- const { onClick, url } = useInboxConversationLink();- const title = agentDisplayName(meta, DEFAULT_INBOX_TITLE);- const active = !!activeRouteId && (activeRouteId === routeId || activeRouteId === inboxAgentId);- const { channelActions, replyState } = useDirectChannelRow(channel, active);- const avatarState = replyState ?? (running ? 'working' : undefined);- // A blocked reply keeps the preview; its avatar already shows it waiting.- const typing = !!avatarState && avatarState !== 'waiting';-- return (- <ConversationRow- closeOnReselect- active={active}- activeAt={activeAt}- // An archived direct Channel is the only thing this row can act on.- contextMenuItems={channel?.status === 'archived' ? channelActions : undefined}- // Same preview and time as every other Agent row; its tagline when it has nothing yet.- preview={conversationPreview(meta.description, topic, channel) ?? t('inbox.desc')}- title={title}- typing={typing}- unread={channel?.unreadCount ?? undefined}- url={url}- avatar={- <AgentAvatar- agentId={routeId}- animated={!!avatarState}- avatar={meta.avatar || DEFAULT_INBOX_AVATAR}- name={title}- size={AVATAR_SIZE}- state={avatarState}- />- }- onClick={onClick}- onMouseEnter={() => inboxAgentId && prefetchAgent(inboxAgentId)}- />- );-});--InboxConversation.displayName = 'InboxConversation';--export default InboxConversation;diff --git a/src/features/MessageList/SearchContext.tsx b/src/features/MessageList/SearchContext.tsxdeleted file mode 100644index 45a5940789e..00000000000--- a/src/features/MessageList/SearchContext.tsx+++ /dev/null@@ -1,20 +0,0 @@-'use client';--import { createContext, type PropsWithChildren, use, useMemo, useState } from 'react';--interface MessageSearchState {- query: string;- setQuery: (query: string) => void;-}--const MessageSearchContext = createContext<MessageSearchState>({ query: '', setQuery: () => {} });--/** Shares the list header's search box with the conversation rows below it. */-export const MessageSearchProvider = ({ children }: PropsWithChildren) => {- const [query, setQuery] = useState('');- const value = useMemo(() => ({ query, setQuery }), [query]);-- return <MessageSearchContext value={value}>{children}</MessageSearchContext>;-};--export const useMessageSearch = () => use(MessageSearchContext);diff --git a/src/features/MessageList/conversations.test.ts b/src/features/MessageList/conversations.test.tsdeleted file mode 100644index 7a1fca547b8..00000000000--- a/src/features/MessageList/conversations.test.ts+++ /dev/null@@ -1,347 +0,0 @@-import type { ChannelListItem, RecentItem, SidebarAgentItem } from '@lobechat/types';-import { describe, expect, it } from 'vitest';--import {- buildConversationEntries,- buildConversationSections,- formatConversationTime,- inboxActivity,- latestActivity,- latestTopicOf,- messagesUnreadCount,-} from './conversations';--const agent = (id: string, updatedAt: string, extra: Partial<SidebarAgentItem> = {}) =>- ({- id,- pinned: false,- title: id,- type: 'agent',- updatedAt: new Date(updatedAt),- ...extra,- }) as SidebarAgentItem;--const topic = (extra: Partial<RecentItem> & { updatedAt: string }) =>- ({- icon: '',- id: Math.random().toString(),- routePath: '/',- status: null,- title: 'topic',- type: 'topic',- ...extra,- updatedAt: new Date(extra.updatedAt),- }) as RecentItem;--describe('buildConversationSections', () => {- it('orders by latest activity, pinned first, with the latest topic as preview', () => {- const { pinned, recent } = buildConversationSections(- [- agent('a', '2026-10-01'),- agent('b', '2026-10-02'),- agent('p', '2026-09-01', { pinned: true }),- agent('g', '2026-09-01', { type: 'group' }),- ],- [- topic({ agentId: 'a', lastAssistantMessage: 'old', updatedAt: '2026-10-03' }),- topic({ agentId: 'a', lastAssistantMessage: 'newest\n reply', updatedAt: '2026-10-05' }),- topic({ routePath: '/group/g/tpc_1', title: 'group topic', updatedAt: '2026-10-04' }),- topic({ agentId: 'b', type: 'document', updatedAt: '2026-10-09' }),- ],- );-- expect(pinned.map((c) => c.item.id)).toEqual(['p']);- // Documents are not conversation activity, so `b` has no conversation and no row.- expect(recent.map((c) => c.item.id)).toEqual(['a', 'g']);- expect(recent[0].preview).toBe('newest reply');- expect(recent[1].preview).toBe('group topic');- });-- it('lists only agents and groups that have a conversation', () => {- const items = [- agent('talked', '2026-10-01'),- agent('idle', '2026-10-09'),- agent('idle-group', '2026-10-09', { type: 'group' }),- agent('open', '2026-10-01'),- agent('pinned', '2026-10-01', { pinned: true }),- ];- const recents = [topic({ agentId: 'talked', updatedAt: '2026-10-02' })];-- const { pinned, recent } = buildConversationSections(items, recents, undefined, {- activeId: 'open',- });-- expect(pinned.map((c) => c.item.id)).toEqual(['pinned']);- expect(recent.map((c) => c.item.id)).toEqual(['talked', 'open']);- });-- it('keeps every agent while searching so a new conversation can start', () => {- const { recent } = buildConversationSections(- [agent('idle', '2026-10-09'), agent('idle-group', '2026-10-08', { type: 'group' })],- [],- undefined,- { includeIdle: true },- );-- expect(recent.map((c) => c.item.id)).toEqual(['idle', 'idle-group']);- });-- it('attributes a group topic that also carries the supervisor agentId to the group', () => {- const { recent } = buildConversationSections(- [agent('sup', '2026-09-01'), agent('g', '2026-09-01', { type: 'group' })],- [- topic({- agentId: 'sup',- lastAssistantMessage: 'group reply',- routePath: '/group/g/tpc_2',- updatedAt: '2026-10-05',- }),- ],- );-- // The supervisor has no conversation of its own, so it never shows the group's reply.- expect(recent.map((c) => c.item.id)).toEqual(['g']);- expect(recent[0].preview).toBe('group reply');- });-- it('drops duplicate ids and falls back to the description', () => {- const { recent } = buildConversationSections(- [agent('a', '2026-10-01', { description: 'helps' }), agent('a', '2026-10-01')],- undefined,- undefined,- { includeIdle: true },- );-- expect(recent).toHaveLength(1);- expect(recent[0].preview).toBe('helps');- });-});--describe('buildConversationSections with direct Channels', () => {- // The row opened the direct Channel but still showed the legacy topic's badge, preview and time.- it('describes an agent row by the direct Channel it opens', () => {- const direct = {- agentId: 'a',- createdAt: new Date('2026-10-01'),- id: 'chn_a',- lastMessage: { content: '**Done**, see\n the PR', createdAt: new Date('2026-10-09') },- unreadCount: 2,- } as ChannelListItem;- const { recent } = buildConversationSections(- [agent('a', '2026-10-01', { unreadCount: 5 }), agent('b', '2026-10-05')],- [topic({ agentId: 'a', lastAssistantMessage: 'legacy reply', updatedAt: '2026-10-02' })],- new Map([['a', direct]]),- );-- // `b` has neither a direct Channel nor a topic.- expect(recent.map((c) => c.item.id)).toEqual(['a']);- expect(recent[0]).toMatchObject({- activeAt: new Date('2026-10-09'),- preview: 'Done, see the PR',- unread: 2,- });- });-- it('falls back to the agent description while its direct Channel is empty', () => {- const direct = {- agentId: 'a',- createdAt: new Date('2026-10-01'),- id: 'chn_a',- lastMessage: null,- unreadCount: 0,- } as ChannelListItem;- const { recent } = buildConversationSections(- [agent('a', '2026-10-01', { description: 'Cooks dinner' })],- [topic({ agentId: 'a', lastAssistantMessage: 'legacy reply', updatedAt: '2026-10-02' })],- new Map([['a', direct]]),- );-- expect(recent[0]).toMatchObject({ preview: 'Cooks dinner', unread: 0 });- });-});--describe('formatConversationTime', () => {- const now = new Date(2026, 9, 26, 15, 0);-- it.each([- [new Date(2026, 9, 26, 9, 5), '09:05'],- [new Date(2026, 9, 25, 23, 59), '10/25'],- [new Date(2025, 0, 2), '2025/1/2'],- ])('formats %s as %s', (date, expected) => {- expect(formatConversationTime(date, now)).toBe(expected);- });-});--describe('buildConversationEntries', () => {- const sections = buildConversationSections(- [- agent('a', '2026-10-05', { title: 'Alpha' }),- agent('b', '2026-10-01', { title: 'Beta' }),- agent('p', '2026-09-01', { pinned: true, title: 'Pinned' }),- ],- undefined,- undefined,- { includeIdle: true },- );- const ids = (entries: ReturnType<typeof buildConversationEntries>) =>- entries.map((e) =>- e.type === 'inbox' ? 'inbox' : e.type === 'channel' ? e.channel.id : e.item.id,- );- const channel = (id: string, title: string, updatedAt: string) =>- ({- createdAt: new Date('2026-01-01'),- id,- title,- updatedAt: new Date(updatedAt),- }) as ChannelListItem;-- it('places Lobe AI by its own activity instead of pinning it on top', () => {- expect(- ids(- buildConversationEntries(sections, { activeAt: new Date('2026-10-03'), title: 'Lobe AI' }),- ),- ).toEqual(['p', 'a', 'inbox', 'b']);- });-- it('puts Lobe AI last until its activity is known', () => {- expect(ids(buildConversationEntries(sections, { title: 'Lobe AI' }))).toEqual([- 'p',- 'a',- 'b',- 'inbox',- ]);- });-- it('filters every row, Lobe AI included, by title', () => {- expect(ids(buildConversationEntries(sections, { title: 'Lobe AI' }, 'bet'))).toEqual(['b']);- expect(ids(buildConversationEntries(sections, { title: 'Lobe AI' }, 'lobe'))).toEqual([- 'inbox',- ]);- });-- it('matches the personal name shown on the row, not only the role title', () => {- const named = {- pinned: [],- recent: [- {- activeAt: new Date('2026-01-01'),- item: agent('n', '2026-01-01', { name: 'Alice', title: 'Health Assistant' }),- },- ],- };-- expect(ids(buildConversationEntries(named, undefined, 'alice'))).toEqual(['n']);- expect(ids(buildConversationEntries(named, undefined, 'health'))).toEqual(['n']);- });-- it('orders group Channels with the other conversations by their latest message', () => {- const channels = [- channel('chn_team', 'Team', '2026-10-03'),- channel('chn_old', 'Archive talk', '2026-08-01'),- ];-- expect(ids(buildConversationEntries(sections, undefined, '', channels))).toEqual([- 'p',- 'a',- 'chn_team',- 'b',- 'chn_old',- ]);- expect(ids(buildConversationEntries(sections, undefined, 'team', channels))).toEqual([- 'chn_team',- ]);- });-- it("finds a project Channel by its project's name", () => {- const channels = [- { ...channel('chn_general', 'General', '2026-10-03'), projectId: 'pro_1' },- channel('chn_team', 'Team', '2026-10-02'),- ];- const projectNameOf = (c: ChannelListItem) => (c.projectId ? 'Apollo' : undefined);-- expect(- ids(buildConversationEntries(sections, undefined, 'apollo', channels, projectNameOf)),- ).toEqual(['chn_general']);- });-});--describe('messagesUnreadCount', () => {- const channel = (patch: Partial<ChannelListItem>) =>- ({- agentId: null,- projectId: null,- status: 'active',- unreadCount: 0,- ...patch,- }) as ChannelListItem;-- it('sums the list rows: topics without a direct Channel, direct, group and project Channels', () => {- const items = [- agent('agt_topics', '2026-10-01', { unreadCount: 2 }),- agent('agt_direct', '2026-10-01', { unreadCount: 5 }),- ];- const channels = [- channel({ agentId: 'agt_direct', id: 'chn_direct', unreadCount: 1 }),- channel({ agentId: 'agt_inbox', id: 'chn_inbox', unreadCount: 3 }),- channel({ id: 'chn_team', unreadCount: 4 }),- channel({ id: 'chn_project', projectId: 'pro_1', unreadCount: 6 }),- ];-- // 2 (topics) + 1 (direct, not the agent's 5 topics) + 3 (inbox) + 4 (group) + 6 (project)- expect(messagesUnreadCount(items, channels)).toBe(16);- });-- it('leaves out archived group Channels, which have no row', () => {- const channels = [channel({ id: 'chn_old', status: 'archived', unreadCount: 7 })];-- expect(messagesUnreadCount([], channels)).toBe(0);- });-- it('counts only Agent topics while Channels are off', () => {- expect(messagesUnreadCount([agent('a', '2026-10-01', { unreadCount: 2 })], undefined)).toBe(2);- });-});--describe('latestTopicOf', () => {- it("takes one owner's newest topic and leaves other owners alone", () => {- const recents = [- topic({ agentId: 'inbox', updatedAt: '2026-10-03' }),- topic({ agentId: 'inbox', lastAssistantMessage: 'newest', updatedAt: '2026-10-06' }),- topic({ agentId: 'a', updatedAt: '2026-10-09' }),- ];-- expect(latestTopicOf(recents, 'inbox')?.lastAssistantMessage).toBe('newest');- expect(latestTopicOf(recents, 'missing')).toBeUndefined();- // No owner id (inbox unresolved) must not match every topic.- expect(latestTopicOf(recents, undefined)).toBeUndefined();- });-});--describe('inboxActivity', () => {- const direct = (createdAt: string) =>- ({ lastMessage: { content: 'hi', createdAt } }) as unknown as ChannelListItem;-- it('follows the direct Channel instead of the legacy topics', () => {- expect(- inboxActivity('2026-10-02', topic({ updatedAt: '2026-10-09' }), direct('2026-10-05')),- ).toEqual(new Date('2026-10-05'));- });-- it('falls back to the latest topic without a direct Channel', () => {- expect(inboxActivity('2026-10-02', topic({ updatedAt: '2026-10-09' }))).toEqual(- new Date('2026-10-09'),- );- });-});--describe('latestActivity', () => {- it('uses the later of the own timestamp and the latest topic', () => {- expect(latestActivity('2026-10-02', topic({ updatedAt: '2026-10-05' }))).toEqual(- new Date('2026-10-05'),- );- expect(latestActivity('2026-10-07', topic({ updatedAt: '2026-10-05' }))).toEqual(- new Date('2026-10-07'),- );- expect(latestActivity(undefined, undefined)).toBeUndefined();- });-});diff --git a/src/features/MessageList/conversations.ts b/src/features/MessageList/conversations.tsdeleted file mode 100644index 5c2a2181a9c..00000000000--- a/src/features/MessageList/conversations.ts+++ /dev/null@@ -1,253 +0,0 @@-import type { ChannelListItem, RecentItem, SidebarAgentItem } from '@lobechat/types';--import { markdownToTxt } from '@/utils/markdownToTxt';--/** A plain left click; modified clicks keep the browser's own handling of the link. */-export const isPlainClick = (- event: Pick<MouseEvent, 'altKey' | 'button' | 'ctrlKey' | 'metaKey' | 'shiftKey'>,-) => event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey;--export interface Conversation {- /** Latest activity: the newer of the item itself and its latest topic. */- activeAt: Date;- /** The agent's direct Channel, when the row opens it. Carries its own archive / trash actions. */- channel?: ChannelListItem;- item: SidebarAgentItem;- /** One-line preview from the latest topic (assistant reply, else title). */- preview?: string;- /** Unread messages of the agent's direct Channel, when the row opens it. */- unread?: number;-}--export interface ConversationSections {- pinned: Conversation[];- recent: Conversation[];-}--const recentOwnerId = (recent: RecentItem): string | undefined => {- if (recent.type !== 'topic') return;- // Group topics created by `execGroupAgent` persist the supervisor's `agentId`- // *and* the group route, so the route decides ownership: reading `agentId`- // first credits the group's replies to the supervisor and the group row never- // picks up its own activity.- const groupId = recent.routePath.match(/\/group\/([^/?#]+)/)?.[1];- return groupId ?? recent.agentId ?? undefined;-};--const toTime = (value: Date | string) => new Date(value).getTime();--const oneLine = (text: string | null | undefined) =>- (text ?? '').replaceAll(/\s+/g, ' ').trim() || undefined;--/** A Channel's latest message as one line of plain text. */-export const channelPreview = (channel: Pick<ChannelListItem, 'lastMessage'>) =>- channel.lastMessage ? oneLine(markdownToTxt(channel.lastMessage.content)) : undefined;--/**- * A row's preview line: its direct Channel's latest message once it has one, else its latest- * topic (assistant reply, else title), else its description.- */-export const conversationPreview = (- description: string | null | undefined,- topic: RecentItem | undefined,- direct?: Pick<ChannelListItem, 'lastMessage'>,-) =>- direct- ? (channelPreview(direct) ?? oneLine(description))- : oneLine(topic?.lastAssistantMessage || topic?.title || description);--/** When a Channel last had a message, else when it was opened. */-export const channelActivity = (channel: ChannelListItem): Date =>- new Date(channel.lastMessage?.createdAt ?? channel.updatedAt ?? channel.createdAt);--/** Newest topic per owner (agent id, or the group named by the topic route). */-const topicsByOwner = (recents: RecentItem[] | undefined): Map<string, RecentItem> => {- const latest = new Map<string, RecentItem>();- for (const recent of recents ?? []) {- const owner = recentOwnerId(recent);- if (!owner) continue;- const current = latest.get(owner);- if (!current || toTime(recent.updatedAt) > toTime(current.updatedAt)) latest.set(owner, recent);- }- return latest;-};--/**- * One owner's latest topic. The inbox row is not part of `items`, so it asks- * for its own activity instead of going through the sections builder.- */-export const latestTopicOf = (- recents: RecentItem[] | undefined,- ownerId: string | undefined,-): RecentItem | undefined => (ownerId ? topicsByOwner(recents).get(ownerId) : undefined);--/** The newer of an entity's own timestamp and its latest topic. */-export const latestActivity = (- own: Date | string | undefined,- topic: RecentItem | undefined,-): Date | undefined => {- const ownTime = own ? toTime(own) : 0;- const topicTime = topic ? toTime(topic.updatedAt) : 0;- if (!ownTime && !topicTime) return undefined;- return new Date(Math.max(ownTime, topicTime));-};--/** The inbox row's activity: once it opens a direct Channel, that replaces its legacy topics. */-export const inboxActivity = (- own: Date | string | undefined,- topic: RecentItem | undefined,- direct?: ChannelListItem,-): Date | undefined =>- direct- ? new Date(Math.max(own ? toTime(own) : 0, channelActivity(direct).getTime()))- : latestActivity(own, topic);--/**- * Turn the sidebar agent/group list into IM-style conversations: each row- * carries a preview of its latest topic and is ordered by latest activity,- * pinned rows first. Only conversations that exist get a row — a direct Channel- * or a topic; the rest stay in Contacts. Pinned rows and the open one stay,- * and a search lists every agent so a new conversation can start from it.- */-export const buildConversationSections = (- items: SidebarAgentItem[],- recents: RecentItem[] | undefined,- /** The person's direct Channel per agent id. A row that opens one shows that conversation. */- directChannels?: Map<string, ChannelListItem>,- {- activeId,- includeIdle = false,- }: {- /** The routed conversation, kept so the open chat always has its row. */- activeId?: string;- /** Keep agents and groups without any conversation yet. */- includeIdle?: boolean;- } = {},-): ConversationSections => {- const latestByOwner = topicsByOwner(recents);-- const seen = new Set<string>();- const conversations: Conversation[] = [];- for (const item of items) {- if (seen.has(item.id)) continue;- seen.add(item.id);-- const itemTime = toTime(item.updatedAt);- const direct = directChannels?.get(item.id);- if (direct) {- // The row opens the direct Channel, so its legacy topics no longer describe it.- conversations.push({- activeAt: new Date(Math.max(itemTime, channelActivity(direct).getTime())),- channel: direct,- item,- preview: conversationPreview(item.description, undefined, direct),- unread: direct.unreadCount ?? 0,- });- continue;- }-- const latest = latestByOwner.get(item.id);- if (!latest && !includeIdle && !item.pinned && item.id !== activeId) continue;-- const latestTime = latest ? toTime(latest.updatedAt) : 0;-- conversations.push({- activeAt: new Date(Math.max(itemTime, latestTime)),- item,- preview: conversationPreview(item.description, latest),- });- }-- conversations.sort((a, b) => b.activeAt.getTime() - a.activeAt.getTime());-- return {- pinned: conversations.filter((c) => c.item.pinned),- recent: conversations.filter((c) => !c.item.pinned),- };-};--export type ConversationEntry =- | { activeAt: Date; channel?: ChannelListItem; type: 'inbox' }- | { activeAt: Date; channel: ChannelListItem; type: 'channel' }- | (Conversation & { type: 'item' });--/**- * One IM list like WeChat's: pinned rows first, then everything else by latest- * activity. Lobe AI and group Channels are ordinary rows placed by their own- * activity, not pinned to the top; a name / title filter narrows the whole list.- */-export const buildConversationEntries = (- { pinned, recent }: ConversationSections,- inbox: { activeAt?: Date; channel?: ChannelListItem; title: string } | undefined,- query = '',- channels: ChannelListItem[] = [],- /** The name of the project a Channel belongs to, which a search also matches. */- projectNameOf?: (channel: ChannelListItem) => string | undefined,-): ConversationEntry[] => {- const keyword = query.trim().toLowerCase();- const matches = (...names: (string | null | undefined)[]) =>- !keyword || names.some((name) => (name ?? '').toLowerCase().includes(keyword));-- // Rows show the personal name when set (`agentDisplayName`), so match it as- // well as the role title.- const items = (list: Conversation[]): ConversationEntry[] =>- list- .filter((c) => matches(c.item.name, c.item.title))- .map((c) => ({ ...c, type: 'item' as const }));-- const rest = [- ...items(recent),- ...channels- .filter((channel) => matches(channel.title, projectNameOf?.(channel)))- .map((channel) => ({- activeAt: channelActivity(channel),- channel,- type: 'channel' as const,- })),- ].sort((a, b) => b.activeAt.getTime() - a.activeAt.getTime());- if (inbox && matches(inbox.title)) {- const activeAt = inbox.activeAt ?? new Date(0);- const index = rest.findIndex((entry) => entry.activeAt.getTime() < activeAt.getTime());- rest.splice(index === -1 ? rest.length : index, 0, {- activeAt,- channel: inbox.channel,- type: 'inbox',- });- }-- return [...items(pinned), ...rest];-};--/**- * The Messages tab badge: the sum of what the list rows show. A row that opens a direct Channel- * counts that Channel's unread messages instead of its Agent's unread topics, and an archived- * group Channel has no row.- */-export const messagesUnreadCount = (- items: Pick<SidebarAgentItem, 'id' | 'unreadCount'>[],- channels: ChannelListItem[] | undefined,-): number => {- let sum = 0;- const directAgentIds = new Set<string>();- for (const channel of channels ?? []) {- const direct = !!channel.agentId && !channel.projectId;- if (direct) directAgentIds.add(channel.agentId!);- else if (channel.agentId || channel.status === 'archived') continue;- sum += channel.unreadCount ?? 0;- }- for (const item of items) {- if (!directAgentIds.has(item.id)) sum += item.unreadCount ?? 0;- }- return sum;-};--/** IM-style timestamp: time today, weekday this week, date otherwise. */-export const formatConversationTime = (date: Date, now: Date = new Date()): string => {- const startOfToday = new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();- const time = date.getTime();- const pad = (n: number) => String(n).padStart(2, '0');-- if (time >= startOfToday) return `${pad(date.getHours())}:${pad(date.getMinutes())}`;- if (date.getFullYear() === now.getFullYear()) return `${date.getMonth() + 1}/${date.getDate()}`;- return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;-};diff --git a/src/features/MessageList/index.tsx b/src/features/MessageList/index.tsxdeleted file mode 100644index 15ffe75baae..00000000000--- a/src/features/MessageList/index.tsx+++ /dev/null@@ -1,31 +0,0 @@-'use client';--import { AgentModalProvider } from '@/features/HomeSidebar/Body/Agent/ModalProvider';-import { NavPanelPortal } from '@/features/NavPanel/NavPanelPortal';-import { NAV_PANEL_MESSAGES_KEY } from '@/features/NavPanel/railRouteKey';-import SideBarLayout from '@/features/NavPanel/SideBarLayout';--import Body from './Body';-import Header from './Header';-import { MessageSearchProvider } from './SearchContext';--export { default as ConversationRow } from './ConversationRow';-export { ListHeader } from './Header';-export { AVATAR_SIZE } from './style';--/**- * Messages tab list column: the IM-style conversation list (Lobe AI, agents- * and groups by latest activity). Owned by the shell so it stays mounted- * across chats. Each row opens its conversation as a channel.- */-const MessageListPortal = () => (- <NavPanelPortal navKey={NAV_PANEL_MESSAGES_KEY}>- <AgentModalProvider>- <MessageSearchProvider>- <SideBarLayout body={<Body />} header={<Header />} />- </MessageSearchProvider>- </AgentModalProvider>- </NavPanelPortal>-);--export default MessageListPortal;diff --git a/src/features/MessageList/style.ts b/src/features/MessageList/style.tsdeleted file mode 100644index 7c0c989bedc..00000000000--- a/src/features/MessageList/style.ts+++ /dev/null@@ -1,124 +0,0 @@-import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';-import * as stylex from '@stylexjs/stylex';--export const AVATAR_SIZE = 28;--export const styles = stylex.create({- avatar: {- position: 'relative',- display: 'inline-flex',- flex: 'none',- },- /** Marks a project avatar as one of that project's Channels. */- channelMark: {- position: 'absolute',- insetBlockEnd: '-3px',- insetInlineEnd: '-3px',- display: 'inline-flex',- alignItems: 'center',- justifyContent: 'center',- width: '14px',- height: '14px',- borderWidth: '1.5px',- borderStyle: 'solid',- borderColor: cssVar.colorBgContainer,- borderRadius: '4px',- backgroundColor: cssVar.colorBgElevated,- },- empty: {- paddingBlock: '8px',- paddingInline: '10px',- fontSize: '12px',- color: cssVar.colorTextQuaternary,- },- /** Pinned rows share one tinted block, like WeChat's 置顶, instead of a card per row. */- pinnedGroup: {- display: 'flex',- flexDirection: 'column',- gap: '1px',- borderRadius: cssVar.borderRadiusLG,- backgroundColor: cssVar.colorFillQuaternary,- },- preview: {- overflow: 'hidden',- minWidth: 0,- textOverflow: 'ellipsis',- whiteSpace: 'nowrap',- flex: '1',- fontSize: '12px',- lineHeight: '16px',- color: cssVar.colorTextTertiary,- },- row: {- cursor: 'pointer',- userSelect: 'none',- display: 'flex',- gap: '10px',- alignItems: 'center',- paddingBlock: '8px',- paddingInline: '8px',- borderRadius: cssVar.borderRadiusLG,- color: { 'default': cssVar.colorText, ':hover': cssVar.colorText },- textDecoration: 'none',- backgroundColor: { 'default': null, ':hover': cssVar.colorFillTertiary },- transition: 'background-color 0.15s',- },- rowActive: {- backgroundColor: { 'default': cssVar.colorFillSecondary, ':hover': cssVar.colorFillSecondary },- },- /** Title plus preview line, so a row without a preview keeps the same height. */- rowText: {- minWidth: 0,- minHeight: '36px',- },- rowTextSingleLine: {- minHeight: 0,- },- tag: {- marginInlineStart: '6px',- fontSize: '11px',- fontWeight: 400,- color: cssVar.colorTextQuaternary,- },- time: {- flex: 'none',- fontSize: '11px',- lineHeight: '18px',- color: cssVar.colorTextQuaternary,- },- title: {- overflow: 'hidden',- minWidth: 0,- textOverflow: 'ellipsis',- whiteSpace: 'nowrap',- flex: '1',- fontSize: '13px',- fontWeight: 500,- lineHeight: '18px',- },- /** Same quiet colour as the preview it replaces, so a reply in progress does not shout. */- typing: {- display: 'flex',- gap: '6px',- alignItems: 'center',- },- unread: {- pointerEvents: 'none',- position: 'absolute',- insetBlockStart: '-5px',- insetInlineEnd: '-6px',- minWidth: '16px',- height: '16px',- paddingInline: '4px',- borderWidth: '1.5px',- borderStyle: 'solid',- borderColor: cssVar.colorBgContainer,- borderRadius: '999px',- fontSize: '10px',- fontWeight: 600,- lineHeight: '13px',- color: '#fff',- textAlign: 'center',- backgroundColor: cssVar.colorError,- },-});diff --git a/src/features/MessageList/useAgentConversationLink.test.ts b/src/features/MessageList/useAgentConversationLink.test.tsdeleted file mode 100644index 13f0442db64..00000000000--- a/src/features/MessageList/useAgentConversationLink.test.ts+++ /dev/null@@ -1,164 +0,0 @@-/**- * @vitest-environment happy-dom- */-import { act, renderHook } from '@testing-library/react';-import type { MouseEvent } from 'react';-import { beforeEach, describe, expect, it, vi } from 'vitest';--import { useAgentConversationLink, useInboxConversationLink } from './useAgentConversationLink';--const state = vi.hoisted(() => ({- directChannelId: undefined as string | undefined,- enabled: true,- inboxAgentId: 'agt_inbox' as string | undefined,- navigate: vi.fn(),- openDirect: vi.fn(),- pathname: '/',- scope: 'personal',- slug: null as string | null,-}));--vi.mock('@/hooks/useActiveLocation', () => ({- useActiveLocation: () => ({ pathname: state.pathname, search: '' }),-}));-vi.mock('@/business/client/hooks/useActiveWorkspaceSlug', () => ({- useActiveWorkspaceSlug: () => state.slug,-}));-vi.mock('@/libs/replica', () => ({ cacheScope: { get: () => state.scope } }));--vi.mock('@/features/AgentRoute/useResolvedAgentRouteId', () => ({- resolveInboxAgentRouteId: (id?: string) => id ?? 'inbox',-}));-vi.mock('@/features/HomeSidebar/Body/Agent/List/usePreservedAgentUrl', () => ({- usePreservedAgentUrl: (id: string) => `/agent/${id}`,-}));-vi.mock('@/store/agent', () => ({- useAgentStore: (selector: (s: object) => unknown) => selector({}),-}));-vi.mock('@/store/agent/selectors', () => ({- builtinAgentSelectors: { inboxAgentId: () => state.inboxAgentId },-}));-vi.mock('@/features/Channels/useChannelsEnabled', () => ({- useChannelsEnabled: () => state.enabled,-}));-vi.mock('@/features/Workspace/useWorkspaceAwareNavigate', () => ({- useWorkspaceAwareNavigate: () => state.navigate,-}));-vi.mock('@/store/channel', () => ({- channelActions: { openDirect: state.openDirect },- channelSelectors: {- directByAgent: () => () => (state.directChannelId ? { id: state.directChannelId } : undefined),- },- useChannelStore: (selector: (s: object) => unknown) => selector({}),-}));--const click = (patch: Partial<MouseEvent> = {}) =>- ({ button: 0, preventDefault: vi.fn(), ...patch }) as unknown as MouseEvent<HTMLAnchorElement>;--const render = () => renderHook(() => useAgentConversationLink('agt_nasa', '/agent/agt_nasa'));--describe('useAgentConversationLink', () => {- beforeEach(() => {- vi.clearAllMocks();- vi.spyOn(console, 'error').mockImplementation(() => {});- state.directChannelId = undefined;- state.enabled = true;- state.inboxAgentId = 'agt_inbox';- state.pathname = '/';- state.scope = 'personal';- state.slug = null;- });-- it('links an Agent row to its direct Channel', () => {- state.directChannelId = 'chn_000000000001';- expect(render().result.current).toEqual({ url: '/channels/chn_000000000001' });- });-- it('keeps the Agent page while the Agent id is still loading', () => {- state.directChannelId = 'chn_000000000001';- const { result } = renderHook(() => useAgentConversationLink(undefined, '/agent/inbox'));- expect(result.current).toEqual({ onClick: undefined, url: '/agent/inbox' });- });-- it('links the inbox Agent row to its direct Channel', () => {- state.directChannelId = 'chn_000000000001';- const { result } = renderHook(() => useInboxConversationLink());- expect(result.current).toEqual({ url: '/channels/chn_000000000001' });- });-- it('opens a missing inbox direct Channel on click', async () => {- state.openDirect.mockResolvedValue('chn_000000000002');- const { result } = renderHook(() => useInboxConversationLink());-- await act(async () => result.current.onClick?.(click()));-- expect(state.openDirect).toHaveBeenCalledWith('agt_inbox');- expect(state.navigate).toHaveBeenCalledWith('/channels/chn_000000000002');- });-- it('keeps the Agent page while Channels are off', () => {- state.enabled = false;- expect(render().result.current).toEqual({ onClick: undefined, url: '/agent/agt_nasa' });- });-- it('opens a missing direct Channel on click and navigates into it', async () => {- state.openDirect.mockResolvedValue('chn_000000000002');- const { result } = render();- const event = click();-- await act(async () => result.current.onClick?.(event));-- expect(event.preventDefault).toHaveBeenCalled();- expect(state.openDirect).toHaveBeenCalledExactlyOnceWith('agt_nasa');- expect(state.navigate).toHaveBeenCalledWith('/channels/chn_000000000002');- });-- it.each([- ['cannot answer in a Channel', () => state.openDirect.mockResolvedValue(undefined)],- ['fails to open one', () => state.openDirect.mockRejectedValue(new Error('offline'))],- ])('falls back to the Agent page when the Agent %s', async (_, arrange) => {- arrange();- const { result } = render();-- await act(async () => result.current.onClick?.(click()));-- expect(state.navigate).toHaveBeenCalledWith('/agent/agt_nasa');- });-- // A slow open pulled the person away from the conversation they picked meanwhile.- it.each([- [- 'another conversation is opened meanwhile',- (rerender: () => void) => {- state.pathname = '/channels/chn_000000000009';- rerender();- },- ],- [- 'the workspace changes meanwhile',- () => {- state.scope = 'workspace:other';- },- ],- ])('does not navigate when %s', async (_, change) => {- let resolve!: (id: string) => void;- state.openDirect.mockReturnValue(new Promise<string>((r) => (resolve = r)));- const { rerender, result } = render();-- act(() => result.current.onClick?.(click()));- change(rerender);- await act(async () => resolve('chn_000000000002'));-- expect(state.navigate).not.toHaveBeenCalled();- });-- it('leaves a modified click to the browser', () => {- const { result } = render();- const event = click({ metaKey: true });-- result.current.onClick?.(event);-- expect(event.preventDefault).not.toHaveBeenCalled();- expect(state.openDirect).not.toHaveBeenCalled();- });-});diff --git a/src/features/MessageList/useAgentConversationLink.ts b/src/features/MessageList/useAgentConversationLink.tsdeleted file mode 100644index a73a3bfe0f8..00000000000--- a/src/features/MessageList/useAgentConversationLink.ts+++ /dev/null@@ -1,76 +0,0 @@-import { CHANNEL_URL } from '@lobechat/const';-import { type MouseEvent, useCallback, useEffect, useRef } from 'react';--import { useActiveWorkspaceSlug } from '@/business/client/hooks/useActiveWorkspaceSlug';-import { resolveInboxAgentRouteId } from '@/features/AgentRoute/useResolvedAgentRouteId';-import { useChannelsEnabled } from '@/features/Channels/useChannelsEnabled';-import { usePreservedAgentUrl } from '@/features/HomeSidebar/Body/Agent/List/usePreservedAgentUrl';-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';-import { useActiveLocation } from '@/hooks/useActiveLocation';-import { cacheScope } from '@/libs/replica';-import { useAgentStore } from '@/store/agent';-import { builtinAgentSelectors } from '@/store/agent/selectors';-import { channelActions, channelSelectors, useChannelStore } from '@/store/channel';--import { isPlainClick } from './conversations';--/**- * With Channels on, an agent row opens the person's direct Channel with the Agent. An Agent made- * before direct Channels has none yet, so the first click opens it; an Agent that cannot answer- * in a Channel (no reachable device) or a failed open falls back to the Agent's own page. Without- * an id yet (the inbox Agent while it loads) the row stays on the Agent's page.- */-export const useAgentConversationLink = (agentId: string | undefined, agentUrl: string) => {- const enabled = useChannelsEnabled() && !!agentId;- const directChannelId = useChannelStore((s) =>- enabled ? channelSelectors.directByAgent(agentId!)(s)?.id : undefined,- );- const navigate = useWorkspaceAwareNavigate();- const opening = useRef(false);- const { pathname, search } = useActiveLocation();- const slug = useActiveWorkspaceSlug();- // Where the person is now. Opening a missing Channel takes a request, and by the time it- // answers they may have picked another conversation or workspace.- const location = `${slug ?? ''}|${pathname}${search}`;- const here = useRef(location);- useEffect(() => {- here.current = location;- }, [location]);-- const onClick = useCallback(- (event: MouseEvent<HTMLAnchorElement>) => {- if (!agentId || !isPlainClick(event)) return;- event.preventDefault();- if (opening.current) return;- opening.current = true;- const from = here.current;- const scope = cacheScope.get();- // Navigate only if nothing else was selected meanwhile, and never route an id from the- // previous workspace under a new one.- const go = (path: string) => {- if (here.current === from && cacheScope.get() === scope) navigate(path);- };- void channelActions- .openDirect(agentId)- .then((channelId) => go(channelId ? CHANNEL_URL(channelId) : agentUrl))- .catch((error) => {- console.error('[channel] Failed to open the direct Channel', error);- go(agentUrl);- })- .finally(() => {- opening.current = false;- });- },- [agentId, agentUrl, navigate],- );-- if (directChannelId) return { url: CHANNEL_URL(directChannelId) };- return { onClick: enabled ? onClick : undefined, url: agentUrl };-};--/** The inbox Agent's row opens its direct Channel the same way any other Agent's row does. */-export const useInboxConversationLink = () => {- const inboxAgentId = useAgentStore(builtinAgentSelectors.inboxAgentId);- const agentUrl = usePreservedAgentUrl(resolveInboxAgentRouteId(inboxAgentId));- return useAgentConversationLink(inboxAgentId, agentUrl);-};diff --git a/src/features/MessageList/useDirectChannelRow.ts b/src/features/MessageList/useDirectChannelRow.tsdeleted file mode 100644index c87d99d7ad9..00000000000--- a/src/features/MessageList/useDirectChannelRow.ts+++ /dev/null@@ -1,44 +0,0 @@-import type { ChannelListItem } from '@lobechat/types';-import { type DropdownItem } from '@lobehub/ui';-import { useCallback } from 'react';--import { directAvatarState, replyAvatarState } from '@/features/Channels/jobStatus';-import { useChannelMenu } from '@/features/Channels/useChannelMenu';-import { channelSelectors, useChannelStore } from '@/store/channel';--/** The direct Channel's own conversation action, next to the Agent's own menu. */-const CONVERSATION_ACTION_KEYS = new Set(['unarchive']);--/**- * A direct Channel is the chat with one Agent, so it cannot be archived or trashed. The row only- * frees one that was archived earlier. Keys are prefixed so they cannot collide with the Agent's- * own menu.- */-export const conversationActions = (menu: DropdownItem[]): DropdownItem[] =>- menu.flatMap((item) => {- if (!item || !('key' in item)) return [];- const key = String(item.key);- if (!CONVERSATION_ACTION_KEYS.has(key)) return [];- return [{ ...item, key: `channel-${key}` } as DropdownItem];- });--/** What an Agent row takes from the direct Channel it opens. */-export const useDirectChannelRow = (channel: ChannelListItem | undefined, active: boolean) => {- const channelMenu = useChannelMenu();- // A direct Channel replies through Channel jobs, not chat operations. The open conversation's- // view is polled while it works, so it is fresher than the list; any other cached view may be- // stale, so other rows read the jobs the list carries.- const replyState = useChannelStore((s) => {- if (!channel) return;- const detail = active- ? channelSelectors.detail({ channelId: channel.id, threadId: null })(s)- : undefined;- return detail ? directAvatarState(detail) : replyAvatarState(channel.replyJobs ?? []);- });- const channelActions = useCallback(- () => (channel ? conversationActions(channelMenu(channel)) : []),- [channel, channelMenu],- );-- return { channelActions, replyState };-};diff --git a/src/features/NavHeader/useNavPanelDrawerContent.ts b/src/features/NavHeader/useNavPanelDrawerContent.tsindex 0b520161939..2bbc7d776cc 100644--- a/src/features/NavHeader/useNavPanelDrawerContent.ts+++ b/src/features/NavHeader/useNavPanelDrawerContent.ts@@ -12,9 +12,6 @@ import { useActiveLocation } from '@/hooks/useActiveLocation';* The sidebar the active route registered through `NavPanelPortal`, for the* mobile drawer. `home` is the desktop agent list, which mobile already shows* as its home page, so it never opens as a drawer.- *- * Mobile keeps the per-route sidebars (agent topics, group members), so it- * resolves with the legacy mapping rather than the desktop rail one.*/export const useNavPanelDrawerContent = (): ReactNode | undefined => {const { pathname } = useActiveLocation();diff --git a/src/features/NavPanel/Shell.tsx b/src/features/NavPanel/Shell.tsxindex 983c7add0fc..bf67dcfef2d 100644--- a/src/features/NavPanel/Shell.tsx+++ b/src/features/NavPanel/Shell.tsx@@ -1,10 +1,6 @@'use client';-import ContactListPortal from '@/features/ContactList';import HomeNavPanelPortal from '@/features/HomeSidebar';-import MessageListPortal from '@/features/MessageList';-import { useImLayout } from '@/features/NavRail/useImLayout';-import TaskNavPortal from '@/features/TaskNav';import NavPanel from './index';@@ -14,26 +10,11 @@ import NavPanel from './index';// Home layout only mounts inside a home tab — and `Activity` unmounts effects// for inactive tabs. Registering from the route layout leaves those tabs with// no `home` entry at all, so the panel is stuck on the loading skeleton.-//-// Under the `im_layout` trial, `home` is the Messages conversation list and-// Contacts / the Tasks scope list are shell-owned for the same reason.-const NavPanelShell = () => {- const imLayout = useImLayout();-- return (- <>- {imLayout ? (- <>- <MessageListPortal />- <ContactListPortal />- <TaskNavPortal />- </>- ) : (- <HomeNavPanelPortal />- )}- <NavPanel />- </>- );-};+const NavPanelShell = () => (+ <>+ <HomeNavPanelPortal />+ <NavPanel />+ </>+);export default NavPanelShell;diff --git a/src/features/NavPanel/components/NavPanelDraggable.tsx b/src/features/NavPanel/components/NavPanelDraggable.tsxindex 5883ed13434..620d4884c45 100644--- a/src/features/NavPanel/components/NavPanelDraggable.tsx+++ b/src/features/NavPanel/components/NavPanelDraggable.tsx@@ -1,6 +1,6 @@'use client';-import { createStaticStyles, cssVar, cx, DraggablePanel } from '@lobehub/ui';+import { createStaticStyles, cssVar, DraggablePanel } from '@lobehub/ui';import { type ReactNode } from 'react';import { Activity, memo, Suspense, useMemo, useRef } from 'react';@@ -10,8 +10,6 @@ import { MAC_VIBRANCY_BACKGROUND } from '@/features/Electron/system/macWindowFulimport Footer from '@/features/HomeSidebar/Footer';import { USER_DROPDOWN_ICON_ID } from '@/features/NavPanel/constants';import { TOGGLE_BUTTON_ID } from '@/features/NavPanel/ToggleLeftPanelButton';-import { LIST_COLUMN_BACKGROUND } from '@/features/NavRail/const';-import { useImLayout } from '@/features/NavRail/useImLayout';import { useGlobalStore } from '@/store/global';import {NAV_PANEL_MAX_WIDTH,@@ -24,11 +22,6 @@ import { useNavPanelSizeChangeHandler } from '../hooks/useNavPanel';import { BACK_BUTTON_ID } from './BackButton';const draggableStyles = createStaticStyles(({ css, cssVar }) => ({- // `im_layout`: the list column inside the rail wrap, divided from the content.- imPanel: css`- border-inline-end: 1px solid ${cssVar.colorBorderSecondary};- background: ${LIST_COLUMN_BACKGROUND};- `,content: css`position: relative;@@ -135,17 +128,12 @@ export const NavPanelDraggable = memo<NavPanelDraggableProps>(({ activeContent,defaultWidthRef.current = systemStatusSelectors.leftPanelWidth(useGlobalStore.getState());}- const imLayout = useImLayout();const styles = useMemo(() => ({- background: imLayout- ? LIST_COLUMN_BACKGROUND- : isDesktop && isMacOS()- ? MAC_VIBRANCY_BACKGROUND- : cssVar.colorBgLayout,+ background: isDesktop && isMacOS() ? MAC_VIBRANCY_BACKGROUND : cssVar.colorBgLayout,zIndex: 11,}),- [imLayout],+ [],);if (defaultWidthRef.current === 0) {@@ -158,7 +146,7 @@ export const NavPanelDraggable = memo<NavPanelDraggableProps>(({ activeContent,return (<DraggablePanel- className={cx(draggableStyles.panel, imLayout && draggableStyles.imPanel)}+ className={draggableStyles.panel}classNames={classNames}defaultSize={defaultSize}expand={expand}@@ -194,12 +182,9 @@ export const NavPanelDraggable = memo<NavPanelDraggableProps>(({ activeContent,<Suspense fallback={null}><NavPanelUpgradeEntry /></Suspense>- {/* The rail owns settings and help under `im_layout`. */}- {!imLayout && (- <Suspense>- <Footer />- </Suspense>- )}+ <Suspense>+ <Footer />+ </Suspense></DraggablePanel>);});diff --git a/src/features/NavPanel/index.test.tsx b/src/features/NavPanel/index.test.tsxindex 4c530075c2a..66df232e0ab 100644--- a/src/features/NavPanel/index.test.tsx+++ b/src/features/NavPanel/index.test.tsx@@ -1,6 +1,6 @@import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';import type { ReactNode } from 'react';-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { beforeEach, describe, expect, it, vi } from 'vitest';import NavPanel from './index';import { NavPanelPortal } from './NavPanelPortal';@@ -59,24 +59,6 @@ vi.mock('@/features/HomeSidebar/Content', () => ({default: () => <div>Home sidebar</div>,}));-const layout = vi.hoisted(() => ({ imLayout: false }));--vi.mock('@/features/NavRail/useImLayout', () => ({ useImLayout: () => layout.imLayout }));--// Under `im_layout` the shell registers the Messages list as `home` instead.-vi.mock('@/features/MessageList', async () => {- const { NavPanelPortal } = await import('./NavPanelPortal');- return {- default: () => (- <NavPanelPortal navKey="home">- <div>Messages list</div>- </NavPanelPortal>- ),- };-});-vi.mock('@/features/ContactList', () => ({ default: () => null }));-vi.mock('@/features/TaskNav', () => ({ default: () => null }));-describe('NavPanel', () => {beforeEach(() => {pathname = '/lobe-team/settings/general';@@ -300,34 +282,3 @@ describe('SideBarLayout scroll restoration', () => {expect(getViewport(second.container).scrollTop).toBe(0);});});--describe('NavPanel under the im_layout trial', () => {- beforeEach(() => {- clearNavPanelRegistry();- layout.imLayout = true;- });-- afterEach(() => {- layout.imLayout = false;- });-- it('renders no list column on the full-page project index', () => {- pathname = '/projects';- registerNavPanelContent('home', Symbol('home'), <div>Home sidebar</div>);-- render(<NavPanel />);-- expect(screen.queryByTestId('nav-panel')).not.toBeInTheDocument();- });-- it('registers the Messages list as the home entry', async () => {- pathname = '/';-- render(<NavPanelShell />);-- await waitFor(() => {- expect(screen.getByText('Messages list')).toBeInTheDocument();- });- expect(screen.queryByText('Home sidebar')).not.toBeInTheDocument();- });-});diff --git a/src/features/NavPanel/index.tsx b/src/features/NavPanel/index.tsxindex 17bf2af0cf6..ff971eacbae 100644--- a/src/features/NavPanel/index.tsx+++ b/src/features/NavPanel/index.tsx@@ -9,7 +9,6 @@ import {NavSideBarSkeleton,} from './components/SideBarSkeleton';import { NAV_PANEL_RIGHT_DRAWER_ID } from './constants';-import { NAV_PANEL_HIDDEN_KEY } from './railRouteKey';import { getNavPanelRegistrySnapshot, subscribeNavPanelRegistry } from './registry';import { useActiveNavKey } from './useActiveNavKey';@@ -35,12 +34,9 @@ const NavPanel = memo(() => {getHomeContent,);- // Full-page tabs (tasks, goals, project index) render without a list column.- const hidden = activeNavKey === NAV_PANEL_HIDDEN_KEY;-return (<>- {!hidden && <NavPanelDraggable activeContent={activeContent} homeContent={homeContent} />}+ <NavPanelDraggable activeContent={activeContent} homeContent={homeContent} /><divid={NAV_PANEL_RIGHT_DRAWER_ID}style={{diff --git a/src/features/NavPanel/railRouteKey.test.ts b/src/features/NavPanel/railRouteKey.test.tsdeleted file mode 100644index 17992d00cae..00000000000--- a/src/features/NavPanel/railRouteKey.test.ts+++ /dev/null@@ -1,58 +0,0 @@-import { describe, expect, it } from 'vitest';--import { isRailContactsRoute, resolveRailNavPanelKey } from './railRouteKey';--describe('resolveRailNavPanelKey', () => {- it.each([- ['/', null, 'home'],- ['/lobe-team', 'lobe-team', 'home'],- // Agent / group routes keep their own workbench sidebar.- ['/agent/agent-1', null, 'agent'],- ['/agent/agent-1/tpc_1', null, 'agent'],- ['/lobe-team/agent/agent-1', 'lobe-team', 'agent'],- ['/agent/agent-1/profile', null, 'agent'],- ['/agent/agent-1/tasks', null, 'agent'],- ['/agent/agent-1/goal/goal-1', null, 'agent'],- ['/agent/agent-1/docs/doc-1', null, 'agent-docs'],- ['/group/group-1', null, 'group'],- ['/group/group-1/tpc_1', null, 'group'],- // The all-agents page shows the Contacts list.- ['/agents', null, 'contacts'],- ['/lobe-team/agents', 'lobe-team', 'contacts'],- // Tasks and goals share the task scope list; the project index is full-page.- ['/tasks', null, 'tasks'],- ['/goals', null, 'tasks'],- ['/lobe-team/task/task-1', 'lobe-team', 'tasks'],- ['/goal/goal-1', null, 'tasks'],- ['/projects', null, 'none'],- // Everything else keeps its route-owned sidebar.- ['/project/project-1', null, 'project'],- ['/resource', null, 'resource'],- ['/resource/library/kb-1', null, 'resourceLibrary'],- ['/community', null, 'discover'],- ['/settings/profile', null, 'settings'],- ])('maps %s to %s', (pathname, activeWorkspaceSlug, expected) => {- expect(resolveRailNavPanelKey(pathname, activeWorkspaceSlug)).toBe(expected);- });-});--describe('isRailContactsRoute', () => {- it.each([- ['/agents', null, true],- ['/agent/agent-1/profile', null, true],- ['/lobe-team/agent/agent-1/channel/discord', 'lobe-team', true],- ['/agent/agent-1/self-evolving/domain-1', null, true],- ['/group/group-1/profile', null, true],- // An agent's or group's chats are its inner pages too.- ['/agent/agent-1', null, true],- ['/agent/agent-1/tpc_1', null, true],- ['/agent/agent-1/tasks', null, true],- ['/group/group-1', null, true],- ['/lobe-team/group/group-1/tpc_1', 'lobe-team', true],- ['/', null, false],- ['/agent', null, false],- ['/tasks', null, false],- ])('%s → %s', (pathname, activeWorkspaceSlug, expected) => {- expect(isRailContactsRoute(pathname, activeWorkspaceSlug)).toBe(expected);- });-});diff --git a/src/features/NavPanel/railRouteKey.ts b/src/features/NavPanel/railRouteKey.tsdeleted file mode 100644index d79acf231ff..00000000000--- a/src/features/NavPanel/railRouteKey.ts+++ /dev/null@@ -1,71 +0,0 @@-import { resolveNavPanelKey } from './routeKey';--/**- * Nav key for routes whose page owns the whole wrap (no list column). The rail- * still highlights their tab; NavPanel renders nothing for this key.- */-export const NAV_PANEL_HIDDEN_KEY = 'none';--/** The IM-style conversation list (agents + groups) behind the Messages tab. */-export const NAV_PANEL_MESSAGES_KEY = 'home';--/** The task scope list (all tasks, goals, projects) behind the Tasks tab. */-export const NAV_PANEL_TASKS_KEY = 'tasks';--/** The contacts list (agents + groups) behind the Contacts tab. */-export const NAV_PANEL_CONTACTS_KEY = 'contacts';--/**- * Roots whose every page is an agent or group's own inner page — its chats,- * topics, profile and config — so the rail highlights Contacts for all of them.- */-const CONTACT_ROOTS = new Set(['agent', 'group']);--const TASK_ROOTS = new Set(['goal', 'goals', 'task', 'tasks']);--const FULL_PAGE_ROOTS = new Set(['projects']);--const splitRoute = (pathname: string, activeWorkspaceSlug: string | null) => {- const segments = pathname.split('/').filter(Boolean);- const isWorkspaceRoute =- !!activeWorkspaceSlug && segments.length > 0 && segments[0] === activeWorkspaceSlug;- return isWorkspaceRoute ? segments.slice(1) : segments;-};--/**- * Whether the rail highlights Contacts for this route: the all-agents page and- * every page inside an agent or group, chats included.- */-export const isRailContactsRoute = (- pathname: string,- activeWorkspaceSlug: string | null,-): boolean => {- const [rootSegment, id] = splitRoute(pathname, activeWorkspaceSlug);- if (rootSegment === 'agents') return true;- return !!id && !!rootSegment && CONTACT_ROOTS.has(rootSegment);-};--/**- * Nav key for the rail layout (rail + list column + content). Builds on the- * legacy `resolveNavPanelKey`, which the mobile drawer still uses unchanged:- * - agent / group routes keep their own workbench sidebar (topics, profile,- * goals, tasks), same as the sidebar layout;- * - the all-agents page shows the Contacts list;- * - tasks and goals share the task scope list (all tasks, goals, projects);- * - the project index renders without a list column.- */-export const resolveRailNavPanelKey = (- pathname: string,- activeWorkspaceSlug: string | null,-): string => {- const legacyKey = resolveNavPanelKey(pathname, activeWorkspaceSlug);- const [rootSegment] = splitRoute(pathname, activeWorkspaceSlug);-- if (legacyKey === 'home') {- if (rootSegment === 'agents') return NAV_PANEL_CONTACTS_KEY;- if (rootSegment && TASK_ROOTS.has(rootSegment)) return NAV_PANEL_TASKS_KEY;- if (rootSegment && FULL_PAGE_ROOTS.has(rootSegment)) return NAV_PANEL_HIDDEN_KEY;- }-- return legacyKey;-};diff --git a/src/features/NavPanel/useActiveNavKey.desktop.test.ts b/src/features/NavPanel/useActiveNavKey.desktop.test.tsindex 7100caf73c9..a0972230e3d 100644--- a/src/features/NavPanel/useActiveNavKey.desktop.test.ts+++ b/src/features/NavPanel/useActiveNavKey.desktop.test.ts@@ -6,10 +6,6 @@ import { useElectronStore } from '@/store/electron';import { useActiveNavKey } from './useActiveNavKey.desktop';-const layout = vi.hoisted(() => ({ imLayout: false }));--vi.mock('@/features/NavRail/useImLayout', () => ({ useImLayout: () => layout.imLayout }));-vi.mock('@/business/client/hooks/useActiveWorkspaceSlug', () => ({useActiveWorkspaceSlug: () => null,}));@@ -17,7 +13,6 @@ vi.mock('@/business/client/hooks/useActiveWorkspaceSlug', () => ({const tab = (id: string, url: string) => ({ id, lastVisited: 0, url });afterEach(() => {- layout.imLayout = false;useElectronStore.setState({ activeTabId: null, tabs: [] });useDisplayedTabStore.setState({ tabId: null });});@@ -54,16 +49,4 @@ describe('useActiveNavKey (desktop)', () => {expect(result.current).toBe('discover');});-- // The rail moves the all-agents page to the Contacts list under `im_layout`.- it('resolves with the rail mapping under the im_layout trial', () => {- layout.imLayout = true;- useElectronStore.setState({ activeTabId: 'only', tabs: [tab('only', '/agents')] });- useDisplayedTabStore.setState({ tabId: 'only' });-- expect(renderHook(() => useActiveNavKey()).result.current).toBe('contacts');-- layout.imLayout = false;- expect(renderHook(() => useActiveNavKey()).result.current).toBe('home');- });});diff --git a/src/features/NavPanel/useActiveNavKey.desktop.ts b/src/features/NavPanel/useActiveNavKey.desktop.tsindex 45868bdf2fa..8dfa57184a6 100644--- a/src/features/NavPanel/useActiveNavKey.desktop.ts+++ b/src/features/NavPanel/useActiveNavKey.desktop.ts@@ -1,8 +1,6 @@import { useActiveWorkspaceSlug } from '@/business/client/hooks/useActiveWorkspaceSlug';import { useDisplayedTabUrl } from '@/features/Electron/TabHost/displayedTab';-import { useImLayout } from '@/features/NavRail/useImLayout';-import { resolveRailNavPanelKey } from './railRouteKey';import { resolveNavPanelKey } from './routeKey';// The route-owned panel registers from inside the tab's layout, so keying the@@ -13,9 +11,5 @@ export const useActiveNavKey = () => {const activeWorkspaceSlug = useActiveWorkspaceSlug();const pathname = url.split(/[#?]/)[0] || '/';- // The `im_layout` rail folds chats into the conversation list and adds the- // Contacts / Tasks list columns; off keeps the per-route sidebars.- const imLayout = useImLayout();-- return (imLayout ? resolveRailNavPanelKey : resolveNavPanelKey)(pathname, activeWorkspaceSlug);+ return resolveNavPanelKey(pathname, activeWorkspaceSlug);};diff --git a/src/features/NavPanel/useActiveNavKey.ts b/src/features/NavPanel/useActiveNavKey.tsindex c72d1842b91..9669e41a170 100644--- a/src/features/NavPanel/useActiveNavKey.ts+++ b/src/features/NavPanel/useActiveNavKey.ts@@ -1,17 +1,11 @@import { useActiveWorkspaceSlug } from '@/business/client/hooks/useActiveWorkspaceSlug';-import { useImLayout } from '@/features/NavRail/useImLayout';import { useActiveLocation } from '@/hooks/useActiveLocation';-import { resolveRailNavPanelKey } from './railRouteKey';import { resolveNavPanelKey } from './routeKey';export const useActiveNavKey = () => {const { pathname } = useActiveLocation();const activeWorkspaceSlug = useActiveWorkspaceSlug();- // The `im_layout` rail folds chats into the conversation list and adds the- // Contacts / Tasks list columns; off keeps the per-route sidebars.- const imLayout = useImLayout();-- return (imLayout ? resolveRailNavPanelKey : resolveNavPanelKey)(pathname, activeWorkspaceSlug);+ return resolveNavPanelKey(pathname, activeWorkspaceSlug);};diff --git a/src/features/NavRail/MoreMenu.test.tsx b/src/features/NavRail/MoreMenu.test.tsxdeleted file mode 100644index 713d30e4592..00000000000--- a/src/features/NavRail/MoreMenu.test.tsx+++ /dev/null@@ -1,96 +0,0 @@-import { cleanup, render, screen } from '@testing-library/react';-import type { ReactNode } from 'react';-import { afterEach, describe, expect, it, vi } from 'vitest';--vi.mock('react-i18next', () => ({- useTranslation: () => ({- t: (key: string) =>- ({- 'changelog': 'Changelog',- 'tab.more': 'More',- 'userPanel.docs': 'Docs',- 'userPanel.feedback': 'Feedback',- })[key] || key,- }),-}));--vi.mock('./style', () => ({- RAIL_ICON_SIZE: 20,- styles: { item: {}, itemActive: {} },-}));--interface MockItem {- key: string;- label?: ReactNode;- type?: string;-}--vi.mock('@lobehub/ui', async (importOriginal) => {- const actual = await importOriginal<Record<string, unknown>>();-- return {- ...actual,- DropdownMenu: ({ children, items }: { children: ReactNode; items: MockItem[] }) => (- <div>- {children}- <ul data-testid={'menu'}>- {items- .filter((item) => item.type !== 'divider')- .map((item) => (- <li data-testid={`item-${item.key}`} key={item.key}>- {item.label}- </li>- ))}- </ul>- </div>- ),- };-});--vi.mock('@/components/ChangelogModal', () => ({- default: () => null,- openChangelogModal: vi.fn(),-}));--vi.mock('@/components/FeedbackModal', () => ({- default: () => null,- openFeedbackModal: vi.fn(),-}));--vi.mock('@/business/client/hooks/useHelpMenuBugReportItem', () => ({- useHelpMenuBugReportItem: () => null,-}));--vi.mock('@/features/Workspace/useWorkspaceAwareNavigate', () => ({- useWorkspaceAwareNavigate: () => vi.fn(),-}));--const mockNavItems = {- bottomMenuItems: [],- topNavItems: [{ hidden: false, icon: 'icon', key: 'dashboard', title: 'Dashboard', url: '/dashboard' }],-};--vi.mock('@/hooks/useNavLayout', () => ({- useNavLayout: () => mockNavItems,-}));--describe('NavRail MoreMenu', () => {- afterEach(() => {- cleanup();- });-- it('keeps the footer Help entries reachable from the rail layout', async () => {- const { default: MoreMenu } = await import('./MoreMenu');-- render(<MoreMenu />);-- // The rail replaces the sidebar footer, so docs / feedback / changelog must- // stay in this menu instead of disappearing with the footer.- expect(screen.getByTestId('item-docs')).toBeTruthy();- expect(screen.getByTestId('item-feedback')).toBeTruthy();- expect(screen.getByTestId('item-changelog')).toBeTruthy();-- // Routes without their own rail tab keep their entry.- expect(screen.getByTestId('item-dashboard')).toBeTruthy();- });-});diff --git a/src/features/NavRail/MoreMenu.tsx b/src/features/NavRail/MoreMenu.tsxdeleted file mode 100644index 4146ad7e481..00000000000--- a/src/features/NavRail/MoreMenu.tsx+++ /dev/null@@ -1,95 +0,0 @@-'use client';--import { type DropdownItem, DropdownMenu, Icon, Tooltip } from '@lobehub/ui';-import * as stylex from '@stylexjs/stylex';-import { Book, EllipsisIcon, Feather, FileClockIcon } from 'lucide-react';-import { memo, useMemo } from 'react';-import { useTranslation } from 'react-i18next';--import { useHelpMenuBugReportItem } from '@/business/client/hooks/useHelpMenuBugReportItem';-import { openChangelogModal } from '@/components/ChangelogModal';-import { openFeedbackModal } from '@/components/FeedbackModal';-import { DOCUMENTS_REFER_URL } from '@/const/url';-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';-import { useNavLayout } from '@/hooks/useNavLayout';--import { RAIL_ICON_SIZE, styles } from './style';--/** Routes that have no rail tab of their own (generation, memory, dashboards). */-const MORE_NAV_KEYS = ['dashboard', 'image', 'memory'];--/**- * The rail replaces the sidebar footer under `im_layout`, so the Help entries- * that used to live there (docs, report a bug, feedback, changelog) move to the- * end of this menu — otherwise they would be unreachable from the rail layout.- */-const MoreMenu = memo<{ active?: boolean }>(({ active }) => {- const { t } = useTranslation('common');- const navigate = useWorkspaceAwareNavigate();- const { topNavItems, bottomMenuItems } = useNavLayout();- const bugReportItem = useHelpMenuBugReportItem();-- const items = useMemo<DropdownItem[]>(() => {- const navItems: DropdownItem[] = [...topNavItems, ...bottomMenuItems]- .filter((item) => !item.hidden && item.url && MORE_NAV_KEYS.includes(item.key))- .map((item) => ({- icon: <Icon icon={item.icon} />,- key: item.key,- label: item.title,- onClick: () => navigate(item.url!),- }));-- const helpItems: DropdownItem[] = [- {- icon: <Icon icon={Book} />,- key: 'docs',- label: (- <a href={DOCUMENTS_REFER_URL} rel="noopener noreferrer" target="_blank">- {t('userPanel.docs')}- </a>- ),- },- ...(bugReportItem ? [bugReportItem as DropdownItem] : []),- {- icon: <Icon icon={Feather} />,- key: 'feedback',- label: t('userPanel.feedback'),- onClick: () => {- openFeedbackModal();- },- },- {- icon: <Icon icon={FileClockIcon} />,- key: 'changelog',- label: t('changelog'),- onClick: () => {- openChangelogModal();- },- },- ];-- if (navItems.length === 0) return helpItems;-- return [...navItems, { type: 'divider' as const }, ...helpItems];- }, [bottomMenuItems, bugReportItem, navigate, t, topNavItems]);-- if (items.length === 0) return null;-- return (- <DropdownMenu items={items} placement={'rightTop'}>- <Tooltip placement={'right'} title={t('tab.more')}>- <div- aria-label={t('tab.more')}- {...stylex.props(styles.item, active && styles.itemActive)}- role={'button'}- >- <Icon icon={EllipsisIcon} size={RAIL_ICON_SIZE} />- </div>- </Tooltip>- </DropdownMenu>- );-});--MoreMenu.displayName = 'MoreMenu';--export default MoreMenu;diff --git a/src/features/NavRail/RailItem.tsx b/src/features/NavRail/RailItem.tsxdeleted file mode 100644index 6dbc00b130c..00000000000--- a/src/features/NavRail/RailItem.tsx+++ /dev/null@@ -1,49 +0,0 @@-'use client';--import { Icon, Tooltip } from '@lobehub/ui';-import * as stylex from '@stylexjs/stylex';-import { type LucideIcon } from 'lucide-react';-import { memo } from 'react';--import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';-import WorkspaceLink from '@/features/Workspace/WorkspaceLink';-import { isModifierClick } from '@/utils/navigation';--import { RAIL_ICON_SIZE, styles } from './style';--interface RailItemProps {- active?: boolean;- badge?: number;- icon: LucideIcon;- title: string;- url: string;-}--const RailItem = memo<RailItemProps>(({ active, badge, icon, title, url }) => {- const navigate = useWorkspaceAwareNavigate();-- return (- <Tooltip placement={'right'} title={title}>- <WorkspaceLink- aria-current={active ? 'page' : undefined}- aria-label={title}- {...stylex.props(styles.item, active && styles.itemActive)}- to={url}- onClick={(e) => {- if (isModifierClick(e)) return;- e.preventDefault();- navigate(url);- }}- >- <Icon icon={icon} size={RAIL_ICON_SIZE} />- {!!badge && badge > 0 && (- <span {...stylex.props(styles.badge)}>{badge > 99 ? '99+' : badge}</span>- )}- </WorkspaceLink>- </Tooltip>- );-});--RailItem.displayName = 'RailItem';--export default RailItem;diff --git a/src/features/NavRail/const.ts b/src/features/NavRail/const.tsdeleted file mode 100644index 814c554166f..00000000000--- a/src/features/NavRail/const.ts+++ /dev/null@@ -1,12 +0,0 @@-import { cssVar } from '@lobehub/ui';--// Kept dependency-free: the boot skeleton (entry chunk) mirrors these.--/** Icon rail width; the list column and content sit in the wrap to its right. */-export const RAIL_WIDTH = 48;--/**- * The list column sits inside the wrap: a half step between the window- * background (rail) and the content surface, like Codex's middle column.- */-export const LIST_COLUMN_BACKGROUND = `color-mix(in srgb, ${cssVar.colorBgContainer} 55%, ${cssVar.colorBgLayout})`;diff --git a/src/features/NavRail/index.tsx b/src/features/NavRail/index.tsxdeleted file mode 100644index 6393e357993..00000000000--- a/src/features/NavRail/index.tsx+++ /dev/null@@ -1,126 +0,0 @@-'use client';--import { cssVar, Flexbox } from '@lobehub/ui';-import * as stylex from '@stylexjs/stylex';-import {- CompassIcon,- FolderKanbanIcon,- LibraryBigIcon,- ListTodoIcon,- MessageCircleIcon,- Settings2Icon,- UsersRoundIcon,-} from 'lucide-react';-import { memo, useMemo } from 'react';-import { useTranslation } from 'react-i18next';--import { useActiveWorkspaceSlug } from '@/business/client/hooks/useActiveWorkspaceSlug';-import { isDesktop } from '@/const/version';-import { useChannelsEnabled } from '@/features/Channels/useChannelsEnabled';-import { MAC_VIBRANCY_BACKGROUND } from '@/features/Electron/system/macWindowFullscreen';-import InboxButton from '@/features/HomeSidebar/Header/components/InboxButton';-import User from '@/features/HomeSidebar/Header/components/User';-import { messagesUnreadCount } from '@/features/MessageList/conversations';-import { useActiveLocation } from '@/hooks/useActiveLocation';-import { channelSelectors, useChannelStore } from '@/store/channel';-import { useHomeStore } from '@/store/home';-import { homeAgentListSelectors } from '@/store/home/selectors';-import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';-import { isMacOS } from '@/utils/platform';--import { ActiveChannelSync, useMessagesUrl } from './messagesTarget';-import MoreMenu from './MoreMenu';-import RailItem from './RailItem';-import { resolveRailTab } from './railTab';-import { RAIL_GAP, styles } from './style';--// macOS Electron shows the window vibrancy through the rail, like the old sidebar.-const railBackground = {- background: isDesktop && isMacOS() ? MAC_VIBRANCY_BACKGROUND : cssVar.colorBgLayout,-};--/** The badge sums the Messages list rows, so it always matches what the list shows. */-const useMessagesUnread = (channelsEnabled: boolean) => {- const channels = useChannelStore(channelSelectors.list);- return useHomeStore((s) =>- messagesUnreadCount(- homeAgentListSelectors.allAgents(s),- channelsEnabled ? channels : undefined,- ),- );-};--/**- * Global icon rail (column ①). Tabs own a list column (column ②) registered- * through `NavPanelPortal`, or render full-width inside the wrap.- */-const NavRail = memo(() => {- const { t } = useTranslation('common');- const { pathname } = useActiveLocation();- const activeWorkspaceSlug = useActiveWorkspaceSlug();- const { showMarket } = useServerConfigStore(featureFlagsSelectors);- const channelsEnabled = useChannelsEnabled();- const unread = useMessagesUnread(channelsEnabled);-- const activeTab = resolveRailTab(pathname, activeWorkspaceSlug);-- // Messages returns to the active Channel, or home where the conversation list lives.- const { activeChannelId, url: messagesUrl } = useMessagesUrl(pathname, activeWorkspaceSlug);-- // Tab order follows the product IA: messages, contacts, docs, tasks, projects.- const topItems = useMemo(- () => [- { icon: MessageCircleIcon, key: 'messages', title: t('tab.messages'), url: messagesUrl },- { icon: UsersRoundIcon, key: 'contacts', title: t('tab.contacts'), url: '/agents' },- { icon: LibraryBigIcon, key: 'resource', title: t('tab.resource'), url: '/resource' },- { icon: ListTodoIcon, key: 'tasks', title: t('tab.tasks'), url: '/tasks' },- { icon: FolderKanbanIcon, key: 'projects', title: t('tab.projects'), url: '/projects' },- ],- [messagesUrl, t],- );-- return (- <Flexbox className={stylex.props(styles.rail).className} gap={12} style={railBackground}>- {/* The badge counts Channel rows, so the list stays fresh whenever Channels are on. */}- {(activeChannelId || channelsEnabled) && <ActiveChannelSync />}- <User lite />- <Flexbox align={'center'} gap={RAIL_GAP}>- {topItems.map((item) => (- <RailItem- active={activeTab === item.key}- badge={item.key === 'messages' ? unread : undefined}- icon={item.icon}- key={item.key}- title={item.title}- url={item.url}- />- ))}- </Flexbox>- <div style={{ flex: 1 }} />- <Flexbox align={'center'} gap={RAIL_GAP}>- {/* The rail replaces the Home sidebar header, which used to own the only- entry point to the notification inbox modal. */}- <InboxButton />- <MoreMenu active={activeTab === 'more'} />- {showMarket && (- <RailItem- active={activeTab === 'discover'}- icon={CompassIcon}- title={t('tab.discover')}- url={'/community'}- />- )}- <RailItem- active={activeTab === 'settings'}- icon={Settings2Icon}- title={t('tab.setting')}- url={'/settings'}- />- </Flexbox>- </Flexbox>- );-});--NavRail.displayName = 'NavRail';--export default NavRail;diff --git a/src/features/NavRail/layoutHint.test.ts b/src/features/NavRail/layoutHint.test.tsdeleted file mode 100644index 4eb89da635f..00000000000--- a/src/features/NavRail/layoutHint.test.ts+++ /dev/null@@ -1,19 +0,0 @@-import { afterEach, describe, expect, it } from 'vitest';--import { IM_LAYOUT_HINT_KEY, readImLayoutHint, writeImLayoutHint } from './layoutHint';--afterEach(() => localStorage.removeItem(IM_LAYOUT_HINT_KEY));--describe('im_layout boot hint', () => {- it('is off until the rail layout has rendered once', () => {- expect(readImLayoutHint()).toBe(false);- });-- it('follows the last rendered layout', () => {- writeImLayoutHint(true);- expect(readImLayoutHint()).toBe(true);-- writeImLayoutHint(false);- expect(readImLayoutHint()).toBe(false);- });-});diff --git a/src/features/NavRail/layoutHint.ts b/src/features/NavRail/layoutHint.tsdeleted file mode 100644index 59e282f130b..00000000000--- a/src/features/NavRail/layoutHint.ts+++ /dev/null@@ -1,24 +0,0 @@-// Dependency-free: the boot skeleton (entry chunk) reads this before any store.--/**- * The boot skeleton paints before the per-user `im_layout` flag is known, so- * the last layout the app rendered is remembered here and mirrored.- */-export const IM_LAYOUT_HINT_KEY = 'LOBE_IM_LAYOUT';--export const readImLayoutHint = (): boolean => {- try {- return localStorage.getItem(IM_LAYOUT_HINT_KEY) === '1';- } catch {- return false;- }-};--export const writeImLayoutHint = (enabled: boolean) => {- try {- if (enabled) localStorage.setItem(IM_LAYOUT_HINT_KEY, '1');- else localStorage.removeItem(IM_LAYOUT_HINT_KEY);- } catch {- // Storage may be unavailable (private mode); the skeleton then shows the default.- }-};diff --git a/src/features/NavRail/messagesTarget.test.ts b/src/features/NavRail/messagesTarget.test.tsdeleted file mode 100644index bee4d8d8a6f..00000000000--- a/src/features/NavRail/messagesTarget.test.ts+++ /dev/null@@ -1,57 +0,0 @@-import { act, renderHook } from '@testing-library/react';-import { beforeEach, describe, expect, it } from 'vitest';--import { useChannelStore } from '@/store/channel';--import { nextActiveChannelId, useMessagesUrl } from './messagesTarget';--describe('nextActiveChannelId', () => {- it.each([- [undefined, '/channels/chn_1', null, 'chn_1'],- ['chn_1', '/lobe-team/channels/chn_2', 'lobe-team', 'chn_2'],- // Other pages keep the active Channel.- ['chn_1', '/agent/agt_1', null, 'chn_1'],- ['chn_1', '/tasks', null, 'chn_1'],- // A project's Channel belongs to the Projects tab.- ['chn_1', '/project/project-1/channels/chn_9', null, 'chn_1'],- // Home clears it.- ['chn_1', '/', null, undefined],- ['chn_1', '/lobe-team', 'lobe-team', undefined],- ])('%s + %s → %s', (previous, pathname, slug, expected) => {- expect(nextActiveChannelId(previous, pathname, slug)).toBe(expected);- });-});--describe('useMessagesUrl', () => {- beforeEach(() => {- useChannelStore.setState({- listMap: { all: [{ id: 'chn_1' }] as never },- } as never);- });-- it('opens home when no Channel is active', () => {- const { result } = renderHook(() => useMessagesUrl('/agent/agt_1', null));- expect(result.current.url).toBe('/');- });-- it('returns to the last opened Channel after leaving it', () => {- const { result, rerender } = renderHook(({ pathname }) => useMessagesUrl(pathname, null), {- initialProps: { pathname: '/channels/chn_1' },- });- expect(result.current.url).toBe('/channels/chn_1');-- rerender({ pathname: '/agent/agt_1' });- expect(result.current.url).toBe('/channels/chn_1');-- rerender({ pathname: '/' });- expect(result.current.url).toBe('/');- });-- it('falls back home once the Channel is gone', () => {- const { result } = renderHook(() => useMessagesUrl('/channels/chn_1', null));- act(() => {- useChannelStore.setState({ listMap: { all: [] } } as never);- });- expect(result.current.url).toBe('/');- });-});diff --git a/src/features/NavRail/messagesTarget.ts b/src/features/NavRail/messagesTarget.tsdeleted file mode 100644index fe17e2b2a2a..00000000000--- a/src/features/NavRail/messagesTarget.ts+++ /dev/null@@ -1,68 +0,0 @@-import { CHANNEL_URL } from '@lobechat/const';-import { memo, useState } from 'react';--import { channelActions, channelSelectors, useChannelStore } from '@/store/channel';--/** Path segments below the active workspace slug, if the pathname carries one. */-const scopedSegments = (pathname: string, activeWorkspaceSlug: string | null) => {- const segments = pathname.split('/').filter(Boolean);- return activeWorkspaceSlug && segments[0] === activeWorkspaceSlug ? segments.slice(1) : segments;-};--/**- * The Channel the Messages tab returns to after `pathname` is visited. Opening a Channel makes it- * the active one; going back home clears it; any other page keeps the previous one. A project- * Channel opened from the Projects tab (`/project/:id/channels/:id`) is not tracked.- */-export const nextActiveChannelId = (- previous: string | undefined,- pathname: string,- activeWorkspaceSlug: string | null,-): string | undefined => {- const segments = scopedSegments(pathname, activeWorkspaceSlug);- if (segments.length === 0) return undefined;- if (segments[0] === 'channels' && segments[1]) return segments[1];- return previous;-};--/**- * Keeps the Channel list fresh while the rail points at a Channel, so one removed elsewhere (another- * tab or device) drops the link back to home instead of opening a missing Channel.- */-export const ActiveChannelSync = memo(() => {- channelActions.useFetchList();- return null;-});--ActiveChannelSync.displayName = 'NavRailActiveChannelSync';--/**- * Where the Messages tab leads: the active Channel while it still exists, otherwise home, where- * the conversation list lives.- */-export const useMessagesUrl = (pathname: string, activeWorkspaceSlug: string | null) => {- const [tracked, setTracked] = useState(() => ({- channelId: nextActiveChannelId(undefined, pathname, activeWorkspaceSlug),- pathname,- }));- // Derive on navigation during render rather than in an effect, so the link is never a step behind.- if (tracked.pathname !== pathname) {- setTracked({- channelId: nextActiveChannelId(tracked.channelId, pathname, activeWorkspaceSlug),- pathname,- });- }- const activeChannelId = tracked.channelId;-- const channelExists = useChannelStore((s) => {- if (!activeChannelId) return false;- const list = channelSelectors.list(s);- // Before the list loads, trust the route the user just opened.- return !list || list.some((channel) => channel.id === activeChannelId);- });-- return {- activeChannelId,- url: activeChannelId && channelExists ? CHANNEL_URL(activeChannelId) : '/',- };-};diff --git a/src/features/NavRail/railTab.test.ts b/src/features/NavRail/railTab.test.tsdeleted file mode 100644index 5e40dd2096d..00000000000--- a/src/features/NavRail/railTab.test.ts+++ /dev/null@@ -1,31 +0,0 @@-import { describe, expect, it } from 'vitest';--import { resolveRailTab } from './railTab';--describe('resolveRailTab', () => {- it.each([- ['/', null, 'messages'],- // Everything inside an agent or group is its inner page, chats included.- ['/agent/agent-1', null, 'contacts'],- ['/agent/agent-1/tpc_1', null, 'contacts'],- ['/lobe-team/group/group-1/tpc_1', 'lobe-team', 'contacts'],- ['/agents', null, 'contacts'],- ['/agent/agent-1/profile', null, 'contacts'],- ['/lobe-team/group/group-1/profile', 'lobe-team', 'contacts'],- // Goals are merged into the Tasks tab.- ['/tasks', null, 'tasks'],- ['/goals', null, 'tasks'],- ['/goal/goal-1', null, 'tasks'],- ['/lobe-team/task/task-1/fix', 'lobe-team', 'tasks'],- ['/projects', null, 'projects'],- ['/project/project-1/tasks', null, 'projects'],- ['/resource/library/kb-1', null, 'resource'],- ['/page/page-1/permission', null, 'resource'],- ['/community/agent/slug', null, 'discover'],- ['/settings/provider/openai', null, 'settings'],- ['/memory', null, 'more'],- ['/image', null, 'more'],- ])('maps %s to %s', (pathname, activeWorkspaceSlug, expected) => {- expect(resolveRailTab(pathname, activeWorkspaceSlug)).toBe(expected);- });-});diff --git a/src/features/NavRail/railTab.ts b/src/features/NavRail/railTab.tsdeleted file mode 100644index 292fa521278..00000000000--- a/src/features/NavRail/railTab.ts+++ /dev/null@@ -1,40 +0,0 @@-import { isRailContactsRoute } from '@/features/NavPanel/railRouteKey';--export type RailTabKey =- 'contacts' | 'discover' | 'messages' | 'more' | 'projects' | 'resource' | 'settings' | 'tasks';--const TAB_BY_ROOT: Record<string, RailTabKey> = {- community: 'discover',- dashboard: 'more',- eval: 'more',- goal: 'tasks',- goals: 'tasks',- image: 'more',- memory: 'more',- page: 'resource',- project: 'projects',- projects: 'projects',- resource: 'resource',- settings: 'settings',- task: 'tasks',- tasks: 'tasks',- video: 'more',-};--/**- * The rail tab a pathname belongs to. The home page is Messages; every page- * inside an agent or group, chats included, is Contacts.- */-export const resolveRailTab = (- pathname: string,- activeWorkspaceSlug: string | null,-): RailTabKey => {- if (isRailContactsRoute(pathname, activeWorkspaceSlug)) return 'contacts';-- const segments = pathname.split('/').filter(Boolean);- const isWorkspaceRoute =- !!activeWorkspaceSlug && segments.length > 0 && segments[0] === activeWorkspaceSlug;- const [rootSegment] = isWorkspaceRoute ? segments.slice(1) : segments;-- return (rootSegment && TAB_BY_ROOT[rootSegment]) || 'messages';-};diff --git a/src/features/NavRail/style.ts b/src/features/NavRail/style.tsdeleted file mode 100644index 28d5add7aa4..00000000000--- a/src/features/NavRail/style.ts+++ /dev/null@@ -1,57 +0,0 @@-import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';-import * as stylex from '@stylexjs/stylex';--// 48px rail; review settled the glyph between 13px (too small) and 18px (too-// large): 16px at 1.5 stroke inside a 30px hit area, 10px apart.-export const RAIL_ICON_SIZE = { size: 16, strokeWidth: 1.5 };-export const RAIL_GAP = 10;--export const styles = stylex.create({- badge: {- pointerEvents: 'none',- position: 'absolute',- insetBlockStart: '-5px',- insetInlineEnd: '-6px',- minWidth: '15px',- height: '15px',- paddingInline: '4px',- borderWidth: '1.5px',- borderStyle: 'solid',- borderColor: cssVar.colorBgLayout,- borderRadius: '999px',- fontSize: '9px',- fontWeight: 600,- lineHeight: '12px',- color: '#fff',- textAlign: 'center',- // Red like the conversation rows' unread badge, so the count reads as unread, not as a label.- backgroundColor: cssVar.colorError,- },- item: {- cursor: 'pointer',- position: 'relative',- display: 'flex',- flex: 'none',- alignItems: 'center',- justifyContent: 'center',- width: '30px',- height: '30px',- borderRadius: cssVar.borderRadius,- color: { 'default': cssVar.colorTextSecondary, ':hover': cssVar.colorText },- backgroundColor: { 'default': null, ':hover': cssVar.colorFillTertiary },- transition: 'color 0.15s, background-color 0.15s',- },- itemActive: {- color: cssVar.colorText,- backgroundColor: { 'default': cssVar.colorFillSecondary, ':hover': cssVar.colorFillSecondary },- },- rail: {- userSelect: 'none',- flex: 'none',- alignItems: 'center',- // Keep in sync with RAIL_WIDTH (./const): StyleX only compiles local literals.- width: '48px',- height: '100%',- paddingBlock: '10px',- },-});diff --git a/src/features/NavRail/useContactBackUrl.test.ts b/src/features/NavRail/useContactBackUrl.test.tsdeleted file mode 100644index 7b9fbb15cb1..00000000000--- a/src/features/NavRail/useContactBackUrl.test.ts+++ /dev/null@@ -1,20 +0,0 @@-import { renderHook } from '@testing-library/react';-import { describe, expect, it, vi } from 'vitest';--import { useContactBackUrl } from './useContactBackUrl';--const imLayout = vi.hoisted(() => ({ value: false }));--vi.mock('./useImLayout', () => ({ useImLayout: () => imLayout.value }));--describe('useContactBackUrl', () => {- it('returns to the Contacts list in the rail layout', () => {- imLayout.value = true;- expect(renderHook(() => useContactBackUrl()).result.current).toBe('/agents');- });-- it('returns home in the sidebar layout', () => {- imLayout.value = false;- expect(renderHook(() => useContactBackUrl()).result.current).toBe('/');- });-});diff --git a/src/features/NavRail/useContactBackUrl.ts b/src/features/NavRail/useContactBackUrl.tsdeleted file mode 100644index 8e7779c7b93..00000000000--- a/src/features/NavRail/useContactBackUrl.ts+++ /dev/null@@ -1,7 +0,0 @@-import { useImLayout } from './useImLayout';--/**- * Where back leaves an agent or group for. The rail files every page inside one- * under Contacts, so back returns to that list; the sidebar layout goes home.- */-export const useContactBackUrl = (): string => (useImLayout() ? '/agents' : '/');diff --git a/src/features/NavRail/useImLayout.ts b/src/features/NavRail/useImLayout.tsdeleted file mode 100644index 8176248aad7..00000000000--- a/src/features/NavRail/useImLayout.ts+++ /dev/null@@ -1,14 +0,0 @@-import { useEffect } from 'react';--import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';--import { writeImLayoutHint } from './layoutHint';--/** Runtime flag `im_layout`: the rail layout trial. Off keeps the sidebar layout. */-export const useImLayout = (): boolean =>- useServerConfigStore((s) => !!featureFlagsSelectors(s).enableImLayout);--/** Remember the rendered layout so the next boot skeleton matches it. */-export const useSyncImLayoutHint = (enabled: boolean) => {- useEffect(() => writeImLayoutHint(enabled), [enabled]);-};diff --git a/src/features/NavRail/wrapStyle.ts b/src/features/NavRail/wrapStyle.tsdeleted file mode 100644index 08d188628db..00000000000--- a/src/features/NavRail/wrapStyle.ts+++ /dev/null@@ -1,26 +0,0 @@-import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';-import * as stylex from '@stylexjs/stylex';--export const wrapStyles = stylex.create({- // The wrap right of the rail: list column + content share one rounded,- // bordered surface (Codex-style); the rail stays on the window background.- wrap: {- position: 'relative',- overflow: 'hidden',- flex: '1',- minWidth: 0,- marginBlockStart: '8px',- marginBlockEnd: '8px',- marginInlineEnd: '8px',- borderWidth: '1px',- borderStyle: 'solid',- borderColor: cssVar.colorBorderSecondary,- borderRadius: '12px',- backgroundColor: cssVar.colorBgContainer,- boxShadow: '0 1px 2px rgb(0 0 0 / 3%)',- },- // Electron: the title bar already sits above the wrap.- wrapDesktop: {- marginBlockStart: 0,- },-});diff --git a/src/features/TaskNav/index.test.tsx b/src/features/TaskNav/index.test.tsxdeleted file mode 100644index d22a9f30580..00000000000--- a/src/features/TaskNav/index.test.tsx+++ /dev/null@@ -1,101 +0,0 @@-/**- * @vitest-environment happy-dom- */-import { fireEvent, render, screen } from '@testing-library/react';-import { createElement } from 'react';-import { beforeEach, describe, expect, it, vi } from 'vitest';--import { TaskNavBody } from './index';--const projectStore = vi.hoisted(() => ({- fetch: {- error: undefined as unknown,- isHydrated: true,- isValidating: false,- revalidate: vi.fn(),- },- projects: undefined as { id: string; name: string }[] | undefined,-}));--vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));-vi.mock('@/business/client/hooks/useActiveWorkspaceSlug', () => ({- useActiveWorkspaceSlug: () => null,-}));-vi.mock('@/hooks/useActiveLocation', () => ({- useActiveLocation: () => ({ pathname: '/tasks', search: '' }),-}));-vi.mock('@/store/project', () => ({- useLoadedProjectList: () => projectStore.projects,- useProjectStore: (selector: (state: object) => unknown) =>- selector({ useFetchProjectList: () => projectStore.fetch }),-}));-vi.mock('@/store/user', () => ({- useUserStore: (selector: (state: object) => unknown) => selector({}),-}));-vi.mock('@/store/user/selectors', () => ({- labPreferSelectors: { enableGoals: () => false, enableProjects: () => true },-}));-vi.mock('@/features/Projects/ProjectAvatar', () => ({ projectIcon: () => null }));-vi.mock('@/features/MessageList', () => ({- ListHeader: ({ title }: { title: string }) => createElement('div', {}, title),-}));-vi.mock('@/features/NavPanel/components/NavItem', () => ({- default: ({ title }: { title: string }) => createElement('div', {}, title),-}));-vi.mock('@/features/NavPanel/components/SkeletonList', () => ({- default: () => createElement('div', {}, 'Loading projects'),-}));-vi.mock('@/features/Workspace/WorkspaceLink', () => ({- default: ({ children }: { children: React.ReactNode }) => createElement('div', {}, children),-}));-vi.mock('@/features/Workspace/useWorkspaceAwareNavigate', () => ({- useWorkspaceAwareNavigate: () => () => {},-}));-vi.mock('@/components/AsyncError', () => ({- default: ({ onRetry }: { onRetry?: () => void }) =>- createElement('button', { onClick: onRetry, type: 'button' }, 'Retry projects'),-}));--beforeEach(() => {- projectStore.fetch.error = undefined;- projectStore.fetch.isHydrated = true;- projectStore.fetch.isValidating = false;- projectStore.fetch.revalidate.mockReset();- projectStore.projects = undefined;-});--describe('TaskNavBody', () => {- it('shows the skeleton while the first project load is in flight', () => {- projectStore.fetch.isHydrated = false;-- render(createElement(TaskNavBody));-- expect(screen.getByText('Loading projects')).toBeInTheDocument();- });-- it('shows a retryable error when the first project load fails', () => {- projectStore.fetch.error = new Error('network');-- render(createElement(TaskNavBody));-- expect(screen.queryByText('Loading projects')).not.toBeInTheDocument();- fireEvent.click(screen.getByText('Retry projects'));- expect(projectStore.fetch.revalidate).toHaveBeenCalled();- });-- it('lists the projects once they load', () => {- projectStore.projects = [{ id: 'p1', name: 'Alpha' }];-- render(createElement(TaskNavBody));-- expect(screen.getByText('Alpha')).toBeInTheDocument();- });-- it('shows the empty hint when the workspace has no project', () => {- projectStore.projects = [];-- render(createElement(TaskNavBody));-- expect(screen.getByText('taskNav.noProjects')).toBeInTheDocument();- });-});diff --git a/src/features/TaskNav/index.tsx b/src/features/TaskNav/index.tsxdeleted file mode 100644index dc4a47d90f1..00000000000--- a/src/features/TaskNav/index.tsx+++ /dev/null@@ -1,150 +0,0 @@-'use client';--import { Flexbox } from '@lobehub/ui';-import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';-import * as stylex from '@stylexjs/stylex';-import { ListTodoIcon, TargetIcon } from 'lucide-react';-import { type ComponentProps, memo } from 'react';-import { useTranslation } from 'react-i18next';--import { useActiveWorkspaceSlug } from '@/business/client/hooks/useActiveWorkspaceSlug';-import AsyncError from '@/components/AsyncError';-import { ListHeader } from '@/features/MessageList';-import NavItem from '@/features/NavPanel/components/NavItem';-import SkeletonList from '@/features/NavPanel/components/SkeletonList';-import { NavPanelPortal } from '@/features/NavPanel/NavPanelPortal';-import { NAV_PANEL_TASKS_KEY } from '@/features/NavPanel/railRouteKey';-import SideBarLayout from '@/features/NavPanel/SideBarLayout';-import { projectIcon } from '@/features/Projects/ProjectAvatar';-import { resolveProjectListState } from '@/features/Projects/projectListState';-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';-import WorkspaceLink from '@/features/Workspace/WorkspaceLink';-import { useActiveLocation } from '@/hooks/useActiveLocation';-import { useLoadedProjectList, useProjectStore } from '@/store/project';-import { useUserStore } from '@/store/user';-import { labPreferSelectors } from '@/store/user/selectors';-import { isModifierClick } from '@/utils/navigation';--import { resolveTaskScope, taskScopeUrl } from './taskScope';--const styles = stylex.create({- empty: {- paddingBlock: '8px',- paddingInline: '10px',- fontSize: '12px',- color: cssVar.colorTextQuaternary,- },- sectionTitle: {- paddingBlockStart: '12px',- paddingBlockEnd: '4px',- paddingInline: '10px',- fontSize: '12px',- color: cssVar.colorTextTertiary,- },-});--interface EntryProps {- active: boolean;- icon: ComponentProps<typeof NavItem>['icon'];- title: string;- url: string;-}--const Entry = memo<EntryProps>(({ active, icon, title, url }) => {- const navigate = useWorkspaceAwareNavigate();-- return (- <WorkspaceLink- aria-current={active ? 'page' : undefined}- aria-label={title}- to={url}- onClick={(e) => {- if (isModifierClick(e)) return;- e.preventDefault();- navigate(url);- }}- >- <NavItem active={active} icon={icon} title={title} />- </WorkspaceLink>- );-});--Entry.displayName = 'TaskNavEntry';--export const TaskNavBody = memo(() => {- const { t } = useTranslation('common');- const { pathname, search } = useActiveLocation();- const activeSlug = useActiveWorkspaceSlug();- const enableGoals = useUserStore(labPreferSelectors.enableGoals);- const enableProjects = useUserStore(labPreferSelectors.enableProjects);- const projects = useLoadedProjectList();- const { error, isHydrated, isValidating, revalidate } = useProjectStore(- (s) => s.useFetchProjectList,- )(enableProjects);- const projectListState = resolveProjectListState({ error, isHydrated, isValidating, projects });-- const scope = resolveTaskScope(pathname, search ?? '', activeSlug);-- return (- <Flexbox gap={1} paddingBlock={'0 12px'} paddingInline={6}>- <Entry- active={scope.type === 'all'}- icon={ListTodoIcon}- title={t('taskNav.all')}- url={taskScopeUrl()}- />- {enableGoals && (- <Entry- active={scope.type === 'goals'}- icon={TargetIcon}- title={t('tab.goals')}- url="/goals"- />- )}- {enableProjects && (- <>- <div {...stylex.props(styles.sectionTitle)}>{t('tab.projects')}</div>- {projectListState === 'error' ? (- <AsyncError error={error} variant="inline" onRetry={() => revalidate()} />- ) : projectListState === 'loading' ? (- <SkeletonList rows={3} />- ) : projectListState === 'empty' ? (- <div {...stylex.props(styles.empty)}>{t('taskNav.noProjects')}</div>- ) : (- projects?.map((project) => (- <Entry- active={scope.type === 'project' && scope.projectId === project.id}- icon={projectIcon(project)}- key={project.id}- title={project.name}- url={taskScopeUrl(project.id)}- />- ))- )}- </>- )}- </Flexbox>- );-});--TaskNavBody.displayName = 'TaskNavBody';--const Header = memo(() => {- const { t } = useTranslation('common');- return <ListHeader title={t('tab.tasks')} />;-});--Header.displayName = 'TaskNavHeader';--/**- * Tasks tab list column: every task, goals, then one entry per project. A- * project entry scopes the task list in place (`/tasks?project=<id>`), so the- * user stays in the Tasks tab instead of jumping into the project workbench.- */-const TaskNavPortal = () => (- <NavPanelPortal navKey={NAV_PANEL_TASKS_KEY}>- <SideBarLayout body={<TaskNavBody />} header={<Header />} />- </NavPanelPortal>-);--export default TaskNavPortal;diff --git a/src/features/TaskNav/taskScope.test.ts b/src/features/TaskNav/taskScope.test.tsdeleted file mode 100644index 281842d38a4..00000000000--- a/src/features/TaskNav/taskScope.test.ts+++ /dev/null@@ -1,25 +0,0 @@-import { describe, expect, it } from 'vitest';--import { resolveTaskScope, taskScopeUrl } from './taskScope';--describe('resolveTaskScope', () => {- it.each([- ['/tasks', '', null, { type: 'all' }],- ['/task/T-1/slug', '', null, { type: 'all' }],- ['/tasks', '?project=prj_1', null, { projectId: 'prj_1', type: 'project' }],- ['/team/tasks', '?project=prj_1&x=1', 'team', { projectId: 'prj_1', type: 'project' }],- ['/goals', '', null, { type: 'goals' }],- ['/team/goal/g-1', '', 'team', { type: 'goals' }],- // The project param only scopes the task list itself.- ['/goals', '?project=prj_1', null, { type: 'goals' }],- ])('maps %s%s', (pathname, search, slug, expected) => {- expect(resolveTaskScope(pathname, search, slug)).toEqual(expected);- });-});--describe('taskScopeUrl', () => {- it('builds the scoped task list url', () => {- expect(taskScopeUrl()).toBe('/tasks');- expect(taskScopeUrl('prj 1')).toBe('/tasks?project=prj%201');- });-});diff --git a/src/features/TaskNav/taskScope.ts b/src/features/TaskNav/taskScope.tsdeleted file mode 100644index e3fa6070459..00000000000--- a/src/features/TaskNav/taskScope.ts+++ /dev/null@@ -1,29 +0,0 @@-/** Query param the Tasks tab uses to scope `/tasks` to one project. */-export const TASK_PROJECT_PARAM = 'project';--export type TaskScope =- { type: 'all' } | { type: 'goals' } | { projectId: string; type: 'project' };--/**- * Which Tasks-tab list entry a location belongs to: a project scope- * (`/tasks?project=<id>`), the goals pages, or every other task route.- */-export const resolveTaskScope = (- pathname: string,- search: string,- activeWorkspaceSlug: string | null,-): TaskScope => {- const segments = pathname.split('/').filter(Boolean);- const [root] =- activeWorkspaceSlug && segments[0] === activeWorkspaceSlug ? segments.slice(1) : segments;-- if (root === 'goals' || root === 'goal') return { type: 'goals' };-- const projectId = new URLSearchParams(search).get(TASK_PROJECT_PARAM);- if (root === 'tasks' && projectId) return { projectId, type: 'project' };-- return { type: 'all' };-};--export const taskScopeUrl = (projectId?: string) =>- projectId ? `/tasks?${TASK_PROJECT_PARAM}=${encodeURIComponent(projectId)}` : '/tasks';diff --git a/src/routes/(main)/_layout/authMount.test.ts b/src/routes/(main)/_layout/authMount.test.tsindex 371d0b4a2da..43c96b8fc54 100644--- a/src/routes/(main)/_layout/authMount.test.ts+++ b/src/routes/(main)/_layout/authMount.test.ts@@ -43,12 +43,6 @@ vi.mock('@/features/Electron/titlebar/TabBar/TabCacheBridges', nullComponent);vi.mock('@/features/Electron/titlebar/TitleBar', nullComponent);vi.mock('@/features/HotkeyHelperPanel', nullComponent);vi.mock('@/features/NavPanel/Shell', nullComponent);-vi.mock('@/features/NavRail', nullComponent);-vi.mock('@/features/NavRail/wrapStyle', () => ({ wrapStyles: {} }));-vi.mock('@/features/NavRail/useImLayout', () => ({- useImLayout: () => false,- useSyncImLayoutHint: () => {},-}));vi.mock('@/layout/GlobalProvider/CmdkLazy', nullComponent);vi.mock('./GatewayMuxWarmup', nullComponent);vi.mock('./ClientLlmWaitResume', nullComponent);diff --git a/src/routes/(main)/_layout/index.desktop.tsx b/src/routes/(main)/_layout/index.desktop.tsxindex 563565b86da..dcb9e89eeb0 100644--- a/src/routes/(main)/_layout/index.desktop.tsx+++ b/src/routes/(main)/_layout/index.desktop.tsx@@ -32,9 +32,6 @@ import TitleBar from '@/features/Electron/titlebar/TitleBar';import WorkspaceMentionNotifier from '@/features/Electron/WorkspaceMentionNotifier';import HotkeyHelperPanel from '@/features/HotkeyHelperPanel';import NavPanelShell from '@/features/NavPanel/Shell';-import NavRail from '@/features/NavRail';-import { useImLayout, useSyncImLayoutHint } from '@/features/NavRail/useImLayout';-import { wrapStyles } from '@/features/NavRail/wrapStyle';import { DndContextWrapper } from '@/features/ResourceManager/DndContextWrapper';import { usePlatform } from '@/hooks/usePlatform';import CmdkLazy from '@/layout/GlobalProvider/CmdkLazy';@@ -55,9 +52,6 @@ const tabHostContainer: CSSProperties = { position: 'relative' };const Layout: FC = () => {const { isPWA } = usePlatform();const { showCloudPromotion } = useServerConfigStore(featureFlagsSelectors);- // `im_layout` trial: icon rail + wrapped list column; off keeps this layout.- const imLayout = useImLayout();- useSyncImLayoutHint(imLayout);useSeedTabsOnBoot();useWindowUrlMirror();@@ -95,28 +89,12 @@ const Layout: FC = () => {stylex.props(isPWA ? styles.mainContainerPWA : styles.mainContainer).className}>- {imLayout ? (- <>- <NavRail />- <Flexbox horizontal {...stylex.props(wrapStyles.wrap, wrapStyles.wrapDesktop)}>- <NavPanelShell />- <DesktopLayoutContainer flush>- <Flexbox height={'100%'} style={tabHostContainer} width={'100%'}>- <TabHost />- </Flexbox>- </DesktopLayoutContainer>- </Flexbox>- </>- ) : (- <>- <NavPanelShell />- <DesktopLayoutContainer>- <Flexbox height={'100%'} style={tabHostContainer} width={'100%'}>- <TabHost />- </Flexbox>- </DesktopLayoutContainer>- </>- )}+ <NavPanelShell />+ <DesktopLayoutContainer>+ <Flexbox height={'100%'} style={tabHostContainer} width={'100%'}>+ <TabHost />+ </Flexbox>+ </DesktopLayoutContainer></Flexbox></DndContextWrapper><Suspense fallback={null}>diff --git a/src/routes/(main)/_layout/index.tsx b/src/routes/(main)/_layout/index.tsxindex 4388f291514..9be706e4572 100644--- a/src/routes/(main)/_layout/index.tsx+++ b/src/routes/(main)/_layout/index.tsx@@ -16,9 +16,6 @@ import DesktopLayoutContainer from '@/features/DesktopLayoutContainer';import AuthRequiredModal from '@/features/Electron/AuthRequiredModal';import HotkeyHelperPanel from '@/features/HotkeyHelperPanel';import NavPanelShell from '@/features/NavPanel/Shell';-import NavRail from '@/features/NavRail';-import { useImLayout, useSyncImLayoutHint } from '@/features/NavRail/useImLayout';-import { wrapStyles } from '@/features/NavRail/wrapStyle';import { DndContextWrapper } from '@/features/ResourceManager/DndContextWrapper';import { RouteMetaBridge } from '@/features/RouteMeta';import { usePlatform } from '@/hooks/usePlatform';@@ -43,9 +40,6 @@ const GlobalApprovalNotification = dynamic(() => import('@/features/GlobalApprovconst Layout: FC = () => {const { isPWA } = usePlatform();const { showCloudPromotion } = useServerConfigStore(featureFlagsSelectors);- // `im_layout` trial: icon rail + wrapped list column; off keeps this layout.- const imLayout = useImLayout();- useSyncImLayoutHint(imLayout);return (<HotkeysProvider initiallyActiveScopes={[HotkeyScopeEnum.Global]}>@@ -63,38 +57,15 @@ const Layout: FC = () => {stylex.props(isPWA ? styles.mainContainerPWA : styles.mainContainer).className}>- {imLayout ? (- <>- <NavRail />- <Flexbox- horizontal- {...stylex.props(wrapStyles.wrap, isDesktop && wrapStyles.wrapDesktop)}- >- <NavPanelShell />- <DesktopLayoutContainer flush>- {/* `/` stays the home dashboard; the Messages tab returns here or to the active Channel. */}- <DesktopHomeLayout>- <DesktopHome />- </DesktopHomeLayout>- <Suspense fallback={<RouteSegmentSkeleton />}>- <Outlet />- </Suspense>- </DesktopLayoutContainer>- </Flexbox>- </>- ) : (- <>- <NavPanelShell />- <DesktopLayoutContainer>- <DesktopHomeLayout>- <DesktopHome />- </DesktopHomeLayout>- <Suspense fallback={<RouteSegmentSkeleton />}>- <Outlet />- </Suspense>- </DesktopLayoutContainer>- </>- )}+ <NavPanelShell />+ <DesktopLayoutContainer>+ <DesktopHomeLayout>+ <DesktopHome />+ </DesktopHomeLayout>+ <Suspense fallback={<RouteSegmentSkeleton />}>+ <Outlet />+ </Suspense>+ </DesktopLayoutContainer></Flexbox></DndContextWrapper><Suspense fallback={null}>diff --git a/src/routes/(main)/agent/features/Conversation/MainChatInput/index.tsx b/src/routes/(main)/agent/features/Conversation/MainChatInput/index.tsxindex 5ba408d899c..1a7f5fedfcc 100644--- a/src/routes/(main)/agent/features/Conversation/MainChatInput/index.tsx+++ b/src/routes/(main)/agent/features/Conversation/MainChatInput/index.tsx@@ -3,15 +3,8 @@import { memo, useMemo } from 'react';import { type ActionKeys } from '@/features/ChatInput';-import { ActionBarContext } from '@/features/ChatInput/ActionBar/context';-import {- COMPACT_ACTION_BAR_CONTEXT,- COMPACT_ACTION_BAR_STYLE,- COMPACT_SEND_BUTTON_PROPS,-} from '@/features/ChatInput/compactPreset';import { ChatInput } from '@/features/Conversation';import { contextSelectors, useConversationStore } from '@/features/Conversation/store';-import { useImLayout } from '@/features/NavRail/useImLayout';import { useModelSupportImageOutput } from '@/hooks/useModelSupportImageOutput';import { useAgentStore } from '@/store/agent';import { agentByIdSelectors } from '@/store/agent/selectors';@@ -22,9 +15,6 @@ import { userGeneralSettingsSelectors } from '@/store/user/selectors';import AgentConfigError from './AgentConfigError';import { useSendMenuItems } from './useSendMenuItems';-// Single-row editor for the channel composer; it still grows with content.-const SLIM_INPUT_PROPS = { defaultHeight: 36 };-const contextWindowRightActions: ActionKeys[] = ['model', 'voiceMessage', 'contextWindow'];const promptTransformRightActions: ActionKeys[] = ['model',@@ -57,41 +47,25 @@ const MainChatInput = memo(() => {// The model chip lives on the right, next to Send (see rightActions); the// left bar keeps the "+" menu, dictation and the expand toggle.const leftActions: ActionKeys[] = useMemo(() => ['plus', 'voiceDictation'], []);- // `im_layout` opens conversations as channels: the slim composer preset of- // the side panels (small actions and send button). The control bar stays —- // it is the only place to pick the device and working directory.- const imLayout = useImLayout();-- const input = (- <ChatInput- skipScrollMarginWithList- actionBarStyle={imLayout ? COMPACT_ACTION_BAR_STYLE : undefined}- inputContainerProps={imLayout ? SLIM_INPUT_PROPS : undefined}- isConfigLoading={isAgentConfigLoading}- leftActions={leftActions}- rightActions={rightActions}- {...(isDevMode- ? { sendMenu: { items: sendMenuItems } }- : {- sendButtonProps: imLayout- ? { ...COMPACT_SEND_BUTTON_PROPS, shape: 'round' }- : { shape: 'round' },- })}- onEditorReady={(instance) => {- // Sync to global ChatStore for compatibility with other features- useChatStore.setState({ mainInputEditor: instance });- }}- />- );return (<><AgentConfigError />- {imLayout ? (- <ActionBarContext value={COMPACT_ACTION_BAR_CONTEXT}>{input}</ActionBarContext>- ) : (- input- )}+ <ChatInput+ skipScrollMarginWithList+ isConfigLoading={isAgentConfigLoading}+ leftActions={leftActions}+ rightActions={rightActions}+ {...(isDevMode+ ? { sendMenu: { items: sendMenuItems } }+ : {+ sendButtonProps: { shape: 'round' },+ })}+ onEditorReady={(instance) => {+ // Sync to global ChatStore for compatibility with other features+ useChatStore.setState({ mainInputEditor: instance });+ }}+ /></>);});diff --git a/src/routes/(main)/agents/[id]/index.tsx b/src/routes/(main)/agents/[id]/index.tsxdeleted file mode 100644index 56093edf55a..00000000000--- a/src/routes/(main)/agents/[id]/index.tsx+++ /dev/null@@ -1,5 +0,0 @@-import ContactDetailPage from '@/features/ContactList/ContactDetail';--const ContactDetailRoute = () => <ContactDetailPage />;--export default ContactDetailRoute;diff --git a/src/routes/(main)/group/_layout/Sidebar/Header/index.tsx b/src/routes/(main)/group/_layout/Sidebar/Header/index.tsxindex 45f0b1a9cc1..47bcb4fdcca 100644--- a/src/routes/(main)/group/_layout/Sidebar/Header/index.tsx+++ b/src/routes/(main)/group/_layout/Sidebar/Header/index.tsx@@ -3,17 +3,14 @@import { type PropsWithChildren } from 'react';import SideBarHeaderLayout from '@/features/NavPanel/SideBarHeaderLayout';-import { useContactBackUrl } from '@/features/NavRail/useContactBackUrl';import Agent from './Agent';import Nav from './Nav';const HeaderInfo = (_props: PropsWithChildren) => {- const backTo = useContactBackUrl();-return (<>- <SideBarHeaderLayout backTo={backTo} left={<Agent />} />+ <SideBarHeaderLayout left={<Agent />} /><Nav /></>);diff --git a/src/routes/(main)/group/features/Conversation/MainChatInput/index.tsx b/src/routes/(main)/group/features/Conversation/MainChatInput/index.tsxindex c666bfbfa6a..22d0a824659 100644--- a/src/routes/(main)/group/features/Conversation/MainChatInput/index.tsx+++ b/src/routes/(main)/group/features/Conversation/MainChatInput/index.tsx@@ -3,21 +3,11 @@import { memo } from 'react';import { type ActionKeys } from '@/features/ChatInput';-import { ActionBarContext } from '@/features/ChatInput/ActionBar/context';-import {- COMPACT_ACTION_BAR_CONTEXT,- COMPACT_ACTION_BAR_STYLE,- COMPACT_SEND_BUTTON_PROPS,-} from '@/features/ChatInput/compactPreset';import { ChatInput } from '@/features/Conversation';-import { useImLayout } from '@/features/NavRail/useImLayout';import { useChatStore } from '@/store/chat';import { useSendMenuItems } from './useSendMenuItems';-// Single-row editor for the channel composer; it still grows with content.-const SLIM_INPUT_PROPS = { defaultHeight: 36 };-const leftActions: ActionKeys[] = ['search','memory',@@ -41,19 +31,11 @@ const rightActions: ActionKeys[] = ['model', 'voiceMessage', 'contextWindow'];const MainChatInput = memo(() => {const sendMenuItems = useSendMenuItems();- // `im_layout` opens conversations as channels: the slim composer preset of- // the side panels (small actions and send button). The control bar stays —- // it is the only place to pick the device and working directory.- const imLayout = useImLayout();-- const input = (+ return (<ChatInputskipScrollMarginWithList- actionBarStyle={imLayout ? COMPACT_ACTION_BAR_STYLE : undefined}- inputContainerProps={imLayout ? SLIM_INPUT_PROPS : undefined}leftActions={leftActions}rightActions={rightActions}- sendButtonProps={imLayout ? COMPACT_SEND_BUTTON_PROPS : undefined}sendMenu={{ items: sendMenuItems }}onEditorReady={(instance) => {// Sync to global ChatStore for compatibility with other features@@ -61,10 +43,6 @@ const MainChatInput = memo(() => {}}/>);-- if (!imLayout) return input;-- return <ActionBarContext value={COMPACT_ACTION_BAR_CONTEXT}>{input}</ActionBarContext>;});MainChatInput.displayName = 'MainChatInput';diff --git a/src/routes/(main)/tasks/index.tsx b/src/routes/(main)/tasks/index.tsxindex 41fce28559c..90a9dcb2296 100644--- a/src/routes/(main)/tasks/index.tsx+++ b/src/routes/(main)/tasks/index.tsx@@ -1,3 +1 @@-'use client';--export { default } from '@/features/AgentTasks/AgentTaskList/TasksTabPage';+export { default } from '@/features/AgentTasks/AgentTaskList/AgentTasksPage';diff --git a/src/services/recent/index.ts b/src/services/recent/index.tsindex 6ccd4053a3b..5280e909e1b 100644--- a/src/services/recent/index.ts+++ b/src/services/recent/index.ts@@ -7,12 +7,6 @@ export const RECENT_SIDEBAR_TYPES = ['task',] as const satisfies readonly RecentItem['type'][];-/**- * The IM conversation list only needs topics: each agent / group row takes its- * activity time and preview from that owner's latest topic.- */-export const RECENT_CONVERSATION_TYPES = ['topic'] as const satisfies readonly RecentItem['type'][];-class RecentService {getAll = (limit?: number,diff --git a/src/spa/BootShell/AppShellSkeleton.tsx b/src/spa/BootShell/AppShellSkeleton.tsxindex 2aa758c8285..a6f290c422c 100644--- a/src/spa/BootShell/AppShellSkeleton.tsx+++ b/src/spa/BootShell/AppShellSkeleton.tsx@@ -1,7 +1,7 @@'use client';import { TITLE_BAR_HEIGHT } from '@lobechat/desktop-bridge';-import { cx, Flexbox } from '@lobehub/ui';+import { Flexbox } from '@lobehub/ui';import { LobeHub } from '@lobehub/ui/brand';import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';import * as stylex from '@stylexjs/stylex';@@ -15,9 +15,6 @@ import {getOuterCssVariables,} from '@/features/DesktopLayoutContainer/cssVariables';import { styles as containerStyles } from '@/features/DesktopLayoutContainer/style';-import { LIST_COLUMN_BACKGROUND, RAIL_WIDTH } from '@/features/NavRail/const';-import { readImLayoutHint } from '@/features/NavRail/layoutHint';-import { wrapStyles as layoutStyles } from '@/features/NavRail/wrapStyle';import { electronStylish } from '@/styles/electron';import { sx } from '@/styles/sx';@@ -116,7 +113,6 @@ interface AppShellSkeletonProps {const AppShellSkeleton = memo<AppShellSkeletonProps>(({ id }) => {const { isDark, navPanelBackground, navPanelWidth, showLeftPanel } = readBootShellGeometry();const hint = useLoadingHint();- const imLayout = readImLayoutHint();useLayoutEffect(retainSkeleton, []);@@ -129,58 +125,6 @@ const AppShellSkeleton = memo<AppShellSkeletonProps>(({ id }) => {</div>);- // `im_layout`: icon rail + one rounded wrap (list column + content).- if (imLayout)- return (- <div aria-hidden id={id} {...sx(styles.root, CSS_VAR_CLASS)}>- {isDesktop && (- <div- {...sx(styles.dragRegion, electronStylish.draggable, { height: TITLE_BAR_HEIGHT })}- />- )}- <Flexbox- horizontal- height={isDesktop ? `calc(100% - ${TITLE_BAR_HEIGHT}px)` : '100%'}- width={'100%'}- >- <div- style={{- background: navPanelBackground,- flexShrink: 0,- height: '100%',- width: RAIL_WIDTH,- }}- />- <Flexbox- horizontal- style={getInnerCssVariables({ isDark })}- className={- stylex.props(layoutStyles.wrap, isDesktop && layoutStyles.wrapDesktop).className- }- >- {showLeftPanel && (- <div- style={{- background: LIST_COLUMN_BACKGROUND,- borderInlineEnd: `1px solid ${cssVar.colorBorderSecondary}`,- flexShrink: 0,- height: '100%',- width: navPanelWidth,- }}- />- )}- <Flexbox- className={cx(containerStyles.innerContainer, containerStyles.innerFlush)}- height={'100%'}- width={'100%'}- >- {brand}- </Flexbox>- </Flexbox>- </Flexbox>- </div>- );-return (<div aria-hidden id={id} {...sx(styles.root, CSS_VAR_CLASS)}>{isDesktop && (diff --git a/src/spa/router/collaborationRoutes.tsx b/src/spa/router/collaborationRoutes.tsxindex 7440f621b85..c0b49bbe291 100644--- a/src/spa/router/collaborationRoutes.tsx+++ b/src/spa/router/collaborationRoutes.tsx@@ -17,15 +17,6 @@ export const collaborationRoutes: RouteObject[] = [handle: { meta: agentsRouteMeta },index: true,},- {- element: dynamicElement(- () => import('@/routes/(main)/agents/[id]'),- 'Desktop > Agents > Contact',- { preloadId: 'agents' },- ),- handle: { meta: agentsRouteMeta },- path: ':id',- },],errorElement: <ErrorBoundary resetPath=".." />,path: 'agents',diff --git a/src/spa/router/mobileRouter.config.tsx b/src/spa/router/mobileRouter.config.tsxindex e565ebbe10d..8dbefd91357 100644--- a/src/spa/router/mobileRouter.config.tsx+++ b/src/spa/router/mobileRouter.config.tsx@@ -303,15 +303,6 @@ export const sharedMainAreaChildren: RouteObject[] = [handle: { meta: routeMeta({ icon: BotIcon, titleKey: 'navigation.agents' }) },index: true,},- {- element: dynamicElement(- () => import('@/routes/(main)/agents/[id]'),- 'Mobile > Agents > Contact',- { preloadId: 'mobile-agents' },- ),- handle: { meta: routeMeta({ icon: BotIcon, titleKey: 'navigation.agents' }) },- path: ':id',- },],errorElement: <ErrorBoundary resetPath=".." />,path: 'agents',diff --git a/src/store/global/initialState.ts b/src/store/global/initialState.tsindex be63b30f491..742ecb45d3e 100644--- a/src/store/global/initialState.ts+++ b/src/store/global/initialState.ts@@ -184,9 +184,6 @@ export const DEFAULT_DOCS_PAGE_SECTION_VIEW: DocsPageSectionView = {type: 'all',};-/** How the Contacts list is ordered: by name, or most recently updated first. */-export type ContactListSortBy = 'title' | 'updatedAt';-/** How a sidebar Channel section orders its Channels. */export interface ChannelListSort {/** `updatedAt` follows the latest message, so it orders by activity. */@@ -257,8 +254,6 @@ export interface SystemStatus {* match and every group would render collapsed.*/collapsedTopicGroupKeysByMode?: Partial<Record<TopicGroupMode, string[]>>;- /** Order of the Contacts list; absent means by name. Device-local view setting. */- contactListSortBy?: ContactListSortBy;disabledModelProvidersSortType?: string;disabledModelsSortType?: string;/**diff --git a/src/store/global/selectors/systemStatus.ts b/src/store/global/selectors/systemStatus.tsindex accfce2555c..a81eb89af66 100644--- a/src/store/global/selectors/systemStatus.ts+++ b/src/store/global/selectors/systemStatus.ts@@ -3,7 +3,6 @@ import { type TopicGroupMode } from '@/types/topic';import type {AgentDocumentSort,ChannelListSort,- ContactListSortBy,DocsPageSectionKey,DocsPageSectionView,GlobalState,@@ -554,8 +553,6 @@ const DEFAULT_AGENT_DOCUMENT_SORT: AgentDocumentSort = {foldersFirst: true,order: 'asc',};-const contactListSortBy = (s: GlobalState): ContactListSortBy =>- s.status.contactListSortBy ?? 'title';// The server lists Channels newest first; keep that as the default view.const DEFAULT_CHANNEL_LIST_SORT: ChannelListSort = { by: 'createdAt', order: 'desc' };const channelListSort = (s: GlobalState): ChannelListSort =>@@ -620,7 +617,6 @@ const homeSelectedAgentId =export const systemStatusSelectors = {agentBuilderPanelWidth,agentDocumentSort,- contactListSortBy,channelListSort,projectListSortBy,projectListViewMode,diff --git a/src/store/home/slices/recent/action.test.ts b/src/store/home/slices/recent/action.test.tsindex ff2276b0284..d2ba96d46ad 100644--- a/src/store/home/slices/recent/action.test.ts+++ b/src/store/home/slices/recent/action.test.ts@@ -21,11 +21,7 @@ import { taskService } from '@/services/task';import { topicService } from '@/services/topic';import { useHomeStore } from '@/store/home';import { HOME_TOPIC_RECENTS_PARAMS, TRAY_RECENTS_PARAMS } from '@/store/home/slices/recent/action';-import {- createConversationRecentQueryKey,- createRecentQueryKey,- initialRecentState,-} from '@/store/home/slices/recent/initialState';+import { createRecentQueryKey, initialRecentState } from '@/store/home/slices/recent/initialState';import { docsHomeListResource, recentListResource } from '@/store/home/slices/recent/projection';import { homeRecentSelectors } from '@/store/home/slices/recent/selectors';@@ -123,23 +119,6 @@ describe('recents replica', () => {expect(result.current.isValidating).toBe(true);});- it('fetches topic recents with previews for the conversation list', async () => {- const getAll = vi- .spyOn(recentService, 'getAll')- .mockImplementation(async () => [item('t1', 'Topic', 'topic')]);- const conversations = createConversationRecentQueryKey(50);-- renderHook(() => useHomeStore((s) => s.useFetchConversationRecents)(50), { wrapper });-- await waitFor(() =>- expect(- homeRecentSelectors.conversationRecents(conversations)(useHomeStore.getState()),- ).toHaveLength(1),- );- // Topics with previews: the IM rows show the latest reply, not the title.- expect(getAll).toHaveBeenCalledWith(50, ['topic'], true);- });-it('does not fetch while logged out', () => {const getAll = vi.spyOn(recentService, 'getAll');renderHook(() => useHomeStore((s) => s.useFetchRecents)(false, 10), { wrapper });diff --git a/src/store/home/slices/recent/action.ts b/src/store/home/slices/recent/action.tsindex 1fac311ac3d..569f3046172 100644--- a/src/store/home/slices/recent/action.ts+++ b/src/store/home/slices/recent/action.ts@@ -9,7 +9,7 @@ import {} from '@/libs/replica';import { documentService } from '@/services/document';import { fileService } from '@/services/file';-import { RECENT_CONVERSATION_TYPES, RECENT_SIDEBAR_TYPES, recentService } from '@/services/recent';+import { RECENT_SIDEBAR_TYPES, recentService } from '@/services/recent';import { taskService } from '@/services/task';import { topicService } from '@/services/topic';import type { HomeStore } from '@/store/home/store';@@ -18,7 +18,6 @@ import { setNamespace } from '@/utils/storeDebug';import { type RecentEntityRef, toRecentEntityRef } from './initialState';import {- conversationRecentResource,DOCS_HOME_LIMIT,docsHomeListResource,type DocsHomeRow,@@ -116,7 +115,6 @@ export class RecentActionImpl {readonly #set: Setter;/** Server writes per entity run in order; the newest optimistic title stays on top. */readonly #renameQueues = new Map<RecentEntityRef, Promise<unknown>>();- readonly #conversationRecents;readonly #docsHome;readonly #recentList;readonly #recents;@@ -133,17 +131,7 @@ export class RecentActionImpl {stateKey: 'recentListReplica',view: recordLens<HomeStore, RecentItem[]>('recentListMap'),});- this.#conversationRecents = createReplicaSlice(conversationRecentResource, {- actionPrefix: n('conversationRecents'),- entity: recentEntity,- // Topics only, with previews: the IM list shows the latest reply per row.- fetcher: ({ limit }) => recentService.getAll(limit, RECENT_CONVERSATION_TYPES, true),- get,- set,- stateKey: 'conversationRecentReplica',- view: recordLens<HomeStore, RecentItem[]>('conversationRecentMap'),- });- this.#recents = linkReplicaEntity<RecentItem>([this.#recentList, this.#conversationRecents]);+ this.#recents = linkReplicaEntity<RecentItem>([this.#recentList]);this.#docsHome = createReplicaSlice(docsHomeListResource, {actionPrefix: n('docsHome'),fetcher: async ({ tab }) =>@@ -182,7 +170,7 @@ export class RecentActionImpl {/** Revalidate every recents query of the active identity. */refreshRecents = async (): Promise<void> => {- await Promise.all([this.#recentList.revalidate(), this.#conversationRecents.revalidate()]);+ await this.#recentList.revalidate();};/**@@ -210,13 +198,6 @@ export class RecentActionImpl {useFetchAllRecents = (open: boolean): ReplicaSyncResult =>this.#recentList.useSync({ limit: ALL_RECENTS_LIMIT }, { enabled: open });- /**- * Latest topic per owner for the IM conversation list. Read the rows with- * `homeRecentSelectors.conversationRecents`.- */- useFetchConversationRecents = (limit: number = ALL_RECENTS_LIMIT): ReplicaSyncResult =>- this.#conversationRecents.useSync({ limit }, { enabled: true });-/*** Home chat-mode recent topics (the viewer's own, server-narrowed). Read them* with `homeRecentSelectors.query(createRecentQueryKey(...HOME_TOPIC_RECENTS_PARAMS))`.diff --git a/src/store/home/slices/recent/initialState.ts b/src/store/home/slices/recent/initialState.tsindex 04c9b93200a..805512ed96f 100644--- a/src/store/home/slices/recent/initialState.ts+++ b/src/store/home/slices/recent/initialState.ts@@ -4,7 +4,7 @@ import { createReplicaState, type ReplicaState } from '@/libs/replica';import type { DocsHomeRow } from './projection';-export { createConversationRecentQueryKey, createRecentQueryKey } from './projection';+export { createRecentQueryKey } from './projection';/** `${type}:${id}`: ids of different entity types can collide. */export type RecentEntityRef = `${RecentItem['type']}:${string}`;@@ -14,10 +14,6 @@ export const toRecentEntityRef = (item: Pick<RecentItem, 'id' | 'type'>): Recentexport interface RecentState {allRecentsDrawerOpen: boolean;- /** Latest topics per owner, the view of the `conversationRecent` replica. */- conversationRecentMap: Record<string, RecentItem[]>;- /** Replica bookkeeping for `conversationRecentMap`. */- conversationRecentReplica: ReplicaState<RecentItem[]>;/** Docs home list per tab, the view of the `docsHomeList` replica. */docsHomeMap: Record<string, DocsHomeRow[]>;docsHomeReplica: ReplicaState<DocsHomeRow[]>;@@ -29,8 +25,6 @@ export interface RecentState {export const initialRecentState: RecentState = {allRecentsDrawerOpen: false,- conversationRecentMap: {},- conversationRecentReplica: createReplicaState(),docsHomeMap: {},docsHomeReplica: createReplicaState(),recentListMap: {},diff --git a/src/store/home/slices/recent/projection.ts b/src/store/home/slices/recent/projection.tsindex 4e5d26c89c2..92f812a8b2f 100644--- a/src/store/home/slices/recent/projection.ts+++ b/src/store/home/slices/recent/projection.ts@@ -50,21 +50,6 @@ export const recentListResource = defineReplica<RecentListParams, RecentItem[]>(version: 1,});-/** Entry key of one conversation-recents query (`conversationRecentMap[limit:N]`). */-export const createConversationRecentQueryKey = (limit: number): string => `limit:${limit}`;--/**- * Latest topics per owner, for the IM conversation list. Kept apart from- * `recentListResource`: the sidebar and the drawer want documents and tasks,- * while this list needs topics with their reply previews.- */-export const conversationRecentResource = defineReplica<RecentListParams, RecentItem[]>({- key: ({ limit }) => createConversationRecentQueryKey(limit),- name: 'conversationRecent',- storage: 'localStorage',- version: 1,-});-export type DocsHomeTab = 'mine' | 'recent' | 'shared';export interface DocsHomeParams {diff --git a/src/store/home/slices/recent/selectors.ts b/src/store/home/slices/recent/selectors.tsindex 88f197a764d..e9b1615e2bb 100644--- a/src/store/home/slices/recent/selectors.ts+++ b/src/store/home/slices/recent/selectors.ts@@ -6,10 +6,6 @@ import type { DocsHomeTab } from './projection';/** Items of one recents query; `undefined` until it is hydrated or fetched. */const query = (queryKey: string) => (s: HomeStore) => s.recentListMap[queryKey];-/** Latest topics per owner for the IM conversation list. */-const conversationRecents = (queryKey: string) => (s: HomeStore) =>- s.conversationRecentMap[queryKey];-/*** Whether a recents query has been answered by the server in this session. A* hydrated snapshot may be stale or empty, so "no rows" only means empty once@@ -25,7 +21,6 @@ const item = (queryKey: string, ref: RecentEntityRef) => (s: HomeStore) =>const docsHome = (tab: DocsHomeTab) => (s: HomeStore) => s.docsHomeMap[tab];export const homeRecentSelectors = {- conversationRecents,docsHome,isQueryConfirmed,item,