Always expand the setup cell when focused (#1166)

This commit is contained in:
Jonatan Kłosko 2022-05-03 16:20:13 +02:00 committed by GitHub
parent 62140eb8d7
commit 567c69a884
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 22 deletions

View file

@ -128,28 +128,13 @@ solely client-side operations.
@apply hidden;
}
[data-el-session]:not([data-js-insert-mode])
[data-el-cell][data-type="setup"]:not([data-eval-validity="fresh"]:not([data-js-empty])):not([data-js-changed])
[data-el-editor-box],
[data-el-session]
[data-el-cell][data-type="setup"]:not([data-eval-validity="fresh"]:not([data-js-empty])):not([data-js-changed]):not([data-js-focused])
[data-el-editor-box] {
@apply h-0 overflow-hidden;
}
[data-el-session][data-js-insert-mode]
[data-el-cell][data-type="setup"][data-js-focused]
[data-el-enable-insert-mode-button],
[data-el-session]
[data-el-cell][data-type="setup"][data-eval-validity="fresh"]:not([data-js-empty])
[data-el-enable-insert-mode-button],
[data-el-session]
[data-el-cell][data-type="setup"][data-js-changed]
[data-el-enable-insert-mode-button] {
@apply hidden;
}
[data-el-session][data-js-insert-mode]
[data-el-cell][data-type="setup"][data-js-focused]
[data-el-info-box],
[data-el-session]

View file

@ -520,12 +520,7 @@ const Session = {
const cell = event.target.closest(`[data-el-cell]`);
const type = cell && cell.getAttribute("data-type");
if (
type &&
["markdown", "setup"].includes(type) &&
this.focusedId &&
!this.insertMode
) {
if (type && type === "markdown" && this.focusedId && !this.insertMode) {
this.setInsertMode(true);
}
},

View file

@ -104,7 +104,6 @@ defmodule LivebookWeb.SessionLive.CellComponent do
status={@cell_view.eval.status} />
</:primary>
<:secondary>
<.enable_insert_mode_button />
<.package_search_button session_id={@session_id} runtime={@runtime} socket={@socket} />
<.cell_link_button cell_id={@cell_view.id} />
<.setup_cell_info />