Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

ux: single-click to create Python cells (#7440)

Akshay Agrawal355103923506
diff --git a/frontend/e2e-tests/helper.ts b/frontend/e2e-tests/helper.ts
index c950175bb4..3203f1a041 100644
--- a/frontend/e2e-tests/helper.ts
+++ b/frontend/e2e-tests/helper.ts
@@ -19,13 +19,12 @@ export async function createCellBelow(opts: {
page.getByTestId("create-cell-button").locator(":visible"),
).toHaveCount(2);
- // Clicking the first button opens a dropdown menu with the cell types
+ // Clicking the first button creates a new cell below
await page
.getByTestId("create-cell-button")
.locator(":visible")
.last()
.click();
- await page.getByText("Python cell").click();
// Type into the currently focused cell
if (content) {
await page.locator("*:focus").type(content);
diff --git a/frontend/src/components/editor/cell/CreateCellButton.tsx b/frontend/src/components/editor/cell/CreateCellButton.tsx
index aeb8826883..7d25087a6e 100644
--- a/frontend/src/components/editor/cell/CreateCellButton.tsx
+++ b/frontend/src/components/editor/cell/CreateCellButton.tsx
@@ -46,7 +46,7 @@ export const CreateCellButton = ({
<div>{baseTooltipContent}</div>
<div className="text-xs text-muted-foreground font-medium pt-1 -mt-2 border-t border-border">
{<MinimalHotkeys shortcut={shortcut} className="inline" />}{" "}
- <span>to auto insert a cell</span>
+ <span>for other cell types</span>
</div>
</div>
);
@@ -81,7 +81,9 @@ export const CreateCellButton = ({
};
const handleButtonClick = (e: React.MouseEvent) => {
- if (oneClickShortcut === "shift" ? e.shiftKey : e.metaKey || e.ctrlKey) {
+ const hasModifier =
+ oneClickShortcut === "shift" ? e.shiftKey : e.metaKey || e.ctrlKey;
+ if (!hasModifier) {
e.preventDefault();
e.stopPropagation();
addPythonCell();
@@ -123,7 +125,7 @@ export const CreateCellButton = ({
>
<Tooltip content={finalTooltipContent}>
<PlusIcon
- strokeWidth={4}
+ strokeWidth={3}
size={14}
className="opacity-60 hover:opacity-90"
/>
diff --git a/frontend/src/components/editor/cell/collapse.tsx b/frontend/src/components/editor/cell/collapse.tsx
index 5d70187a38..1b3a6c3175 100644
--- a/frontend/src/components/editor/cell/collapse.tsx
+++ b/frontend/src/components/editor/cell/collapse.tsx
@@ -44,9 +44,9 @@ export const CollapseToggle: React.FC<Props> = (props) => {
const Arrow = ({ isCollapsed }: { isCollapsed: boolean }) => {
return isCollapsed ? (
- <ChevronRightIcon className="w-5 h-5 shrink-0" />
+ <ChevronRightIcon className="w-5 h-5 shrink-0 opacity-60" strokeWidth={2} />
) : (
- <ChevronDownIcon className="w-5 h-5 shrink-0" />
+ <ChevronDownIcon className="w-5 h-5 shrink-0 opacity-60" strokeWidth={2} />
);
};