Skip to content

Adding pause/resume buttons in preparation for future - #684

Merged
zuozhiw merged 23 commits into
masterfrom
kerry_pause_resume
Mar 10, 2019
Merged

zuozhiw merged 23 commits into
masterfrom
kerry_pause_resume

Conversation

@kerryqliu

Copy link
Copy Markdown
Contributor

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

screen shot 2019-01-13 at 6 23 25 pm

screen shot 2019-01-13 at 6 23 30 pm

After execution completes, the button displays run again.

screen shot 2019-01-13 at 6 23 38 pm

@henrychen0220 henrychen0220 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

  1. 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.
  2. For testing, also check if the initial state of running and isPaused is correct. In addition, check if the method onClickPauseResume successfully reverse the isPaused variable.
  3. To test whether the UI is displayed correctly, you can manually set the variable running to true. Then, check if the UI is updated when the button is clicked by the user. This can also check if the current button is pause button or resume button.

@kerryqliu

Copy link
Copy Markdown
Contributor Author

Red pause button
screen shot 2019-01-22 at 10 48 39 pm

Light red resume button
screen shot 2019-01-22 at 10 56 00 pm

Green resume button
screen shot 2019-01-22 at 10 50 14 pm

Blue resume button
screen shot 2019-01-22 at 10 48 30 pm

Grey resume button
screen shot 2019-01-22 at 10 53 08 pm

Light green resume button
screen shot 2019-01-22 at 10 55 12 pm

@henrychen0220 henrychen0220 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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:

ezgif com-video-to-gif

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.

@kerryqliu

Copy link
Copy Markdown
Contributor Author

What should the hover effect do? Should I outline the border of the button or change text color?

@henrychen0220

Copy link
Copy Markdown
Contributor

You can change the button background color or change button text color, or do both at the same time.

@henrychen0220

Copy link
Copy Markdown
Contributor

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.

Here is a GIF I made:
ezgif com-video-to-gif 1

I have pushed this new change into the branch. @zuozhiw and @avinash0161 please verify if this new design of the run button is ok.

@kerryqliu
kerryqliu force-pushed the kerry_pause_resume branch from 1b4ef44 to 8ef91e9 Compare March 1, 2019 23:55
@zuozhiw
zuozhiw merged commit 420acc4 into master Mar 10, 2019
@zuozhiw
zuozhiw deleted the kerry_pause_resume branch March 10, 2019 00:32
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Oct 8, 2026
…#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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants