Skip to content

Conversation

mabaasit
Copy link
Collaborator

@mabaasit mabaasit commented Oct 2, 2025

Description

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@mabaasit mabaasit requested a review from a team as a code owner October 2, 2025 12:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adjusts the z-index behavior of toast notifications to display them behind modal dialogs instead of on top. The change addresses COMPASS-8162 by modifying the toast stacking context calculation.

  • Updated z-index calculation to position toasts below modal components
  • Renamed variables to better reflect the new behavior
  • Updated comments to accurately describe the toast positioning

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

const zIndex = stackedContext?.zIndex ? stackedContext.zIndex + 1 : 1;
// We always want to show the toast under the modal
const toastPortalStyles = useMemo(() => {
const zIndex = stackedContext?.zIndex ? stackedContext.zIndex - 1 : 0;
Copy link
Preview

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

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

Setting z-index to 0 when no stacked context exists may cause toasts to appear behind other page elements. Consider using a positive default value like 1 to ensure toasts remain visible above normal page content.

Suggested change
const zIndex = stackedContext?.zIndex ? stackedContext.zIndex - 1 : 0;
const zIndex = stackedContext?.zIndex ? stackedContext.zIndex - 1 : 1;

Copilot uses AI. Check for mistakes.

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.

2 participants