fix(ui): persist CZentrix panel on innerpage routes, move dev sim button - #30
Conversation
…ton to bottom left Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughCTI rendering and inbound-call handling move from dashboard-scoped code into root-level components and a singleton service. The dashboard retains feedback and agent-status responsibilities. HAO campaign flows now validate array-shaped response payloads. ChangesCTI application integration
HAO response validation
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant Telephony
participant InboundCtiService
participant CallStore
participant Router
Telephony->>InboundCtiService: Send inbound CTI postMessage
InboundCtiService->>CallStore: Validate origin, eligibility, and active session
InboundCtiService->>CallStore: Seed fresh call with CLI and sessionId
InboundCtiService->>Router: Navigate to /innerpage
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/app.html`:
- Line 2: Move the trusted postMessage listener and inbound CTI call-routing
logic out of DashboardComponent into an application-scoped service or root-level
owner that remains alive across route changes. Update the app bootstrap flow to
initialize that owner once, preserving the existing message validation and
routing behavior for calls received from the persistent app-cti-panel iframe.
In `@src/app/shared/components/layout/cti-panel.component.ts`:
- Around line 94-100: Update the showCzentrix computed predicate to also require
a non-null agent ID from ctiUrl(), while preserving the existing authentication
and supervisor feature-code checks. Use the agentID value exposed by ctiUrl() so
the toggle remains hidden when no agent ID is available.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 986f1903-90e0-4d84-a9a3-4edfd435b2f9
📒 Files selected for processing (5)
src/app/app-modules/dashboard/components/dashboard-footer.component.tssrc/app/app-modules/dashboard/dashboard.component.tssrc/app/app.htmlsrc/app/app.tssrc/app/shared/components/layout/cti-panel.component.ts
…when no agentID Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/app/app-modules/call/inbound-cti.service.ts (1)
35-40: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winReject opaque telephony URL schemes before trusting the origin.
new URL('data:...').originandnew URL('file:///...').origincan be"null", which also appears asMessageEvent.originfor opaque or sandboxed senders. IftelephoneServeris misconfigured this way, forged inbound CTI messages would pass the origin check. Restrict the configured URL tohttp:/https:and reject"null".Proposed fix
function safeOrigin(url: string): string { try { - return new URL(url).origin; + const parsed = new URL(url); + if ( + !['http:', 'https:'].includes(parsed.protocol) || + parsed.origin === 'null' + ) { + return 'invalid:no-telephony-origin'; + } + return parsed.origin; } catch { return 'invalid:no-telephony-origin'; } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/app/app-modules/call/inbound-cti.service.ts` around lines 35 - 40, Update safeOrigin to accept only http: and https: telephoneServer URLs, returning the existing invalid sentinel for all other schemes or when the parsed origin is "null". Preserve the current valid-origin behavior and error fallback.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/app/app-modules/call/inbound-cti.service.ts`:
- Around line 35-40: Update safeOrigin to accept only http: and https:
telephoneServer URLs, returning the existing invalid sentinel for all other
schemes or when the parsed origin is "null". Preserve the current valid-origin
behavior and error fallback.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6db7fd8b-3926-429e-a009-a43ca6aebc24
📒 Files selected for processing (6)
src/app/app-modules/call/hao/hao.service.tssrc/app/app-modules/call/hao/steps/closure-step.component.tssrc/app/app-modules/call/inbound-cti.service.tssrc/app/app-modules/dashboard/dashboard.component.tssrc/app/app.tssrc/app/shared/components/layout/cti-panel.component.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/app/shared/components/layout/cti-panel.component.ts
…ypes Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@coderabbitai review full pr |
|
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 35 minutes. |
|
@coderabbitai review full pr |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/app-modules/call/inbound-cti.service.ts`:
- Around line 64-69: Update the inbound message handler around onMessage to
require the same CTI eligibility conditions enforced by CtiPanelComponent before
calling handleCtiMessage: the user must be authenticated, able to receive CTI
calls, and have an agent ID. Keep the trusted-origin check and return without
processing events when either origin or authentication eligibility fails.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a3fc89b6-b3d1-4a54-b967-dad8b6ab3d49
📒 Files selected for processing (8)
src/app/app-modules/call/hao/hao.service.tssrc/app/app-modules/call/hao/steps/closure-step.component.tssrc/app/app-modules/call/inbound-cti.service.tssrc/app/app-modules/dashboard/components/dashboard-footer.component.tssrc/app/app-modules/dashboard/dashboard.component.tssrc/app/app.htmlsrc/app/app.tssrc/app/shared/components/layout/cti-panel.component.ts
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@coderabbitai review full pr |
|
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 34 minutes. |
|
@coderabbitai review full pr |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/app-modules/call/hao/hao.service.ts`:
- Line 162: Update the response mapping in the call-type service around the
visible pipe/map logic so null or undefined data still produces an empty result,
but any other non-array payload throws an error instead of returning [].
Preserve array responses unchanged so ClosureStepComponent.loadCallTypes()
reaches its existing error handling for malformed successful responses.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 591a63cb-60d1-4b52-9c4a-64efc0930e63
📒 Files selected for processing (8)
src/app/app-modules/call/hao/hao.service.tssrc/app/app-modules/call/hao/steps/closure-step.component.tssrc/app/app-modules/call/inbound-cti.service.tssrc/app/app-modules/dashboard/components/dashboard-footer.component.tssrc/app/app-modules/dashboard/dashboard.component.tssrc/app/app.htmlsrc/app/app.tssrc/app/shared/components/layout/cti-panel.component.ts
…ires Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/app-modules/call/hao/hao.service.ts`:
- Around line 167-172: Update the response handling in the call-type retrieval
method around the visible Array.isArray check so null or undefined res.data
returns an empty list, preserving the prior res.data ?? [] behavior. Continue
throwing the existing error for all other non-array payloads, and return array
data unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6125b795-8cb0-4bcc-891c-7a45ad308b40
📒 Files selected for processing (1)
src/app/app-modules/call/hao/hao.service.ts
|
@coderabbitai review full pr |
|
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 49 minutes. |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@coderabbitai review full pr |
|
✅ Action performedFull review finished. |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fix 1 — CZentrix panel now persists on all routes including /innerpage/*
The panel was owned by the dashboard footer and was destroyed on navigation.
Extracted into a root-level CtiPanelComponent rendered in app.html outside
the router-outlet so it stays mounted across all routes during a call.
Fix 2 — Dev simulation button moved to bottom-left
"Simulate inbound call (dev)" was colliding with CZentrix button bottom-right.
Moved to bottom-left with subtle muted styling — clearly a dev tool, not
a primary UI element.
Summary by CodeRabbit
postMessageto start the inbound call flow and navigate to the inner page.datais an array before updating campaign/call options.