Fixed hovering of kanban cards (#15808)

This PR fixes the record inline cells that disappeared on board card due
to recent refactors.
This commit is contained in:
Lucas Bordeau
2025-11-13 18:49:52 +01:00
committed by GitHub
parent 998365457e
commit 9d43058e50
2 changed files with 11 additions and 15 deletions
@@ -115,7 +115,7 @@ export const RecordInlineCellContainer = () => {
<IconLabel stroke={theme.icon.stroke.sm} />
</StyledIconContainer>
)}
{label && (
{showLabel && (
<StyledLabelContainer width={labelWidth}>
<OverflowingTextWithTooltip text={label} displayedMaxRows={1} />
</StyledLabelContainer>
@@ -134,7 +134,6 @@ export const RecordInlineCellContainer = () => {
)}
</StyledLabelAndIconContainer>
)}
<StyledValueContainer readonly={readonly ?? false} id={anchorId}>
<RecordInlineCellValue />
</StyledValueContainer>
@@ -60,8 +60,6 @@ const StyledEmptyField = styled.div`
color: ${({ theme }) => theme.font.color.light};
display: flex;
height: 20px;
background-color: ${({ theme }) => theme.background.secondary};
`;
export const RecordInlineCellDisplayMode = ({
@@ -74,25 +72,24 @@ export const RecordInlineCellDisplayMode = ({
}>) => {
const { t } = useLingui();
const { editModeContentOnly, showLabel, label, buttonIcon, readonly } =
const { editModeContentOnly, label, buttonIcon, readonly } =
useRecordInlineCellContext();
const isDisplayModeContentEmpty = useIsFieldEmpty();
const isFieldEmpty = useIsFieldEmpty();
const showEditButton =
buttonIcon &&
isHovered &&
!readonly &&
!isDisplayModeContentEmpty &&
!isFieldEmpty &&
!editModeContentOnly;
const isFieldInputOnly = useIsFieldInputOnly();
const shouldDisplayEditModeOnFocus = isHovered && isFieldInputOnly;
const emptyPlaceHolder = label ?? t`Empty`;
const emptyPlaceHolder = showLabel ? t`Empty` : label;
const shouldShowValue = !isFieldEmpty || isFieldInputOnly;
const shouldShowEmptyPlaceholder =
(isDisplayModeContentEmpty && !shouldDisplayEditModeOnFocus) || !children;
const shouldShowEmptyPlaceholder = isFieldEmpty;
return (
<>
@@ -102,11 +99,11 @@ export const RecordInlineCellDisplayMode = ({
onClick={onClick}
>
<StyledRecordInlineCellNormalModeInnerContainer>
{shouldShowEmptyPlaceholder ? (
<StyledEmptyField>{emptyPlaceHolder}</StyledEmptyField>
) : (
{shouldShowValue ? (
children
)}
) : shouldShowEmptyPlaceholder ? (
<StyledEmptyField>{emptyPlaceHolder}</StyledEmptyField>
) : null}
</StyledRecordInlineCellNormalModeInnerContainer>
</StyledRecordInlineCellNormalModeOuterContainer>
{showEditButton && (