Skip to content

Local test sub#15

Open
lwx270901 wants to merge 5 commits into
Local_Testfrom
Local_Test_sub
Open

Local test sub#15
lwx270901 wants to merge 5 commits into
Local_Testfrom
Local_Test_sub

Conversation

@lwx270901

Copy link
Copy Markdown
Collaborator

READ CAREFULLY THEN REMOVE

Remove bullet points that are not relevant.

PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.

  • Pull requests that do not follow these guidelines will be closed without review or comment.
  • If you use AI to write your PR description your pr will be close without review or comment.
  • If you are unsure about anything, feel free to ask for clarification.

Description

Please provide a clear description of your changes.


Type of Change

Please delete options that are not relevant.

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature with breaking changes)
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • 🔒 Security enhancement
  • ⚡ Performance improvement

Areas Affected

Please check all that apply:

  • Email Integration (Gmail, IMAP, etc.)
  • User Interface/Experience
  • Authentication/Authorization
  • Data Storage/Management
  • API Endpoints
  • Documentation
  • Testing Infrastructure
  • Development Workflow
  • Deployment/Infrastructure

Testing Done

Describe the tests you've done:

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • Cross-browser testing (if UI changes)
  • Mobile responsiveness verified (if UI changes)

Security Considerations

For changes involving data or authentication:

  • No sensitive data is exposed
  • Authentication checks are in place
  • Input validation is implemented
  • Rate limiting is considered (if applicable)

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in complex areas
  • I have updated the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix/feature works
  • All tests pass locally
  • Any dependent changes are merged and published

Additional Notes

Add any other context about the pull request here.

Screenshots/Recordings

Add screenshots or recordings here if applicable.


By submitting this pull request, I confirm that my contribution is made under the terms of the project's license.

Copilot AI review requested due to automatic review settings June 9, 2026 03:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds end-to-end “user feedback” flows for mail analysis: client UI to collect feedback/corrections and server-side TRPC handlers that optionally re-run OpenAI analysis and persist updated results back into the DB.

Changes:

  • Added TRPC mutations for submitting general feedback and for regenerating classification/action suggestions from user feedback (OpenAI + DB updates).
  • Updated the mail display UI to submit priority-score corrections, collect action-suggestion feedback via a dialog, and provide a “move to label” submenu.
  • Wired the feedback settings page to send feedback via TRPC with pending/error states.

Reviewed changes

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

File Description
apps/server/src/trpc/routes/mail.ts Adds feedback-related TRPC mutations, including OpenAI-backed regeneration and DB persistence of refreshed analysis.
apps/mail/components/mail/mail-display.tsx Adds UI/UX to submit LLM feedback (priority + action) and label moves, plus local overrides for refreshed results.
apps/mail/app/(routes)/mail/feedback/page.tsx Implements actual feedback submission via TRPC with toast notifications and loading state.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

timestamp: new Date().toISOString(),
};

console.info('[feedback] received', feedbackEvent);
Comment on lines +101 to +106
z.object({
threadId: z.string().min(1),
messageId: z.string().min(1),
correctedPriority: z.enum(['low', 'high']),
currentPriorityScore: z.number().min(0).max(100).optional(),
}),
Comment on lines +313 to +317
await db
.update(emailTable)
.set({
categoryId: matchedCategory?.categoryId ?? null,
priorityScore: normalizedScore,
Comment on lines +569 to +574
await db
.update(emailTable)
.set({
categoryId: matchedCategory?.categoryId ?? null,
priorityScore: normalizedScore,
})
Comment on lines +1378 to +1381
<p className="text-muted-foreground text-sm">
Provide feedback for this email and we will update the prompt, resend to OpenAI,
and refresh the analysis result.
</p>
@@ -18,12 +21,28 @@ export async function clientLoader({ request }: Route.ClientLoaderArgs) {
}

export default function FeedbackPage() {
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