Make it easy to reassign already-used identifiers #150
Labels
No labels
bug
ci
design
duplicate
engine
enhancement
maintenance
prospective
question
regression
stub
todo
ui
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Depends on
#151 Allow identifier change via direct edit in certain views
StudioInfinity/dyna3
Reference
StudioInfinity/dyna3#150
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We'd like to make it easy to change an element's identifier when the desired identifier is already in use. Many mechanisms for this involve stealing the desired identifier.
Example scenario
As an example, suppose we have the following elements
applebananacantaloupeand we want to permute their identifiers like this:
bananacantaloupeappleWe don't want to look at the existing identifier list ahead of time, or think about what order to change the identifiers in. To model this, we'll assume that we plan to rename the elements in the order yellow, orange, red.
The bar to clear
To resolve this issue, we need to at minimum come up with a workflow that's smoother than the existing one.
banana.temp_orange(or something).banana.cantaloupe.apple.appleis now available. Otherwise, we'd use another temporary identifier, liketemp_red, which will take an extra step to change later.cantaloupe.Implementation ideas for the graphical interface
Steal identifier with warning indicator
When you're typing in an identifier field, it continually checks whether the current value is in use as an identifier already, and shows a warning indicator if so. If you complete the input despite the warning, that means you want to steal the identifier.
Pros:
Cons:
Example scenario workflow
bananain the yellow element's identifier field.cantaloupein the orange element's identifier field.applein the red element's identifier field.Extra enter to steal identifier
If you try to assign an identifier that's already in use to a different element, the identifier doesn't get assigned when you complete the input. Instead, a warning indicator appears. You can then press enter to steal the identifier.
Pros
Cons
Example scenario workflow
bananain the yellow element's identifier field and press enter.cantaloupein the orange element's identifier field and press enter.applein the red element's identifier field and press enter.Shift + enter to steal identifier
When you enter a new identifier, you can complete the input by pressing shift + enter to indicate that you want to steal it. If you complete the input in the usual way, by pressing enter or shifting focus, the identifier only gets assigned if it's not already in use. If it is already in use, it stays unassigned, and a warning indicator appears.
Pros
Cons
Example scenario workflow
bananain the yellow element's identifier field and press shift + enter.cantaloupein the orange element's identifier field and press shift + enter.applein the red element's identifier field and press shift + enter.appleis still in use.Implementation ideas for the command line
To be added.
@Vectornaut wrote in #150 (comment):
I think the primary reason it is not clear is that we don't yet have a design for identifier change via direct entry into an editable identifier field. So I think this issue in some sense becomes part of the design of that facility, for which I will file another issue and reference this one (and make this depend on that one).
OK, so having added #151, let's take one example behavior for changing an identifier via a gui, namely the initially recommended one of "close/change focus to submit". In that case,for the "extra enter to steal identifier" option, any gesture to close the text box should display/emphasize the identifier in use indicator, adding the "enter to steal identifier" message, and the close behavior should not fire, leaving the focus on the text entry box. On the other hand, more "passive" changes of focus such as clicking on a different entry box or hitting a change-focus keyboard shortcut (such as, say, tab) are a bit trickier, and may depend on some subtleties of the original ID change text entry box. If in fact that entry box more or less auto-closes on losing focus, which is likely a good design, then certainly a keyboard shortcut change of focus should operate like any other closure of the box per the above. On the other hand, clicking elsewhere to move the focus to that new place shouldn't be disrupted -- I think it's pretty disconcerting to have your specific click ignored/disrupted. So options in that scenario could include:
There may well be other options worth considering.
Leaving the identifier field unexpectedly open (with a warning indicator) feels most natural to me. Closing and reverting seems hard to distinguish from what happens when an identifier is assigned successfully.