Default the direction of new relationships between persons and groups

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Normal
    • 2023-08-28
    • Affects Version/s: None
    • Component/s: Relationship editor
    • None

      Import of http://bugs.musicbrainz.org/ticket/2789

      "At the moment, the order of has/had member depends on how you select artists. It would be helpful if this checked to see what type each artist is. So if wanted to relate a person, "Joe Bloggs" to a band "The Joe Bloggs Experience" it would default to "Joe Bloggs is/was a member of The Joe Bloggs Experience", regardless of the order the relationship was created."


      Specifically, when a relationship of one of the following types is being added between a person and a group (including a choir or an orchestra), the person should default to being on the source side:

      • member of / members
      • conductor for / conductor
      • founded / founded by
      • collaborator on / collaborators
      • composer-in-residence at / composers-in-residence
      • artistic director for / artistic director

          [MBS-2604] Default the direction of new relationships between persons and groups

          GitHub Bot added a comment -

          See code changes in pull request #3011 submitted by derat.

          GitHub Bot added a comment - See code changes in pull request #3011 submitted by derat .

          jesus2099 added a comment -

          Sounds cool, to me, derat. πŸ˜πŸ‘

          jesus2099 added a comment - Sounds cool, to me, derat. πŸ˜πŸ‘

          derat added a comment -

          I've got some working code to do this. I'll upload it soon to get early feedback on whether the approach that I'm taking (mostly constrained to root/static/scripts/relationship-editor/components/RelationshipDialogContent.js) is acceptable.

          derat added a comment - I've got some working code to do this. I'll upload it soon to get early feedback on whether the approach that I'm taking (mostly constrained to root/static/scripts/relationship-editor/components/RelationshipDialogContent.js ) is acceptable.

          derat added a comment - - edited

          I've gotten tired enough of clicking the "Change direction" button (or forgetting to, and making groups be members of people) that I'm starting to look at implementing this.

          My feeling is that the link direction in the relationship editor should be updated to make sense (if possible) whenever the user changes the link type or selects a target entity.

          Specifically, when a relationship of one of the following types is being added between a person and a group (including a choir or an orchestra), I think that the person should default to being on the source side:

          • member of / members
          • conductor for / conductor
          • founded / founded by
          • collaborator on / collaborators
          • composer-in-residence at / composers-in-residence
          • artistic director for / artistic director

          It might make sense to also add similar handling for "voice of / voiced by" relationships between people and characters, but that's a far less common case.

          I don't plan to actually restrict anything; I just want the link direction to default to what's most likely to be correct. Editors will still be able to reverse it if needed (e.g. maybe they have an open edit to modify one or both of the artists' types).

          Does that sound reasonable?

          derat added a comment - - edited I've gotten tired enough of clicking the "Change direction" button (or forgetting to, and making groups be members of people) that I'm starting to look at implementing this. My feeling is that the link direction in the relationship editor should be updated to make sense (if possible) whenever the user changes the link type or selects a target entity. Specifically, when a relationship of one of the following types is being added between a person and a group (including a choir or an orchestra), I think that the person should default to being on the source side: member of / members conductor for / conductor founded / founded by collaborator on / collaborators composer-in-residence at / composers-in-residence artistic director for / artistic director It might make sense to also add similar handling for "voice of / voiced by" relationships between people and characters, but that's a far less common case. I don't plan to actually restrict anything; I just want the link direction to default to what's most likely to be correct. Editors will still be able to reverse it if needed (e.g. maybe they have an open edit to modify one or both of the artists' types). Does that sound reasonable?

          jesus2099 added a comment -

          Maybe it would be more easy for developpers to :

          BLOCK edit which tries to make group IS A MEMBER OF person. by going back to edit form with error (like when an edit changes nothing or does bad thing, which is exactly the case here).

          jesus2099 added a comment - Maybe it would be more easy for developpers to : BLOCK  edit which tries to make group IS A MEMBER OF person. by going back to edit form with error (like when an edit changes nothing or does bad thing, which is exactly the case here).

          jesus2099 added a comment -

          Same for support and many others.

          jesus2099 added a comment - Same for support and many others.

          Ian McEwen added a comment -

          The decision was more how to do it, UI-wise; you may be right it shouldn't be DR, but I'm not sure.

          The question, as I understood it, was: when do we trigger the automatic direction-switching, and how do we alert the user that it's happened? I think the answer is: it should be triggered at the earliest time when the relationship type is known (so, for add relationship, when it's selected from the dropdown, or immediately when the page is seeded with a type; for edit relationship, at page load and when selections change); obviously if the type is changed away from a person<->group rel (or to one that should be in a different direction) the button should come back to usability. I think the direction should not be changed (back) when the button comes back, when applicable. I'd propose that the user be alerted as though it's a form error, underneath the type/entity selector; these alerts should happen whenever the order is changed without direct input. Obviously nothing should happen if the artist types cannot be determined or don't match the "one person, one group" paradigm.

          Ian McEwen added a comment - The decision was more how to do it, UI-wise; you may be right it shouldn't be DR, but I'm not sure. The question, as I understood it, was: when do we trigger the automatic direction-switching, and how do we alert the user that it's happened? I think the answer is: it should be triggered at the earliest time when the relationship type is known (so, for add relationship, when it's selected from the dropdown, or immediately when the page is seeded with a type; for edit relationship, at page load and when selections change); obviously if the type is changed away from a person<->group rel (or to one that should be in a different direction) the button should come back to usability. I think the direction should not be changed (back) when the button comes back, when applicable. I'd propose that the user be alerted as though it's a form error, underneath the type/entity selector; these alerts should happen whenever the order is changed without direct input. Obviously nothing should happen if the artist types cannot be determined or don't match the "one person, one group" paradigm.

          Ben Ockmore added a comment -

          This doesn't seem to require a decision - there's no question that it would be useful to do this, if possible.

          Ben Ockmore added a comment - This doesn't seem to require a decision - there's no question that it would be useful to do this, if possible.

          Ben Ockmore added a comment -

          Yeah, I've had a look at this and there doesn't seem to be enough data in the edit/relationship page to make it work at the moment. We would need to pass or look up the artist information somehow.

          It would also need a JS function to check the relationship type and set the entity order and disable the change direction button whenever the select box was changed.

          Not much I can do here, so unassigning.

          Ben Ockmore added a comment - Yeah, I've had a look at this and there doesn't seem to be enough data in the edit/relationship page to make it work at the moment. We would need to pass or look up the artist information somehow. It would also need a JS function to check the relationship type and set the entity order and disable the change direction button whenever the select box was changed. Not much I can do here, so unassigning.

          Ben Ockmore added a comment -

          I'll work on implementing this in the UI as soon as I get enough time to do it.

          Ben Ockmore added a comment - I'll work on implementing this in the UI as soon as I get enough time to do it.

            Assignee:
            derat
            Reporter:
            NicolΓ‘s Tamargo
            Votes:
            15 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2023-08-28