fix(frontend): render-loop in Tasks/Reports/Communication behoben — usePluginToolbarStore wurde ohne Selector destrukturiert; jedes Store-Update re-renderte alle Seiten inkl. registerItems-Effektkette (Maximum update depth in Tests sichtbar). Selektor-Pattern wie Dms/Mail/Calendar/ContactsList

This commit is contained in:
Agent Zero
2026-08-27 08:26:27 +02:00
parent a796438dfa
commit 1a24e3e999
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -755,7 +755,8 @@ export function CommunicationPage() {
const [loading, setLoading] = useState(true);
const [showNewChat, setShowNewChat] = useState<ConversationCategory | null>(null);
const [mobileView, setMobileView] = useState<'list' | 'chat'>('list');
const { registerItems, unregisterPlugin } = usePluginToolbarStore();
const registerItems = usePluginToolbarStore((s) => s.registerItems);
const unregisterPlugin = usePluginToolbarStore((s) => s.unregisterPlugin);
const loadConversations = useCallback(async () => {
try {
+2 -1
View File
@@ -60,7 +60,8 @@ interface DownloadEntry {
export function ReportsPage() {
const { t } = useTranslation();
const toast = useToast();
const { registerItems, unregisterPlugin } = usePluginToolbarStore();
const registerItems = usePluginToolbarStore((s) => s.registerItems);
const unregisterPlugin = usePluginToolbarStore((s) => s.unregisterPlugin);
// Data hooks
const { data: templates = [], isLoading: templatesLoading } = useReportTemplates();
+2 -1
View File
@@ -220,7 +220,8 @@ function TaskDetail({ task, onEdit, onDelete, onStatusChange }: TaskDetailProps)
export function TasksPage() {
const { t } = useTranslation();
const toast = useToast();
const { registerItems, unregisterPlugin } = usePluginToolbarStore();
const registerItems = usePluginToolbarStore((s) => s.registerItems);
const unregisterPlugin = usePluginToolbarStore((s) => s.unregisterPlugin);
const [page, setPage] = useState(1);
const [filter, setFilter] = useState<TaskFilter>({});