Fix Bug 1611510 - Implement Source String Comments #1623
Fix Bug 1611510 - Implement Source String Comments #1623mathjazz merged 59 commits intomozilla:masterfrom
Conversation
mathjazz
left a comment
There was a problem hiding this comment.
Thanks for the patch and keeping up this tedious work!
I'll ignore nits and smaller issues in my review for now so that we can first mitigate the risk of needing to drop this library. However, since we hit the next two issues in the previous attempt as well and we might close the old PR soon, I'll list them here again:
- Break long words into new lines: abeb790#diff-917d1532b1d18eaa3aa01ddd93c9e17c
- Fix the shrinking submit button issue: 16f966c#diff-97a5a5d80f7699b198c5465ea7237e53
We should also copy both TODO items over from #1609.
|
Rebased with |
|
After spending some time working out how to detect links while comments are added I ran into issues finding the right solution for detecting links that did not include a protocol. In the end I decided to use html-react-parser to parse the html into react elements which allowed me to again use I was also able to handle the added |
|
Just pushed up my most recent work which adds the ability to get user data from the DB for the suggestions, keeps the suggestions from overflowing the edge of the window, and removes the work for adding the The final known piece remaining is to fix the positioning of the suggestions when scroll is active. Also, there are now conflicts with master around the terminology changes. However, I'm not sure how to handle the conflict in |
There was a problem hiding this comment.
I was not able to figure out what Flow was asking for here.
There was a problem hiding this comment.
I'm pretty sure the number of people who fully understand Flow is lower than the number of fingers on the hand of an arm-less person.
|
Mentions are now working 😃 I left a note above regarding issues with Flow, and I didn't tackle the conflicts because IIRC you were going to do a rebase for those since they involve the Terminology changes (let me know if you want me to go ahead and tackle that though). Otherwise, the tests pass for me locally so this should be ready for a review. |
|
Thanks for the update, April! The most important thing in rebasing this patch is to move the condition we currently use on the Let me know if you still want me to do that myself. |
|
I've added the style changes and fixed up a few things. In doing that I reduced the number of suggestions displayed in order to avoid many of the overflow issues. FWIW, they fit the best when there are only 3, but that felt a bit limiting so I set it to 5. However, with that setting it can still get cut off at the top of the team comments if the window is smaller (mostly this occurred for me when I had the dev tools open at the bottom) I did try to set a max-height and then allow all the suggestions to populate with the ability to scroll through the names, but I was not able to get the div to scroll with the use of the arrow keys. Let me know if this is something you would like me to dig into and I can try to see if there is a solution for that. Of course, if you find any further functional issues just let me know 😊 |
mathjazz
left a comment
There was a problem hiding this comment.
That works very well!
Excellent job and thanks for sticking to that massive effort from the design and research phase all the way to implementing the final details. As far as I can tell this has turned out to be by far the hardest task you've been assigned to within the Pontoon project, and you've once again proven to be an amazing coder. Well done!
I left a bunch of comments, but there isn't anything major.
mathjazz
left a comment
There was a problem hiding this comment.
Thanks for the update!
Only two nits remain.
adngdb
left a comment
There was a problem hiding this comment.
I've been doing a high-level review, focusing on hooks usage and a bit on architecture and complexity. I did not run the code locally, as I assume that has been covered by Matjaz extensively. I've spotted a few issues ranging from nits to performance-impacting problems. Since I'm also quite new to hooks, it is possible that some of my comments are wrong, in which case please let me know why so I can learn!
There was a problem hiding this comment.
I'm pretty sure the number of people who fully understand Flow is lower than the number of fingers on the hand of an arm-less person.
| const handleMentionsMouseDown = React.useCallback((event: SyntheticMouseEvent<HTMLDivElement>) => { | ||
| event.preventDefault(); | ||
| if (target !== null) { | ||
| const charIndex = chars.indexOf(event.currentTarget.innerText) |
|
I've addressed @adngdb comments and made the needed changes. |
|
Anyone else having problems building this patch locally? It seems like upgrading
|
|
It happens to me too ✋ |


Initial work towards implementing source string comments. Replaced the textarea for the comments with a Slate editor and added the ability to
@mention users.Work still needed:
linkifylinksenter\nis added\nadded to avoid empty comments!importantfrom CSS changeTODO: