observablehq / feedback

Customer submitted bugs and feature requests
42 stars 3 forks source link

BUG: "New cell defaults to JavaScript" affects only the keyboard shortcut #427

Closed wizzard0 closed 1 year ago

wizzard0 commented 2 years ago

Describe the bug All the cells that I ever create are JS. e.g. I never use pure Markdown cells because md`` keeps the mental model simpler. Recently Observable introduced the mandatory menu I have to click through each time I'm creating a cell.

This is annoying on desktop and a big UX regression on mobile. One has to scroll the UI every time (!) to click the menu when adding one more cell at the end of the notebook (see attached screenshot).

I was excited to find an option "new cell defaults to JS" only to discover it doesn't affect the buttons. But one can't press Cmd+Enter on the virtual keyboard %)

To Reproduce Steps to reproduce the behavior:

  1. Enable the "cells default to JS"
  2. Tap or click the "+" to create a cell.

Expected behavior The "default cell type" option applies to the button tap/click action as well.

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

tophtucker commented 2 years ago

Thanks Oleksandr, these are good points. I worked on the new mandatory menu (and personally also usually make JavaScript cells). For launch we focused on the desktop experience, and it shows; I agree it's gotta get better on mobile.

hiding the buttons make UI much less discoverable and cumbersome to use on mobile

Which buttons specifically are you looking for here?

an ability to edit the cell on mobile with a single tap instead of currently mandatory two taps

Are you referring to tapping on the cell editor, where currently I think it takes one tap to focus the cell (so it shows the menu and such) and then another tap to actually focus the editor / bring up the keyboard? Or are you referring to tapping on the "⋮" cell menu and then tapping "Edit", e.g. on a cell without the code pinned open?

tophtucker commented 2 years ago

I'd also love to hear more about your overall mobile editing experience and habits. Can you describe when or why you're on your phone rather than at a laptop or desktop? (As a programmer who spends most of most days sitting in front of a laptop, it's all too easy for me to assume others are doing the same!)

wizzard0 commented 2 years ago

For launch we focused on the desktop experience, and it shows; I agree it's gotta get better on mobile.

well, that makes sense, but I mean it was better on mobile %)

it takes one tap to focus the cell (so it shows the menu and such) and then another tap to actually focus the editor / bring up the keyboard?

Yes, tapping the cell editor. Previously there was always visible "insert cell" button and you could insert cell between any existing cells and begin editing with one tap, or edit another cell also with one tap.

why you're on your phone rather than at a laptop or desktop?

Well, I actually wrote (or rather, fixed) quite a lot of production code from my phone.

I mostly do consulting on hard problems, and when you happen to be a last-resort escalation point - those escalations tend to happen at inconvenient times. When you're hiking somewhere in the mountains, you typically don't have a laptop with you.

That doesn't apply to Observable though %) but that's where the habit of considering the phone a worthwhile dev environment comes from.

I use Observable on my phone a) if I want either to quickly write down/check some ideas b) to quickly make some charts/calculations and support my claims with data during an adhoc meeting (e.g. between the drinks in a bar/on the bus etc). It's a notebook after all!

tophtucker commented 2 years ago

We've restored the old behavior when you tap ➕ on small screens. You can tap and hold to get the menu. Still workin on making the menu more mobile-friendly when it does come up!

tophtucker commented 2 years ago

Also wanna say thank you for such patient and thoughtful feedback! For every person who writes in, there's a hundred who suffer silently. We notice and feel a lot of these things internally, but when you're too close to the work it's hard to weigh the tradeoffs impartially, let alone prioritize what to fix first, so we really do rely on outside feedback.

CobusT commented 2 years ago

Since defaulting behavior is now fixed, are there other suggestions/feature requests here that would be better classified as Feature requests? Should we close this (bug) and create a new feature request so it is clear what we want to address? Sounds like the proposal is to make the menu more mobile friendly (which is a bit 'hidden' in this issue).

jrus commented 2 years ago

For what it’s worth, I would prefer if the new cell button would also always make a javascript cell. Having a menu pop up is mildly distracting/annoying every time I want to add a cell. Which is one of the most common actions in working with Observable.

CobusT commented 2 years ago

@jrus There is a setting for that on your user Editor settings. Just check the item “New cell” keyboard shortcut defaults to JavaScript

image
jrus commented 2 years ago

Yes I know and have that one enabled. I am talking about the + button, not the keyboard shortcut.

CobusT commented 2 years ago

Ah ok. Got it.

CobusT commented 1 year ago

Double-clicking the + creates a JavaScript cell... I don't think we are going to get rid of the cell type option as a default, since that is now so much more than just a cell mode selector, it is also a way to access snippets.