ayon-core icon indicating copy to clipboard operation
ayon-core copied to clipboard

Publisher: context menu option to revert each attribute to default

Open bradenjennings opened this issue 1 year ago • 16 comments

Changelog Description

Publisher - now has a "Revert to default" context menu option for each menu of various widgets ( Int, Float, String and Enum)

Additional info

Paragraphs of text giving context of additional technical information or code examples.

Testing notes:

  1. start with this step
  2. follow this step

bradenjennings avatar Mar 06 '24 04:03 bradenjennings

Revert to default menu options now appears for Bool, Int, Float, String and Enum menus.

It adds itself to existing menus, instead of replacing them.

image

bradenjennings avatar Mar 06 '24 04:03 bradenjennings

image BlackMagic Resolve

Not sure how much more complexity it would add, but this approach seems to be best UX. Reset button on right of each row.

jakubjezek001 avatar Mar 07 '24 20:03 jakubjezek001

Maybe @Innders could chip in with ideas or whether there is some convention in AYON already.

tokejepsen avatar Mar 07 '24 21:03 tokejepsen

image BlackMagic Resolve

Not sure how much more complexity it would add, but this approach seems to be best UX. Reset button on right of each row.

qargparse actually does that and thus the OpenPype Loader Option box fields also do that, e.g. see the button to right of Remove Publish Folder here:

image

There does seem to be a bug though that if you click that reset button it doesn't disappear in that particular UI - but it's a decent reference.

BigRoy avatar Mar 07 '24 21:03 BigRoy

I do agree that right click is not good option to reset value, consideting I want to reset all attributes to default state.

iLLiCiTiT avatar Mar 08 '24 09:03 iLLiCiTiT

I do agree that right click is not good option to reset value, consideting I want to reset all attributes to default state.

Well, not always. I usually want to revert an attribute or two - not the full instance. But if I'd want to revert 10, then yes. This will be very slow. However, the context menu could show a "shortcut" label like e.g. CTRL+LMB and when clicking that on an attribute that it reverts to default. Works perfectly fine like that in Houdini.

BigRoy avatar Mar 08 '24 09:03 BigRoy

There is a separate ticket for a reset all attributes button. So in this case you wouldn't need to click every attribute directly. https://github.com/ynput/ayon-core/pull/153

What's the consensus should we keep the context menu, or add a button next to each attribute. Personally I find its a lot of visual noise having a button next to each attribute.

bradenjennings avatar Mar 10 '24 20:03 bradenjennings

I find the Houdini context menu option to be a clean non distacting implementation.

bradenjennings avatar Mar 10 '24 20:03 bradenjennings

I find the Houdini context menu option to be a clean non distacting implementation.

You just described hidden feature, that requires 2 clicks. But I'm not known for UX, so hard to tell.

EDITED: @mkolar mentioned that if we'll add the button then right click should be enough.

iLLiCiTiT avatar Mar 11 '24 10:03 iLLiCiTiT

I find the Houdini context menu option to be a clean non distacting implementation.

I personally quite like Houdini's implementation - only if we can also match the shortcut behavior of CTRL + MMB to revert to default and the context menu label showing the shortcut.

image

That way you can also perform the revert in one click per attribute.

BigRoy avatar Mar 11 '24 11:03 BigRoy

That way you can also perform the revert in one click per attribute.

So, let it in context menu with hint to use Ctrl + MMB instead (oh, Mac users will be pissed 😈 ).

iLLiCiTiT avatar Mar 11 '24 12:03 iLLiCiTiT

(oh, Mac users will be pissed 😈 ).

Would be Command + MMB then I suppose. No idea how that works. Didn't Qt have something built-in for that and also to labelize menu entries, etc - by QAction.setShortcut and enabling its visibility in the context menu.

Also according to Qt docs:

Note: On Mac OS X, the CTRL value corresponds to the Command keys on the Macintosh keyboard, and the META value corresponds to the Control keys.

As such, that should handle itself?

BigRoy avatar Mar 11 '24 14:03 BigRoy

Would be Command + MMB then I suppose.

It was not about CTRL, you would have to find MMB :)

iLLiCiTiT avatar Mar 11 '24 16:03 iLLiCiTiT

It was not about CTRL, you would have to find MMB :)

🤦‍♂️ Of course. Anyway, not sure what Houdini does there.

BigRoy avatar Mar 11 '24 16:03 BigRoy

Seriously folks. Context menu is more than enough here. We're talking about something that is probably used very occasionally and it's super common to add these kinds of things to right click. It's a few attributes, so resetting all at once is really on a fringe of usefulness compared to the effort.

mkolar avatar May 03 '24 12:05 mkolar

Closed in favor of https://github.com/ynput/ayon-core/pull/986

iLLiCiTiT avatar Nov 05 '24 17:11 iLLiCiTiT