Add 3 point arc (#5722)
* bare minimum * start of segment util added * remove redundant handle * some probably buggy handling of arc handles, can fix later * probably bug implementation of update args, but data flow through is mostly there can fix bugs after * fix update for arc * fix math for center handle * fix up length indicator * tweak math * stub out xState logic for arc * more progress on adding point and click, implemented more of sketchLineHelper for arc * small unrelated tweak * fix up draft arc bugs * fix arc last click * fix draft segment animation and add comment * add draft point snapping for arcs * add helper stuff to arc * clone arc point and click as base for arc-three-point * rust change for arc three point * can draw three point arc * make arcTo editable * can add new three point arc, so long as it continues existing profile * get overlays working * make snap to for continuing profile work for three point arcs * add draft animation * tangent issue fix * action rename * tmp test fix up * fix silly bug * fix couple problems causing tests to fail * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * fix up * add delet segment test for new segments * update docs * draft segments should look right * add test for dragging new segment handles * arc tools can be chained now * make three point arc can start a new profile (not only extend existing paths) * add test for equiping and unequiping the tool plus drawing with it * fix console noise * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * clean up * update rust/docs * put toolbar mode check into fixture * do thing for lee * use TEST_COLORSs * fix colors * don't await file write * remove commented code * remove unneeded template strings * power to **2 * remove magic numbers * more string templates * some odd bits of clean up * arc should be enable in dev * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * add new simulation test * fix test code from kwark migration * issues Frank found * fix deleting half complete ark * fix * small fix on dele index * tsc post main merge * fix up snaping to profile start * add cross hari for three point arc * block snapping if it's the only segment * add tests for canceling arcTo halfway through --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
		@ -8,6 +8,7 @@ import {
 | 
			
		||||
} from '../test-utils'
 | 
			
		||||
import { SidebarType } from 'components/ModelingSidebar/ModelingPanes'
 | 
			
		||||
import { SIDEBAR_BUTTON_SUFFIX } from 'lib/constants'
 | 
			
		||||
import { ToolbarModeName } from 'lib/toolbar'
 | 
			
		||||
 | 
			
		||||
export class ToolbarFixture {
 | 
			
		||||
  public page: Page
 | 
			
		||||
@ -120,6 +121,15 @@ export class ToolbarFixture {
 | 
			
		||||
    // this is for the engine animation, as it takes 500ms to complete
 | 
			
		||||
    await this.page.waitForTimeout(600)
 | 
			
		||||
  }
 | 
			
		||||
  private _getMode = () =>
 | 
			
		||||
    this.page.locator('[data-current-mode]').getAttribute('data-current-mode')
 | 
			
		||||
  expectToolbarMode = {
 | 
			
		||||
    toBe: (mode: ToolbarModeName) => expect.poll(this._getMode).toEqual(mode),
 | 
			
		||||
    not: {
 | 
			
		||||
      toBe: (mode: ToolbarModeName) =>
 | 
			
		||||
        expect.poll(this._getMode).not.toEqual(mode),
 | 
			
		||||
    },
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private _serialiseFileTree = async () => {
 | 
			
		||||
    return this.page
 | 
			
		||||
@ -176,6 +186,22 @@ export class ToolbarFixture {
 | 
			
		||||
    ).toBeVisible()
 | 
			
		||||
    await this.page.getByTestId('dropdown-circle-three-points').click()
 | 
			
		||||
  }
 | 
			
		||||
  selectArc = async () => {
 | 
			
		||||
    await this.page
 | 
			
		||||
      .getByRole('button', { name: 'caret down Tangential Arc:' })
 | 
			
		||||
      .click()
 | 
			
		||||
    await expect(this.page.getByTestId('dropdown-arc')).toBeVisible()
 | 
			
		||||
    await this.page.getByTestId('dropdown-arc').click()
 | 
			
		||||
  }
 | 
			
		||||
  selectThreePointArc = async () => {
 | 
			
		||||
    await this.page
 | 
			
		||||
      .getByRole('button', { name: 'caret down Tangential Arc:' })
 | 
			
		||||
      .click()
 | 
			
		||||
    await expect(
 | 
			
		||||
      this.page.getByTestId('dropdown-three-point-arc')
 | 
			
		||||
    ).toBeVisible()
 | 
			
		||||
    await this.page.getByTestId('dropdown-three-point-arc').click()
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  async closePane(paneId: SidebarType) {
 | 
			
		||||
    return closePane(this.page, paneId + SIDEBAR_BUTTON_SUFFIX)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user