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
19 changes: 16 additions & 3 deletions lib/live_debugger/components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,15 @@ defmodule LiveDebugger.Components do
assigns
|> assign(:button_class, button_class)
|> assign(:icon_class, icon_class)
|> assign(:aria_label, assigns[:"aria-label"] || icon_label(assigns.icon))

~H"""
<.button class={[@button_class | List.wrap(@class)]} variant={@variant} {@rest}>
<.button
aria-label={@aria_label}
class={[@button_class | List.wrap(@class)]}
variant={@variant}
{@rest}
>
<.icon name={@icon} class={@icon_class} />
</.button>
"""
Expand All @@ -333,6 +339,7 @@ defmodule LiveDebugger.Components do
def nav_icon(assigns) do
~H"""
<button
aria-label={icon_label(@icon)}
class={[
"w-8! h-8! px-[0.25rem] py-[0.25rem] w-max h-max rounded text-xs font-semibold text-navbar-icon hover:text-navbar-icon-hover hover:bg-navbar-icon-bg-hover"
| List.wrap(@class)
Expand Down Expand Up @@ -546,7 +553,7 @@ defmodule LiveDebugger.Components do

def navbar(assigns) do
~H"""
<div class="w-full h-12 shrink-0 py-auto px-4 flex items-center gap-2 bg-navbar-bg text-navbar-logo border-b border-navbar-border">
<navbar class="w-full h-12 shrink-0 py-auto px-4 flex items-center gap-2 bg-navbar-bg text-navbar-logo border-b border-navbar-border">
<.link :if={@return_link?} patch={Routes.live_views_dashboard()}>
<.nav_icon icon="icon-arrow-left" />
</.link>
Expand All @@ -573,7 +580,7 @@ defmodule LiveDebugger.Components do
<%= @inner_block && render_slot(@inner_block) %>
</div>
</div>
</div>
</navbar>
"""
end

Expand Down Expand Up @@ -651,4 +658,10 @@ defmodule LiveDebugger.Components do

defp button_size_classes("md"), do: "py-2 px-3"
defp button_size_classes("sm"), do: "py-1.5 px-2"

defp icon_label("icon-" <> icon_name) do
icon_name
|> String.capitalize()
|> String.replace("-", " ")
end
end
2 changes: 1 addition & 1 deletion lib/live_debugger/components/tree.ex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ defmodule LiveDebugger.Components.Tree do

def tree(assigns) do
~H"""
<div class={["w-full overflow-y-auto flex flex-col", @class]}>
<div class={["min-h-20 w-full overflow-y-auto flex flex-col", @class]}>
<div class="flex items-center justify-between">
<div class="shrink-0 font-medium text-secondary-text px-6 py-3"><%= @title %></div>
<%= if LiveDebugger.Feature.enabled?(:highlighting) do %>
Expand Down
6 changes: 3 additions & 3 deletions lib/live_debugger/live_views/channel_dashboard_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defmodule LiveDebugger.LiveViews.ChannelDashboardLive do
@impl true
def render(assigns) do
~H"""
<div class="w-screen h-screen flex flex-col">
<div class="w-screen h-screen grid grid-rows-[auto_1fr]">
<.navbar return_link?={true}>
<div class="grow flex items-center justify-end">
<.nav_icon
Expand All @@ -52,7 +52,7 @@ defmodule LiveDebugger.LiveViews.ChannelDashboardLive do
</.navbar>
<.async_result :let={lv_process} assign={@lv_process}>
<:loading>
<div class="h-full flex items-center justify-center">
<div class="m-auto flex items-center justify-center">
<.spinner size="xl" />
</div>
</:loading>
Expand All @@ -62,7 +62,7 @@ defmodule LiveDebugger.LiveViews.ChannelDashboardLive do
<Error.unexpected_error_component :if={reason not in [:not_found, :session_limit]} />
</:failed>

<div class="flex flex-1 overflow-hidden">
<div class="flex overflow-hidden">
<SidebarLive.live_render
id="sidebar"
socket={@socket}
Expand Down
6 changes: 3 additions & 3 deletions lib/live_debugger/live_views/live_views_dashboard_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ defmodule LiveDebugger.LiveViews.LiveViewsDashboardLive do
@impl true
def render(assigns) do
~H"""
<div class="w-full h-full min-w-[25rem] flex flex-col items-center">
<div class="flex-1 min-w-[25rem] grid grid-rows-[auto_1fr]">
<.navbar return_link?={false} />
<div class="max-xl:p-8 pt-8 w-full xl:max-w-[40rem] h-full">
<div class="flex gap-4 items-center justify-between">
<div class="flex-1 max-lg:p-8 pt-8 lg:w-[60rem] lg:m-auto">
<div class="flex items-center justify-between">
<.h1>Active LiveViews</.h1>
<.button phx-click="refresh">
<div class="flex items-center gap-2">
Expand Down
7 changes: 3 additions & 4 deletions lib/live_debugger/live_views/sidebar_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defmodule LiveDebugger.LiveViews.SidebarLive do
<%= live_render(@socket, __MODULE__,
id: @id,
session: @session,
container: {:div, class: "h-full"}
container: {:aside, class: "h-full"}
) %>
"""
end
Expand Down Expand Up @@ -93,7 +93,6 @@ defmodule LiveDebugger.LiveViews.SidebarLive do
highlight?={@highlight?}
parent_lv_process={@parent_lv_process}
/>
<.report_issue class="border-t border-default-border" />
</div>
<.sidebar_slide_over :if={not @hidden?}>
<.sidebar_content
Expand All @@ -105,7 +104,6 @@ defmodule LiveDebugger.LiveViews.SidebarLive do
highlight?={@highlight?}
parent_lv_process={@parent_lv_process}
/>
<.report_issue class="border-t border-default-border" />
</.sidebar_slide_over>
</div>
"""
Expand Down Expand Up @@ -210,7 +208,7 @@ defmodule LiveDebugger.LiveViews.SidebarLive do

defp sidebar_content(assigns) do
~H"""
<div class="flex flex-col max-h-full h-max">
<div class="grid grid-rows-[auto_auto_1fr_auto] h-full">
<.basic_info
pid={@lv_process.pid}
socket_id={@lv_process.socket_id}
Expand All @@ -227,6 +225,7 @@ defmodule LiveDebugger.LiveViews.SidebarLive do
max_opened_node_level={@max_opened_node_level}
highlight?={@highlight?}
/>
<.report_issue class="border-t border-default-border" />
</div>
"""
end
Expand Down