✨(frontend) Scroll to linked block when read-only

Make the "Copy link to block" scroll for users with
Read-only permissions.

Signed-off-by: BOUKERFA Mohamed El Amine <boukerfa.ma@gmail.com>
This commit is contained in:
BOUKERFA Mohamed El Amine
2026-09-14 14:20:29 +02:00
committed by Anthony LC
parent 31cff890b8
commit 250b533417
3 changed files with 19 additions and 1 deletions
+1
View File
@@ -23,6 +23,7 @@ and this project adheres to
- 🐛(backend) skip session creation for the liveness probe
- 🐛(frontend) preserve page titles when adding an emoji #2586
- 🐛(frontend) scroll to the linked block in read-only documents #2663
- 🐛(frontend) hide the selection highlight on presenter images #2665
- 🐛(y-provider) prevent process crash on malformed websocket frames #2673
- 🐛(docker) pull minio images from quay.io #2675
@@ -5,7 +5,7 @@ import cs from 'convert-stream';
import { createDoc, goToGridDoc, verifyDocName } from './utils-common';
import { getEditor, openSuggestionMenu, writeInEditor } from './utils-editor';
import { updateShareLink } from './utils-share';
import { connectOtherUserToDoc, updateShareLink } from './utils-share';
import {
createRootSubPage,
getTreeRow,
@@ -744,6 +744,21 @@ test.describe('Doc Editor', () => {
await page.goto(clipboardContent);
await expect(editor.getByText('First Block')).not.toBeInViewport();
await expect(editor.getByText('My Block')).toBeInViewport();
await page.getByRole('button', { name: 'Share' }).click();
await updateShareLink(page, 'Public', 'Reading');
// Check link on read-only view for another user
const { otherPage, cleanup } = await connectOtherUserToDoc({
browserName,
docUrl: clipboardContent,
withoutSignIn: true,
});
await expect(otherPage.getByText('First Block')).not.toBeInViewport();
await expect(otherPage.getByText('My Block')).toBeInViewport();
await cleanup();
});
test('it checks "Equation block" feature', async ({ page, browserName }) => {
@@ -419,6 +419,8 @@ export const BlockNoteReader = ({
useHeadings(editor);
useScrollToBlockAnchor();
return (
<Box>
<DocsEditorStyle />