New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MBS-12715, MBS-13526: ArtistCreditEditor refactor #3113
MBS-12715, MBS-13526: ArtistCreditEditor refactor #3113
Conversation
077d26f
to
38ac43b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots to go yet, few comments for now.
175d19b
to
d150ce0
Compare
f068256
to
8402a91
Compare
Finally got tests working here. Many of the failures revealed actual bugs, all of which I've fixed, but other failures were simply due to the HTML of the autocompletes changing. |
aa9ce6f
to
35d3331
Compare
Tested this locally, seems to work fine - except for the automatic feat. standardization, but that's good since that hasn't been our guideline for years now so that code should be removed anyway. Do check if other join phrase standardizations are still wanted though that also fail? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, checking this up to the start of the release-editor
folder.
@@ -87,7 +88,7 @@ function entityHref( | |||
break; | |||
|
|||
default: | |||
if (entityProps.mbid && entity.gid) { | |||
if (entityProps.mbid && nonEmpty(entity.gid)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does nonEmpty
work on knockout observables? Would it always see it as non-empty even if the T
in Observable<T>
is ''
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would always see it as non-empty, yes. But the nonEmpty
call was mainly added to work around a sketchy-null error from Flow. If the unwrapped gid
is empty, entityHref
will return a nonsense result either way (because id
will just remain an empty string).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing that's why I originally added #3113 (comment) though.
35d3331
to
adef368
Compare
There's a conflict here, but in general maybe we should put this on test? |
1cfdb45
to
c727909
Compare
Sure, I've rebased and put it on the test server now. :) |
Also when removing a name, the line stays with |
It still is the main change here so the usual |
The |
Ok, I guess that it is a first step towards your above point 3 about un-removing (as the relationship editor already does it). |
c727909
to
d288533
Compare
Do you mean more space? I had increased the max-width, and it's clearly bigger for me.
Fixed
I changed it back to gray, since nobody complained about it before
I'm not sure if this was intentional, but if you prefer the behavior we could keep it.
You can undo them now
Fixed
Fixed
I tweaked the positioning and it turns green now. (However, this looks kinda weird for inputs that still have a border -- unlike the ones in the tracklist.)
This sounds like a good idea, but I'm not actually sure how to gray out the icon (and it's an Autocomplete2 issue, not an ArtistCreditEditor issue -- I'd prefer to work on other improvements later). |
d288533
to
fde41e7
Compare
This is to allow preserving the same input id format in the artist credit editor. If we really want '-input' in the id, we can still pass it to the component that way.
fde41e7
to
5cb5f9e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me. I didn’t test the latest changes but you obviously did.
Just a couple of minor tidying-up points:
- “Removal undoing” at least seems to be worth a separate ticket.
- The PR title should start to with the addressed ticket(s) as usual, even though some more refactoring is done as well.
* Uses the new `ButtonPopover` component. * Uses the new `Autocomplete2` component (MBS-12715). * Replaces the nasty `ArtistCreditBubble` update hacks with `createPortal`. * Converts everything into "stateless" (as in, no internal state) functional components. * Adds Flow types. * Fixes a usability issue with removing items by keeping focus on the current [X] and replacing the deleted row with [removed]. See https://ux.stackexchange.com/a/99411. * Adds support for undoing removals (MBS-13526).
5cb5f9e
to
8cef6e9
Compare
Apologies, since you'd suggested that previously in #3113 (comment) but I forgot to apply the changes. I also opened MBS-13526 for the undo button. |
This is based on top of #3111 since I use the new library for updating React state here.
Problem
The current ArtistCreditEditor has a number of issues:
Autocomplete2
,ButtonPopover
).createPortal
.flushSync
.In case the motivation is not clear: the above issues currently make it difficult to use the ArtistCreditEditor in future edit forms, like the React conversion of the release editor, and the "alternative tracklists" editor.
Solution
This basically refactors the entire component and its sub-components, and updates a lot of glue code that keeps it in sync with Knockout observables in the release, recording, and release group edit forms.
Testing
Just manual testing so far in the release, recording, and release group edit forms.