KittyCAD / modeling-app

The KittyCAD modeling app.
https://kittycad.io/modeling-app/download
MIT License
429 stars 37 forks source link

Add offset plane point-and-click user flow #4552

Closed franknoirot closed 3 days ago

franknoirot commented 6 days ago

Closes #4468. Users can now use the Offset plane tool in the modeling mode toolbar or the corresponding command palette entry. They must select a default plane to sketch on, then enter an offset distance value.

Adds one new E2E playwright test. I couldn't make it an electron and fixture-based test, because I ran into issues with the selectors within cmdBar.page never being correct in the electron context. I am unsure if this is because I attempted to add this as the first electron test in the point-and-click.spec.ts file, and I was missing something about the imports or beforeEach that was needed for that to work, but I've made it a browser playwright test for now. @lf94 has a big migration of all our tests to electron right now, so I imagine a lot of test infra stuff will be shifted slightly in the near future that I can use to swap it back over to electron without much trouble.

Limitations

One important note is that we'd like to treat the default planes differently in the near future (see #4504), so that will impact and hopefully simplify some of the special case code needed to handle selection of default planes. I had to extend the Selections type, and add default planes as a possible otherSelections in addition to the Axis type currently used in some sketch mode code. I've grouped them under a "NonCodeSelections" type, but some of the strategies proposed for #4504 have included actually including the default planes in the code as a sort of prelude, so further tweaks may be necessary.

Demo

https://github.com/user-attachments/assets/bd255fc8-33cf-40c4-9557-4859fd1633c9

qa-wolf[bot] commented 6 days ago

QA Wolf here! As you write new code it's important that your test coverage is keeping up. Click here to request test coverage for this PR!

vercel[bot] commented 6 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Nov 26, 2024 4:26pm
franknoirot commented 6 days ago

tsc is high VS Code knows that my Map functions are correct

nadr0 commented 4 days ago

nitpick, does the icon for offset plane look disabled? At first I thought it wasn't enabled. image

franknoirot commented 3 days ago

@jtran figured out that my TSC issues are because we're running 5.0.0 and the Map.entries() type inference I'm trying to use wasn't introduced until ^5.5.2, so he's doing me a solid and opening a PR to bump our TS version.

franknoirot commented 3 days ago

nitpick, does the icon for offset plane look disabled? At first I thought it wasn't enabled.

Super fair point, let me try a different one real quick