Skip to content
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

LB-1230: Added ability to edit comment after pinning a Listen #2799

Merged
merged 9 commits into from
May 29, 2024

Conversation

lzzy12
Copy link
Contributor

@lzzy12 lzzy12 commented Feb 27, 2024

Problem

Fixes this Ticket:
https://tickets.metabrainz.org/browse/LB-1230

Solution

Added an extra action for pinned listen:
image

@lzzy12 lzzy12 changed the title Added ability to edit comment after pinning a Listen LB-1230 Added ability to edit comment after pinning a Listen Feb 27, 2024
@lzzy12 lzzy12 changed the title LB-1230 Added ability to edit comment after pinning a Listen LB-1230: Added ability to edit comment after pinning a Listen Feb 27, 2024
1. New route added: /pin/update/<id>
2. Adjusted frontent code to use the API
@pep8speaks
Copy link

pep8speaks commented Feb 27, 2024

Hello @lzzy12! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-05-29 14:52:49 UTC

Copy link
Contributor

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening a PR! It's looking quite good !

I did a first round of review without running the code, but it's looking functional already.
Some questions about return value and statuses below:

frontend/js/src/pins/PinRecordingModal.tsx Outdated Show resolved Hide resolved
frontend/js/src/pins/PinRecordingModal.tsx Outdated Show resolved Hide resolved
frontend/js/src/pins/PinRecordingModal.tsx Outdated Show resolved Hide resolved
frontend/js/src/utils/APIService.ts Show resolved Hide resolved
frontend/js/src/user/components/PinnedRecordingCard.tsx Outdated Show resolved Hide resolved
@lzzy12
Copy link
Contributor Author

lzzy12 commented Feb 27, 2024

Hi, thanks for your feedbacks. I will work on them

@lzzy12
Copy link
Contributor Author

lzzy12 commented Feb 29, 2024

@MonkeyDo I have pushed an update. Please have a look when you feel better :)

Copy link
Contributor

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the modifications, I have a couple more comments but it's looking nice !

frontend/js/src/pins/PinRecordingModal.tsx Outdated Show resolved Hide resolved
frontend/js/src/pins/PinRecordingModal.tsx Outdated Show resolved Hide resolved
frontend/js/src/utils/APIService.ts Show resolved Hide resolved
lzzy12 and others added 2 commits March 4, 2024 22:50
Co-authored-by: Monkey Do <MonkeyDo@users.noreply.github.com>
Co-authored-by: Monkey Do <MonkeyDo@users.noreply.github.com>
Copy link
Contributor

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for those changes, the code looks great now !

I deployed the PR to our test server, and it's working nicely! I was able to update a comment without any issue, nice work !

Through testing I do have two more pieces of feedback from a user perspective. Sorry about not realizing sooner !

  • It would be useful to have the current pin comment in the textarea when I open the modal to edit the pin. Currently to update a typo I would have to copy the comment first. Left some comments about that below
  • I would want the UI to update so that the new text content is shown on the pin card on the page. Also left some comments to that effect, but basically we can consider the call modal.show( as a promise and make the modal return a value when the API call succeeds (in this case the updated text).

frontend/js/src/pins/PinRecordingModal.tsx Show resolved Hide resolved
frontend/js/src/pins/PinRecordingModal.tsx Outdated Show resolved Hide resolved
frontend/js/src/pins/PinRecordingModal.tsx Outdated Show resolved Hide resolved
@lzzy12
Copy link
Contributor Author

lzzy12 commented Mar 5, 2024

Actually the current behavior was inlined to what happens when we pin a track. It only shows up in pin when the user refreshes. I have observed this behavior at multiple places in the webapp. That was the reason I tried to keep it inlined to that behavior.
I will work on it to implement the suggested changes

@MonkeyDo
Copy link
Contributor

MonkeyDo commented Mar 5, 2024

Actually the current behavior was inlined to what happens when we pin a track. It only shows up in pin when the user refreshes. I have observed this behavior at multiple places in the webapp. That was the reason I tried to keep it inlined to that behavior.
I will work on it to implement the suggested changes

Yes, I didn't want to muddy the waters by mentioning it, but I did realize the pin is not updated on the page when pinning a track, which is definitely not great UX :)

I think since you are working on that feature, and since you noticed it yourself, you will be in a great position to fix that too in your next PR, if you are interested in doing that.

@MonkeyDo
Copy link
Contributor

MonkeyDo commented Apr 3, 2024

Hi @lzzy12 !
Just checking in to see if you have some time to finish this PR, or if you would rather pass the baton to someone else.
Either way is fine by me, please let me know :)

@lzzy12
Copy link
Contributor Author

lzzy12 commented Apr 3, 2024

Sorry got caught up with something. Will be finishing it this weekend

Otherwise the user updates the text and needs to refresh the page in order to see the modifications, which isn't great UX,
@MonkeyDo
Copy link
Contributor

I took the liberty to finish this off, hope you don't mind :)

@MonkeyDo MonkeyDo merged commit 4c8cd02 into metabrainz:master May 29, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants