mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-10 17:15:09 +08:00
4bacba6b1d
* 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 |
||
---|---|---|
.. | ||
livebook | ||
livebook_cli | ||
livebook_web | ||
livebook.ex | ||
livebook_cli.ex | ||
livebook_web.ex |