Files
twenty_crm/packages/twenty-front/src/modules/ui/layout/constants/RootStackingContextZIndices.ts
Lucas Bordeau 5e43839efb Fix CSV import select field matching (#11361)
This PR fixes a bug that prevented to do the matching of an imported CSV
file that contains a SELECT type column.

Fixes https://github.com/twentyhq/twenty/issues/11220

## Stacking context improvement 

During the development it was clear that we lacked a reliable way to
understand our own z indices for components like modal, portaled
dropdown, overlay background, etc.

So in this PR we introduce a new enum RootStackingContextZIndices, this
enum allows to keep track of our root stacking context component
z-index, and because it is an enum, it prevents any conflict.

See
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_positioned_layout/Stacking_context
for reference.

## Component cleaning

Components have been reorganized in a SubMatchingSelectRow component

The Dropdown component has been used to replace the SelectInput
component which doesn't fit this use case because we are not in a cell,
we just need a simple standalone dropdown, though it would be
interesting to extract the UI part of the SelectInput, to share it here,
the benefit is not obvious since we already have good shared components
like Tag and Dropdown to implement this specific use case.

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
2025-04-03 16:28:15 +02:00

25 lines
967 B
TypeScript

/**
* Please read this article to understand why we use this enum : https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_positioned_layout/Stacking_context
*
* It is important to keep track of the stacking contexts that are created on top of the root stacking context of the document.
*
* Right now we have to guess it by looking into the developer console
*
* This way we can avoid hazardous fidgeting with z-index CSS properties
* and having to look down the tree in the developer console to see which component is in the root stacking context or not
*
* Using an enum enforces a single z-index for each component in the root stacking context
*
* TODO: add the other remaining components that can appear in the root stacking context
*/
export enum RootStackingContextZIndices {
CommandMenu = 21,
CommandMenuButton = 22,
RootModalBackDrop = 39,
RootModal = 40,
DropdownPortal = 50,
Dialog = 9999,
SnackBar = 10002,
NotFound = 10001,
}