🏠 back to Observable

Via UX prompt: Ctrl-F to find code in someone's notebook


#1

I saw Tom’s solicitation on Twitter and wanted to share my early UX challenge.

The problem is simple and I’d be surprised if no one else had encountered it: If I know that a long notebook uses a little snippet of code, I haven’t noticed a way to pop open all the cells at one time to search them to find the correct cell, say with ctrl-f, besides exporting it.

Good luck and keep up the good work.


Fresh & clean new cell name display
#2

Not an ideal solution, but you can use Safe mode for this: Safe mode shows all the code (and only the code) for your notebook. To access Safe mode, either add /safe to the URL in the address bar, or from your profile, click on the little menu for your notebook and then click Safe mode.

(Because Observable syncs your changes in realtime as you commit them, you can also develop notebooks in safe mode and non-safe mode in two side-by-side windows, if you prefer that style of development.)


#3

Thanks, I had heard of Safe Mode once but hadn’t remembered to use it like that.

The parenthetical method is pretty cool. The websocket sync capability perhaps conflicts with the “safe mode” name: it is a hidden side effect, albeit of the “backend” still being smart, even if the front-end is mostly not.

Happy to resolve this if it’s best.


#4

I think a keyboard shortcut to open/close all (non-pinned) cells would be an excellent addition though!


#5

Is there any way to get the browser to still have the text content of a hidden code block as part of the DOM, and then show the cell in question when it gets a selection event from Find?

Might be unnecessarily complicated / hard to make work across browsers / etc. Just an idea.