-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add option to replace instead of undo #178
Conversation
Useful e.g. if what the operator thought was a jam starting whistle turns out to be a timeout instead.
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.
Frontend doesn't seem right here.
Just thinking there - should we log operator clock-related actions to the js console? That'd help debug if someone presses the wrong thing
function setReplaceButton(value) { | ||
$("#EnableReplaceButton").prop("checked", value); | ||
$("label.EnableReplaceButton").toggleClass("ui-state-active", value); | ||
$("#ClockUndo").toggleClass("Hidden KeyInactive", value); |
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.
This isn't working, I'm always seeing both buttons.
I'd suggest always showing both.
var controlsTr = createRowTable(4,1).appendTo(table.find("td")).find("tr:eq(0)").addClass("Controls"); | ||
|
||
var replaceInfoText = $("<span>").html("Replace "<span id=\"replacedLabel\"></span>" with").appendTo(replaceInfoTr); |
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.
This text is always showing.
Ignore that, a 2nd forced refresh got it working. I'd still suggest always showing both the replace and undo buttons - in a hurry you don't want to have to do the extra click to turn it on |
@@ -189,14 +198,17 @@ public void stopJamTO() { | |||
createSnapshot(ACTION_STOP_JAM); | |||
setLabels(ACTION_START_JAM, ACTION_NONE, ACTION_TIMEOUT); | |||
_endJam(false); | |||
finishReplace(); |
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.
We should probably have unittests covering each of these new finishReplace calls
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.
I've extended the unittest that was already there instead of adding new ones.
I've got a better feel for how this works now, I'm wondering if we should just hardcode this as the only way. |
The idea is that the operator chooses one mode of operation and uses that all the time. (In replace mode clicking "Undo" and then replace with "no action" has the same effect as straight undo, so there's no need for a straight undo button. (And we are striving to reduce the number of buttons, not increase it.) |
And the reason I've not hardcoded it is that there is a good chance operators would discover it the first time they press "undo" on a newer version of the scoreboard. And many operators won't be open to learn about new functionality just as they press undo. I hope we can do it that way once the new mode has become known amongst operators. |
d8e005a
to
3c4a65d
Compare
Useful e.g. if what the operator thought was a jam starting whistle
turns out to be a timeout instead.