Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion assets/app/hooks/fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const Fullscreen = {
this.el.close();
this.el.classList.remove('flex');
this.el.classList.add('hidden');
this.pushEvent('fullscreen-closed', { id: this.el.id });

if (this.el.hasAttribute('data-send-close-event')) {
this.pushEvent('fullscreen-closed', { id: this.el.id });
}
};

// Events from the browser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ defmodule LiveDebugger.App.Debugger.NodeState.Web.HookComponents.AssignsHistory
assigns = assign(assigns, id: @assigns_history_id)

~H"""
<.fullscreen id={@id} title="Assigns History" class="xl:w-3/4!">
<.fullscreen id={@id} title="Assigns History" send_close_event={true} class="xl:w-3/4!">
<div class="flex flex-col justify-between p-4 min-h-[40rem]">
<.async_result :let={history_entries} assign={@history_entries}>
<:loading>
Expand Down
7 changes: 7 additions & 0 deletions lib/live_debugger/app/web/components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,12 @@ defmodule LiveDebugger.App.Web.Components do
attr(:id, :string, required: true)
attr(:title, :string, default: "", doc: "Title of the fullscreen.")

attr(:send_close_event, :boolean,
default: false,
doc:
"Whether to send a `fullscreen-closed` event to the server when the fullscreen is closed."
)

attr(:class, :any,
default: nil,
doc: "Additional classes to be added to the fullscreen element."
Expand All @@ -483,6 +489,7 @@ defmodule LiveDebugger.App.Web.Components do
<dialog
id={@id}
phx-hook="Fullscreen"
data-send-close-event={@send_close_event}
class={[
"relative h-max w-full xl:w-max xl:min-w-[50rem] bg-surface-0-bg pt-1 overflow-auto hidden flex-col rounded-md backdrop:bg-black backdrop:opacity-50"
| List.wrap(@class)
Expand Down
2 changes: 1 addition & 1 deletion priv/static/app.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions priv/static/app.js.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions test/e2e/assigns_test.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
defmodule LiveDebugger.E2E.AssignsTest do
use LiveDebugger.E2ECase

setup_all do
LiveDebugger.Services.CallbackTracer.GenServers.TracingManager.ping!()
LiveDebugger.API.SettingsStorage.save(:tracing_enabled_on_start, false)

:ok
end

@sessions 2
feature "user can search assigns using the searchbar", %{
sessions: [dev_app, debugger]
Expand Down