lionleaf / dwitter

Social network for short js demos
https://www.dwitter.net
Apache License 2.0
766 stars 69 forks source link

The complete comment system revamp #424

Open dwitterer opened 5 years ago

dwitterer commented 5 years ago

(Don't merge yet!)

I was initially going to create just a separate branch for the tests for the new hashtag system, but I ended up having all the new changes in this branch. Anyway, this pull request covers all the new functionalities and improvements for the comment system on Dwitter:

NOTE: The first two bulletpoints seem to require a refresh to work, after you post a comment using them... I'm not sure if this will be the case in production, but it's not a major issue anyway. Just thought I'd let you know, so that you would know. They should show up normally for other users viewing comments.

Overall, just minor things really, but they fix many of the bugs and annoying technical issues with the current comment system, and greatly increase the accuracy of the hashtag system.

dwitterer commented 5 years ago

Things to fix with the comment system in future PRs:

dwitterer commented 5 years ago

Thanks for the info. I will certainly have a look at the models.py. The refreshing thing woud be qood to fix, but I think that I'll move that onto another PR. This is already quite a large one, and minor annoyances like this are not a major priority right now. I will also have a look at the code thing you sent, but your formatting kinda messed up there, so not sure exactly what that is supposed to say. As for the number-only hashtags, the requirement for a letter kinda put itself in place, and I just kept it there, as it seems to match the way twitter hashtags work, and y'know, twitter knows their stuff when it comes to hashtags :wink: Also, number-only hashtags probably wouldn't be very meaningful anyway. Also also, wht if I make a comment saying "My dweet is #1"? I don't want the "#1" to be a hashtag!

Anyways, I have quite a lot of school work to do for the next few days, but hopefully I can have a look (and maybe finally get this PR ready) next friday/weekend :)

Thanks again for the stuff!

dwitterer commented 5 years ago

Okay, so I fixed the formatting in that code comment of yours, and pasted it into my localhost version of dwitter. The only thing that I could find that could possibly fail is the double backticks as in `whatever `a``, and we already test for that, so I'll just ignore that for now, unless you can clarify what issue you have found.

So all I need to do now, is solve the usernames thing....

That was easy :D

dwitterer commented 5 years ago

Okay, so I fixed all of the stuff you mentioned above, and put tests in place for the new punctuation stuff. As of right now, all d/ links, u/ links, and hashtags have to be followed by a space, end-of-string, comma, colon, semi-colon, question mark, or exclamation point. Parentheses and quotes will be added in soon to fix 2-3 more tests....

However, I kinda need your help, as half of my tests are now failing due to 'unbalanaced parentheses' in the same file, at the same place, when I haven't even touched that file... :thinking:

After we fix that, we're pretty much ready to merge :D

stianjensen commented 5 years ago

The error is on this line: https://github.com/lionleaf/dwitter/pull/424/files#diff-f552aa4b1485a67b4f2ebbdd750855c0R138

lionleaf commented 5 years ago

Looks like I messed up github markdown in an earlier comment. Let me try again; what happens with a comment like this (today #FFFFFF would become a clickable hashtag):

This is a comment with some code: ` color:#FFFFFF;` 

Does it look ok? And I guess it might be silently added to hashtags, so even if #FFFFFF doesn't become clickable the dweet can now be found at h/FFFFFF ?

lionleaf commented 5 years ago

Should fix #334