Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook up chamfer UI with AST-mod #4694

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Hook up chamfer UI with AST-mod #4694

wants to merge 6 commits into from

Conversation

max-mrgrsk
Copy link
Collaborator

@max-mrgrsk max-mrgrsk commented Dec 8, 2024

Description:

This PR adds the chamfer button to the command bar and integrates it with the AST mod. It also updates playwright tests to ensure the chamfer and button’s enabled/disabled states work correctly under various conditions.

Todo:

  • activate chamfer button for dev
  • hook it up with the ast-mod
  • add playwright tests
Screen.Recording.2024-12-08.at.18.44.22.mov

References

  1. closes: hook up chamfer ui with ast-mod #4693
  2. part of Fillet UI #2606 project

@max-mrgrsk max-mrgrsk linked an issue Dec 8, 2024 that may be closed by this pull request
4 tasks
Copy link

vercel bot commented Dec 8, 2024

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

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Dec 8, 2024 5:36pm

Copy link

qa-wolf bot commented Dec 8, 2024

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!

@max-mrgrsk max-mrgrsk self-assigned this Dec 8, 2024
@max-mrgrsk max-mrgrsk added feature Feature Requests tests Pull requests that update or improve our test suite labels Dec 8, 2024
@max-mrgrsk max-mrgrsk added this to the v1 Modeling App Launch milestone Dec 8, 2024
@max-mrgrsk max-mrgrsk marked this pull request as ready for review December 8, 2024 18:04
icon: 'chamfer3d',
status: 'kcl-only',
status: DEV ? 'available' : 'kcl-only',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Not specific to this PR, no change requested here)

@franknoirot I think we might want to start checking against another variable than DEV here? Something that could resolve to true on app.zoo.dev and nightly builds, but not release builds. Seems to me that DEV might be a tad too restrictive here. But I could be wrong too.

Copy link
Collaborator Author

@max-mrgrsk max-mrgrsk Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I’d be happy to follow this path for fillets and chamfers while waiting for the engine team to unblock them for revolves.

Overall, I think shipping semi-working features for nightly builds could be a good practice, as we have enough warning messages in place. Including the Command Bar UI warnings. We could add an extra indication for the buttons that are "nightly only".

Besides, DEV blocks part of our team like Nick and Josh from checking and testing new stuff.

On the other hand, it doesn’t fully align with the general rule: “Don’t ship shit.” : D

@jessfraz, @Irev-Dev , what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this idea, we should add another environment variable for this. @pierremtb would you be able to do that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure! And should be a separate PR too

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #4709

Copy link
Collaborator

@franknoirot franknoirot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one primary requested change, because we've seen the light on not allowing async code to run inside of XState actions. The other thing is optional! I've checked out the branch locally and it's working great.

if (err(applyEdgeTreatmentToSelectionResult))
return applyEdgeTreatmentToSelectionResult

// eslint-disable-next-line @typescript-eslint/no-floating-promises
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're trying to prevent using these ESLint disabling comments in any new code. Would you mind converting this AST chamfer from an XState action, which is inherently synchronous, to an actor, which can be asynchronous so that we can appropriately await things like this?

There is a fresh example here from Pierre's shell PR. As you can see, it requires adding a bit of extra code and another state for the machine to sit in while the async code runs. I'm happy to pair with you or do a video walkthrough of Pierre's code if you need!

Then we can go back and refactor the Fillet code in another small PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[optional] we can come back and rewrite this test in our new fixture-based approach later, but since I'm already asking you to switch out the XState actor to an action I figure I'd give you a heads up on this one too.

Pierre has a good example of a Playwright test that uses our new fixture-based approach here in his Shell PR, and we're going to try to make any new tests use it, not least of all because Lee's work on migrating our tests to Electron uses it and then all our tests can run on both desktop and browser at-will.

I can show you how to rewrite this test in the new style if you need a hand or anything, although I think it would be pretty trivial for you!

Copy link
Collaborator Author

@max-mrgrsk max-mrgrsk Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good poits, thanks. Is it ok if I'll do that in the following pr so I can tackle one thing at a time ? Then I can fix both chamfer and fillet in one batch

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen Pierre's states too and was curious about it. Thanks for clarifying:)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@franknoirot I've created an issue for it (#4749). The current chamfer PR will wait until the older fillet code is updated to the latest XState requirements. Once that's done, I'll base current chamfer PR on the updated code so we don't mix everything into a single pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature Requests tests Pull requests that update or improve our test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hook up chamfer ui with ast-mod
3 participants