fix: sidebar hiding works again
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -90,7 +90,7 @@
|
|||||||
<section
|
<section
|
||||||
class={["sidebar-shell", if(not @workbench.sidebar_visible, do: "is-hidden")]}
|
class={["sidebar-shell", if(not @workbench.sidebar_visible, do: "is-hidden")]}
|
||||||
data-testid="sidebar-shell"
|
data-testid="sidebar-shell"
|
||||||
style={"width: #{@workbench.sidebar_width}px;"}
|
style={"width: #{if(@workbench.sidebar_visible, do: @workbench.sidebar_width, else: 0)}px;"}
|
||||||
>
|
>
|
||||||
<div class="sidebar" data-region="sidebar">
|
<div class="sidebar" data-region="sidebar">
|
||||||
<div id="sidebar-content" class="sidebar-content sidebar-body" phx-hook="SidebarInteractions">
|
<div id="sidebar-content" class="sidebar-content sidebar-body" phx-hook="SidebarInteractions">
|
||||||
@@ -307,7 +307,7 @@
|
|||||||
<section
|
<section
|
||||||
class={["assistant-sidebar-shell", if(not @workbench.assistant_sidebar_visible, do: "is-hidden")]}
|
class={["assistant-sidebar-shell", if(not @workbench.assistant_sidebar_visible, do: "is-hidden")]}
|
||||||
data-testid="assistant-shell"
|
data-testid="assistant-shell"
|
||||||
style={"width: #{@workbench.assistant_sidebar_width}px;"}
|
style={"width: #{if(@workbench.assistant_sidebar_visible, do: @workbench.assistant_sidebar_width, else: 0)}px;"}
|
||||||
>
|
>
|
||||||
<div class="resizable-panel-divider assistant-divider" data-resize="assistant" data-role="resize-handle"></div>
|
<div class="resizable-panel-divider assistant-divider" data-resize="assistant" data-role="resize-handle"></div>
|
||||||
<aside class="assistant-sidebar" data-region="assistant-sidebar">
|
<aside class="assistant-sidebar" data-region="assistant-sidebar">
|
||||||
|
|||||||
@@ -154,4 +154,19 @@ defmodule BDS.Desktop.ShellLiveTest do
|
|||||||
html = render_keydown(view, "shortcut", %{key: "w", meta: true})
|
html = render_keydown(view, "shortcut", %{key: "w", meta: true})
|
||||||
refute html =~ ~s(data-tab-id="media-1")
|
refute html =~ ~s(data-tab-id="media-1")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "hiding the sidebar collapses its width to zero" do
|
||||||
|
{:ok, view, html} = live_isolated(build_conn(), BDS.Desktop.ShellLive)
|
||||||
|
|
||||||
|
assert html =~ ~s(data-testid="sidebar-shell")
|
||||||
|
assert html =~ ~s(style="width: 280px;")
|
||||||
|
|
||||||
|
html =
|
||||||
|
view
|
||||||
|
|> element("[data-testid='toggle-sidebar']")
|
||||||
|
|> render_click()
|
||||||
|
|
||||||
|
assert html =~ ~s(class="sidebar-shell is-hidden")
|
||||||
|
assert html =~ ~s(style="width: 0px;")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user