feat: Add functionalities to improve Tutorial page. Replied messages state, Comment numbers, Proper User Details. #217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Includes various enhancements and bug fixes across multiple components in the
TutorialPage
. The most important changes include adding user-specific data handling, improving comment and reply functionality, and adding a snackbar for user feedback. Also, improved the Date of posting to include hh:mm::ss.Description
Enhancements to user-specific data handling:
UserDetails.jsx
: The previous logic usesgetuserProfileData
which updates user state for every fetch, hence only a single user can be stored in profile store. Updated the component to check for edge cases and properly show user details.Comment.jsx
: AddeduserHandle
to fetch the current user's handle and updatedhandleSubmit
to useuserHandle
instead of a hardcoded user ID.TutorialPage/index.jsx
: AddeduserHandle
to fetch the current user's handle and updatedhandleAddComment
to useuserHandle
instead of a hardcoded codelabzuser.Improvements to comment and reply functionality:
Comment.jsx
: UpdatedhandleSubmit
to handle replies and dispatch an action to update the replies array.tutorialPageActions.js
: Added logic to fetch the number of comments and replies and included this data in the tutorial and comment objects.User feedback enhancements:
InfoSnackBar.jsx
: Added a new reusableInfoSnackBar
component to display feedback messages to the user.PostDetails.jsx
: IntegratedInfoSnackBar
to show a "Copied to clipboard" message when the share button is clicked and also copy the current URL.Additional changes:
Textbox.jsx
: ReplacedAccountCircle
withAvatar
and included the user's profile picture or initial to maintain uniformity of user picture shown at different places.actionTypes.js
: Added a new action typeADD_REPLIES_SUCCESS
for handling replies.Related Issue
Fixes #207
Fixes #218
Fixes #219
Motivation and Context
There were several issues with viewing an existing Tutorial, causing huge degradation in user experience.
How Has This Been Tested?
Tested many edge cases through Browser and logging as a creator or viewer user.
Videos:
Screencast.from.2025-02-22.05-32-51.mp4
Screencast.from.2025-02-22.05-27-26.mp4
Types of changes
Checklist: