How to show unpinned cells (Observable 2)

I realise this topic has come up in various places on other threads, but though it might be clearer to have a focussed topic here.

The recent change to show unpinned code cells with a single label is a big improvement on always showing the expanded cell. But it does risk misleading people when a non-empty cell is labelled ‘empty’.

I am not aware of the shape of technical challenge here, so it may be wishful thinking, but tried to jot down some of my thoughts here, in case it helps:

https://observablehq.com/@jwolondon/cell-output-discussion

Good write-up and we appreciate the feedback.

I agree that “empty” is slightly misleading in that it means “the cell has no outputs” rather than “the cell has no source”.

We’re still planning on implementing the automatic inspection of top-level variables. This would mean that a cell declaring a function (or any other variable) would no longer be “empty” as it would now display the inspector. Though I think you should be able to suppress the automatic inspection (via the hidden option) if such output would be unnecessary or distracting. And I’d like the automatic inspection to be concise: if a cell declares multiple top-level variables, I’d still like the automatic inspection to fit on a single line, and let you optionally expand it for more detail. Getting this to work well is one reason it’s taking time to implement this feature.

As for cells that do display something but the displayed content is invisible (such as the style and link elements you mention), that’s tricky too. There is a min-height of 1px on cells; that probably needs to increase to be 1.5rem (25.5px) to match Old Observable… but it would still be invisible, if not easier to click on. We can use :empty to detect truly empty cells, but there’s no CSS selector for a cell with no visible content. We’ll likely need to special-case the common invisible elements (style and link… not sure if others). And I’d still like to have completely hidden cells in read-only mode, which would mean no min-height so that margins can collapse.