Skip to content

Conversation

whatsupsumit
Copy link

#46 Its done made some changes hope you like it

Merge it if you like my work......tell me if any changes required i will implement it

image

✅ What Was Done

  1. Created New Branch
    Branch: feat/user-feedback-mechanism
    4 commits with clear, semantic commit messages
    Clean, ready for pull request
  2. Implemented Complete Feedback System

Frontend Changes:
✅ Added 👍 (thumbs up) and 👎 (thumbs down) buttons next to Copy button
✅ Created beautiful feedback modal for negative feedback
✅ Full dark mode support
✅ Smooth animations and visual feedback
✅ Message passing to background script

Backend Changes:
✅ New /v1/feedback endpoint
✅ Cloudflare KV storage integration
✅ Feedback validation and unique ID generation
✅ Proper error handling and CORS support

- Add thumbs up/down buttons next to Copy button in UI
- Implement feedback modal for negative feedback with optional comment
- Create /v1/feedback backend endpoint to store feedback
- Store feedback in Cloudflare KV with metadata
- Support both light and dark themes
- Pass original code through translation pipeline for feedback context
- Add comprehensive documentation in FEEDBACK_FEATURE.md

This enables users to report translation quality issues directly,
creating a feedback loop to improve AI prompts and translation quality.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hi @whatsupsumit! 🎉
Welcome, and thank you for submitting your first pull request to CodeTranslateAI! We're thrilled to have your contribution.
Please make sure you've read our CONTRIBUTING.md guide. We'll review your changes shortly.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a complete user feedback mechanism to rate translation quality and capture optional comments, wiring frontend UI to a new backend endpoint with KV storage.

  • Adds 👍/👎 buttons and a modal for negative feedback in the UI, with dark mode support
  • Sends feedback via background script to new backend POST /v1/feedback
  • Stores feedback in Cloudflare KV; updates docs with setup and usage

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
frontend/scripts/ui.js Adds action buttons, feedback modal, and wiring to send feedback; updates styles and function signature to carry original code
frontend/scripts/content.js Passes original selected code into injectOrUpdateTranslations for feedback context
frontend/background.js Handles SUBMIT_FEEDBACK messages and POSTs to backend feedback endpoint
backend/src/index.ts Introduces FEEDBACK_STORE and adds /v1/feedback route with storage in KV
backend/wrangler.jsonc Binds FEEDBACK_STORE KV namespace
README.md Documents the new feedback feature and setup
IMPLEMENTATION_SUMMARY.md High-level implementation details for the feedback mechanism
FEEDBACK_FLOW_DIAGRAM.md Visual flow/architecture of the feature
FEEDBACK_FEATURE.md Feature documentation and setup instructions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@whatsupsumit
Copy link
Author

@dineshsutihar can you merge it passes the test...
and let me know if changes are required

@whatsupsumit
Copy link
Author

@dineshsutihar can you please review it and merge it
i will make further changes if you want ...but do merge this ..it will boost my confidence..😅😊😊

@dineshsutihar
Copy link
Collaborator

Hey @whatsupsumit , thanks again for your effort on this PR - the feedback feature itself is really solid

I noticed that you’ve added several .md files and also updated the main README. For this PR, those changes aren’t directly related to the feedback feature, so we should avoid mixing them in here.

If you want to improve the docs or add new guides, it’d be better to create a separate PR just for documentation. That way:

  • The feature PR stays focused and easier to review
  • You can get separate Hacktoberfest credit for your docs contributions

You can keep your current changes for the feedback functionality in this PR, and then submit another PR for the docs. Thanks for understanding, and I really appreciate your contributions!

}

// Generate a unique ID for the feedback
const feedbackId = `feedback_${Date.now()}_${Math.random().toString(36).substring(7)}`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

line 116 could theoretically collide in very high traffic scenarios.

  • use UUID (crypto.randomUUID()) for safer uniqueness.

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