-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notebook cell list focus/selection model #117868
Comments
cc @misolori, @roblourens and @jrieken for inputs. |
One thing I failed to understand from the issue is: what is the expected behavior for Notebooks? That is: what do you expect to happen when pressing all combinations of Ctrl/Shift with arrow keys? |
@joaomoreno sorry that I didn't make it clear:
now we don't use |
I still think that being consistent with other lists will save us a lot of time and energy. Maybe with minor tweaks we can address things that feel off in notebooks, like
Then there is the question of how this gets exposed in API, we probably don't have to expose the exact details of focus vs selection in API. We can decide what the goal of the API is, design the right API for that, and map it to our internal model. |
I agree on this, staying close to the list view logic will be the best for engineering efforts. The concern I have is how many workarounds/tweaks we need to take to reach a reasonable state
It makes You will not see any cell bgcolors in this case as it's still not multi-select. However from user's perspective, it should be multi-select as they press I wonder if we can have tweaks which can ensure they all work as expected. But currently I didn't think so considering how |
Feedback we got from the standup today about if we want list commands work seamlessly in notebook land
|
Already supported via List View's new navigation model. |
The notebook editor is a list widget/view under the hood, thus users can use their familiar list view keybindings to navigate and select cells in the notebook editor. It works well with single selection mode but fell apart after we turned on the multiple selection mode.
Selection/Focus model difference
The multi-selection/focus mode in the builtin list view seems inherits the concept of selection/focus of the File Explorer (VS Code one, not the OS one), and the major difference we are running into is
The list view behavior makes sense for the File Explorer as it's a master-details view, the selected entry might be opened in the editor pane so arrow up/down moves the focus, but not the "selection". However in Notebook, it's simply a list, pretty close to Finder, arrow keys just moves the focus/selection up and down. The only difference between Notebook list and Finder is probably that in Finder, there is no "focus" but in notebook, the lastly activated item is the focused element.
Proposal 1
When @roblourens and me discussed about this, we talked about if we should align completely with the default list view. The catch is it feels weird in notebook list, even for the simplest scenario
It's beyond my expectation and IMHO users will get confused too. The advantage of this solution is though all list commands and features just work seamlessly, and we don't need to tweak how selections/focus are handled, which will definitely lead to interesting bugs.
Proposal 2
The other way around is keeping our current UX in notebook, but I found that I'm almost fighting against the list view logic (how it
setFocus
andsetSelection
):setFocus
onlysetFocus
and thensetSelection
Whether the selection should be updated depends on if a
setSelection
call is invoked and we can't tell that whensetFocus
is invoked. Almost every list view navigation/selection related commands leveragesetFocus
andsetSelection
to archive the file_explorer_style experience. To completely workaround this in notebook, it seems we have tosetFocus
is called, make sure the focused element is also selectedThe drawback is list commands are no longer useable in Notebook and we may also want to disable list commands completely otherwise users will run into weird state as list commands can call
setFocus
andsetSelection
in a wrong order (wrong = not what we expect).@joaomoreno I'd like to hear your thoughts on this, especially how to approach this if we want a different focus/selection model than the default one. Currently I prefer the second approach but found it challenging to implement.
The text was updated successfully, but these errors were encountered: