Change setModified to destructively overwrite target in OpenDisplayAction#3720
Conversation
|
@vincent-hve, need to admit I do not quite understand the use case this PR fixes. Can you please clarify the workflow, and also attach a bob file? |
|
Its not a bob-file specific issue. Any OpenDisplayAction has a default target, normally this is TAB. Thus click on an ActionButton with an OpenDisplayAction (or other widget with an action) will open the bob file in a new tab. However, additionally the OpenDisplayAction supports pressing middle mouse button (or left + ctrl) to open the bob file in a new window instead of a new tab. This behavior was previously implemented by permanently changing the target field in the OpenDisplayAction, when processing the modifiers (e.g. ctrl or middle mouse instead of left mouse). Any subsequent clicks without modifiers on the ActionButton would still open the bob file in a new window, instead of a new tab as would be expected. This unexpected behavior is fixed in this PR by adding an addition override target field, which is only used when the modifier is active, and keeping the original target field as-is. |
|
@vincent-hve, thanks for the explanation. However, on top of the observed issue I think there might be a bug or unintended behavior. Currently the code reads: suggesting CTRL+left click would select TAB as the target. This I find odd as TAB is in a sense the default (as in the editor) and should not need a modifier key. At the same time the display example (the "documentation") reads: The last case CTRL+SHIFT+left click ( My suggestion would be: This would solve the issue at hand while also supporting the |
|
You're right, my bad. Depending on the wanted default target configured on the action, one needs to honor that when no modifier keys are used. Thanks for adding the missing case (REPLACE). I would maybe suggest: This text is in https://github.com/ControlSystemStudio/phoebus/blob/master/app/display/model/src/main/resources/examples/controls_action_buttons.bob |
No. Replacement should be the default, just like links on a web page will by default replace the current page with the linked one. Without any key modifiers, the default should be the default target of actions, which is replacement. |
|
Ok, So the documentation is the desired ( correct ) behaviour. We should update the The other documentation and code are correct so we don't need to change the key combination to behaviour mapping code BUT @vincent-hve has found what I think is a valid bug The use of the modifiers should be a one time/temporary change in behaviour but as stated... once you use any of the modifiers the open display behaviour of the action button is permanently changed ( until the screen is closed ) I think the open display behaviour action should return to what is configured in the .bob file on all future clicks @kasemir is there a use case/workflow I am missing? |
|
Based on @vincent-hve code the following would make the code consistent with the documentation and make the modifier based behaviour a one time thing |
Yes, REPLACE should be the default. Key combinations override the default, just like in a web browser. Slight confusion with Ctrl vs. Apple-Propeller-Command key. Regrettably, but also just as in a web browser, we allow changing the default when defining an action and updating the "target" for that action. That usually results in many open tabs/windows followed by complaints that everything is slowing down. I don't know what to do about that. |
Is it ok if we fix the following... Once a user uses the modifier to open a "replace" with "a new window"... I don't want all subsequent clicks on the actions to use new window (even when the modifiers are not pressed... this is what is happening now), the behaviour should go back to using the "replace"... this would also avoid the too many tabs/windows issues @vincent-hve can you update your PR with the changes I suggested in #3720 (comment) |
Absolutely |
…fier target targetOvr to modifierTarget
|
From what I can tell STANDALONE is deprecated. So, should we still support this? I'm more inclined to make the CTRL+SHIFT operation REPLACE. This would allow you to force any of the 3 non-deprecated options. For now I have modified it in accordance to #3720 (comment) . |
|
|
It was deprecated and not implemented, but I think that has changed, it's now implemented |




Middle or control click on a widget supporting Actions, changed the target field permanently in the associated OpenDisplayAction, causing this operation to be executed henceforth, even without the modifier keys, or middle mouse button.
This PR fixes that, such that the target is only active for as long as the modifier is set.