Skip to content

Conversation

@limichange
Copy link
Contributor

@limichange limichange commented Nov 14, 2025

…tions

Summary by CodeRabbit

  • Bug Fixes
    • Fixed z-index layering to ensure the Intercom widget displays behind toast notifications for improved notification visibility.

@revan-zhang
Copy link
Contributor

revan-zhang commented Nov 14, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 14, 2025

Walkthrough

A CSS modification adds z-index rules to Intercom container elements, ensuring they render beneath toast notifications. This resolves layering issues where the Intercom help center icon overlapped with error toast UI.

Changes

Cohort / File(s) Summary
Intercom z-index adjustment
packages/shared/src/web/index.css
Adds z-index: 1 !important to #intercom-container and .intercom-lightweight-app selectors to position Intercom UI behind toast overlays.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Pre-merge checks and finishing touches

✅ 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: adjusting Intercom's z-index to keep it behind toast notifications, which directly matches the changeset.
Linked Issues check ✅ Passed The PR directly addresses issue OK-45961 by adjusting z-index values to position the Intercom help icon behind toast notifications, fulfilling the stated requirement.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the Intercom z-index layering issue; no unrelated modifications to other components or files are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch OK-45961

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1a7e5d6 and 528f5e5.

📒 Files selected for processing (1)
  • packages/shared/src/web/index.css (1 hunks)
⏰ 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: unittest (20.x)
  • GitHub Check: lint (20.x)
  • GitHub Check: Analyze (javascript-typescript)

Comment on lines +280 to +283
/* Keep Intercom floating UI behind toast notifications (z-index 1e6) */
#intercom-container *, .intercom-lightweight-app {
z-index: 1 !important;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

The wildcard selector will break Intercom's internal stacking.

The rule #intercom-container * applies z-index: 1 !important to every descendant. If Intercom uses z-index internally (for dropdowns, popovers, tooltips), forcing all children to z-index: 1 destroys that layering.

Apply z-index only to the container itself, not all descendants:

-/* Keep Intercom floating UI behind toast notifications (z-index 1e6) */
-#intercom-container *, .intercom-lightweight-app {
+/* Keep Intercom floating UI behind toast notifications */
+#intercom-container,
+.intercom-lightweight-app {
   z-index: 1 !important;
 }

This lets the container sit below toasts while preserving Intercom's internal stacking for its own UI layers.


[/run_scripts]

[/web_search]


🏁 Script executed:

#!/bin/bash
# Search for Intercom usage and configuration in codebase
echo "=== Searching for Intercom references ==="
rg -i "intercom" --type=js --type=ts --type=tsx --type=jsx -C 3 | head -100

echo -e "\n=== Checking if intercom-lightweight-app is imported or documented ==="
rg "intercom-lightweight-app" -C 2

echo -e "\n=== Looking for toast z-index configuration ==="
rg -i "toast.*z-index|z-index.*toast" --type=css --type=js -C 2

echo -e "\n=== Context around the CSS lines ==="
sed -n '275,290p' packages/shared/src/web/index.css

Length of output: 1216


🌐 Web query:

How does Intercom handle z-index layering for internal UI components like dropdowns

💡 Result:

Short answer: Intercom isolates its UI inside the Messenger and exposes only a top-level z-index you can set; internal components (dropdowns, product-tour steps, confetti, mobile messenger, etc.) are layered inside Intercom’s own stacking context and are not all controlled by that single value. You can raise/lower the Messenger with IntercomSettings.z_index or Intercom('update', {z_index}) but some internal pieces always stay on top or have their own fixed layering (product tours and mobile messenger stay at very high z-index; some animations may render inside or outside the widget with different precedence). If Intercom UI appears behind your site content you usually need to lower/adjust your site’s stacking context (or Messenger z_index) because child elements can’t escape parent stacking contexts. References: Intercom developer docs (Messenger z-index and limitations) and Intercom community threads discussing posts/modal layering and editor conflicts. [1][2][3]

Sources

  • Intercom developer docs — Messenger z-index (settings, API, and listed limitations). [1]
  • Intercom Community — “Popup over Intercom editor” (stacking conflicts / troubleshooting). [2]
  • Intercom Community — post rendered under header / advice to adjust host z-index or use workarounds. [3]

Remove the wildcard selector—it forces all Intercom descendants to z-index: 1.

The rule #intercom-container * applies z-index: 1 !important to every child element. This overrides any internal z-index values Intercom uses for dropdowns, modals, or tooltips, flattening its internal stacking.

Target only the container itself:

-/* Keep Intercom floating UI behind toast notifications (z-index 1e6) */
-#intercom-container *, .intercom-lightweight-app {
+/* Keep Intercom floating UI behind toast notifications */
+#intercom-container,
+.intercom-lightweight-app {
   z-index: 1 !important;
 }

This keeps the container behind toasts while preserving Intercom's internal layering for its own UI components.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/* Keep Intercom floating UI behind toast notifications (z-index 1e6) */
#intercom-container *, .intercom-lightweight-app {
z-index: 1 !important;
}
/* Keep Intercom floating UI behind toast notifications */
#intercom-container,
.intercom-lightweight-app {
z-index: 1 !important;
}
🤖 Prompt for AI Agents
In packages/shared/src/web/index.css around lines 280 to 283, the current rule
uses the wildcard selector "#intercom-container *" which forces every descendant
to z-index: 1 and flattens Intercom's internal stacking; remove the wildcard and
apply z-index: 1 only to the container itself by changing the selector to target
#intercom-container (and keep .intercom-lightweight-app) so internal Intercom
elements retain their own z-index values while the container stays behind
toasts.

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.

3 participants