diff --git a/lib/livebook/session.ex b/lib/livebook/session.ex index 9183b5e8d..e574b7f86 100644 --- a/lib/livebook/session.ex +++ b/lib/livebook/session.ex @@ -642,8 +642,8 @@ defmodule Livebook.Session do {:noreply, state} end - def handle_info({:evaluation_output, cell_id, string}, state) do - operation = {:add_cell_evaluation_output, self(), cell_id, string} + def handle_info({:evaluation_output, cell_id, output}, state) do + operation = {:add_cell_evaluation_output, self(), cell_id, output} {:noreply, handle_operation(state, operation)} end diff --git a/lib/livebook_web/live/output.ex b/lib/livebook_web/live/output.ex index 30ffb4f07..c90a27256 100644 --- a/lib/livebook_web/live/output.ex +++ b/lib/livebook_web/live/output.ex @@ -99,10 +99,20 @@ defmodule LivebookWeb.Output do ) end - defp render_output({:frame_dynamic, pid}, %{id: id, socket: socket, input_values: input_values}) do + defp render_output({:frame_dynamic, pid}, %{ + id: id, + socket: socket, + input_values: input_values, + cell_validity_status: cell_validity_status + }) do live_render(socket, LivebookWeb.Output.FrameDynamicLive, id: id, - session: %{"id" => id, "pid" => pid, "input_values" => input_values} + session: %{ + "id" => id, + "pid" => pid, + "input_values" => input_values, + "cell_validity_status" => cell_validity_status + } ) end diff --git a/lib/livebook_web/live/output/frame_dynamic_live.ex b/lib/livebook_web/live/output/frame_dynamic_live.ex index 60da22733..68693862d 100644 --- a/lib/livebook_web/live/output/frame_dynamic_live.ex +++ b/lib/livebook_web/live/output/frame_dynamic_live.ex @@ -2,12 +2,27 @@ defmodule LivebookWeb.Output.FrameDynamicLive do use LivebookWeb, :live_view @impl true - def mount(_params, %{"pid" => pid, "id" => id, "input_values" => input_values}, socket) do + def mount( + _params, + %{ + "pid" => pid, + "id" => id, + "input_values" => input_values, + "cell_validity_status" => cell_validity_status + }, + socket + ) do if connected?(socket) do send(pid, {:connect, self()}) end - {:ok, assign(socket, id: id, output: nil, input_values: input_values)} + {:ok, + assign(socket, + id: id, + output: nil, + input_values: input_values, + cell_validity_status: cell_validity_status + )} end @impl true @@ -20,7 +35,8 @@ defmodule LivebookWeb.Output.FrameDynamicLive do id={"#{@id}-frame"} socket={@socket} runtime={nil} - input_values={@input_values} /> + input_values={@input_values} + cell_validity_status={@cell_validity_status} /> <% else %>