feat: frontend status toast overlay, while refactoring document store usage.

This commit is contained in:
2025-12-03 15:16:26 +01:00
parent 4337575b17
commit 186743ee37
10 changed files with 301 additions and 44 deletions
-9
View File
@@ -1,7 +1,6 @@
import React, { useRef } from 'react';
import { usePanelManager, usePanelResizeBindings } from '../app/PanelManagerContext';
import type { StatusMessage } from '../hooks/documents/store/useDocumentsStore';
import type { Identifier } from '../types/identifiers';
import SidebarFolderList from './components/SidebarFolderList';
@@ -40,7 +39,6 @@ interface SidebarProps {
onCreateTag?: (label: string) => Promise<void> | void;
onCreateCorrespondent?: (name: string) => Promise<void> | void;
onLogout?: () => void;
status?: StatusMessage | null;
tenantName?: string | null;
tenants?: TenantOption[];
activeTenantId?: Identifier | null;
@@ -72,7 +70,6 @@ const Sidebar: React.FC<SidebarProps> = ({
onCreateTag,
onCreateCorrespondent,
onLogout,
status = null,
tenantName,
tenants = [],
activeTenantId = null,
@@ -122,12 +119,6 @@ const Sidebar: React.FC<SidebarProps> = ({
/>
<div className="panel-body sidebar__body">
{status && (
<div className="sidebar__status">
<div className={`status-banner ${status.variant}`}>{status.message}</div>
</div>
)}
<SidebarSearch />
<SidebarFolderList
-7
View File
@@ -1,7 +1,6 @@
import { useMemo } from 'react';
import type { DragEvent } from 'react';
import { TAG_FILTER_UNTAGGED } from '../app/workspaceUtils';
import type { StatusMessage } from '../hooks/documents/store/useDocumentsStore';
import type { Identifier } from '../types/identifiers';
interface FolderTreeNode {
@@ -89,7 +88,6 @@ interface UseSidebarPropsArgs {
appStatus: string;
previewActive: boolean;
handleLogout: () => void | Promise<void>;
status: StatusMessage | null;
tenantName: string | null;
tenantOptions: TenantOption[];
currentTenantId: Identifier | null;
@@ -119,10 +117,8 @@ interface SidebarHookResult {
onCreateTag: (label: string) => void;
correspondents: CorrespondentOption[];
onCreateCorrespondent: (name: string) => void;
appStatus: string;
previewActive: boolean;
onLogout: UseSidebarPropsArgs['handleLogout'];
status: StatusMessage | null;
tenantName: string | null;
tenants: TenantOption[];
activeTenantId: Identifier | null;
@@ -150,7 +146,6 @@ const useSidebarProps = ({
appStatus,
previewActive,
handleLogout,
status,
tenantName,
tenantOptions,
currentTenantId,
@@ -183,7 +178,6 @@ const useSidebarProps = ({
appStatus,
previewActive,
onLogout: handleLogout,
status,
tenantName,
tenants: tenantOptions,
activeTenantId: currentTenantId,
@@ -227,7 +221,6 @@ const useSidebarProps = ({
previewActive,
draggedFolderId,
selectedFolder,
status,
tags,
tenantName,
tenantOptions,