From cb9021c2667adecd265b650054aca5fb661e655d Mon Sep 17 00:00:00 2001 From: Darwin Wu Date: Sat, 15 Aug 2026 05:23:23 +0000 Subject: [PATCH 1/5] feat: add mobile bottom navigation Amp-Thread-ID: https://ampcode.com/threads/T-01a003bd-4cda-73e9-a977-da00cd0164f5 --- lib/textbin_web/components/layouts.ex | 123 +++++++++++++++--- .../live/ui/organization_live_test.exs | 36 ++++- .../live/ui/workspace_live_test.exs | 18 +++ 3 files changed, 157 insertions(+), 20 deletions(-) diff --git a/lib/textbin_web/components/layouts.ex b/lib/textbin_web/components/layouts.ex index 4d266ce..f97b64a 100644 --- a/lib/textbin_web/components/layouts.ex +++ b/lib/textbin_web/components/layouts.ex @@ -54,17 +54,9 @@ defmodule TextbinWeb.Layouts do
- +
+ <.icon name="hero-building-office-2" class="size-4.5" /> +

{@current_scope.organization.name} @@ -78,10 +70,13 @@ defmodule TextbinWeb.Layouts do

-
+
+

+ Navigation +

@@ -123,12 +119,14 @@ defmodule TextbinWeb.Layouts do
{render_slot(@inner_block)}
+ + <.mobile_bottom_navigation scope={@current_scope} active={@active_navigation} />
<% else %>
@@ -142,14 +140,109 @@ defmodule TextbinWeb.Layouts do """ end + attr :scope, :map, required: true + attr :active, :any, default: nil + + defp mobile_bottom_navigation(assigns) do + ~H""" + + """ + end + + attr :navigate, :string, required: true + attr :icon, :string, required: true + attr :label, :string, required: true + attr :active, :boolean, default: false + + defp mobile_navigation_link(assigns) do + ~H""" + <.link + navigate={@navigate} + aria-current={@active && "page"} + class={[ + "flex min-h-14 min-w-0 flex-col items-center justify-center gap-1 rounded-xl px-1 py-2 text-[0.6875rem] font-semibold transition", + if(@active, + do: "bg-primary/10 text-primary", + else: "text-base-content/60 hover:bg-base-200 hover:text-base-content" + ) + ]} + > + <.icon name={@icon} class="size-5" /> + {@label} + + """ + end + attr :id, :string, required: true attr :scope, :map, required: true attr :workspaces, :list, required: true attr :active, :any, default: nil + attr :compact, :boolean, default: false defp application_sidebar(assigns) do ~H""" -
-
+
    <%= unless @current_scope do %>
  • diff --git a/test/textbin_web/live/ui/organization_live_test.exs b/test/textbin_web/live/ui/organization_live_test.exs index de86231..e6f785b 100644 --- a/test/textbin_web/live/ui/organization_live_test.exs +++ b/test/textbin_web/live/ui/organization_live_test.exs @@ -137,9 +137,23 @@ defmodule TextbinWeb.UI.OrganizationLiveTest do "More" ) - assert has_element?(view, "dialog#mobile-navigation-dialog.overflow-hidden") - assert has_element?(view, "#mobile-navigation-title", "Navigation") + assert has_element?(view, "dialog#mobile-navigation-dialog.overflow-hidden.rounded-2xl") + assert has_element?(view, "#mobile-navigation-title", "More") assert has_element?(view, "#mobile-sidebar-navigation.h-auto") + assert has_element?(view, "#mobile-organization-context", context.organization.name) + refute has_element?(view, "#mobile-organization-icon") + + assert has_element?( + view, + "#mobile-account-navigation a[href='/users/settings']", + "Account settings" + ) + + assert has_element?( + view, + "#mobile-account-navigation a[href='/users/log-out']", + "Log out" + ) assert has_element?( view, From b5d95befa9d1f011273e364bfe574d74af16ca08 Mon Sep 17 00:00:00 2001 From: Darwin Wu Date: Sat, 15 Aug 2026 06:34:46 +0000 Subject: [PATCH 4/5] fix: simplify mobile navigation hierarchy Amp-Thread-ID: https://ampcode.com/threads/T-01a003bd-4cda-73e9-a977-da00cd0164f5 --- lib/textbin_web/components/layouts.ex | 178 ++++++++++++------ .../live/ui/organization_live_test.exs | 21 ++- .../live/ui/workspace_live_test.exs | 10 + 3 files changed, 143 insertions(+), 66 deletions(-) diff --git a/lib/textbin_web/components/layouts.ex b/lib/textbin_web/components/layouts.ex index e7ef0e6..67a82b9 100644 --- a/lib/textbin_web/components/layouts.ex +++ b/lib/textbin_web/components/layouts.ex @@ -56,26 +56,12 @@ defmodule TextbinWeb.Layouts do >
-
-
-

- {@current_scope.organization.name} -

-

- {@current_scope.workspace.name} -

-
-
- -
+

More @@ -94,12 +80,9 @@ defmodule TextbinWeb.Layouts do id="mobile-navigation-scroll-region" class="min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain" > - <.application_sidebar - id="mobile-sidebar-navigation" + <.mobile_more_navigation scope={@current_scope} workspaces={@navigation_workspaces} - active={@active_navigation} - compact />

@@ -233,19 +216,112 @@ defmodule TextbinWeb.Layouts do """ end + attr :scope, :map, required: true + attr :workspaces, :list, required: true + + defp mobile_more_navigation(assigns) do + ~H""" + + """ + end + attr :id, :string, required: true attr :scope, :map, required: true attr :workspaces, :list, required: true attr :active, :any, default: nil - attr :compact, :boolean, default: false defp application_sidebar(assigns) do ~H""" -
- -
-
-
-

- Account -

-

- {account_label(@scope)} -

-
- <.theme_toggle /> -
-
- <.link - href={~p"/users/settings"} - class="flex items-center gap-3 rounded-lg px-2.5 py-2 text-sm font-medium text-base-content/65 transition hover:bg-base-200 hover:text-base-content" - > - <.icon name="hero-user-circle" class="size-4.5" /> Account settings - - <.link - href={~p"/users/log-out"} - method="delete" - class="flex items-center gap-3 rounded-lg px-2.5 py-2 text-sm font-medium text-error transition hover:bg-error/10" - > - <.icon name="hero-arrow-right-start-on-rectangle" class="size-4.5" /> Log out - -
-
""" end @@ -437,10 +479,22 @@ defmodule TextbinWeb.Layouts do id="app-header" class="navbar sticky top-0 z-30 h-16 min-h-16 gap-4 border-b border-base-300 bg-base-100/95 px-4 backdrop-blur sm:px-6 lg:px-8" > -
- +
+ Textbin +
+

+ {@current_scope.organization.name} +

+

+ {@current_scope.workspace.name} +

+
Date: Sat, 15 Aug 2026 06:44:40 +0000 Subject: [PATCH 5/5] fix: streamline mobile paste page heading Amp-Thread-ID: https://ampcode.com/threads/T-01a003bd-4cda-73e9-a977-da00cd0164f5 --- lib/textbin_web/live/ui/paste_live/index.html.heex | 11 ++++++++--- test/textbin_web/live/ui/paste_live_test.exs | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/textbin_web/live/ui/paste_live/index.html.heex b/lib/textbin_web/live/ui/paste_live/index.html.heex index c7ab3e8..1065ec8 100644 --- a/lib/textbin_web/live/ui/paste_live/index.html.heex +++ b/lib/textbin_web/live/ui/paste_live/index.html.heex @@ -6,11 +6,16 @@ >
-

{@current_scope.workspace.name}

-

+ +

Pastes

-

+

diff --git a/test/textbin_web/live/ui/paste_live_test.exs b/test/textbin_web/live/ui/paste_live_test.exs index 2413a59..8169690 100644 --- a/test/textbin_web/live/ui/paste_live_test.exs +++ b/test/textbin_web/live/ui/paste_live_test.exs @@ -38,6 +38,7 @@ defmodule TextbinWeb.UI.PasteLiveTest do {:ok, view, _html} = live(recycle(conn), path) assert has_element?(view, "#paste-form") + assert has_element?(view, "#pastes-heading.sr-only", "Pastes") assert has_element?(view, "#paste_audience[disabled] option[value='unlisted']") refute has_element?(view, "#organization-overview-link")