Skip to content

Conversation

@roshankumar0036singh
Copy link
Contributor

Pull Requests Review Criteria

Caution

PRs that fail to meet these review standards will be automatically flagged and may be rejected by maintainers.

  • Filled out this PR template properly
  • Did not commit directly to main
  • Limited commits (max 3–4 unless permitted by Admin/Mentors)
  • Added comments in complex parts of code

Closes: #1170

Describe the add-ons or changes you've made 📃

Introduced a complete Feedback & Issue Reporting System to allow users to report bugs, suggest features, or provide general feedback directly from the application.

🌟 New Features

  1. Navbar Integration

    • Added a new "Support" icon to the Navbar.
    • Dropdown Menu:
      • Feedback: Opens the internal feedback modal.
      • Request a Feature: Redirects to the GitHub Feature Request template (feature-request.yml).
    • Logic is inlined directly into Navbar for seamless state management.
  2. Feedback Modal

    • Rich Form: Includes fields for Title, Category (Articles, Chats, Code), Details, and Reproduce Steps.
    • File Attachment: Users can attach screenshots (max 5MB).
    • Validation: Real-time validation for character limits and required fields.
    • Notifications: Integrated with the internal useNotifications hook for consistent success/error feedback (removed react-toastify).
  3. Backend Implementation

    • Database: New Feedback model and schema in MongoDB.
    • API Endpoint: POST /api/feedback/submit accepts a JSON payload.
    • Image Handling: Attachments are converted to Base64 on the client and uploaded directly to Cloudinary by the backend.
    • Security: Removed dependencies like sanitize-html in favor of strict validation and clean architecture.

🔧 Technical Improvements

  • No FormData: strict requirement to avoid FormData references; implemented JSON-based file transfer (Base64).
  • Clean Code: Refactored to remove unused imports and dependencies (multer, react-toastify removed).
  • Type Safety: Full TypeScript definitions for feedback payloads and categories.

Screenshots 📷

Screenshot 2026-01-20 225055

@vercel
Copy link

vercel bot commented Jan 20, 2026

@roshankumar0036singh is attempting to deploy a commit to the avdheshvarshney's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link

Thank you for submitting your pull request! We'll review it as soon as possible. For further communication, join our discord server https://discord.gg/tSqtvHUJzE.

@roshankumar0036singh
Copy link
Contributor Author

roshankumar0036singh commented Jan 20, 2026

@Avdhesh-Varshney plz review it

Copy link
Collaborator

@Avdhesh-Varshney Avdhesh-Varshney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turn off your installed vs-code prettier or formatter tool. Then, use this command,

npm run format

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert these formatting

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this formatting

}) => {
const queryString = params
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
`?${new URLSearchParams(params as any).toString()}`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback should not be searchable through URL search parameter.
Just pass limit and skip values and encode them in api URL

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert the formatting

}}
>
<Badge>
<SupportAgentIcon />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move popper logic in navbar components folder. Just keep the icon button to be here.
Keep the code to be clean.

reproduce_steps,
attachment_url,
attachment_public_id,
status: 'pending',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create enum for FEEDBACK_STATUS and also use the same in schema


const feedbackRoutes = express.Router();

// Route checks authentication and handles single file upload logic for 'attachment' field
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to use upload multer middleware

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update schema with enums

"nodemailer": "^7.0.5",
"rate-limiter-flexible": "^7.3.0",
"resend": "^6.1.2",
"sanitize-html": "^2.17.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't remove this package.
Revert the changes of package.json and package-lock.json

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this formatting

@vercel
Copy link

vercel bot commented Jan 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
code-a2z Ready Ready Preview, Comment Jan 21, 2026 4:56am
code-a2z-server Ready Ready Preview, Comment Jan 21, 2026 4:56am

@Avdhesh-Varshney
Copy link
Collaborator

image

@roshankumar0036singh Check this - on adding content in the textarea, instead of scroll with particular max height, it grows up

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.

Add a Feedback Form to Collect User Suggestions

2 participants