teragrep / ajs_01

User interface for Teragrep
Apache License 2.0
0 stars 0 forks source link

Pause icon in paragraph-control is not clickable but disabled #204

Open ronja-ui opened 1 year ago

ronja-ui commented 1 year ago

In paragraph-control when you click run paragraph button, it shows a pause button that looks clickable but actually isn't.

<i class="fas fa-pause" role="button" title="Cancel (Ctrl+{{ (isMac ? 'Option' : 'Alt') }}+C)" ng-click="cancelParagraph(paragraph)" ng-class="{'item-disable' : isNoteRunning}"> </i>

When .item-disable class name (which is not the best name) is attached to the icon, it makes the pause icon light blue. When there's no .item-disable class name, the pause icon is red.

Sometimes the pause icon is disabled, sometimes it's not. It's confusing for the user.

Investigate how the feature is implemented and figure out a better UX for it.

BVVLD commented 22 hours ago

the code related to this issue is highly spaghettified. Currently, there are three different methods in paragraph controller: isNoteRunning, isRunning and isParagraphRunning. not related to the issue: (isRunning is just an interface for isParagraphRunning utility, interconnected and dependent to paragraph-status logic placed elsewhere. ) isNoteRunning, however, is a scope variable, that is changed during several conditions:

What else does isNoteRunning do? Quite a lot, actually:

Additionally, the "cancelParagraph(paragraph)" function, which is called by the button click, is only doing one thing: it sends the websocket call "CANCEL_PARAGRAPH" with paragraphID provided. It does not have any additional logic in it and has no feedback. Therefore, if call is sent, but ignored/returns error (and we know how current error handling is performing) - user will see nothing and will think that button is unclickable.