Skip to content

fix(call-control): implement-mute-unmute-actions#492

Merged
adhmenon merged 10 commits into
webex:ccwidgetsfrom
akulakum:CALL_MUTE_UNMUTE
Jul 15, 2025
Merged

fix(call-control): implement-mute-unmute-actions#492
adhmenon merged 10 commits into
webex:ccwidgetsfrom
akulakum:CALL_MUTE_UNMUTE

Conversation

@akulakum

@akulakum akulakum commented Jul 7, 2025

Copy link
Copy Markdown
Contributor

COMPLETES #https://jira-eng-sjc12.cisco.com/jira/browse/CAI-6761

Vidcast link: https://app.vidcast.io/share/614a17e8-69dd-407f-affd-e101361083a3

This pull request addresses

Implemented Mute Button for WebRTC Calls (Desktop Mode Only)

  • Added a mute button that will be displayed only during WebRTC calls.
  • The mute button is available only in desktop mode as per design requirements.
  • Ensured the mute state is maintained consistently across both customer and consult call flows.

by making the following changes

< DESCRIBE YOUR CHANGES >

Screenshot 2025-07-08 at 10 55 48 AM Screenshot 2025-07-08 at 10 56 03 AM

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

  • The testing is done with the amplify link
    During testing, we encountered a known audio-related issue in the consult flow. Two-way audio is not functioning correctly — the agent initiating the consult can hear audio without issues, but the receiving agent does not get any audio. Apart from this, all other flows are working as expected.

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

Checklist before merging

  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the testing document

@coderabbitai

coderabbitai Bot commented Jul 7, 2025

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

This change set introduces mute/unmute functionality across the contact center application's call control components and supporting infrastructure. New boolean state properties and callback handlers for mute toggling are added to the store, React components, and type definitions. The UI is updated to include a mute/unmute button with dynamic icon, tooltip, and disabled state, and corresponding CSS styles for its appearance and states. The mute state is managed via MobX in the store, with new methods and event handling to reset or update mute status based on task and device context. The useCallControl hook is extended to implement toggle logic, error handling, and callback invocation. Comprehensive tests are added for the new mute/unmute logic, and the sample app is updated to handle mute toggle events. No existing behaviors are removed or altered.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@aws-amplify-us-east-2

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-492.d1b38q61t1z947.amplifyapp.com

@adhmenon adhmenon added validated Indicates that the PR is ready for actions run_e2e Add this label to run E2E test for meeting and CC widgets labels Jul 8, 2025
@adhmenon

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 14, 2025

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 0

🧹 Nitpick comments (4)
packages/contact-center/cc-components/src/components/task/CallControl/CallControlCustom/call-control-consult.tsx (1)

59-76: Fix the module name in error logging.

The mute toggle handler is well-implemented with proper error handling and UI state management. However, there's an inconsistency in the error logging.

      logger.error('Mute toggle failed:', {
        error,
-       module: 'call-control.tsx',
+       module: 'call-control-consult.tsx',
        method: 'handleMuteToggle',
      });

The rest of the implementation correctly:

  • Disables the button immediately to prevent rapid clicks
  • Handles errors gracefully with logging
  • Re-enables the button after 500ms regardless of success/failure
packages/contact-center/store/src/storeEventsWrapper.ts (1)

399-407: Implementation looks good for auto-unmuting WebRTC calls.

The method correctly identifies WebRTC telephony tasks and ensures they start unmuted. The placement after the incoming task callback is appropriate.

Consider adding a user preference setting in the future to allow agents to choose their default mute state for new calls.

Also applies to: 529-529

packages/contact-center/task/src/helper.ts (1)

431-470: Excellent implementation of the toggleMute functionality!

The method properly handles:

  • Control visibility validation
  • Async SDK calls with proper state management
  • Error handling that maintains state consistency
  • Optional callback invocation in both success and error cases

Consider making the warning message more generic:

-      logger.warn('Mute only available for voice tasks', {module: 'useCallControl', method: 'toggleMute'});
+      logger.warn('Mute control not available', {module: 'useCallControl', method: 'toggleMute'});
packages/contact-center/cc-components/src/components/task/CallControl/call-control.tsx (1)

90-107: Good UX pattern for preventing rapid clicks.

The immediate button disable and delayed re-enable prevents UI issues. However, consider providing user feedback on errors.

Consider showing a toast notification or other user feedback when the mute operation fails:

    } catch (error) {
      logger.error('Mute toggle failed:', {
        error,
        module: 'call-control.tsx',
        method: 'handleMuteToggle',
      });
+     // TODO: Show error notification to user
    }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f0dd79a and 8823c5b.

📒 Files selected for processing (15)
  • packages/contact-center/cc-components/src/components/task/CallControl/CallControlCustom/call-control-consult.tsx (3 hunks)
  • packages/contact-center/cc-components/src/components/task/CallControl/call-control.styles.scss (1 hunks)
  • packages/contact-center/cc-components/src/components/task/CallControl/call-control.tsx (3 hunks)
  • packages/contact-center/cc-components/src/components/task/CallControlCAD/call-control-cad.tsx (2 hunks)
  • packages/contact-center/cc-components/src/components/task/constants.ts (1 hunks)
  • packages/contact-center/cc-components/src/components/task/task.types.ts (5 hunks)
  • packages/contact-center/store/src/store.ts (1 hunks)
  • packages/contact-center/store/src/store.types.ts (3 hunks)
  • packages/contact-center/store/src/storeEventsWrapper.ts (6 hunks)
  • packages/contact-center/task/src/CallControl/index.tsx (3 hunks)
  • packages/contact-center/task/src/CallControlCAD/index.tsx (3 hunks)
  • packages/contact-center/task/src/helper.ts (3 hunks)
  • packages/contact-center/task/src/task.types.ts (2 hunks)
  • packages/contact-center/task/tests/helper.ts (3 hunks)
  • widgets-samples/cc/samples-cc-react-app/src/App.tsx (3 hunks)
🧰 Additional context used
🧠 Learnings (14)
📓 Common learnings
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/index.tsx:10-10
Timestamp: 2025-02-13T06:58:01.805Z
Learning: In the StationLogin component (packages/contact-center/station-login/src/station-login/index.tsx), `handleContinue` and `showMultipleLoginAlert` props have been intentionally removed from store destructuring as part of the Agent Multi-Login configurability changes.
Learnt from: mkesavan13
PR: webex/widgets#347
File: packages/contact-center/user-state/src/helper.ts:10-19
Timestamp: 2024-12-06T01:07:12.444Z
Learning: In `packages/contact-center/user-state/src/helper.ts`, within the `useUserState` hook, the timer reset in the `useEffect` hook is handled during the state change success. Therefore, modifying the dependency array is unnecessary.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:44:14.152Z
Learning: The file `packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx` is going to change completely, so writing tests for these changes are being ignored.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/src/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:45:03.435Z
Learning: In `packages/contact-center/station-login/src/station-login/station-login.presentational.tsx`, certain code sections are temporary or removable, and comments regarding these sections can be ignored in future reviews.
packages/contact-center/task/src/CallControl/index.tsx (5)
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/index.tsx:10-10
Timestamp: 2025-02-13T06:58:01.805Z
Learning: In the StationLogin component (packages/contact-center/station-login/src/station-login/index.tsx), `handleContinue` and `showMultipleLoginAlert` props have been intentionally removed from store destructuring as part of the Agent Multi-Login configurability changes.
Learnt from: mkesavan13
PR: webex/widgets#347
File: packages/contact-center/user-state/src/helper.ts:10-19
Timestamp: 2024-12-06T01:07:12.444Z
Learning: In `packages/contact-center/user-state/src/helper.ts`, within the `useUserState` hook, the timer reset in the `useEffect` hook is handled during the state change success. Therefore, modifying the dependency array is unnecessary.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/src/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:45:03.435Z
Learning: In `packages/contact-center/station-login/src/station-login/station-login.presentational.tsx`, certain code sections are temporary or removable, and comments regarding these sections can be ignored in future reviews.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:44:14.152Z
Learning: The file `packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx` is going to change completely, so writing tests for these changes are being ignored.
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/station-login.types.ts:129-132
Timestamp: 2025-02-13T06:59:01.103Z
Learning: In the station-login component's type definitions, it's acceptable for `UseStationLoginProps` to have a subset of props (`cc`, `onLogin`, `onLogout`, `logger`, `isAgentLoggedIn`) compared to `IStationLoginProps` and `StationLoginPresentationalProps`, even if properties like `handleContinue` and `showMultipleLoginAlert` exist in the latter interfaces.
packages/contact-center/store/src/store.types.ts (2)
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/index.tsx:10-10
Timestamp: 2025-02-13T06:58:01.805Z
Learning: In the StationLogin component (packages/contact-center/station-login/src/station-login/index.tsx), `handleContinue` and `showMultipleLoginAlert` props have been intentionally removed from store destructuring as part of the Agent Multi-Login configurability changes.
Learnt from: mkesavan13
PR: webex/widgets#453
File: widgets-samples/cc/samples-cc-wc-app/app.js:57-98
Timestamp: 2025-05-13T06:51:13.155Z
Learning: In the widgets-samples/cc/samples-cc-wc-app application, the Webex object is provided by an external SDK script loaded in the HTML file, and JavaScript functions in app.js may be called by HTML elements even if static analysis can't detect this relationship.
packages/contact-center/cc-components/src/components/task/CallControl/call-control.styles.scss (1)
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/src/station-login/styles.module.scss:0-0
Timestamp: 2024-11-19T13:35:53.226Z
Learning: The code in 'packages/contact-center/station-login/src/station-login/styles.module.scss' is temporary and is going to be removed.
packages/contact-center/cc-components/src/components/task/CallControlCAD/call-control-cad.tsx (5)
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/index.tsx:10-10
Timestamp: 2025-02-13T06:58:01.805Z
Learning: In the StationLogin component (packages/contact-center/station-login/src/station-login/index.tsx), `handleContinue` and `showMultipleLoginAlert` props have been intentionally removed from store destructuring as part of the Agent Multi-Login configurability changes.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/src/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:45:03.435Z
Learning: In `packages/contact-center/station-login/src/station-login/station-login.presentational.tsx`, certain code sections are temporary or removable, and comments regarding these sections can be ignored in future reviews.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:44:14.152Z
Learning: The file `packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx` is going to change completely, so writing tests for these changes are being ignored.
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/station-login.types.ts:129-132
Timestamp: 2025-02-13T06:59:01.103Z
Learning: In the station-login component's type definitions, it's acceptable for `UseStationLoginProps` to have a subset of props (`cc`, `onLogin`, `onLogout`, `logger`, `isAgentLoggedIn`) compared to `IStationLoginProps` and `StationLoginPresentationalProps`, even if properties like `handleContinue` and `showMultipleLoginAlert` exist in the latter interfaces.
Learnt from: mkesavan13
PR: webex/widgets#347
File: packages/contact-center/user-state/src/helper.ts:10-19
Timestamp: 2024-12-06T01:07:12.444Z
Learning: In `packages/contact-center/user-state/src/helper.ts`, within the `useUserState` hook, the timer reset in the `useEffect` hook is handled during the state change success. Therefore, modifying the dependency array is unnecessary.
packages/contact-center/task/src/CallControlCAD/index.tsx (5)
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/index.tsx:10-10
Timestamp: 2025-02-13T06:58:01.805Z
Learning: In the StationLogin component (packages/contact-center/station-login/src/station-login/index.tsx), `handleContinue` and `showMultipleLoginAlert` props have been intentionally removed from store destructuring as part of the Agent Multi-Login configurability changes.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/src/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:45:03.435Z
Learning: In `packages/contact-center/station-login/src/station-login/station-login.presentational.tsx`, certain code sections are temporary or removable, and comments regarding these sections can be ignored in future reviews.
Learnt from: mkesavan13
PR: webex/widgets#347
File: packages/contact-center/user-state/src/helper.ts:10-19
Timestamp: 2024-12-06T01:07:12.444Z
Learning: In `packages/contact-center/user-state/src/helper.ts`, within the `useUserState` hook, the timer reset in the `useEffect` hook is handled during the state change success. Therefore, modifying the dependency array is unnecessary.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:44:14.152Z
Learning: The file `packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx` is going to change completely, so writing tests for these changes are being ignored.
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/station-login.types.ts:129-132
Timestamp: 2025-02-13T06:59:01.103Z
Learning: In the station-login component's type definitions, it's acceptable for `UseStationLoginProps` to have a subset of props (`cc`, `onLogin`, `onLogout`, `logger`, `isAgentLoggedIn`) compared to `IStationLoginProps` and `StationLoginPresentationalProps`, even if properties like `handleContinue` and `showMultipleLoginAlert` exist in the latter interfaces.
packages/contact-center/task/src/helper.ts (2)
Learnt from: mkesavan13
PR: webex/widgets#347
File: packages/contact-center/user-state/src/helper.ts:10-19
Timestamp: 2024-12-06T01:07:12.444Z
Learning: In `packages/contact-center/user-state/src/helper.ts`, within the `useUserState` hook, the timer reset in the `useEffect` hook is handled during the state change success. Therefore, modifying the dependency array is unnecessary.
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/index.tsx:10-10
Timestamp: 2025-02-13T06:58:01.805Z
Learning: In the StationLogin component (packages/contact-center/station-login/src/station-login/index.tsx), `handleContinue` and `showMultipleLoginAlert` props have been intentionally removed from store destructuring as part of the Agent Multi-Login configurability changes.
packages/contact-center/cc-components/src/components/task/constants.ts (1)
Learnt from: Riteshfyi
PR: webex/widgets#485
File: playwright/Utils/wrapupUtils.ts:22-22
Timestamp: 2025-07-05T20:59:40.600Z
Learning: In the @webex/widgets repository, test IDs for wrap-up reasons are constructed using lowercase in both the UI components (call-control.tsx) and utility functions (wrapupUtils.ts). The pattern `wrapup-reason-${reason.toLowerCase()}` is used consistently, so there are no case sensitivity issues with test ID matching.
packages/contact-center/task/src/task.types.ts (3)
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/index.tsx:10-10
Timestamp: 2025-02-13T06:58:01.805Z
Learning: In the StationLogin component (packages/contact-center/station-login/src/station-login/index.tsx), `handleContinue` and `showMultipleLoginAlert` props have been intentionally removed from store destructuring as part of the Agent Multi-Login configurability changes.
Learnt from: mkesavan13
PR: webex/widgets#347
File: packages/contact-center/user-state/src/helper.ts:10-19
Timestamp: 2024-12-06T01:07:12.444Z
Learning: In `packages/contact-center/user-state/src/helper.ts`, within the `useUserState` hook, the timer reset in the `useEffect` hook is handled during the state change success. Therefore, modifying the dependency array is unnecessary.
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/station-login.types.ts:129-132
Timestamp: 2025-02-13T06:59:01.103Z
Learning: In the station-login component's type definitions, it's acceptable for `UseStationLoginProps` to have a subset of props (`cc`, `onLogin`, `onLogout`, `logger`, `isAgentLoggedIn`) compared to `IStationLoginProps` and `StationLoginPresentationalProps`, even if properties like `handleContinue` and `showMultipleLoginAlert` exist in the latter interfaces.
packages/contact-center/task/tests/helper.ts (7)
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:44:14.152Z
Learning: The file `packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx` is going to change completely, so writing tests for these changes are being ignored.
Learnt from: mkesavan13
PR: webex/widgets#347
File: packages/contact-center/user-state/src/helper.ts:10-19
Timestamp: 2024-12-06T01:07:12.444Z
Learning: In `packages/contact-center/user-state/src/helper.ts`, within the `useUserState` hook, the timer reset in the `useEffect` hook is handled during the state change success. Therefore, modifying the dependency array is unnecessary.
Learnt from: Shreyas281299
PR: webex/widgets#362
File: packages/contact-center/task/tests/CallControl/call-control.presentational.tsx:0-0
Timestamp: 2025-01-20T09:52:20.775Z
Learning: UI testing is not mandatory for React components in the webex/widgets repository.
Learnt from: Riteshfyi
PR: webex/widgets#485
File: playwright/Utils/incomingTaskUtils.ts:137-137
Timestamp: 2025-07-05T21:10:16.104Z
Learning: Social task automation is not yet implemented in the playwright/Utils/incomingTaskUtils.ts file. The code for TASK_TYPES.SOCIAL is placeholder code that will be updated when social task automation is added to the system.
Learnt from: Riteshfyi
PR: webex/widgets#485
File: playwright/incoming-task-test.spec.ts:0-0
Timestamp: 2025-07-05T21:10:46.832Z
Learning: In the webex-widgets project, test setup functions like pageSetup() in playwright test files are acceptable to keep as comprehensive sequential functions even if they are long, when they primarily consist of checks and function calls. Breaking them down into smaller functions may be unnecessary abstraction for test code.
Learnt from: Shreyas281299
PR: webex/widgets#362
File: packages/contact-center/task/tests/CallControl/index.tsx:29-46
Timestamp: 2025-01-20T09:52:57.754Z
Learning: UI testing is not mandatory for components in the @webex/widgets repository. Focus should be on functional testing rather than UI element verification.
Learnt from: mkesavan13
PR: webex/widgets#453
File: widgets-samples/cc/samples-cc-wc-app/app.js:57-98
Timestamp: 2025-05-13T06:51:13.155Z
Learning: In the widgets-samples/cc/samples-cc-wc-app application, the Webex object is provided by an external SDK script loaded in the HTML file, and JavaScript functions in app.js may be called by HTML elements even if static analysis can't detect this relationship.
packages/contact-center/cc-components/src/components/task/CallControl/call-control.tsx (4)
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/index.tsx:10-10
Timestamp: 2025-02-13T06:58:01.805Z
Learning: In the StationLogin component (packages/contact-center/station-login/src/station-login/index.tsx), `handleContinue` and `showMultipleLoginAlert` props have been intentionally removed from store destructuring as part of the Agent Multi-Login configurability changes.
Learnt from: mkesavan13
PR: webex/widgets#347
File: packages/contact-center/user-state/src/helper.ts:10-19
Timestamp: 2024-12-06T01:07:12.444Z
Learning: In `packages/contact-center/user-state/src/helper.ts`, within the `useUserState` hook, the timer reset in the `useEffect` hook is handled during the state change success. Therefore, modifying the dependency array is unnecessary.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/src/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:45:03.435Z
Learning: In `packages/contact-center/station-login/src/station-login/station-login.presentational.tsx`, certain code sections are temporary or removable, and comments regarding these sections can be ignored in future reviews.
Learnt from: Riteshfyi
PR: webex/widgets#485
File: playwright/Utils/wrapupUtils.ts:22-22
Timestamp: 2025-07-05T20:59:40.600Z
Learning: In the @webex/widgets repository, test IDs for wrap-up reasons are constructed using lowercase in both the UI components (call-control.tsx) and utility functions (wrapupUtils.ts). The pattern `wrapup-reason-${reason.toLowerCase()}` is used consistently, so there are no case sensitivity issues with test ID matching.
widgets-samples/cc/samples-cc-react-app/src/App.tsx (3)
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/index.tsx:10-10
Timestamp: 2025-02-13T06:58:01.805Z
Learning: In the StationLogin component (packages/contact-center/station-login/src/station-login/index.tsx), `handleContinue` and `showMultipleLoginAlert` props have been intentionally removed from store destructuring as part of the Agent Multi-Login configurability changes.
Learnt from: mkesavan13
PR: webex/widgets#347
File: packages/contact-center/user-state/src/helper.ts:10-19
Timestamp: 2024-12-06T01:07:12.444Z
Learning: In `packages/contact-center/user-state/src/helper.ts`, within the `useUserState` hook, the timer reset in the `useEffect` hook is handled during the state change success. Therefore, modifying the dependency array is unnecessary.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/src/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:45:03.435Z
Learning: In `packages/contact-center/station-login/src/station-login/station-login.presentational.tsx`, certain code sections are temporary or removable, and comments regarding these sections can be ignored in future reviews.
packages/contact-center/cc-components/src/components/task/CallControl/CallControlCustom/call-control-consult.tsx (4)
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/index.tsx:10-10
Timestamp: 2025-02-13T06:58:01.805Z
Learning: In the StationLogin component (packages/contact-center/station-login/src/station-login/index.tsx), `handleContinue` and `showMultipleLoginAlert` props have been intentionally removed from store destructuring as part of the Agent Multi-Login configurability changes.
Learnt from: mkesavan13
PR: webex/widgets#347
File: packages/contact-center/user-state/src/helper.ts:10-19
Timestamp: 2024-12-06T01:07:12.444Z
Learning: In `packages/contact-center/user-state/src/helper.ts`, within the `useUserState` hook, the timer reset in the `useEffect` hook is handled during the state change success. Therefore, modifying the dependency array is unnecessary.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/src/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:45:03.435Z
Learning: In `packages/contact-center/station-login/src/station-login/station-login.presentational.tsx`, certain code sections are temporary or removable, and comments regarding these sections can be ignored in future reviews.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:44:14.152Z
Learning: The file `packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx` is going to change completely, so writing tests for these changes are being ignored.
packages/contact-center/store/src/storeEventsWrapper.ts (5)
Learnt from: pagour98
PR: webex/widgets#385
File: packages/contact-center/station-login/src/station-login/index.tsx:10-10
Timestamp: 2025-02-13T06:58:01.805Z
Learning: In the StationLogin component (packages/contact-center/station-login/src/station-login/index.tsx), `handleContinue` and `showMultipleLoginAlert` props have been intentionally removed from store destructuring as part of the Agent Multi-Login configurability changes.
Learnt from: mkesavan13
PR: webex/widgets#347
File: packages/contact-center/user-state/src/helper.ts:10-19
Timestamp: 2024-12-06T01:07:12.444Z
Learning: In `packages/contact-center/user-state/src/helper.ts`, within the `useUserState` hook, the timer reset in the `useEffect` hook is handled during the state change success. Therefore, modifying the dependency array is unnecessary.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/src/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:45:03.435Z
Learning: In `packages/contact-center/station-login/src/station-login/station-login.presentational.tsx`, certain code sections are temporary or removable, and comments regarding these sections can be ignored in future reviews.
Learnt from: Kesari3008
PR: webex/widgets#239
File: packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx:0-0
Timestamp: 2024-11-19T13:44:14.152Z
Learning: The file `packages/contact-center/station-login/tests/station-login/station-login.presentational.tsx` is going to change completely, so writing tests for these changes are being ignored.
Learnt from: Riteshfyi
PR: webex/widgets#485
File: playwright/Utils/incomingTaskUtils.ts:137-137
Timestamp: 2025-07-05T21:10:16.104Z
Learning: Social task automation is not yet implemented in the playwright/Utils/incomingTaskUtils.ts file. The code for TASK_TYPES.SOCIAL is placeholder code that will be updated when social task automation is added to the system.
🧬 Code Graph Analysis (3)
packages/contact-center/cc-components/src/components/task/CallControlCAD/call-control-cad.tsx (1)
packages/contact-center/store/src/storeEventsWrapper.ts (1)
  • isMuted (152-154)
packages/contact-center/task/src/helper.ts (1)
packages/contact-center/store/src/storeEventsWrapper.ts (3)
  • logger (48-50)
  • isMuted (152-154)
  • currentTask (74-76)
packages/contact-center/cc-components/src/components/task/CallControl/CallControlCustom/call-control-consult.tsx (1)
packages/contact-center/cc-components/src/components/task/constants.ts (2)
  • UNMUTE_CALL (17-17)
  • MUTE_CALL (16-16)
🔇 Additional comments (31)
packages/contact-center/store/src/store.ts (1)

54-54: LGTM! Clean addition of mute state to store.

The isMuted property is properly added to the observable store with a sensible default value of false (unmuted). This follows the existing patterns in the store class.

widgets-samples/cc/samples-cc-react-app/src/App.tsx (2)

186-189: LGTM! Callback handler follows established patterns.

The onToggleMute callback correctly logs the mute state and task information, which is appropriate for a sample app demonstrating the functionality.


745-745: LGTM! Consistent prop passing to call control components.

The onToggleMute prop is correctly passed to both CallControl and CallControlCAD components, ensuring consistent mute functionality across different call control implementations.

Also applies to: 762-762

packages/contact-center/task/src/CallControlCAD/index.tsx (2)

15-15: LGTM! Proper integration of mute functionality.

The onToggleMute prop and isMuted state are correctly added to the component, following the same pattern as other callback props and store state properties.

Also applies to: 32-32


41-41: LGTM! Consistent prop passing to useCallControl hook.

The mute-related props are properly passed to the useCallControl hook, maintaining consistency with how other similar props are handled in this component.

Also applies to: 46-46

packages/contact-center/cc-components/src/components/task/constants.ts (1)

16-17: LGTM! Clean addition of mute-related constants.

The MUTE_CALL and UNMUTE_CALL constants follow the established naming convention and provide clear, user-friendly text for the mute functionality.

packages/contact-center/task/src/CallControl/index.tsx (2)

10-10: LGTM! Consistent mute functionality integration.

The onToggleMute prop and isMuted state are correctly added to the component, maintaining consistency with the CallControlCAD component and following established patterns.

Also applies to: 24-24


34-34: LGTM! Proper hook parameter integration.

The mute-related props are correctly passed to the useCallControl hook, ensuring the mute functionality is properly integrated into the call control logic.

Also applies to: 39-39

packages/contact-center/task/src/task.types.ts (2)

11-20: LGTM! Type definitions correctly extended for mute functionality.

The addition of onToggleMute to CallControlProps and both onToggleMute and isMuted to useCallControlProps properly supports the new mute/unmute feature. The multiline formatting also improves readability.


22-35: LGTM! Hook props type correctly includes mute state and callback.

The useCallControlProps type properly includes both the isMuted boolean state and onToggleMute callback, enabling the hook to manage mute functionality.

packages/contact-center/store/src/store.types.ts (3)

72-72: LGTM! Store interface correctly extended with mute state.

The isMuted boolean property appropriately represents the global mute state in the store.


97-97: LGTM! Store wrapper interface correctly includes mute state setter.

The setIsMuted(value: boolean): void method provides proper controlled access to update the mute state within the MobX store wrapper.


130-130: LGTM! New task event constant for consult offer.

The TASK_OFFER_CONSULT event constant provides a proper event identifier for consult offer handling.

packages/contact-center/cc-components/src/components/task/CallControlCAD/call-control-cad.tsx (2)

44-46: LGTM! Props correctly extended for mute functionality.

The isMuted boolean and toggleMute callback props are properly destructured and will enable mute control in the CAD component.


212-215: LGTM! Mute props properly passed to consult component.

The mute-related props are correctly passed to CallControlConsultComponent with appropriate mapping:

  • muteUnmute from controlVisibility.muteUnmute for visibility control
  • isMuted for current mute state
  • onToggleConsultMute mapped from toggleMute callback
packages/contact-center/cc-components/src/components/task/CallControl/call-control.styles.scss (1)

140-169: LGTM! Mute button styles properly implemented.

The new CSS classes for the muted button state are well-structured and follow the existing design patterns:

  • Consistent sizing and layout with other call control buttons
  • Appropriate use of design tokens for colors and spacing
  • Error-themed icon color for muted state visibility
  • Proper disabled state handling with opacity and cursor changes

The styles correctly support the mute/unmute functionality with clear visual feedback.

packages/contact-center/cc-components/src/components/task/CallControl/CallControlCustom/call-control-consult.tsx (5)

1-1: LGTM! useState import correctly added for mute state management.

The useState import is properly added to support the local isMuteDisabled state needed for the mute button functionality.


4-4: LGTM! Constants properly imported for mute button tooltips.

The MUTE_CALL and UNMUTE_CALL constants from the relevant code snippets (packages/contact-center/cc-components/src/components/task/constants.ts lines 16-17) are correctly imported for use in button tooltips.


17-20: LGTM! Props correctly extended for mute functionality.

The new props muteUnmute, isMuted, and onToggleConsultMute are properly destructured and provide the necessary interface for mute control in the consult component.


21-21: LGTM! Local state for mute button disable logic.

The isMuteDisabled state using useState provides proper UI feedback by temporarily disabling the mute button during toggle operations.


79-87: LGTM! Mute button configuration properly implemented.

The mute button configuration is well-structured with:

  • Dynamic icon based on mute state (microphone-muted-bold vs microphone-bold)
  • Dynamic tooltip using the imported constants
  • Proper CSS class based on mute state
  • Correct disabled state binding
  • Proper visibility control via muteUnmute prop
packages/contact-center/store/src/storeEventsWrapper.ts (2)

152-160: LGTM! Proper implementation of mute state management.

The getter and setter follow the established pattern in this file and correctly use MobX's runInAction for state updates.


369-369: Good catch! Fixing incorrect event constant usage.

The change from CC_EVENTS.AGENT_OFFER_CONSULT to TASK_EVENTS.TASK_OFFER_CONSULT correctly aligns the event handling with the appropriate event enumeration for task-related consult offers.

Also applies to: 520-520, 579-579

packages/contact-center/task/src/helper.ts (1)

619-620: Correctly exposes mute functionality from the hook.

The toggleMute function and isMuted state are properly added to the hook's return value.

packages/contact-center/cc-components/src/components/task/CallControl/call-control.tsx (1)

178-186: Well-configured mute button with dynamic states.

The button properly handles:

  • Dynamic icon switching between muted/unmuted states
  • Appropriate tooltip text changes
  • Visual feedback through CSS classes
  • Visibility control based on feature availability
packages/contact-center/task/tests/helper.ts (1)

1-7: Excellent test coverage for the mute functionality!

The test suite comprehensively covers:

  • ✅ State transitions (muted ↔ unmuted)
  • ✅ Error handling with state consistency
  • ✅ Callback behavior (with and without)
  • ✅ Edge cases (rapid calls, undefined visibility)
  • ✅ Proper mock setup and assertions

Great attention to detail in testing both success and failure paths.

Also applies to: 1902-2136

packages/contact-center/cc-components/src/components/task/task.types.ts (5)

152-158: LGTM! Well-structured callback interface following established patterns.

The onToggleMute callback follows the same pattern as existing callbacks like onHoldResume and onRecordingToggle, with proper JSDoc documentation, consistent parameter structure, and appropriate return type.


202-205: LGTM! Consistent method signature with other toggle methods.

The toggleMute method follows the same pattern as toggleHold and toggleRecording, maintaining consistency in the interface design.


246-249: LGTM! Boolean flag follows established naming convention.

The isMuted flag is consistent with existing boolean state properties like isHeld and isRecording, maintaining a clear and predictable naming pattern.


420-421: LGTM! Proper extension of component props with mute functionality.

The addition of toggleMute and isMuted to the CallControlComponentProps type correctly extends the interface to support mute functionality in call control components.


519-521: LGTM! Comprehensive mute support for consult call components.

The additions to CallControlConsultComponentsProps properly include:

  • muteUnmute: visibility control for the mute button
  • isMuted: current mute state
  • onToggleConsultMute: callback for mute toggling in consult scenarios

This provides complete mute functionality for consult call flows.

Comment thread packages/contact-center/store/src/storeEventsWrapper.ts Outdated
Comment thread packages/contact-center/task/src/CallControlCAD/index.tsx
Comment thread packages/contact-center/task/src/helper.ts Outdated
Comment thread packages/contact-center/task/src/task.types.ts
Comment thread widgets-samples/cc/samples-cc-react-app/src/App.tsx Outdated
@@ -1,9 +1,20 @@
jest.mock('../src/Utils/task-util', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can remove all comments that are not required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed all unnecessary comments

@adhmenon
adhmenon merged commit ba70164 into webex:ccwidgets Jul 15, 2025
12 of 16 checks passed
github-actions Bot pushed a commit that referenced this pull request Jul 15, 2025
# [1.28.0-ccwidgets.92](v1.28.0-ccwidgets.91...v1.28.0-ccwidgets.92) (2025-07-15)

### Bug Fixes

* **call-control:** implement-mute-unmute-actions ([#492](#492)) ([ba70164](ba70164))
@sreenara

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.28.0-ccwidgets.92 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released on @ccwidgets run_e2e Add this label to run E2E test for meeting and CC widgets validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants