Skip to content

[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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yehiarasheed
Copy link
Contributor

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

image

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.

@yehiarasheed
Copy link
Contributor Author

yehiarasheed commented Oct 17, 2024

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.

@yehiarasheed
Copy link
Contributor Author

@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?

Copy link

@dcq01 dcq01 left a 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:

  1. Null Checks for userTweets: Add a check to ensure that userTweets is an array before proceeding with the slicing and mapping.
  2. Potential Out of Bounds: Ensure that the slicing logic correctly handles the number of tweets available in userTweets to avoid out-of-bounds errors.
  3. Error Handling: Add a check for cases where userTweets might be empty or undefined to handle such cases gracefully.
  4. Handling Empty userTweets: If userTweets is an empty array, consider adding a fallback UI to inform the user that there are no tweets available.
  5. Key Prop Usage: Use a unique identifier for the key prop in the Tweet component instead of the index (e.g., key={tweet.id}).
  6. Image Source Validation: Validate the src attribute of the img tag for the avatar to ensure it points to a safe source.
  7. Accessibility Considerations: Ensure that the alt attribute for the image is meaningful and consider providing a fallback value.
  8. Repeated Code: Refactor the mapping logic for rendering tweets into a separate function to reduce code duplication.
  9. 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.
  10. 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:

  1. Does this comment provide suggestions from a dimension you hadn’t considered?
    1. Do you find this comment helpful?

Thanks a lot for your time and feedback! And sorry again if this message is a bother.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants