From c58deb11e8dd07fd4fb4255e2e5fca53a762dc2d Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Wed, 8 Apr 2026 14:04:03 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F(frontend)=20adapt=20threa?= =?UTF-8?q?d=20new=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We stopped to use pagination for thread comments, so we need to adapt the thread type to reflect that. --- .../apps/e2e/__tests__/app-impress/doc-version.spec.ts | 1 + .../docs/doc-editor/components/comments/DocsThreadStore.tsx | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-version.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-version.spec.ts index c1aec64ee..e689c610d 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-version.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-version.spec.ts @@ -142,6 +142,7 @@ test.describe('Doc Version', () => { const thread = page.locator('.bn-thread'); await thread.getByRole('paragraph').first().fill('This is a comment'); await thread.locator('[data-test="save"]').click(); + await expect(thread).toBeHidden(); await goToGridDoc(page, { title: randomDoc, diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/components/comments/DocsThreadStore.tsx b/src/frontend/apps/impress/src/features/docs/doc-editor/components/comments/DocsThreadStore.tsx index a8484ae83..a0c13f839 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/components/comments/DocsThreadStore.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/components/comments/DocsThreadStore.tsx @@ -1,7 +1,7 @@ import { CommentBody, ThreadStore } from '@blocknote/core/comments'; import type { Awareness } from 'y-protocols/awareness'; -import { APIError, APIList, errorCauses, fetchAPI } from '@/api'; +import { APIError, errorCauses, fetchAPI } from '@/api'; import { Doc } from '@/features/docs/doc-management'; import { useEditorStore } from '../../stores'; @@ -15,7 +15,7 @@ import { ServerThread, } from './types'; -type ServerThreadListResponse = APIList; +type ServerThreadListResponse = ServerThread[]; export class DocsThreadStore extends ThreadStore { protected static COMMENTS_PING = 'commentsPing'; @@ -335,7 +335,7 @@ export class DocsThreadStore extends ThreadStore { const threads = (await response.json()) as ServerThreadListResponse; const next = new Map(); - threads.results.forEach((thread) => { + threads.forEach((thread) => { const threadData: ClientThreadData = serverThreadToClientThread(thread); next.set(thread.id, threadData); });