XXXX taking over for Kanishk: Phase 4 - Task Comments Frontend Implementation#4227
XXXX taking over for Kanishk: Phase 4 - Task Comments Frontend Implementation#4227kanishkagarwal6101 wants to merge 6 commits intodevelopmentfrom
Conversation
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
There was a problem hiding this comment.
Hi Kanishk,
I have reviewed your PR locally - i only have 2 concerns.
- Try submitting 1000+ characters - should show character limit error You mentioned character limit error - it only stops me due to character limit inline and doesn't throw any error - is it supposed to inline as if it not then i do not see any error being displayed.
- Delete functionality only available for comments posted by current user - I am able to delete someone else's comment as you can see in the below video. I have left my comments as is and have also tested this using other login's and was able to delete comments left at the end of below video.
https://github.com/user-attachments/assets/1350b613-4294-451c-85bf-aecd4c7aa329
|
Hi Kanishk, Able to see the comments made in comment section as Student comments. Dark mode is working. However as mentioned in the above review, I am able to delete others comments along with mine. And I don't see any inline error for empty comment and 1000+ character submission. Screen.Recording.2025-12-08.234000.mp4 |
- Fix character limit error: Remove maxLength attribute and show inline error when exceeding 1000 characters - Fix empty comment error: Enable submit button to allow error display on submit - Fix delete security: Use userId comparison instead of name comparison to prevent unauthorized deletions - Add visual feedback: Character count turns red when exceeding limit - Add server-side validation: Double-check userId in handleDeleteComment for additional security
- Add PropTypes validation to all components (CommentBox, CommentList, Toast, Icon, BellIcon) - Improve error handling with development-mode logging - Fix CSS contrast issues (improved text colors for better accessibility) - Remove duplicate CSS selectors (:root and .headerDark) - Extract validation logic to reduce cognitive complexity - Improve code maintainability and reliability
… complexity - Fix contrast issue in CommentBox.module.css by using darker blue (#2563eb) for better WCAG compliance - Reduce cognitive complexity in WriteTaskUpload.jsx by extracting render helpers and event handlers - Extract functions: renderSidebar, renderHeader, renderFormSection, renderHistorySection, renderProgressPane, renderFormGrid - Extract event handlers: handleCommentChange, handleLinkUrlChange, handleShowLink - Extract data management: loadCommentsFromStorage, getDefaultComments, saveCommentsToStorage, createNewComment, formatItemTime - Extract validation: validateDeletePermission
- Change color from 'white' to '#ffffff' for better specificity - Use darker gradient colors (#2563eb, #7c3aed) for better contrast - Update dark mode gradient to even darker shades (#1e40af, #6d28d9)
…eration - Replace Date.now() + Math.random() with crypto.randomUUID() in useToast hook - Use cryptographically secure random number generator to satisfy SonarQube security hotspot - crypto.randomUUID() is available in all modern browsers and provides proper UUIDs
|
|
Hello All, I have made the changes as requested please I re-request review from all. Your feedback is very helpful. |
debadyuti23
left a comment
There was a problem hiding this comment.
Hi @kanishkagarwal6101 I have verified the changes, it works correctly. Couple of observations which I can see:
- The submit button and pie chart got removed when I submitted a very long comment.
- In dark mode, various functionalities like the progress bar, pie chart does not adjust with proper color.
Test video 1: https://drive.google.com/file/d/1SqTdH3_agCdtP8EZY3ffmN9Uyw_LyCWu/view?usp=sharing
Test video 2: https://github.com/user-attachments/assets/6299a3e1-8eba-48d5-89f3-fa0df0747e78
Since these changes are not related to PR, I have approved it. However please be mindful about these issues in future.
ShreyaMP1999
left a comment
There was a problem hiding this comment.
Tested the current branch locally following the provided steps. Comment submission, validation (empty and character limit), delete functionality, dark mode styling, and comment persistence after refresh are all working as expected. No issues found.
Screen.Recording.2026-01-03.at.4.07.44.PM.mov
Shravan-neelamsetty
left a comment
There was a problem hiding this comment.
Hi Kanishk, I tested this PR locally by navigating to /educationportal/tasks/upload and verified the comment functionality. Comment submission works correctly with proper validation for empty comments and character limits. The character counter displays accurately, and comments persist after page refresh as expected. The delete functionality correctly restricts deletion to only the current user's comments. However, I noticed dark mode issues: there are several white boxes visible in dark mode, and some elements like the progress bar and pie chart don't adjust with proper dark mode colors.
Vikas-8055
left a comment
There was a problem hiding this comment.
Hi Kanishk,
I have reviewed your PR locally and tested the comment functionality. The main features are working correctly - comment submission with character counter, validation for empty comments and 1000+ character limit, delete functionality for own comments, and comment persistence after refresh all work as expected. I tested in both light and dark modes, and the Comments/Queries Section displays properly with readable text and buttons in both modes.
I noticed some white boxes visible in dark mode (Unit 1 selection button, Choose Trades button, and file upload area), but as other reviewers mentioned, these appear to be part of the existing page layout and outside the scope of this PR which specifically focuses on the comment functionality. The comment components themselves have proper dark mode styling.
Ganesh112001
left a comment
There was a problem hiding this comment.
Hi Kanishk, I tested PR #4227 and verified that the Task Comments feature works perfectly. After navigating to /educationportal/tasks/upload, I confirmed that students can post comments with proper validation and character counter, delete their own comments with the red × button, and receive success/error toast notifications. Dark mode is fully supported with excellent contrast across all components. Comments persist correctly using localStorage after page refresh. No console errors observed. Everything functions perfectly and is ready for merge!
There was a problem hiding this comment.
Hi Kanishk,
I reviewed your PR locally and all core features work great! Comment submission works smoothly with the character counter, empty comment validation shows inline errors, and the 1000+ character limit displays the proper error message. Delete functionality works correctly I can only delete my own comments and the success toast appears as expected. Comments persist after page refresh.
Regarding @rohanrastogi311's dark mode feedback the Progress Bar and Drag & Drop areas are pre-existing components outside this PR's scope. A separate PR should be raised to address those dark mode issues. This PR focuses on the Task Comments feature, and the Comments/Queries Section is properly styled in both light and dark mode.
roshini1212
left a comment
There was a problem hiding this comment.
Tested the kanishk_task_comments_frontend branch locally and all functionality works perfectly at "/educationportal/tasks/upload". Comment submission displays success toasts and lists correctly, validation properly blocks empty submissions and 1000+ character inputs with clear inline errors, delete removes own comments with confirmation toasts and light mode styling is fully responsive across all components.
The dark mode has some white boxes which felt off. But the basic functionalities according to the PR are working properly.
|
Hi @kanishkagarwal6101
|
ManojPuttaswamy
left a comment
There was a problem hiding this comment.
Tested all functionality and everything works as expected. One minor fix needed — the submit button should be disabled when the comment exceeds 1000 characters. This can be done by updating the disabled prop on the button.
disabled={disabled || comment.length > 1000}
| <button | ||
| type="submit" | ||
| className={`${styles.submitButton} ${darkMode ? styles.submitButtonDark : ''}`} | ||
| disabled={disabled} |
There was a problem hiding this comment.
The button is only disabled when the disabled prop is true, but not when the character limit is exceeded. A user can still submit while the error is showing:
rajanidi1999
left a comment
There was a problem hiding this comment.
Overall looks good. The components are well-structured and reusable, and the feature implementation is solid. Just a few minor improvements to consider: remove unnecessary Promise.resolve() in async functions, standardize API response/error shapes for consistency, and disable the submit button in CommentBox when validation fails (e.g., character limit exceeded). These are non-blocking and can be addressed in follow-ups.
rithika-paii
left a comment
There was a problem hiding this comment.
Hi Kanishk,
I reviewed this PR and tested the Task Comments functionality on the upload page in both light and dark modes. The overall feature works as expected, but I found one issue:
Comment deletion permission issue: Currently, it is possible to delete comments posted by other users. The delete option should be restricted so that users can only delete their own comments, as mentioned in the PR description.
PR.4227.mov
saurabhdipte
left a comment
There was a problem hiding this comment.
Hi Vikas,
I tested the changes locally. I’m able to submit a comment and delete it successfully. However, I also noticed that I’m able to delete other students’ comments, which might need to be restricted.
The validation for empty comments is working as expected. For the 1000+ character limit, I’m able to enter more than 1000 characters in the text box, but submission is blocked. It might be better to restrict input beyond 1000 characters at the typing level itself.
In dark mode, there are a few contrast-related issues, particularly with some text boxes, which may need adjustment.
kunchalasireesha
left a comment
There was a problem hiding this comment.
Hi Vikas, it looks like this PR currently has merge conflicts with the base branch. Could you please rebase or merge the latest changes from development into your branch and resolve the conflicts? Once the build passes, I’ll finish the review.



























Description
Implements Phase 4 - Task Comments Frontend feature for the Education Portal. This PR adds comprehensive comment functionality to the WriteTaskUpload component, allowing students to post comments and educators to view them, with full dark mode support and delete functionality.
Related PRS (if any):
This is a standalone frontend feature. No related backend PRs at this time.
Main changes explained:
How to test:
git checkout kanishk_task_comments_frontendnpm installto install dependenciesnpm run start:localhttp://localhost:3000/educationportal/tasks/uploadScreenshots or videos of changes:
Note: