From 848c4ea146d065bc75c5fc567d6d89a149442de0 Mon Sep 17 00:00:00 2001 From: Jamey Greenwood Date: Mon, 19 Jan 2026 21:37:34 +0000 Subject: [PATCH] feat: add navigation and collapsible sidebar to theme editor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add "← View Shop" link on admin/theme page for easy navigation - Add collapsible sidebar with chevron toggle button - Include proper ARIA attributes for accessibility (aria-label, aria-expanded, aria-controls) Co-Authored-By: Claude Opus 4.5 --- .../components/layouts/root.html.heex | 53 +++++++++++-------- .../live/theme_live/index.ex | 6 +++ .../live/theme_live/index.html.heex | 46 ++++++++++++++-- 3 files changed, 78 insertions(+), 27 deletions(-) diff --git a/lib/simpleshop_theme_web/components/layouts/root.html.heex b/lib/simpleshop_theme_web/components/layouts/root.html.heex index b3c5947..b115b0e 100644 --- a/lib/simpleshop_theme_web/components/layouts/root.html.heex +++ b/lib/simpleshop_theme_web/components/layouts/root.html.heex @@ -34,29 +34,36 @@ - + {@inner_content} diff --git a/lib/simpleshop_theme_web/live/theme_live/index.ex b/lib/simpleshop_theme_web/live/theme_live/index.ex index 1fe2301..8fd3126 100644 --- a/lib/simpleshop_theme_web/live/theme_live/index.ex +++ b/lib/simpleshop_theme_web/live/theme_live/index.ex @@ -31,6 +31,7 @@ defmodule SimpleshopThemeWeb.ThemeLive.Index do |> assign(:logo_image, logo_image) |> assign(:header_image, header_image) |> assign(:customise_open, false) + |> assign(:sidebar_collapsed, false) |> allow_upload(:logo_upload, accept: ~w(.png .jpg .jpeg .webp .svg), max_entries: 1, @@ -280,6 +281,11 @@ defmodule SimpleshopThemeWeb.ThemeLive.Index do {:noreply, assign(socket, :customise_open, !socket.assigns.customise_open)} end + @impl true + def handle_event("toggle_sidebar", _params, socket) do + {:noreply, assign(socket, :sidebar_collapsed, !socket.assigns.sidebar_collapsed)} + end + @impl true def handle_event("noop", _params, socket) do {:noreply, socket} diff --git a/lib/simpleshop_theme_web/live/theme_live/index.html.heex b/lib/simpleshop_theme_web/live/theme_live/index.html.heex index bfe621c..72b0902 100644 --- a/lib/simpleshop_theme_web/live/theme_live/index.html.heex +++ b/lib/simpleshop_theme_web/live/theme_live/index.html.heex @@ -1,11 +1,48 @@
-
+
+ + <%= if @sidebar_collapsed do %> +
+ +
+ <% else %> -
-

Theme Studio

-

One theme, infinite possibilities. Every combination is designed to work beautifully.

+
+
+

Theme Studio

+

One theme, infinite possibilities. Every combination is designed to work beautifully.

+
+
@@ -838,6 +875,7 @@
One of 100,000+ possible combinations
+ <% end %>