From 6f68c1ea3b8fe2b53595643d3fe45b57a34ecfe5 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Mon, 3 Aug 2026 11:21:49 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5(frontend)=20remove=20copy=20as=20m?= =?UTF-8?q?arkown=20from=20document=20options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have removed the "Copy as Markdown" option from the document options menu. If user need to copy the document content as markdown, they can just copy the content from the document editor and paste it into a markdown editor. --- .../__tests__/app-impress/doc-header.spec.ts | 40 ------------------- .../docs/doc-header/components/DocToolBox.tsx | 12 ------ 2 files changed, 52 deletions(-) diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts index b3eaab1d6..7cb42a835 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts @@ -480,46 +480,6 @@ test.describe('Doc Header', () => { ).toBeHidden(); }); - test('It checks the copy as Markdown button', async ({ - page, - browserName, - }) => { - test.skip( - browserName === 'webkit', - 'navigator.clipboard is not working with webkit and playwright', - ); - - // create page and navigate to it - await page - .getByRole('link', { - name: 'New', - exact: true, - }) - .click(); - - // Add dummy content to the doc - const editor = page.locator('.ProseMirror'); - const docFirstBlock = editor.locator('.bn-block-content').first(); - await docFirstBlock.click(); - await page.keyboard.type('# Hello World', { delay: 100 }); - const docFirstBlockContent = docFirstBlock.locator('h1'); - await expect(docFirstBlockContent).toHaveText('Hello World'); - - // Copy content to clipboard - await page.getByLabel('Open the document options').click(); - await page.getByRole('menuitem', { name: 'Copy as Markdown' }).click(); - await expect( - page.getByText('Copied as Markdown to clipboard'), - ).toBeVisible(); - - // Test that clipboard is in Markdown format - const handle = await page.evaluateHandle(() => - navigator.clipboard.readText(), - ); - const clipboardContent = await handle.jsonValue(); - expect(clipboardContent.trim()).toBe('# Hello World'); - }); - test('it checks the copy link button', async ({ page, browserName }) => { test.skip( browserName === 'webkit', diff --git a/src/frontend/apps/impress/src/features/docs/doc-header/components/DocToolBox.tsx b/src/frontend/apps/impress/src/features/docs/doc-header/components/DocToolBox.tsx index 8ad47dda4..9a5ad9315 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-header/components/DocToolBox.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-header/components/DocToolBox.tsx @@ -19,7 +19,6 @@ import HistorySVG from '@/assets/icons/ui-kit/history.svg'; import KeepSVG from '@/assets/icons/ui-kit/keep.svg'; import KeepOffSVG from '@/assets/icons/ui-kit/keep_off.svg'; import LeaveSVG from '@/assets/icons/ui-kit/leave.svg'; -import MarkdownCopySVG from '@/assets/icons/ui-kit/markdown_copy.svg'; import MoreSVG from '@/assets/icons/ui-kit/more_horiz.svg'; import { Doc, @@ -36,8 +35,6 @@ import { usePresenterStore } from '@/docs/doc-presenter/stores'; import { useAuth } from '@/features/auth'; import { useFocusStore, useResponsiveStore } from '@/stores'; -import { useCopyCurrentEditorToClipboard } from '../hooks/useCopyCurrentEditorToClipboard'; - const ModalRemoveDoc = dynamic( () => import('@/docs/doc-management/components/ModalRemoveDoc').then((mod) => ({ @@ -94,7 +91,6 @@ export const DocToolBox = ({ doc }: DocToolBoxProps) => { const { isTopRoot } = useDocUtils(doc); const isTopParent = doc.id === treeContext?.root?.id; // it can be a child but not for the current user const { authenticated } = useAuth(); - const copyCurrentEditorToClipboard = useCopyCurrentEditorToClipboard(); const [openDropdown, setOpenDropdown] = useState(false); const [isModalRemoveOpen, setIsModalRemoveOpen] = useState(false); const [isModalExportOpen, setIsModalExportOpen] = useState(false); @@ -169,14 +165,6 @@ export const DocToolBox = ({ doc }: DocToolBoxProps) => { }, isHidden: !ModalExport, }, - { - label: t('Copy as {{format}}', { format: 'Markdown' }), - icon: