-
Notifications
You must be signed in to change notification settings - Fork 597
✨Comment side panel #2279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
✨Comment side panel #2279
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
896444a
✨(frontend) add right panel
AntoLC 2c43179
✨(frontend) add comment side panel
AntoLC 68b9342
♻️(frontend) move table of content to right panel
AntoLC 43a3620
📱(frontend) reduce breakpoint mobile view
AntoLC 981aef0
📱(frontend) coordinate left/right panel visibility on tablet
AntoLC e85e7d6
♿️(frontend) fine grained accessibility for right panel
AntoLC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 40 additions & 21 deletions
61
src/frontend/apps/e2e/__tests__/app-impress/doc-table-content.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,66 @@ | ||
| import { expect, test } from '@playwright/test'; | ||
|
|
||
| import { createDoc, verifyDocName } from './utils-common'; | ||
| import { createDoc } from './utils-common'; | ||
| import { tryFocusEditorContent } from './utils-editor'; | ||
|
|
||
| test.beforeEach(async ({ page }) => { | ||
| await page.goto('/'); | ||
| }); | ||
|
|
||
| test.describe('Doc Table Content', () => { | ||
| test('it checks the doc table content', async ({ page, browserName }) => { | ||
| const [randomDoc] = await createDoc( | ||
| page, | ||
| 'doc-table-content', | ||
| browserName, | ||
| 1, | ||
| ); | ||
|
|
||
| await verifyDocName(page, randomDoc); | ||
|
|
||
| await page.locator('.ProseMirror').click(); | ||
| await createDoc(page, 'doc-table-content', browserName, 1); | ||
|
|
||
| await expect( | ||
| page.getByRole('button', { name: 'Show the table of contents' }), | ||
| page.getByRole('button', { name: 'Show the table of contents sidebar' }), | ||
| ).toBeHidden(); | ||
|
|
||
| await page.keyboard.type('# Level 1\n## Level 2\n### Level 3'); | ||
| const editor = await tryFocusEditorContent({ page }); | ||
| await page.keyboard.type('# Level 1'); | ||
| for (let i = 0; i < 20; i++) { | ||
| await page.keyboard.press('Enter'); | ||
| } | ||
| await page.keyboard.type('## Level 2'); | ||
| for (let i = 0; i < 20; i++) { | ||
| await page.keyboard.press('Enter'); | ||
| } | ||
| await page.keyboard.type('### Level 3'); | ||
|
|
||
| await page | ||
| .getByRole('button', { name: 'Show the table of contents sidebar' }) | ||
| .click(); | ||
|
|
||
| const summaryContainer = page.locator('#summaryContainer'); | ||
| await summaryContainer.click(); | ||
| const elSidePanel = page.getByLabel('Table of contents side panel'); | ||
|
|
||
| const level1 = summaryContainer.getByText('Level 1'); | ||
| const level2 = summaryContainer.getByText('Level 2'); | ||
| const level3 = summaryContainer.getByText('Level 3'); | ||
| const level1 = elSidePanel.getByText('Level 1'); | ||
| const editorLevel1 = editor.getByText('Level 1'); | ||
| const level2 = elSidePanel.getByText('Level 2'); | ||
| const editorLevel2 = editor.getByText('Level 2'); | ||
| const level3 = elSidePanel.getByText('Level 3'); | ||
|
|
||
| await expect(level1).toBeVisible(); | ||
| await expect(level1).toHaveCSS('padding', /4px 0px/); | ||
| await expect(level1).toHaveAttribute('aria-selected', 'true'); | ||
| await expect(level1).toHaveCSS('padding', /0px 0px 0px 8px/); | ||
| await expect(editorLevel1).not.toBeInViewport(); | ||
| await expect(level1).toHaveAttribute('aria-selected', 'false'); | ||
|
|
||
| await expect(level2).toBeVisible(); | ||
| await expect(level2).toHaveCSS('padding-left', /14.4px/); | ||
| await expect(level2).toHaveAttribute('aria-selected', 'false'); | ||
| await expect(editorLevel2).toBeInViewport(); | ||
| await expect(level2).toHaveAttribute('aria-selected', 'true'); | ||
|
|
||
| await expect(level3).toBeVisible(); | ||
| await expect(level3).toHaveCSS('padding-left', /24px/); | ||
| await expect(level3).toHaveAttribute('aria-selected', 'false'); | ||
|
|
||
| await level1.click(); | ||
| await expect(editorLevel1).toBeInViewport(); | ||
| await expect(level1).toHaveAttribute('aria-selected', 'true'); | ||
| await expect(level2).toHaveAttribute('aria-selected', 'false'); | ||
|
|
||
| await level2.click(); | ||
| await expect(editorLevel1).not.toBeInViewport(); | ||
| await expect(editorLevel2).toBeInViewport(); | ||
| await expect(level2).toHaveAttribute('aria-selected', 'true'); | ||
| await expect(level1).toHaveAttribute('aria-selected', 'false'); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.