Draw the browser scroll marker with the scroll icon
Middle-click scrolling in the built-in browser showed the text arrow "↕" at 20 px in a 24 px circle. The look of that glyph depends on the font, and the circle cut it. It also showed only two directions, but the scroll moves in four. The marker now uses the four-way scroll icon of Project Management, which the shared Icon component also gets. The marker has the size of the Project Management marker: a 26 px circle with a 20 px icon. The interaction smoke test checks the icon and keeps screenshots in both themes. Card ac49c9ec.
This commit is contained in:
@@ -162,6 +162,14 @@ await runSmoke('browser/interaction', async ({ browser }) => {
|
||||
const box = await surface.boundingBox();
|
||||
const x = box.x + 220, y = box.y + 180;
|
||||
await page.mouse.click(x, y, { button: 'middle' });
|
||||
// The marker draws the four-way scroll icon, not a text glyph that depends on the font.
|
||||
const marker = page.locator('.scroll-anchor');
|
||||
assert.equal(await marker.locator('svg path').count(), 1);
|
||||
assert.equal(await marker.evaluate(node => node.textContent.trim()), '');
|
||||
for (const theme of ['light', 'dark']) {
|
||||
await page.evaluate(async mode => (await import('/src/lib/theme/appearance.ts')).applyAppearance({ theme: 'default', mode }), theme);
|
||||
await page.screenshot({ path: path.join(output, `scroll-marker-${theme}.png`), clip: { x: x - 30, y: y - 30, width: 60, height: 60 } });
|
||||
}
|
||||
await page.mouse.move(x + 90, y + 120);
|
||||
await page.waitForTimeout(1500);
|
||||
const scrolled = await evaluate('({x:scrollX,y:scrollY})');
|
||||
|
||||
Reference in New Issue
Block a user