Skip to content
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

Make notebook status bar contributable #104958

Closed
miguelsolorio opened this issue Aug 18, 2020 · 4 comments
Closed

Make notebook status bar contributable #104958

miguelsolorio opened this issue Aug 18, 2020 · 4 comments
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders notebook on-testplan ux User experience issues
Milestone

Comments

@miguelsolorio
Copy link
Contributor

It would be great if extensions could provide richer functionality via the status bar, like we currently do in our Core status bar. One idea is this will allow for extensions to provide content actions that are separate from cell actions, like a Markdown WYSIWYG:

image

@miguelsolorio miguelsolorio added feature-request Request for new features or functionality ux User experience issues notebook labels Aug 18, 2020
@miguelsolorio miguelsolorio added this to the Backlog milestone Aug 18, 2020
@roblourens
Copy link
Member

roblourens commented Aug 20, 2020

A couple ways to think about this

  • Like status bar API
    • Dynamic
    • An extension can show/hide individual items per cell
  • Like a menu/toolbar
    • Static
    • An extension can register entries with visibility controlled by "when" clause

In the use cases we care about, there are some items that we will want to add only to a particular cell, and also cases where we want to add an item to, say, every markdown cell. The dynamic option will be inconvenient for getting items to show up on new cells.

The static option would work if we had the ability to dynamically change custom context keys for different cells. As far as I know, we can only set global custom context keys (executeCommand('setContext'), and the tree and comments APIs allow for setting one context key per item, which is not dynamic. I think the solution would be a map of custom context keys/values on NotebookCell, a sibling of metadata, that can be changed at any time and referenced by static contributions of status bar items.

I think this would also be a new contribution point unless these things are registered in code. I don't think it would fit into "menus".

@roblourens
Copy link
Member

And there is also work going to support working with complex context keys here #104625

@roblourens
Copy link
Member

roblourens commented Aug 20, 2020

The things that should go into the contribution look basically like StatusBarItem

  • alignment (left/right)
  • priority
  • text
  • tooltip
  • color (?)
  • command
  • accessibility info (label/role)

I think it's not clear that all these things can be known statically. I need to know more about use-cases in Python.

@roblourens
Copy link
Member

Talking to Kai, we clearly need a statusbar-like API, we may also have a toolbar-type API, but these are distinct usecases.

namespace notebook {
	export function createCellStatusBarItem(cell: NotebookCell, alignment?: StatusBarAlignment, priority?: number): NotebookCellStatusBarItem;
}

export interface NotebookCellStatusBarItem {
	readonly cell: NotebookCell;
	readonly alignment: StatusBarAlignment;
	readonly priority?: number;
	text: string;
	tooltip: string | undefined;
	color: string | ThemeColor | undefined;
	command: string | Command | undefined;
	accessibilityInformation?: AccessibilityInformation;
	show(): void;
	hide(): void;
	dispose(): void;
}

@roblourens roblourens modified the milestones: Backlog, August 2020 Aug 27, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders notebook on-testplan ux User experience issues
Projects
None yet
Development

No branches or pull requests

4 participants
@roblourens @rebornix @miguelsolorio and others