#4469 Improve toolbar ux (#5841)

* Improve ActionButtonDropdown selection

* center rectangle icon fixed

* ignore Esc key when displaying hotkeys

* add ability to escape 3 point circle tool

* remove focus from ActionButton, ActionButtonDropdown

* remove focus outline from buttons

* remember lastly selected multi action item

* Add tests for toolbar buttons

* fix sketch-tests by turning toolbar dropdown arrays into an object with an id - this got broken because dropdown now remember the last selected option so we cant rely on cant reference the first option in tests

* update other tests with open menu click
This commit is contained in:
Andrew Varga
2025-04-09 14:32:52 +02:00
committed by GitHub
parent e78100eaac
commit e5f23a49b4
10 changed files with 743 additions and 621 deletions

View File

@ -115,7 +115,7 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
await page.waitForTimeout(100) // this wait is needed for webkit - not sure why
await page
.getByRole('button', {
name: 'Length: open menu',
name: 'constraints: open menu',
})
.click()
await page.getByRole('button', { name: 'remove constraints' }).click()
@ -189,7 +189,7 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
await page.waitForTimeout(100)
await page
.getByRole('button', {
name: 'Length: open menu',
name: 'constraints: open menu',
})
.click()
await page
@ -299,7 +299,7 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
await page.keyboard.up('Shift')
await page
.getByRole('button', {
name: 'Length: open menu',
name: 'constraints: open menu',
})
.click()
await page.getByRole('button', { name: constraint }).click()
@ -420,7 +420,7 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
await page.waitForTimeout(100)
await page
.getByRole('button', {
name: 'Length: open menu',
name: 'constraints: open menu',
})
.click()
await page
@ -533,7 +533,7 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
await page.keyboard.up('Shift')
await page
.getByRole('button', {
name: 'Length: open menu',
name: 'constraints: open menu',
})
.click()
await page.getByTestId('dropdown-constraint-angle').click()
@ -627,7 +627,7 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
await page.mouse.click(line3.x, line3.y)
await page
.getByRole('button', {
name: 'Length: open menu',
name: 'constraints: open menu',
})
.click()
await page.getByTestId('dropdown-constraint-' + constraint).click()
@ -719,7 +719,7 @@ part002 = startSketchOn(XZ)
await page.mouse.click(line3.x, line3.y)
await page
.getByRole('button', {
name: 'Length: open menu',
name: 'constraints: open menu',
})
.click()
await page.getByTestId('dropdown-constraint-' + constraint).click()
@ -817,7 +817,7 @@ part002 = startSketchOn(XZ)
const activeLinesContent = await page.locator('.cm-activeLine').all()
const constraintMenuButton = page.getByRole('button', {
name: 'Length: open menu',
name: 'constraints: open menu',
})
const constraintButton = page
.getByRole('button', {
@ -905,7 +905,7 @@ part002 = startSketchOn(XZ)
await page.mouse.click(line3.x - 3, line3.y + 20)
await page.keyboard.up('Shift')
const constraintMenuButton = page.getByRole('button', {
name: 'Length: open menu',
name: 'constraints: open menu',
})
const constraintButton = page.getByRole('button', {
name: constraintName,
@ -990,7 +990,7 @@ part002 = startSketchOn(XZ)
await page.keyboard.up('Shift')
await page.waitForTimeout(100)
const constraintMenuButton = page.getByRole('button', {
name: 'Length: open menu',
name: 'constraints: open menu',
})
const constraintButton = page.getByRole('button', {
name: constraintName,
@ -1057,7 +1057,7 @@ part002 = startSketchOn(XZ)
await page
.getByRole('button', {
name: 'Length: open menu',
name: 'constraints: open menu',
})
.click()
await page.waitForTimeout(500)