jupyterlab / jupyterlab

JupyterLab computational environment.
https://jupyterlab.readthedocs.io/
Other
14.08k stars 3.32k forks source link

UI design for an empty notebook #13142

Open hbcarlos opened 1 year ago

hbcarlos commented 1 year ago

Problem

As presented in #13141, adding a new cell every time we have an empty notebook conflict with RTC.

This issue is to discuss a UI design to improve the UX on empty notebooks.

Proposed Solution

Add a button to create a new cell when the notebook is empty.

Additional context

cc @GabrielaVives

GabrielaVives commented 1 year ago

I suggest that we create a standard design for empty notebooks. It is important for the user experience for the design to have to components:

Here is an example in the following prototype: https://www.figma.com/proto/tPuLOg7FLmvVVK4q7EWlNc/Empty-notebook-design?node-id=311%3A3320&scaling=scale-down&page-id=311%3A3319&starting-point-node-id=311%3A3320

and as a screenshot:

Neutral state

image

When navigating left and right on keyboard

image

When hovering over a button Screenshot 2022-09-28 at 14 17 57

davidbrochart commented 1 year ago

Note that in Observable notebooks, creating a new notebook starts with an empty cell, and deleting it just clears its content. This is the behavior @krassowski described in https://github.com/jupyterlab/jupyterlab/pull/13141#issuecomment-1260785653, and I also prefer that compared to introducing a new UI.

firai commented 1 year ago

I would also advocate against moving away from the current behavior to having to click a button in a fresh notebook to add a cell, as the current behavior allows the user to immediately start typing once a new document is started, which is similar to the experience in word processors and text/code editors. I personally start typing code before I start organizing it around headings and such, but this default shouldn't be too harsh on users who prefer the other way around since cells are easily convertible. Maybe the default cell type could be configurable?

VSCode, Google Colab and Deepnote all add an empty code cell to new notebooks and focus into the empty cell by default as well. Like Observable, deleting the last cell in Deepnote, which is another notebook platform that supports RTC, just clears the contents of the last cell (while keeping the cell type).

SylvainCorlay commented 1 year ago

I would also advocate against moving away from the current behavior to having to click a button in a fresh notebook to add a cell, as the current behavior allows the user to immediately start typing once a new document is started, which is similar to the experience in word processors and text/code editors. I personally start typing code before I start organizing it around headings and such, but this default shouldn't be too harsh on users who prefer the other way around since cells are easily convertible. Maybe the default cell type could be configurable?

New notebooks would still have one cell presumably. We merely want to allow for removing that cell.

krassowski commented 4 weeks ago

Note from frontends call: we could possibly reuse the existing add cell button which is at the bottom (thanks @bollwyvl) - but it only creates a cell of default type.