mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-02-20 21:04:17 +08:00
* 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 |
||
---|---|---|
.. | ||
controllers | ||
helpers | ||
live | ||
plugs | ||
templates | ||
views | ||
endpoint.ex | ||
helpers.ex | ||
router.ex | ||
telemetry.ex |