Skip to content

fix(store): update task-refactor with latest next 27th May#688

Open
Shreyas281299 wants to merge 31 commits into
webex:task-refactorfrom
Shreyas281299:next-in-task-refactor
Open

fix(store): update task-refactor with latest next 27th May#688
Shreyas281299 wants to merge 31 commits into
webex:task-refactorfrom
Shreyas281299:next-in-task-refactor

Conversation

@Shreyas281299

@Shreyas281299 Shreyas281299 commented May 27, 2026

Copy link
Copy Markdown
Contributor

COMPLETES #N/A

This pull request addresses

This PR brings the task-refactor branch up to date with the latest next changes and completes the Contact Center task-refactor work needed for campaign preview support. It addresses campaign preview task visibility, reserved/engaged state handling, incoming notification dismissal, campaign timer consistency, campaign call control visibility, hydrate behavior, wrap-up handling, and supporting task UI updates.

by making the following changes

  • Adds campaign preview task UI support, including campaign list items, popover, countdown, error dialog, and campaign variable/global variable rendering.
  • Updates TaskList and IncomingTask behavior so campaign previews appear in the correct surface, show handle time in the task list, and show time-left in incoming notifications.
  • Updates store task-event handling for campaign preview reservation, accepted campaign tracking, task assignment callbacks, hydrate behavior, and task list refreshes.
  • Updates CallControl and CallControlCAD behavior for campaign preview acceptance, wrap-up, UI controls, CAD layout, and transcript-related task surfaces.
  • Adds and updates unit tests, snapshots, task types, exports, and ai-docs for the task-refactor/contact-center widget changes.

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
  • Verified campaign preview notifications render in the task list.
  • Verified campaign preview reservation shows the agent state as Reserved.
  • Verified campaign preview task list uses handle-time while incoming notifications use time-left.
  • Verified CallControl renders without the deviceType reference error.
  • Verified campaign CallControl does not appear before the campaign preview is accepted.
  • Verified campaign wrap-up controls are shown after the campaign call ends when wrap-up is required.
  • Verified refresh/hydrate behavior shows only the new incoming campaign preview instead of duplicating an already accepted preview.
  • Verified incoming notifications are removed from the sample app after the answer/assigned flow.
  • Focused unit coverage was updated for impacted task, campaign, countdown, incoming task, task list, call control, and real-time transcript paths.
  • Local full workspace validation is currently blocked by the existing @webex/event-dictionary-ts type/dependency resolution issue.

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
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify: Cursor AI assistance
  • 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
  • I have tested the functionality with amplify link

Make sure to have followed the contributing guidelines before submitting.

riteshfyi and others added 21 commits March 31, 2026 09:22
…able releases (webex#661)

Co-authored-by: Bharath Balan <62698609+bhabalan@users.noreply.github.com>
Co-authored-by: Kesava Krishnan Madavan <mkesavan13@gmail.com>
Co-authored-by: Shreyas Sharma <shreyassharma9912@gmail.com>
Co-authored-by: Shreyas Sharma <72344404+Shreyas281299@users.noreply.github.com>
Co-authored-by: molker <molker@cisco.com>
Co-authored-by: Kesava Krishnan Madavan <mkesavan13@gmail.com>
Co-authored-by: ciscoRankush <ciscoRankush@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Rankush Kumar <rankkuma+cisco@cisco.com>
…coverage, and bug-fix pipeline (webex#636)

Co-authored-by: Kesava Krishnan Madavan <mkesavan13@gmail.com>
…on [PSIRT-0974799192] (webex#676)

Co-authored-by: Bharath Balan <62698609+bhabalan@users.noreply.github.com>
Co-authored-by: Christina Mullen <chrmulle@cisco.com>
Co-authored-by: Matthew Olker <molker@cisco.com>
@Shreyas281299 Shreyas281299 requested a review from a team as a code owner May 27, 2026 09:15

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b68e6448d8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Inbound: ani = caller's number, dn = entry point dialed by caller
// Outdial: ani = agent's originating number (entry point), dn = customer's dialed number
const outboundType = currentTask?.data?.interaction?.outboundType;
const callerNumber = getCallerIdentifier(ani, dn, outboundType);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Declare dn before deriving caller number

This new call passes dn into getCallerIdentifier, but dn is never declared in CallControlCADComponent. Any build of cc-components that type-checks this file will fail with an unresolved identifier before the widget can be published.

Useful? React with 👍 / 👎.

CallControlComponentProps,
CallAssociatedDataMap,
getCallerIdentifier,
CallAssociatedDataMap,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove the duplicate imported symbol

CallAssociatedDataMap is now listed twice in the same import declaration, which creates a duplicate local binding and blocks TypeScript/Babel parsing of this module. Please keep a single import for each symbol before shipping this change.

Useful? React with 👍 / 👎.

return liveTranscriptEntries;
}

return transcriptLines.map((line) => mapTranscriptLineToEntry(line, currentTaskId));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Scope transcript rows to the active task

When an agent switches from one active task to another, store.realtimeTranscriptionData is not cleared by setCurrentTask, and this hook maps every stored transcript line to whatever currentTaskId is currently selected. That makes live transcript text from the previous call appear under the newly selected task until the old task is removed; filter/store transcript data by interaction/conversation before rendering it.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ffb2ebfd68

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +33 to +34
deviceType,
featureFlags,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove undefined call-control options

When CallControlInternal renders, these shorthand properties read deviceType and featureFlags, but neither name is declared in this module or destructured from store. That makes the widget fail to compile (or throw a ReferenceError before reaching the current-task guard in non-typechecked builds); these values are not part of useCallControlProps, so drop them or define them before passing props.

Useful? React with 👍 / 👎.

Comment on lines +43 to +44
deviceType,
featureFlags,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove undefined CAD call-control options

When CallControlCADInternal renders, these shorthand properties reference deviceType and featureFlags, but this file never declares them or pulls them from store. That blocks the task package build (or throws at render time before the null-task guard in non-typechecked builds); since useCallControl does not consume these props, remove them or explicitly define them.

Useful? React with 👍 / 👎.

Comment on lines +24 to +32
export function isCampaignPreviewTask(task: ITask): boolean {
const interaction = task.data?.interaction;
if (!interaction) return false;
const outboundType = interaction.outboundType ?? '';
const cpd = interaction.callProcessingDetails as unknown as CampaignCallProcessingDetails;
const campaignType = cpd?.campaignType ?? '';

return (
CAMPAIGN_PREVIEW_OUTBOUND_TYPES.includes(outboundType) || CAMPAIGN_PREVIEW_CAMPAIGN_TYPES.includes(campaignType)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Import the campaign utility dependencies

This new exported helper uses ITask, CampaignCallProcessingDetails, and the campaign preview constants, but task-util.ts still only imports Interaction. Any import of isUnacceptedCampaignPreview (now used by both call-control widgets) therefore fails the task package build with unresolved symbols before the campaign-preview guard can work.

Useful? React with 👍 / 👎.

const campaignType = cpd?.campaignType ?? '';

return (
CAMPAIGN_PREVIEW_OUTBOUND_TYPES.includes(outboundType) || CAMPAIGN_PREVIEW_CAMPAIGN_TYPES.includes(campaignType)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Import the outbound campaign constants

The predicate now checks CAMPAIGN_PREVIEW_OUTBOUND_TYPES, but the import at the top of this file only brings in CAMPAIGN_PREVIEW_CAMPAIGN_TYPES. Building or rendering TaskList with this module will fail on the unresolved constant, so import it from @webex/cc-store alongside the campaign-type constants.

Useful? React with 👍 / 👎.

@bhabalan bhabalan added the validated Indicates that the PR is ready for actions label Jun 1, 2026
zachraymer and others added 2 commits June 15, 2026 16:01
…#695)

Co-authored-by: Zach Raymer <zraymer@cisco.com>
Co-authored-by: Kesava Krishnan Madavan <mkesavan13@gmail.com>
@github-actions github-actions Bot removed the validated Indicates that the PR is ready for actions label Jun 25, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e0477fb904

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +63 to +64
} else if (latestGlobalVariables.length > 0) {
globalVariablesRef.current = latestGlobalVariables;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Clear cached campaign variables on contact updates

When a preview contact is skipped or removed and the SDK updates the same interaction with the next contact, this branch keeps globalVariablesRef whenever the new snapshot has no agent-viewable globals (or temporarily omits callAssociatedData). The component already detects same-task contact changes via campaignPreviewOfferTimeout, but because the interaction id does not change, the CAD panel can continue showing the previous customer's global variables on the new preview contact. Reset the cached variables when the contact/timeout changes, not only when a new interaction id appears.

Useful? React with 👍 / 👎.

Comment on lines +233 to +234
if (versionB === stableVersion) {
versionsToUse = [stableVersion];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include prereleases when the target is a stable version

When comparing across stable trains and the target selector is the exact stable version (for example 1.28.0-next.101.29.0), this branch limits the end train to [stableVersion]. That skips all prerelease entries in the target train, so the commit history under-reports the changes that led up to the stable release. Include the target train's prereleases up to the stable release as well (and the stable entry if it has distinct commits).

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7edb129acd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +589 to +593
if (isCampaignPreview) {
this.setState({
developerName: RESERVED_LABEL,
name: RESERVED_USERNAME,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Mark accepted previews before leaving RESERVED

For the task-level campaign preview reservation event, acceptedCampaignIds is the source of truth used by setCurrentTask and isUnacceptedCampaignPreview to allow call controls after the preview is accepted, but this branch only keeps preview campaigns in RESERVED and never records the interaction as accepted. When a standard/direct preview is accepted, the same interaction remains treated as unaccepted, so CallControl stays hidden and the campaign row keeps pending behavior; add the interaction id and transition the accepted preview to ENGAGED on this path.

Useful? React with 👍 / 👎.

if (callProcessingDetails) {
const {isPaused} = callProcessingDetails;
setIsRecording(!isPaused);
setIsRecording(isPaused !== 'true');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Treat boolean paused state as paused

If the SDK supplies callProcessingDetails.isPaused as boolean true (the previous implementation handled booleans, and the local fixtures still use boolean values), this string-only comparison evaluates to true and the UI reports recording as active while it is actually paused. Handle both true and 'true' here so the recording button state stays correct across SDK payload shapes.

Useful? React with 👍 / 👎.

Comment on lines +1129 to +1132
const numA = parseInt(versionASpecific.match(/\.(\d+)$/)?.[1] || '0', 10);
const numB = parseInt(versionBSpecific.match(/\.(\d+)$/)?.[1] || '0', 10);
if (numA > numB) {
alert('Base pre-release version must be older than target pre-release version');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow prerelease-to-stable comparisons

When comparing within the same stable train and the target dropdown is the stable release, for example 1.28.0-next.101.28.0, this parses the stable target's patch number as 0, so numA > numB rejects a valid comparison even though the stable release comes after its prereleases. Treat an exact stable target as the end of the train instead of comparing its patch segment as a prerelease number.

Useful? React with 👍 / 👎.

@Shreyas281299 Shreyas281299 added the validated Indicates that the PR is ready for actions label Jul 1, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4a0547221

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

on:
push:
branches: # Allow list of deployable tags and branches. Note that all allow-listed branches cannot include any `/` characters
<<<<<<< next-in-task-refactor

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove conflict markers from deploy workflow

This leaves an unresolved merge-conflict marker in .github/workflows/deploy.yml, so the workflow file is not valid GitHub Actions YAML and the Deploy CD workflow will be rejected/disabled for pushes to the release branches instead of publishing packages. Resolve the branch list to real - next/- task-refactor entries and remove the surrounding conflict markers.

Useful? React with 👍 / 👎.

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

Labels

task-refactor validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.