Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions frontend/src/components/editor/Cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,13 @@ const CellComponent = (
ref: cellContainerRef,
skip: !isMarkdown,
onResize: (size) => {
const cellTooShort = size.height && size.height < 68;
const shouldBeInline =
(size.height && size.height < 68 && hasOutput) || false;
isMarkdownCodeHidden && (cellTooShort || cellOutput === "below");
setIsCellStatusInline(shouldBeInline);

if (canCollapse && shouldBeInline) {
setIsCellButtonsInline(shouldBeInline);
setIsCellButtonsInline(true);
} else if (isCellButtonsInline) {
setIsCellButtonsInline(false);
}
Expand Down Expand Up @@ -432,6 +433,7 @@ const CellComponent = (
stopped: stopped,
disabled: cellConfig.disabled,
stale: status === "disabled-transitively",
borderless: isMarkdownCodeHidden,
});

const HTMLId = HTMLCellId.create(cellId);
Expand Down Expand Up @@ -608,7 +610,7 @@ const CellComponent = (
className={cn(
"absolute flex flex-col gap-[2px] justify-center h-full left-[-34px] z-20",
isMarkdownCodeHidden && cellOutput === "above" && "-top-7",
isMarkdownCodeHidden && cellOutput === "below" && "-bottom-10",
isMarkdownCodeHidden && cellOutput === "below" && "-bottom-8",
isMarkdownCodeHidden && isCellButtonsInline && "-left-[3.8rem]",
)}
>
Expand Down Expand Up @@ -650,7 +652,12 @@ const CellComponent = (
languageAdapter={languageAdapter}
setLanguageAdapter={setLanguageAdapter}
/>
<div className="shoulder-right">
<div
className={cn(
"shoulder-right",
isMarkdownCodeHidden && cellOutput === "below" && "top-14",
)}
>
{!isCellStatusInline && cellStatusComponent}
<div className="flex gap-2 items-end">
<CellDragHandle />
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/css/app/Cell.css
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@
}
}

/* Borderless styles for Cell */
&.borderless {
border-color: transparent;
box-shadow: none;

/* Apply the original styles */
&:hover {
border: 1px solid var(--gray-4);
@apply shadow-smSolid shadow-shade;
}
}

/* -------------------------- Shoulders/Buttons ---------------------------- */
.shoulder-right {
display: inline-flex;
Expand Down
Loading