Refactor post and comment handling; enhance sharing logic#13
Conversation
Refactored post and comment functionalities by introducing `MemePost` and optimizing metadata handling. Updated comment scroll behavior and added an advanced sharing flow via Web Share API and Clipboard. Adjusted configurations and documentation for frontend and container compatibility improvements.
|
I have found some issues will fix them |
|
Can you also split this into two PRs so we can work on the dev environment part in another PR? I think instead of having complete different compose files maybe we can use |
|
I tried to do that always, but the auto refresh is really unreliable "though" docker. But we can still try it. |
|
Reverted all the changes with the local env |
Removed unnecessary console.log statements used for debugging postId and commentId. This cleanup improves code readability and avoids cluttering the console during runtime.
# Conflicts: # wsd-frontend/src/app/(app)/posts/[hex]/page.tsx
isik-kaplan
left a comment
There was a problem hiding this comment.
I think we can merge this if you just move some code around and optionally add the comment body to the metadata (if you want I can handle that part)
My comments are mostly ocd fueled nitpicks and trying to follow some unwritten conventions I have:
- Keep the metadata functions definitions in the page component files
- 1 component 1 file (for stuff under /wsd/)
- Write reusable stuff if we can and prioritize declarative ui instead of imperative
- Try to keep the ui consistent as much as we can even if the previous decisions were wrong(if there are wrong we should try to change it all at once so that the ui is still consistent)
But other than these this is a great addition thank you.
I also have a design question:
I made the background black for the selected comment, do you think this makes it "pop" more? Totally your decision, if you want we can keep it with the border/outline you have
| if (!_.isUndefined(comment)) { | ||
| const commentData = includesType(comment, 'user', 'User') | ||
|
|
||
| // @TODO: Handle comment body |
There was a problem hiding this comment.
Are you looking to render the comment and then return the text? That might be slightly complicated, we can render the comments on the backend but we can't get the text easily, we can throw in something like jsdom to emulate dom and use some dom method to get the text, that's the only method I can think of right now.
There was a problem hiding this comment.
Yes but i dont know how to do it really, i would rather butcher your fine code even more.
Removed an unnecessary console.log statement that appeared to be a debugging artifact. This change cleans up the code and improves maintainability by removing unused code.
|
If you are able could you do the comment body? As i have no clue. |
Replaced custom scroll logic in `MemeComment` with the reusable `ScrollToHashContainer` component. Improved code structure by simplifying properties while preserving existing functionality for smooth scrolling and highlighting targeted comments.
|
@isik-kaplan done all of your comments, let me know if this is ok. The only thing that is left is the comment body parsing. |
|
This looks good, thank you, I'll add the comment body stuff asap and merge it |
…ure/comment_link # Conflicts: # wsd-frontend/next.config.mjs # wsd-frontend/src/app/(app)/posts/[hex]/page.tsx # wsd-frontend/src/components/wsd/MemeComment/MemeComment.tsx


Refactored post and comment functionalities by introducing
MemePostand optimizing metadata handling. Updated comment scroll behavior and added an advanced sharing flow via Web Share API and Clipboard.I did NOT implement the case when there are too many comments to fit in one batch ( and "when" replies are implemented that needs to handled too )
URL:
http://local-whysodank.com/posts/a8316130c26f43ff8639006dc670c86c/comment/5249bbecbf0b4c32acc68d21d3f7330a
Title will be:
user.username - comment on post.titleOne thing i could not find out how to do really is for metadata the html body text.