Repository navigation
Adding pause/resume buttons in preparation for future - #684
Conversation
henrychen0220
left a comment
There was a problem hiding this comment.
I have look through the codebase and the feature is working as expected. Some minor changes such as naming and variable definitions change are needed. Other than that, there are 2 more things you can do for this PR
- When a user runs a query plan, change the color of the run button. For instance, you can make pause button red and resume button blue. Try many different pairs and get some screenshots, we can decide which color works the best.
- For testing, also check if the initial state of
runningandisPausedis correct. In addition, check if the methodonClickPauseResumesuccessfully reverse theisPausedvariable. - To test whether the UI is displayed correctly, you can manually set the variable
runningto true. Then, check if the UI is updated when the button is clicked by the user. This can also check if the current button ispause buttonorresume button.
henrychen0220
left a comment
There was a problem hiding this comment.
Hello,
For the new pause / resume button design, I like light red (maybe a little bit darker) for pause and light green (maybe a little darker as well) for the resume button. Also, while you are making changes to the button, can you also add css hover effect to regular / pause / resume button as well?
While testing your branch I encounter a possible bug in the UI. Here is the demo:
The problem is that when I pause the workflow and it finishes (since we don't actually pause the workflow right now), when I run again, it will display Resume instead of Pause. You should reinitialize the state of the button to display Pause when the user starts a workflow, which means that isWorkflowPaused variable should always be set to false when onClickRun() happens.
|
What should the hover effect do? Should I outline the border of the button or change text color? |
|
You can change the button background color or change button text color, or do both at the same time. |
|
Instead of changing the color of the text, I prefer changing the color of the button background. Also, after discussing with @hiseen, we believe that using the same colors for all states of run button is a better design than having different colors for each. I have pushed this new change into the branch. @zuozhiw and @avinash0161 please verify if this new design of the run button is ok. |
1b4ef44 to
8ef91e9
Compare
…#8896) ### What changes were proposed in this PR? Removes three exported REST endpoint constants from `execute-workflow.service.ts` that nothing imports: `EXECUTE_WORKFLOW_ENDPOINT`, `PAUSE_WORKFLOW_ENDPOINT` and `RESUME_WORKFLOW_ENDPOINT`. **−5 lines.** There is no behaviour change. Execute, pause and resume are sent over the websocket (`WorkflowExecuteRequest` / `WorkflowPauseRequest` / `WorkflowResumeRequest`), and the backend has no `queryplan/execute`, `pause` or `resume` REST routes. ### History | | | | --- | --- | | **Introduced by** | apache#622 (2018-06-21), the first execute-workflow service: `EXECUTE_WORKFLOW_ENDPOINT`. apache#684 (2019-03-10), pause/resume buttons: the other two | | **Usage removed by** | apache#811 (2020-08-21), the Amber merge, which moved pause/resume to websocket requests and removed their `http.post` calls. apache#982 (2021-01-25), "Improves multiple ports support in Texera operators (Step 4)", which removed the last REST execute call | The pause/resume constants have been unused for six years, and the execute one for nearly five. ### Any related issues, documentation, discussions? Closes apache#8895 ### How was this PR tested? No new tests; no spec imported the constants. From `frontend/`: - `npx ng test --watch=false`, covering `execute-workflow.service.spec.ts` plus all 17 specs that import the service (18 files): 1363 tests pass, 1 is skipped (an existing `it.skip`). - `yarn format:ci`: clean. - `npx ng build`: success. To re-check: ``` git grep -n -w -E "EXECUTE_WORKFLOW_ENDPOINT|PAUSE_WORKFLOW_ENDPOINT|RESUME_WORKFLOW_ENDPOINT" # no hits ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5) 🤖 Generated with [Claude Code](https://claude.com/claude-code)








This PR implements the pause/resume buttons in preparation for the future pause and resume features. Modified code in the navigation component to do so. Currently, the text on the run button gets replaced by a spinner during execution. Now, the run button gets replaced by a separate identical button when executing the workflow. Clicking on the pause/resume button will swap the text between the two.
What the buttons look like
After execution completes, the button displays run again.