livebook/lib
Lee Jarvis 4bacba6b1d
Remove delete prompt for empty sections (#829)
* Remove delete prompt for empty sections

If a section has no cell views or only empty cell views, avoid
prompting the user to delete the section and just go ahead and delete
it.

Closes #800

* Move delete prompt logic to SessionLive

This avoids creating two separate paths in the view for displaying
delete buttons (triggering either a prompt, or deleting the empty
section).

Instead, the `delete_section` callback is always triggered, and the
"display prompt" logic is kept here.

Couple of things I'm unsure about so will discuss on the PR.

See https://github.com/livebook-dev/livebook/pull/829#discussion_r775560671

* Check only against empty cell list in `delete_section`

* Fix indentation

* Handle section not existing on deletion

* Match empty cell list in case expression

Also explicitly set the section and then re-use it. I think this is a
bit nicer than just matching against the empty list since it matches
the following match too
2021-12-27 18:42:27 +01:00
..
livebook Add support for exporting JS output (#826) 2021-12-27 13:56:55 +01:00
livebook_cli Revert to URI.new! (#784) 2021-12-09 20:46:45 +01:00
livebook_web Remove delete prompt for empty sections (#829) 2021-12-27 18:42:27 +01:00
livebook.ex Automatically back up notebooks without a file (#736) 2021-12-04 16:29:14 +01:00
livebook_cli.ex Include full stacktrace for unexpected exceptions (#781) 2021-12-09 15:44:23 +01:00
livebook_web.ex Refactor modals with JS commands (#669) 2021-11-02 22:34:44 +01:00