Skip to content
Merged
Changes from 1 commit
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
17 changes: 15 additions & 2 deletions frontend/src/components/editor/actions/useCellActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ export function useCellActionButtons({ cell, closePopover }: Props) {
}
};

const isSetupCell = cellId === "setup";

// Actions
const actions: ActionButton[][] = [
[
Expand Down Expand Up @@ -181,6 +183,7 @@ export function useCellActionButtons({ cell, closePopover }: Props) {
onEnterKey={() => closePopover?.()}
/>
),
hidden: isSetupCell,
},
{
icon: <PlayIcon size={13} strokeWidth={1.5} />,
Expand Down Expand Up @@ -254,6 +257,7 @@ export function useCellActionButtons({ cell, closePopover }: Props) {
/>
),
handle: toggleDisabled,
hidden: isSetupCell,
},
{
icon: <XCircleIcon size={13} strokeWidth={1.5} />,
Expand Down Expand Up @@ -282,6 +286,7 @@ export function useCellActionButtons({ cell, closePopover }: Props) {
keepCodeAsIs: false,
});
},
hidden: isSetupCell,
},
{
icon: <DatabaseIcon size={13} strokeWidth={1.5} />,
Expand All @@ -297,6 +302,7 @@ export function useCellActionButtons({ cell, closePopover }: Props) {
keepCodeAsIs: false,
});
},
hidden: isSetupCell,
},
{
icon: <PythonIcon />,
Expand All @@ -309,6 +315,7 @@ export function useCellActionButtons({ cell, closePopover }: Props) {
maybeAddMarimoImport({ autoInstantiate, createNewCell: createCell });
toggleToLanguage(editorView, "python", { force: true });
},
hidden: isSetupCell,
},
],

Expand All @@ -324,6 +331,7 @@ export function useCellActionButtons({ cell, closePopover }: Props) {
label: "Create cell above",
hotkey: "cell.createAbove",
handle: () => createCell({ cellId, before: true }),
hidden: isSetupCell,
},
{
icon: (
Expand All @@ -341,26 +349,28 @@ export function useCellActionButtons({ cell, closePopover }: Props) {
label: "Move cell up",
hotkey: "cell.moveUp",
handle: () => moveCell({ cellId, before: true }),
hidden: isSetupCell,
},
{
icon: <ChevronDownIcon size={13} strokeWidth={1.5} />,
label: "Move cell down",
hotkey: "cell.moveDown",
handle: () => moveCell({ cellId, before: false }),
hidden: isSetupCell,
},
{
icon: <ChevronLeftIcon size={13} strokeWidth={1.5} />,
label: "Move cell left",
hotkey: "cell.moveLeft",
handle: () => moveCell({ cellId, direction: "left" }),
hidden: appWidth !== "columns",
hidden: appWidth !== "columns" || isSetupCell,
},
{
icon: <ChevronRightIcon size={13} strokeWidth={1.5} />,
label: "Move cell right",
hotkey: "cell.moveRight",
handle: () => moveCell({ cellId, direction: "right" }),
hidden: appWidth !== "columns",
hidden: appWidth !== "columns" || isSetupCell,
},
{
icon: <ChevronsUpIcon size={13} strokeWidth={1.5} />,
Expand All @@ -369,6 +379,7 @@ export function useCellActionButtons({ cell, closePopover }: Props) {
// When using the cell menu, likely the user doesn't want to scroll
// and instead just wants to get the cell out of the way
handle: () => sendToTop({ cellId, scroll: false }),
hidden: isSetupCell,
},
{
icon: <ChevronsDownIcon size={13} strokeWidth={1.5} />,
Expand All @@ -377,13 +388,15 @@ export function useCellActionButtons({ cell, closePopover }: Props) {
// When using the cell menu, likely the user doesn't want to scroll
// and instead just wants to get the cell out of the way
handle: () => sendToBottom({ cellId, scroll: false }),
hidden: isSetupCell,
},
{
icon: <Columns2Icon size={13} strokeWidth={1.5} />,
label: "Break into new column",
hotkey: "cell.addColumnBreakpoint",
hidden: appWidth !== "columns",
handle: () => addColumnBreakpoint({ cellId }),
hidden: isSetupCell,
Copy link
Contributor

Choose a reason for hiding this comment

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

there is a bug with this one

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, thanks

},
],

Expand Down
Loading