Skip to content

Conversation

@devksingh4
Copy link
Member

@devksingh4 devksingh4 commented Nov 13, 2025

Summary by CodeRabbit

  • New Features
    • Added an email copy confirmation modal. Users now see a dedicated confirmation screen with privacy information, warning alerts, and explicit confirmation required before copying emails.

@github-actions
Copy link
Contributor

💰 Infracost report

Monthly estimate generated

This comment will be updated when code changes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 13, 2025

Walkthrough

A confirmation modal workflow is added to the copy emails feature in the tickets view. Three copy email buttons now trigger a modal that displays privacy considerations and requires user confirmation before copying, replacing direct function calls with an intermediary modal confirmation step.

Changes

Cohort / File(s) Summary
Copy Emails Confirmation Modal
src/ui/pages/tickets/ViewTickets.page.tsx
Introduces showCopyEmailModal and pendingCopyMode state variables; adds three new handlers (handleCopyEmailsClick, handleCloseCopyEmailModal, handleConfirmCopyEmails); refactors three Copy Emails button click handlers to invoke the modal; adds new modal UI component with privacy warning and confirmation action.

Sequence Diagram

sequenceDiagram
    participant User
    participant Button
    participant Modal
    participant CopyFunction

    User->>Button: Click Copy Emails
    Button->>Modal: Show Confirmation Modal
    Note over Modal: Display privacy warning
    User->>Modal: Confirm or Cancel
    alt User Confirms
        Modal->>CopyFunction: Call copyEmails(mode)
        CopyFunction->>User: Emails copied
    else User Cancels
        Modal->>User: Modal closes
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • State management logic: Verify that showCopyEmailModal and pendingCopyMode are correctly initialized, updated, and reset to prevent state inconsistencies
  • Modal flow: Confirm that the modal opens when any of the three Copy Emails buttons are clicked and that the correct mode is stored for later use
  • Confirmation handler: Ensure handleConfirmCopyEmails correctly retrieves the pending mode and invokes copyEmails with the right parameter
  • Button refactoring: Review that all three button click handlers now correctly invoke handleCopyEmailsClick instead of directly calling copyEmails

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add a confirmation for BCC when copying emails' accurately describes the main change: introducing a confirmation modal for the email copy workflow to address privacy/BCC considerations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dsingh14/add-copy-warning

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/ui/pages/tickets/ViewTickets.page.tsx (1)

486-518: Consider adding a Cancel button and displaying the copy mode.

The privacy notice modal is clear and effective. Two optional UX enhancements:

  1. Add an explicit Cancel button alongside the confirmation button for consistency with the fulfillment modal pattern (lines 470-472).
  2. Display which email list (All, Fulfilled, or Unfulfilled) is being copied so users can confirm they selected the correct option.

Apply this diff to add both enhancements:

       <Stack>
         <Alert
           icon={<IconAlertCircle size={16} />}
           title="Privacy Notice"
           color="yellow"
           variant="light"
         >
           <Text size="sm" fw={500}>
             Be sure to BCC all recipients to avoid leaking the purchase list
           </Text>
         </Alert>

+        <Text size="sm" fw={600}>
+          You are about to copy:{" "}
+          {pendingCopyMode === TicketsCopyMode.ALL && "All Emails"}
+          {pendingCopyMode === TicketsCopyMode.FULFILLED && "Fulfilled Emails"}
+          {pendingCopyMode === TicketsCopyMode.UNFULFILLED && "Unfulfilled Emails"}
+        </Text>
+
         <Text size="sm">
           When composing your email, make sure to add all email addresses to
           the BCC field (not To or CC) to protect the privacy of your
           recipients.
         </Text>

         <Group justify="flex-end" mt="md">
+          <Button variant="subtle" onClick={handleCloseCopyEmailModal}>
+            Cancel
+          </Button>
           <Button color="blue" onClick={handleConfirmCopyEmails}>
             I understand, copy emails
           </Button>
         </Group>
       </Stack>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 922f8da and 17d59d4.

📒 Files selected for processing (1)
  • src/ui/pages/tickets/ViewTickets.page.tsx (4 hunks)
🧰 Additional context used
🪛 GitHub Actions: Required Reviews
src/ui/pages/tickets/ViewTickets.page.tsx

[error] 1-1: Requirement "Base Requirement" is not satisfied by the existing reviews.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build Application
  • GitHub Check: Run Unit Tests
🔇 Additional comments (3)
src/ui/pages/tickets/ViewTickets.page.tsx (3)

91-94: LGTM!

The state variables correctly manage the copy email confirmation workflow with proper typing.


137-153: LGTM!

The handler functions implement a clean confirmation workflow with proper state management and edge case handling.


304-325: LGTM!

The button handlers correctly invoke the new confirmation flow, preserving the original copy modes while adding the privacy checkpoint.

@devksingh4 devksingh4 merged commit f076739 into main Nov 13, 2025
11 of 12 checks passed
@devksingh4 devksingh4 deleted the dsingh14/add-copy-warning branch November 13, 2025 08:01
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