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

Cell tools #1586

Merged
merged 37 commits into from Feb 7, 2017
Merged

Cell tools #1586

merged 37 commits into from Feb 7, 2017

Conversation

@blink1073
Copy link
Member

@blink1073 blink1073 commented Jan 30, 2017

Fixes #902.

Notes about the raw metadata editor:

  • When the user focuses the the raw metadata cell, it no longer updates with programmatic changes.
  • If the user makes a change to the raw metadata, commit and revert buttons are shown above the text area.
  • If the user blurs the text area without having made any changes, it is updated to reflect the current data.
  • If the user blurs the text area having made changes, the buttons remain and the metadata is not updated.
  • If the user cancels the changes, the area is updated to reflect the current data.
  • If the user commits the changes, the metadata is merged, with the input data overriding any keys that were set programatically. Keys that were removed by the user are deleted.
  • If the user has input invalid JSON, the box will be made red and the buttons will remain visible.

The raw metadata editor was written so that it could be used to edit notebook level metadata as well. Also, when we add metadata editing for multiple cells, we can use the Metadata.IOwner interface to abstract over all selected cells.

Raw cell:
image

Code cell (nbconvert selector is disabled):
image

Editing Metadata:
metadata_editor

@blink1073
Copy link
Member Author

@blink1073 blink1073 commented Feb 1, 2017

@cameronoelsen, the bones are there, except for the handling of the cell metadata editing. I can't remember what we said we were going to do for that. I think we had said it would be a read-only text area, and double-clicking would bring up an editor.

@blink1073
Copy link
Member Author

@blink1073 blink1073 commented Feb 2, 2017

@afshin and I talked about this and propose the following behavior:

  • When the user focuses the the raw metadata cell, it no longer updates with programmatic changes
  • If the user makes a change to the raw metadata, commit and cancel buttons are shown above the text area
  • If the user blurs the text area without having made any changes, it is updated to reflect the current data
  • If the user blurs the text area having made changes, the buttons remain and the metadata is not updated.
  • If the user cancels the changes, the area is updated to reflect the current data.
  • If the user commits the changes, the metadata is merged, with the input data overriding any keys that were set programatically.
  • If the user has input invalid JSON, the box will be made red and the buttons will remain visible

@ellisonbg
Copy link
Contributor

@ellisonbg ellisonbg commented Feb 3, 2017

@blink1073 can you show some screen shots that show the whole lab so we can see what the notebook looks like and the L panel looks like?

@blink1073
Copy link
Member Author

@blink1073 blink1073 commented Feb 3, 2017

@ellisonbg, updated.

@blink1073
Copy link
Member Author

@blink1073 blink1073 commented Feb 3, 2017

We agreed in the weekly dev meeting today to try out the approach above, moving the editor to the end and making it collapsed by default.

@blink1073
Copy link
Member Author

@blink1073 blink1073 commented Feb 3, 2017

Notes from discussion with @afshin this morning: we should use the Message system instead of signaling to notify the cell tools of changes, since they are hierarchical. Override the parent property to be a CellTools object.

afshin
afshin approved these changes Feb 7, 2017
Copy link
Member

@afshin afshin left a comment

Awesome, thanks! This is epic.

@blink1073 blink1073 merged commit 3fd36bb into jupyterlab:master Feb 7, 2017
2 checks passed
@blink1073 blink1073 deleted the cell-tools branch Feb 7, 2017
@jasongrout
Copy link
Contributor

@jasongrout jasongrout commented Feb 7, 2017

👏!

@lock lock bot locked as resolved and limited conversation to collaborators Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants