-
Notifications
You must be signed in to change notification settings - Fork 11
Feat/Added a user feedback mechanism for translation quality #48
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
base: develop
Are you sure you want to change the base?
Feat/Added a user feedback mechanism for translation quality #48
Conversation
- 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.
There was a problem hiding this 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.
There was a problem hiding this 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.
@dineshsutihar can you merge it passes the test... |
@dineshsutihar can you please review it and merge it |
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:
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)}`; |
There was a problem hiding this comment.
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.
#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
✅ What Was Done
Branch: feat/user-feedback-mechanism
4 commits with clear, semantic commit messages
Clean, ready for pull request
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