-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[feat] add the option for people to contribute tweets #673
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
base: main
Are you sure you want to change the base?
[feat] add the option for people to contribute tweets #673
Conversation
Note that the hyperlink does not work for now because I've replaced it with the link that is supposed to work after merging, if you are looking for the working hyperlink for now you can access it here. |
@yangshun what do you think about the current changes, and concerning the form where users submit data instead of actually making commits in the files themselves and creating a PR? |
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.
Hi! I'm a grad student working on a research project about using large language models to automate code review. Based on your commit d9fe94d and the changes in apps/website/src/pages/index.js, my tool generated this comment:
- Null Checks for
userTweets
: Add a check to ensure thatuserTweets
is an array before proceeding with the slicing and mapping. - Potential Out of Bounds: Ensure that the slicing logic correctly handles the number of tweets available in
userTweets
to avoid out-of-bounds errors. - Error Handling: Add a check for cases where
userTweets
might be empty or undefined to handle such cases gracefully. - Handling Empty
userTweets
: IfuserTweets
is an empty array, consider adding a fallback UI to inform the user that there are no tweets available. - Key Prop Usage: Use a unique identifier for the
key
prop in theTweet
component instead of the index (e.g.,key={tweet.id}
). - Image Source Validation: Validate the
src
attribute of theimg
tag for the avatar to ensure it points to a safe source. - Accessibility Considerations: Ensure that the
alt
attribute for the image is meaningful and consider providing a fallback value. - Repeated Code: Refactor the mapping logic for rendering tweets into a separate function to reduce code duplication.
- Dynamic Rendering: Implement a more dynamic approach to calculate the number of columns based on the total number of tweets and the desired number of tweets per column.
- Performance Testing: Consider adding performance tests to measure rendering time and ensure that the component remains performant with a larger dataset.
As part of my research, I'm trying to understand how useful these comments are in real-world development. If you have a moment, I'd be super grateful if you could quickly reply to these two yes/no questions:
- Does this comment provide suggestions from a dimension you hadn’t considered?
-
- Do you find this comment helpful?
Thanks a lot for your time and feedback! And sorry again if this message is a bother.
Description
This PR addresses the issue #670, I know that the section listed under the heading Over 1,000,000 people have benefitted from this handbook! is meant for showcasing the benefits of this handbook rather than being accessible to the public like the Success Stories section where users are allowed to contribute their success stories. However the most recent tweets under the first section are from 2022, which is around two years old and that's considered pretty old keeping in mind that the handbook is actually still popular on social media and that we could benefit as contributors and users from using updated information, testimonials and tweets like these that showcase the benefits of this handbook. Therefore, I added the option for users to share their experiences too, just like they have that option under the Success Stories section as could be seen in the screenshots below. I'm considering adding sort of a form on the website later on that automates the process and Pull Requests for programmers that are not very involved with JavaScript (me included haha) so that tweets or success stories can be added through filling a form with the needed details rather than actually changing the website's code, given that you as the project owner can just review the code and the deployment on Vercel and merge right away.
Screenshots
Additional Context
I mimicked what you've implemented with the Success stories, I have separated the data (or the stories) from the actual code that displays and renders the stories so that we minimize errors in the code and could later on debug the code easier (Separation of Concerns). I have also maintained the formatting and order of tweets as the original format on the website.