🏠 back to Observable

Don’t automatically pin all cells upon creation

Not sure if this would be possible to do, but it would be nice to not automatically pin certain types of cells when creating them.

Specifically, when first running a newly created cell, if the cell is an expression cell consisting of an md tagged template, or is an import cell, it should not be pinned.

This is because md templates are often used for documentation or human-readable instructions, so most of the time, seeing the source just duplicates the rendered text. Additionally, the nice display for import cells makes the actual import statement duplicative unless there is a with clause.

Counterpoints:

  • I “grow” my text cells through frequent edits, so having them readily open is very practical.
  • Creating a cell and then only seeing the output (which may be empty) can be disorienting.
  • Difference in behavior depending on the cell content is an anti-pattern, because it would require users to learn and understand the various cases.
  • At the most this should be a configurable editor preference.
1 Like
  • Good point, but it’s only one more click to open the code section again; or you could click to pin the ones you plan to add to.
  • The two cases I chose mitigate this issue, since the output is very similar to the code. Additionally, the code block only collapses when you focus out of it.
  • IMO this behavior is kind of intuitive, and it’s always just one click to reverse the behavior
  • Whatever the team decides :man_shrugging:

My +1 to configurable editor preference option

And I share @j-f1’s concern, almost all the time I need to unpin markdown cells

1 Like

+1 from for a per-account editor setting.

Regarding cell content based pin states, I’d like to play devil’s advocate and outline two scenarios, and you can tell me if I got the behavior right:

Scenario 1:

  1. Add a cell
  2. Write md`something`
  3. Save cell
  4. Unfocus cell
  5. The cell is not pinned.

Scenario 2:

  1. Add a cell
  2. Save cell
  3. Write md`something`
  4. Save cell
  5. Unfocus cell
  6. The cell is pinned.

Those two scenarios are correct.

And what about this one:

  1. Add a cell
  2. Write md`something`
  3. Save cell
  4. Replace cell content with foo = "bar"
  5. Save cell
  6. Unfocus cell
  7. The cell is not pinned.

I’m not sure If i have the shortcut right but I find ‘P’ very easy to pin or unpin a cell with focus.

My only worry when working with firefox is to pass from the edit state to the focus state without having to blur the cell with ‘ESC’ then reselect it with ‘J’ or ‘K’.

The shortcut ‘CRTL-SHIFT P’ does probably that but because in firefox it is already taken to open a ‘private navigation window’ and in chromium to print the page, I cannot use it.

But if you can use ‘CRTL-SHIFT P’ to unpin a cell directly from the edit mode while keeping the focus on it, do you really need an automatic cell unpin based on content analysis ? But maybe I miss understood the problem.

1 Like

Just to add another aspect to the conversation: Lately I’m seeing a lot of notebooks with pinned title cells. I assume that many authors simply don’t notice the single line code block (and perhaps some just don’t care).

2 Likes