Allow smart cells to reevaluate automatically

This commit is contained in:
Jonatan Kłosko 2025-05-29 22:47:59 +02:00
parent b2bcc064fa
commit cb0546f901
3 changed files with 5 additions and 1 deletions

View file

@ -15,6 +15,7 @@ defmodule Livebook.Notebook.Cell.Smart do
:source,
:chunks,
:outputs,
:reevaluate_automatically,
:kind,
:attrs,
:js_view,
@ -29,6 +30,7 @@ defmodule Livebook.Notebook.Cell.Smart do
source: String.t() | :__pruned__,
chunks: Livebook.Runtime.chunks() | nil,
outputs: list(Cell.indexed_output()),
reevaluate_automatically: boolean(),
kind: String.t() | nil,
attrs: attrs() | :__pruned__,
js_view: Livebook.Runtime.js_view() | nil,
@ -47,6 +49,7 @@ defmodule Livebook.Notebook.Cell.Smart do
source: "",
chunks: nil,
outputs: [],
reevaluate_automatically: false,
kind: nil,
attrs: %{},
js_view: nil,

View file

@ -1978,6 +1978,7 @@ defmodule LivebookWeb.SessionLive do
type: :smart,
empty: cell.source == "",
eval: eval_info_to_view(cell, info.eval, data, changed_input_ids),
reevaluate_automatically: cell.reevaluate_automatically,
status: info.status,
js_view: cell.js_view,
editor:

View file

@ -249,7 +249,7 @@ defmodule LivebookWeb.SessionLive.CellComponent do
cell_id={@cell_view.id}
validity={@cell_view.eval.validity}
status={@cell_view.eval.status}
reevaluate_automatically={false}
reevaluate_automatically={@cell_view.reevaluate_automatically}
reevaluates_automatically={@cell_view.eval.reevaluates_automatically}
/>
</:primary>