Skip to content

Conversation

aglinxinyuan
Copy link
Contributor

@aglinxinyuan aglinxinyuan commented Sep 22, 2025

This PR adds a region layer to the workflow editor. The region layer becomes visible after the user clicks the "Run" button on the workflow.
Screenshot 2025-10-15 at 17 56 48

The region layer will be hidden by default, and the user can enable it in the layer dropdown.
Screenshot 2025-10-15 at 17 59 52

Demo:
Animation2

Fix issue #3904

@aglinxinyuan aglinxinyuan changed the title WIP: show region on gui wip: show region on gui Sep 22, 2025
@aglinxinyuan aglinxinyuan self-assigned this Sep 29, 2025
@aglinxinyuan aglinxinyuan added the frontend Changes related to the frontend GUI label Sep 29, 2025
@github-actions github-actions bot added engine dependencies Pull requests that update a dependency file labels Oct 6, 2025
@aglinxinyuan aglinxinyuan changed the title wip: show region on gui fear(gui): show region on workflow Oct 9, 2025
@aglinxinyuan aglinxinyuan changed the title fear(gui): show region on workflow feat(gui): show region on workflow Oct 15, 2025
Copy link
Contributor

@Xiao-zhen-Liu Xiao-zhen-Liu left a comment

Choose a reason for hiding this comment

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

LGTM in general. Left some minor comments.

@Yicong-Huang
Copy link
Contributor

This is such a nice feature!!! I hope we can use color to indicate region state in the future, e.g., orange means running, green means completed

@aglinxinyuan
Copy link
Contributor Author

This is such a nice feature!!! I hope we can use color to indicate region state in the future, e.g., orange means running, green means completed

Yes, that's a planned follow-up PR.

@chenlica
Copy link
Contributor

@aglinxinyuan Can we add test cases?

@aglinxinyuan
Copy link
Contributor Author

aglinxinyuan commented Oct 17, 2025

@aglinxinyuan Can we add test cases?

We don't need to add new test cases for the following reason:

  1. This PR doesn’t introduce any new components — the functionality it affects is already covered by existing test cases.

  2. The main change in this PR is a visual update on the front end, and our current testing framework doesn’t support GUI testing. Even if we used a framework that can test GUIs, defining the “correctness” of a visual element would still be difficult. For example, if a region’s shape is 10 px larger than expected due to differences in library algorithms, it would still be considered valid.

@Yicong-Huang
Copy link
Contributor

@aglinxinyuan Can we add test cases?

We don't need to add new test cases for the following reason:

  1. This PR doesn’t introduce any new components — the functionality it affects is already covered by existing test cases.
  2. The main change in this PR is a visual update on the front end, and our current testing framework doesn’t support GUI testing. Even if we used a framework that can test GUIs, defining the “correctness” of a visual element would still be difficult. For example, if a region’s shape is 10 px larger than expected due to differences in library algorithms, it would still be considered valid.

I disagree. There are new code, there better be new tests. Try use AI to generate tests? At least you can test if this new component can be initialized properly.

@aglinxinyuan
Copy link
Contributor Author

aglinxinyuan commented Oct 17, 2025

@aglinxinyuan Can we add test cases?

We don't need to add new test cases for the following reason:

  1. This PR doesn’t introduce any new components — the functionality it affects is already covered by existing test cases.
  1. The main change in this PR is a visual update on the front end, and our current testing framework doesn’t support GUI testing. Even if we used a framework that can test GUIs, defining the “correctness” of a visual element would still be difficult. For example, if a region’s shape is 10 px larger than expected due to differences in library algorithms, it would still be considered valid.

I disagree. There are new code, there better be new tests. Try use AI to generate tests? At least you can test if this new component can be initialized properly.

We have quite a few frontend test cases written in the way you described. Honestly, i don't like this approach—because in doing so, we’re essentially adding test cases just for the sake of having test cases. If we can’t find a meaningful way to verify a component’s functionality, then we’re just creating tests that will never fail and can’t actually catch any bugs. If any new code automatically means a new component and test cases, then we should add test cases for the readme file and issue templates.

@Yicong-Huang
Copy link
Contributor

First of all, we should start to add more tests. Secondly, those simple initiation tests can at least help us to know if a component can be initialized or not, which is at least helpful when we upgrade dependencies.

Anyway, we can blame the existing tests, they can be improved. but that's not a reason not to add test here.

@Yicong-Huang
Copy link
Contributor

All I'm asking now is adding tests for source code, I think that's reasonable. Actually spark is also testing docs, but we are not there yet.

@aglinxinyuan
Copy link
Contributor Author

First of all, we should start to add more tests. Secondly, those simple initiation tests can at least help us to know if a component can be initialized or not, which is at least helpful when we upgrade dependencies.

Anyway, we can blame the existing tests, they can be improved. but that's not a reason not to add test here.

We already have initiation tests and the other tests for the workflow-editor. I'm not adding any new component in this PR.

@Yicong-Huang
Copy link
Contributor

First of all, we should start to add more tests. Secondly, those simple initiation tests can at least help us to know if a component can be initialized or not, which is at least helpful when we upgrade dependencies.

Anyway, we can blame the existing tests, they can be improved. but that's not a reason not to add test here.

We already have initiation tests and the other tests for the workflow-editor. I'm not adding any new component in this PR.

That's good. Can we add some tests against your new code?

@aglinxinyuan
Copy link
Contributor Author

aglinxinyuan commented Oct 17, 2025

All I'm asking now is adding tests for source code, I think that's reasonable. Actually spark is also testing docs, but we are not there yet.

Spark is testing docs doesn't automatically mean it's absolutely correct. Also their docs is very different from readme. The point I want to make is that testing markdown files is quite difficult since rendering can vary.

@aglinxinyuan
Copy link
Contributor Author

aglinxinyuan commented Oct 17, 2025

First of all, we should start to add more tests. Secondly, those simple initiation tests can at least help us to know if a component can be initialized or not, which is at least helpful when we upgrade dependencies.

Anyway, we can blame the existing tests, they can be improved. but that's not a reason not to add test here.

We already have initiation tests and the other tests for the workflow-editor. I'm not adding any new component in this PR.

That's good. Can we add some tests against your new code?

That's why did I mentioned my second point in my earlier comment. In this PR, I'm drawing some shape in html with a library. It's not easy to compare drawing in joints with our current test framework. Even it's possible, it's hard to define what's a correct drawing.

@aglinxinyuan aglinxinyuan enabled auto-merge (squash) October 20, 2025 02:06
@aglinxinyuan aglinxinyuan disabled auto-merge October 20, 2025 02:11
@aglinxinyuan aglinxinyuan enabled auto-merge (squash) October 20, 2025 02:27
@chenlica
Copy link
Contributor

@aglinxinyuan Can resolve the conversation so that we can merge it?

@aglinxinyuan
Copy link
Contributor Author

aglinxinyuan commented Oct 20, 2025

@aglinxinyuan Can resolve the conversation so that we can merge it?

I cannot find any unresolved conversation on my end. There might be a bug on GitHub, I will try to figure it out…

Copy link
Contributor

@Xiao-zhen-Liu Xiao-zhen-Liu left a comment

Choose a reason for hiding this comment

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

LGTM now.

@aglinxinyuan aglinxinyuan disabled auto-merge October 20, 2025 05:09
@aglinxinyuan aglinxinyuan enabled auto-merge (squash) October 20, 2025 05:09
@aglinxinyuan aglinxinyuan merged commit bfca002 into main Oct 20, 2025
19 checks passed
@aglinxinyuan aglinxinyuan deleted the xinyuan-region-gui branch October 20, 2025 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file engine frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants