Skip to content

refactor(omnichannel): migrate ReturnChatQueueModal to GenericModal#38753

Open
Agarwalchetan wants to merge 3 commits intoRocketChat:developfrom
Agarwalchetan:migrate/return-chat-queue-modal-to-generic-modal
Open

refactor(omnichannel): migrate ReturnChatQueueModal to GenericModal#38753
Agarwalchetan wants to merge 3 commits intoRocketChat:developfrom
Agarwalchetan:migrate/return-chat-queue-modal-to-generic-modal

Conversation

@Agarwalchetan
Copy link
Contributor

@Agarwalchetan Agarwalchetan commented Feb 17, 2026

fixes #38752 Refactor ReturnChatQueueModal to use GenericModal from @rocket.chat/ui-client

Replaces the manually assembled Modal structure in ReturnChatQueueModal with the shared GenericModal component from @rocket.chat/ui-client.

This addresses the existing inline TODO and aligns the component with current modal patterns used elsewhere (e.g., CloseChatModal).


Changes

  • Removed manual usage of:

    • Modal
    • ModalHeader
    • ModalContent
    • ModalFooter
    • ModalIcon
    • ModalTitle
  • Replaced with GenericModal

  • Mapped:

    • Title → title
    • Icon → icon
    • Confirm action → onConfirm
    • Cancel action → onCancel
    • Close action → onClose
    • Confirm button label → confirmText
  • Removed the TODO comment


Notes

  • No behavioral changes.
  • Lint and type checks pass locally.
  • No direct usages of this component found via git grep.

Summary by CodeRabbit

  • Refactor

    • Replaced a custom modal with the app's standard modal component for consistent look and behavior.
    • Simplified the modal's API so confirm/close actions are consistently wired.
  • UI

    • Modal content now uses the centralized translation string; text and action labels align with other dialogs.

Replace hand-assembled Modal, ModalHeader, ModalContent, ModalFooter
layout with GenericModal component from @rocket.chat/ui-client.

Resolves the TODO comment requesting this migration.
@Agarwalchetan Agarwalchetan requested a review from a team as a code owner February 17, 2026 17:21
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Feb 17, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Feb 17, 2026

⚠️ No Changeset found

Latest commit: 18b2502

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

No actionable comments were generated in the recent review. 🎉

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 190e67b and 18b2502.

📒 Files selected for processing (1)
  • apps/meteor/client/views/omnichannel/modals/ReturnChatQueueModal.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/client/views/omnichannel/modals/ReturnChatQueueModal.tsx
⏰ 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 Packages
  • GitHub Check: CodeQL-Build

Walkthrough

Replaced a manual fuselage-based modal layout with GenericModal in the ReturnChatQueueModal component; updated the component signature to destructure onCancel and onMoveChat, wired GenericModal props (title, icon, variant, onConfirm, onCancel, onClose, confirmText), and removed fuselage Modal subcomponents and a TODO.

Changes

Cohort / File(s) Summary
Modal Component Refactoring
apps/meteor/client/views/omnichannel/modals/ReturnChatQueueModal.tsx
Replaced manual Modal + ModalHeader/ModalContent/ModalFooter usage with GenericModal from @rocket.chat/ui-client; removed Modal subcomponents and TODO; updated component signature to ({ onCancel, onMoveChat }: ReturnChatQueueModalProps) and mapped confirm/cancel/close handlers and labels to GenericModal props.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I hopped into code with cheer,
Swapped the parts that once were dear,
One GenericModal now takes the stage,
Clean callbacks bound upon the page,
A little refactor — a joyful cheer!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: migrating ReturnChatQueueModal to GenericModal, which is the primary objective of the changeset.
Linked Issues check ✅ Passed All objectives from issue #38752 are met: manual Modal replaced with GenericModal, modal props mapped correctly, TODO removed, and functionality preserved without behavioral changes.
Out of Scope Changes check ✅ Passed All changes are directly related to the stated objective of migrating ReturnChatQueueModal to GenericModal; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

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: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 508b4a1 and 190e67b.

📒 Files selected for processing (1)
  • apps/meteor/client/views/omnichannel/modals/ReturnChatQueueModal.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/views/omnichannel/modals/ReturnChatQueueModal.tsx
⏰ 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). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
🔇 Additional comments (1)
apps/meteor/client/views/omnichannel/modals/ReturnChatQueueModal.tsx (1)

9-25: Clean migration to GenericModal — looks good.

Props are correctly mapped (onMoveChatonConfirm, onCancel → both onCancel and onClose), the warning variant is appropriate for a destructive-ish confirmation, and the body text is properly translated. This aligns well with the existing modal patterns referenced in the issue.

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/meteor/client/views/omnichannel/modals/ReturnChatQueueModal.tsx`:
- Line 1: The file starts with a Unicode BOM (U+FEFF) before the import which
can break tooling; remove the BOM so the file begins directly with the import
(e.g., "import { GenericModal } from '@rocket.chat/ui-client';"), save the file
as UTF-8 without BOM, and ensure any editor/formatter or commit hook that
touches ReturnChatQueueModal.tsx preserves the no-BOM encoding.

Replace hand-assembled Modal, ModalHeader, ModalContent, ModalFooter
layout with GenericModal component from @rocket.chat/ui-client.

Resolves the TODO comment requesting this migration.
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.49%. Comparing base (508b4a1) to head (18b2502).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #38753      +/-   ##
===========================================
- Coverage    70.51%   70.49%   -0.02%     
===========================================
  Files         3176     3176              
  Lines       111139   111139              
  Branches     20050    20073      +23     
===========================================
- Hits         78367    78347      -20     
- Misses       30721    30749      +28     
+ Partials      2051     2043       -8     
Flag Coverage Δ
e2e 60.35% <100.00%> (-0.13%) ⬇️
e2e-api 47.73% <ø> (-0.04%) ⬇️
unit 71.54% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Refactor ReturnChatQueueModal to use GenericModal from @rocket.chat/ui-client

1 participant