-
Notifications
You must be signed in to change notification settings - Fork 113
Add Udon breakpoint UI - breakpoint-related operations #2953
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
Conversation
# Conflicts: # core/gui/custom-webpack.config.js # core/gui/package.json # core/gui/yarn.lock
core/amber/src/main/python/core/architecture/managers/pause_manager.py
Outdated
Show resolved
Hide resolved
core/gui/src/app/workspace/component/code-editor-dialog/code-debugger.component.ts
Outdated
Show resolved
Hide resolved
aglinxinyuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few questions regarding the UI design:
- Is it intentional that I can only set breakpoints while the workflow is running?
- If breakpoints can only be set when the workflow is running, could we hide the option when unavailable? Currently, when I attempt to set a breakpoint, it prints break: line number, but the breakpoint isn’t actually set, which is a bit confusing.
- Can we position the breakpoint icon closer to or directly on the line number? The padding between them is too large, making it difficult to find the correct spot to click.
- Should users be able to set breakpoints in multiple UDFs simultaneously? If not, we should disable the breakpoint option in the second editor.
- If multiple editors can support breakpoints, the console isn’t switching to the active editor after a breakpoint is set. For example, after setting a breakpoint in Editor 2, the console still shows the content of Editor 1. Ideally, the console should automatically switch to the current editor after it's highlighted, but the breakpoint is preventing this switch.
Yes. For this PR, we will have this assumption as debug states are stored in the backend (although some partial states are cached in the frontend as described in the PR description, the backend still has the ground truth). Later we will relax this assumption by introducing some frontend debug state life cycle.
Good suggestion, I have changed it to only enable breakpoint operations while a UDF is either running or paused to avoid confusion. Note that a special case is when the workflow is terminated, we do not change the frontend state (it will keep the old state). Thus killing a workflow will not disable breakpoint operations. In future PRs, I will introduce breakpoint operation logic during other states, which will resolve the issue.
This is controlled by the library. We could potentially alter the CSS by ourselves, but I prefer to keep it as it is and only change it if needed.
I think you mean "do we allow a single user to set breakpoints on two UDFs". Currently, I assume there is only one UDF at a time to set a breakpoint with. To relax the assumption, it is related to the operator highlighting logic. In future PRs, I can relax the assumption.
Thanks. Yes it is related to highlighting logic. Will handle it in future PRs. |
aglinxinyuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR adds the Udon UI for breakpoint-related operations, including setting a breakpoint, removing a breakpoint, adding a condition to a breakpoint, and hitting a breakpoint. Adding/Removing breakpoints with optional conditions.  Manually continue the execution and breakpoint hit:  ### Limitations: - It will pause the UDF upon any breakpoint-related operations. It will not automatically continue/resume the execution. - Currently, the breakpoints are only to be set during a running Python UDF operator. Submitting a new execution will remove all debugging states, including previously set breakpoints. - Some states are stored in frontend (in UDFDebugService) only. They need to be retrieved back from backend debugger.
This PR adds the Udon UI for breakpoint-related operations, including setting a breakpoint, removing a breakpoint, adding a condition to a breakpoint, and hitting a breakpoint.
Adding/Removing breakpoints with optional conditions.

Manually continue the execution and breakpoint hit:

Limitations: