-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scroll to cell by ID based on hash fragment (#13285)
* Scroll to cell by ID based on hash fragment * Preserve the old behaviour for unmatched headings * Add test for scroll to heading/cell, remove `CSS.escape`. `CSS.escape` was no longer correct since the rewrite to manual iteration over cells to fetch headings, since we no longer use `querySelector` and instead compare to actual heading IDs. * Document scrolling to notebook headings/cells, change cursor * Update Playwright Snapshots * Shorten section title, fix image address and code highlight * Prevent kernel flicker on documentation screenshots * Adjust documentation snapshots to new cursor, add `positionMouseOver` utility * Export added interface, set to empty object by default * Update Playwright Snapshots * Remove debug log * Set right sidebar width * Update Playwright Snapshots * Revert bot update to debugger-variables Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ebe33ad
commit 6ecb558
Showing
20 changed files
with
561 additions
and
79 deletions.
There are no files selected for viewing
This file contains 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 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
Binary file modified
BIN
-3 Bytes
(100%)
...n.test.ts-snapshots/customized-terminal-position-single-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2 Bytes
(100%)
...ustomization.test.ts-snapshots/default-notebook-toolbar-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Binary file modified
BIN
-1.68 KB
(37%)
...ocumentation/debugger.test.ts-snapshots/debugger-kernel-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+395 Bytes
(140%)
...t/documentation/debugger.test.ts-snapshots/debugger-run-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+228 Bytes
(130%)
...cumentation/debugger.test.ts-snapshots/debugger-sidebar-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Binary file modified
BIN
+74 Bytes
(100%)
...tation/general.test.ts-snapshots/files-create-text-file-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+138 Bytes
(100%)
.../documentation/general.test.ts-snapshots/files-menu-top-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+50 Bytes
(100%)
...entation/general.test.ts-snapshots/files-shareable-link-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.96 KB
(64%)
...documentation/general.test.ts-snapshots/interface-right-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.98 KB
.../general.test.ts-snapshots/notebook-heading-anchor-link-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1 Byte
(100%)
...internationalization.test.ts-snapshots/language-chinese-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
|
||
import { test } from '@jupyterlab/galata'; | ||
import { expect } from '@playwright/test'; | ||
import * as path from 'path'; | ||
|
||
const fileName = 'scroll.ipynb'; | ||
|
||
test.describe('Notebook Scroll', () => { | ||
test.beforeEach(async ({ page, tmpPath }) => { | ||
await page.contents.uploadFile( | ||
path.resolve(__dirname, `./notebooks/${fileName}`), | ||
`${tmpPath}/${fileName}` | ||
); | ||
|
||
await page.notebook.openByPath(`${tmpPath}/${fileName}`); | ||
await page.notebook.activate(fileName); | ||
}); | ||
|
||
test.afterEach(async ({ page, tmpPath }) => { | ||
await page.contents.deleteDirectory(tmpPath); | ||
}); | ||
|
||
const cellLinks = { | ||
'penultimate cell using heading, legacy format': 18, | ||
'penultimate cell using heading, explicit fragment': 18, | ||
'last cell using heading, legacy format': 19, | ||
'last cell using heading, explicit fragment': 19, | ||
'last cell using cell identifier': 19 | ||
}; | ||
for (const [link, cellIdx] of Object.entries(cellLinks)) { | ||
test(`Scroll to ${link}`, async ({ page }) => { | ||
const firstCell = await page.notebook.getCell(0); | ||
await firstCell.scrollIntoViewIfNeeded(); | ||
expect(await firstCell.boundingBox()).toBeTruthy(); | ||
|
||
await page.click(`a:has-text("${link}")`); | ||
|
||
await firstCell.waitForElementState('hidden'); | ||
expect(await firstCell.boundingBox()).toBeFalsy(); | ||
|
||
const lastCell = await page.notebook.getCell(cellIdx); | ||
await lastCell.waitForElementState('visible'); | ||
expect(await lastCell.boundingBox()).toBeTruthy(); | ||
}); | ||
} | ||
}); |
Oops, something went wrong.