From 470851ef192815c2ea2c80502232c5a815721c2a Mon Sep 17 00:00:00 2001 From: Andrey Epifancev Date: Tue, 27 Oct 2026 00:23:40 +0400 Subject: [PATCH] =?UTF-8?q?AURORA-1683=20=D0=BF=D0=B0=D0=BD=D0=B5=D0=BB?= =?UTF-8?q?=D1=8C=20=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=B2:=20=D1=81=D1=87=D1=91=D1=82=D1=87=D0=B8=D0=BA=20=D0=B8?= =?UTF-8?q?=20=D0=BF=D0=BE=D0=BF=D0=BE=D0=B2=D0=B5=D1=80=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D0=B5=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- .../DocumentComments/CommentsPopover.tsx | 42 +++++++++++++++++++ web/src/widgets/FilesDrawer/FilesList.tsx | 20 +++++---- 2 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 web/src/widgets/DocumentComments/CommentsPopover.tsx diff --git a/web/src/widgets/DocumentComments/CommentsPopover.tsx b/web/src/widgets/DocumentComments/CommentsPopover.tsx new file mode 100644 index 0000000..624ae98 --- /dev/null +++ b/web/src/widgets/DocumentComments/CommentsPopover.tsx @@ -0,0 +1,42 @@ +import { CommentOutlined } from '@ant-design/icons'; +import { Button, Popover } from 'antd'; +import { useState } from 'react'; +import { CommentsList } from './CommentsList'; +import { useDocumentComments } from './useDocumentComments'; + +/** Кнопка с числом комментариев в строке панели документов [39-01]; по клику — список только для чтения. */ +export function CommentsPopover({ documentId, fileName, count }: { documentId: string; fileName: string; count: number }) { + const [open, setOpen] = useState(false); + const { state, load, reset } = useDocumentComments(documentId); + + const onOpenChange = (next: boolean) => { + setOpen(next); + if (next) load(); + else reset(); + }; + + const content = ( +
e.stopPropagation()} + onKeyDown={(e) => e.stopPropagation()} + style={{ width: 360, maxWidth: 420 }}> +
+ +
+
+ +
+
+ ); + + return ( + + + + ); +} diff --git a/web/src/widgets/FilesDrawer/FilesList.tsx b/web/src/widgets/FilesDrawer/FilesList.tsx index 7c74d7c..3e300d0 100644 --- a/web/src/widgets/FilesDrawer/FilesList.tsx +++ b/web/src/widgets/FilesDrawer/FilesList.tsx @@ -4,6 +4,7 @@ import type { ColumnsType } from 'antd/es/table'; import type { ReactNode } from 'react'; import { useNavigate } from 'react-router-dom'; import type { CheckResult, FileOut, FileType } from '../../types/api'; +import { CommentsPopover } from '../DocumentComments/CommentsPopover'; import { FileWarningsPopover } from './FileWarningsPopover'; import { type DocumentRow, type RowStatus, buildDocumentRows, rowBadge } from './documentRows'; @@ -138,14 +139,17 @@ export function FilesList({ title: '', dataIndex: 'action', render: (_, r) => ( -