Skip to content

Commit

Permalink
Fix the '1 face' mislabelling of selection for sweep segments (#5183)
Browse files Browse the repository at this point in the history
* Fix the '1 face' mislabelling of selection for sweep segments
Fixes #5182

* A snapshot a day keeps the bugs away! πŸ“·πŸ› (OS: namespace-profile-ubuntu-8-cores)

* Reset snapshots

* A snapshot a day keeps the bugs away! πŸ“·πŸ› (OS: namespace-profile-ubuntu-8-cores)

* Fix lint

* Revert snap

* Fix chamfer and fillet test selection

* Fix other test

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
pierremtb and github-actions[bot] authored Jan 31, 2025
1 parent 5b207d7 commit 7095ce2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions e2e/playwright/point-click.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ extrude001 = extrude(-12, sketch001)
currentArgKey: 'radius',
currentArgValue: '5',
headerArguments: {
Selection: '1 face',
Selection: '1 segment',
Radius: '',
},
stage: 'arguments',
Expand All @@ -1192,7 +1192,7 @@ extrude001 = extrude(-12, sketch001)
await cmdBar.expectState({
commandName: 'Fillet',
headerArguments: {
Selection: '1 face',
Selection: '1 segment',
Radius: '5',
},
stage: 'review',
Expand Down Expand Up @@ -1398,7 +1398,7 @@ extrude001 = extrude(-12, sketch001)
currentArgKey: 'length',
currentArgValue: '5',
headerArguments: {
Selection: '1 face',
Selection: '1 segment',
Length: '',
},
stage: 'arguments',
Expand All @@ -1407,7 +1407,7 @@ extrude001 = extrude(-12, sketch001)
await cmdBar.expectState({
commandName: 'Chamfer',
headerArguments: {
Selection: '1 face',
Selection: '1 segment',
Length: '5',
},
stage: 'review',
Expand Down
2 changes: 1 addition & 1 deletion e2e/playwright/sketch-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ test.describe('Sketch tests', () => {
// sketch selection should already have been made. "Selection: 1 face" only show up when the selection has been made already
// otherwise the cmdbar would be waiting for a selection.
await expect(
page.getByRole('button', { name: 'selection : 1 face', exact: false })
page.getByRole('button', { name: 'selection : 1 segment', exact: false })
).toBeVisible({
timeout: 10_000,
})
Expand Down
7 changes: 3 additions & 4 deletions src/lib/selections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,9 @@ export function getSelectionTypeDisplayText(
.map(
// Hack for showing "face" instead of "extrude-wall" in command bar text
([type, count]) =>
`${count} ${type
.replace('wall', 'face')
.replace('solid2d', 'face')
.replace('segment', 'face')}${count > 1 ? 's' : ''}`
`${count} ${type.replace('wall', 'face').replace('solid2d', 'face')}${
count > 1 ? 's' : ''
}`
)
.toArray()
.join(', ')
Expand Down

0 comments on commit 7095ce2

Please sign in to comment.