netcreateorg / netcreate-itest

Developing the 2.0 version of NetCreate
https://github.com/netcreateorg/netcreate-2018
Other
0 stars 0 forks source link

Fixes: Gracefully handle duplicate Node labels #113

Closed benloh closed 6 months ago

benloh commented 7 months ago

This addresses #38 and #56

Disambiguate duplicate node labels

It was impossible to distinguish between nodes with identical labels while using autosuggest both using the Search field and while editing a node label.

We now show the node id along with the label to help differentiate between the nodes.

screenshot_1365

Improved autosuggest selection during Node label edit

During node label editing, the autosuggest behavior as confusing.

The list is now improved:

screenshot_1371

Disambiguate source/target selection during Edge editing

When selecting a new source or target node while editing an edge, selecting a node that has identical labels would select the first matching label. If you try to link to the second one, the link will only be established to the first one.

We now link by using the node id field, so the correct node is always chosen.

Questions

  1. Search autosuggest supports keyboard highlights, but not mouse Currently while using the Search field, if you use the keyboard arrow keys you can move the highlighted item around, the graph will display the currently highlighted item in light gray.

screenshot_1368

This does not work with a mouse. There is a secondary highlight via a mouse hover, but that does not highlight the node in the graph view. Should we add that? So we can support either mouse or keyboard?

  1. Should the duplicate node warning ALWAYS be shown even while the input field does not have the focus?

Currently the duplicate node warning is only shown if the input field has the focus. So if for instance you open a duplicate node "abc", you will not see the duplicate node warning until you edit the node and click in the input field.

Should the warning ALWAYS be shown?
e.g. should you see "Duplicate node" when the node is open in VIEW mode? e.g. should you see "Duplicate node" when the node is open in EDIT mode and the label field does NOT have the focus?

  1. Revise duplicate warning? Currently the default duplicate warning is:
    You’re entering a duplicate node.  Do you want to View the Existing node, or Continue creating?

    This is actually confusing and problematic from a UX perspective. You can't View the existing node currently. If we re-introduce the hover highlight via mouse we can potentially show the duplicate node in the graph view as you move your cursor around if that's helpful. But I think we don't want to introduce the ability to click on the highlight to change the name -- that'd only lead to inadvertently creating duplicate names. So what should the warning say?

    "abc" node already exists
jdanish commented 7 months ago

Awesome, thanks!!

This does not work with a mouse. There is a secondary highlight via a mouse hover, but that does not highlight the node in the graph view. Should we add that? So we can support either mouse or keyboard?

So what should the warning say?

What about this: instead of putting the warning in the drop-down, put it just below. Can we then use the sam property that determines if you have a cancel or delete button to have 1 of 2 warnings?

And then if the warning is red, but the note is black it won't be as distracting on repeat visits.

Would that be doable without too much extra time? If it will take a while just use the second of the two.

benloh commented 7 months ago

This does not work with a mouse. There is a secondary highlight via a mouse hover, but that does not highlight the node in the graph view. Should we add that? So we can support either mouse or keyboard?

  • Ideally, yes, it'd work with the mouse as well. If that will take more than an hour, though, let's make it an issue for later.
  • Also, the keyboard is a bit misleading in that I now expect enter to open the one I am moused over. If changing that would take an hour or more, let's make it an issue and leave it for later.

It sounds like the ideal solution is to either use the keyboard OR the mouse but not both -- that way the behavior is consistent. I'm working on this.

So what should the warning say? What about this: instead of putting the warning in the drop-down, put it just below. Can we then use the sam property that determines if you have a cancel or delete button to have 1 of 2 warnings?

  • If this is a new node: "WARNING: at least one other node has the same name. Press cancel if you wish to look for the other(s) and edit them."
  • If this is an existing node: "NOTE: at least one other node has the same name. Use search or the node table to check the others." And then if the warning is red, but the note is black it won't be as distracting on repeat visits.

To keep things simple, I'm going to go with a single message. Especially because the Duplicate Warning message is defined in the template. (Note the screenshots are using the default template language, not the updated text you suggested. Just change the template to use whatever language you prefer. The new default template will use the language you suggested: "NOTE: At least one other node has the same name. Use search or the node table to check the others.").

benloh commented 7 months ago

@jdanish The AutoSuggest list now supports either mouse or keyboard, and the functionality for both is now the same:

Getting all the nuances of the search for both the main search and the NCEdges source/target editing was a bit of a challenge because there were so many variations involved. But I think it's ready to test now.

jdanish commented 7 months ago

A few minor issues:

  1. Carriage return works to create a new node even when not logged in and "new node" is grayed out (correctly)
  2. If you use the mouse to select a suggested node, the id fills the search rather than the name. Does not appear to impact keyboard nav.
  1. Also, if you shrink the window so that the "new node" button moves below the search field, the dropdown menu overlaps it (see attached). This one is minor and can be ignored if a big deal. If it's easy to move it to the right that'll work, though?
Screenshot 2023-12-18 at 4 46 01 PM
benloh commented 6 months ago
  1. Carriage return works to create a new node even when not logged in and "new node" is grayed out (correctly)

Yikes. Sorry 'bout that. Fixed with aadb93d442c731eeb7a2b9320862c00a4ae0a83f

  1. If you use the mouse to select a suggested node, the id fills the search rather than the name. Does not appear to impact keyboard nav.

Good catch. There were a ton of these. Should be fixed with 0843e1ee4f9d5c0d75f91bc295fd8fbb3222226f.

  1. Also, if you shrink the window so that the "new node" button moves below the search field, the dropdown menu overlaps

Right justifying is a good idea. 49cadb9bbb0ea19a76fb3a095d8148bd8a3658c1