From f7db67f636441a398c5ce0aa3e3b62893e85e96f Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 16 Nov 2021 14:07:47 -0600 Subject: [PATCH 1/5] Hide icons with associated buttons from accessibility tree. --- lib/live_beats_web/live/player_live.ex | 7 +++++-- lib/live_beats_web/live/song_live/index.ex | 9 +++++---- lib/live_beats_web/views/layout_view.ex | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/live_beats_web/live/player_live.ex b/lib/live_beats_web/live/player_live.ex index 91830fa..ed32f2e 100644 --- a/lib/live_beats_web/live/player_live.ex +++ b/lib/live_beats_web/live/player_live.ex @@ -41,7 +41,7 @@ defmodule LiveBeatsWeb.PlayerLive do redirect_to={profile_path(@profile)} class="mx-auto flex outline border-2 border-white border-opacity-20 rounded-md p-1 pr-2" > - <.icon name={:user_circle}/> + <.icon name={:user_circle} aria-hidden="true"/>

<%= @profile.username %>

<% else %> @@ -221,7 +221,10 @@ defmodule LiveBeatsWeb.PlayerLive do {:noreply, play_current_song(socket)} end - def handle_info({Accounts, %Accounts.Events.ActiveProfileChanged{new_profile_user_id: user_id}}, socket) do + def handle_info( + {Accounts, %Accounts.Events.ActiveProfileChanged{new_profile_user_id: user_id}}, + socket + ) do if user_id do {:noreply, assign(socket, profile: get_profile(user_id))} else diff --git a/lib/live_beats_web/live/song_live/index.ex b/lib/live_beats_web/live/song_live/index.ex index 43d8879..545826b 100644 --- a/lib/live_beats_web/live/song_live/index.ex +++ b/lib/live_beats_web/live/song_live/index.ex @@ -13,7 +13,7 @@ defmodule LiveBeatsWeb.SongLive.Index do <%= @profile.tagline %> <%= if @owns_profile? do %>(you)<% end %> <.link href={@profile.external_homepage_url} _target="blank" class="block text-sm text-gray-600"> - <.icon name={:code}/> <%= url_text(@profile.external_homepage_url) %> + <.icon name={:code} aria-hidden="true"/> <%= url_text(@profile.external_homepage_url) %> @@ -22,18 +22,18 @@ defmodule LiveBeatsWeb.SongLive.Index do <.button primary phx-click={JS.push("switch_profile", value: %{user_id: nil}, target: "#player", loading: "#player")} > - <.icon name={:stop}/>Stop Listening + <.icon name={:stop} aria-hidden="true"/>Stop Listening <% else %> <.button primary phx-click={JS.push("switch_profile", value: %{user_id: @profile.user_id}, target: "#player", loading: "#player")} > - <.icon name={:play}/>Listen + <.icon name={:play} aria-hidden="true"/>Listen <% end %> <%= if @owns_profile? do %> <.button primary patch_to={Routes.song_index_path(@socket, :new)}> - <.icon name={:upload}/>Upload Songs + <.icon name={:upload} aria-hidden="true"/>Upload Songs <% end %> @@ -236,6 +236,7 @@ defmodule LiveBeatsWeb.SongLive.Index do end defp url_text(nil), do: "" + defp url_text(url_str) do uri = URI.parse(url_str) uri.host <> uri.path diff --git a/lib/live_beats_web/views/layout_view.ex b/lib/live_beats_web/views/layout_view.ex index f4823eb..6e3ebcd 100644 --- a/lib/live_beats_web/views/layout_view.ex +++ b/lib/live_beats_web/views/layout_view.ex @@ -35,7 +35,7 @@ defmodule LiveBeatsWeb.LayoutView do redirect_to={profile_path(@current_user)} class="text-gray-700 hover:text-gray-900 hover:bg-gray-50 group flex items-center px-2 py-2 text-sm font-medium rounded-md" > - <.icon name={:music_note} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6"/> + <.icon name={:music_note} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6" aria-hidden="true"/> My Songs @@ -43,7 +43,7 @@ defmodule LiveBeatsWeb.LayoutView do redirect_to={Routes.settings_path(LiveBeatsWeb.Endpoint, :edit)} class="text-gray-700 hover:text-gray-900 hover:bg-gray-50 group flex items-center px-2 py-2 text-sm font-medium rounded-md" > - <.icon name={:adjustments} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6"/> + <.icon name={:adjustments} outlined class="text-gray-400 group-hover:text-gray-500 mr-3 flex-shrink-0 h-6 w-6" aria-hidden="true"/> Settings <% else %> From fad37064db742375add78a8c85531d9dde5028d3 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 16 Nov 2021 14:26:10 -0600 Subject: [PATCH 2/5] Label player controls. --- lib/live_beats_web/live/player_live.ex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/live_beats_web/live/player_live.ex b/lib/live_beats_web/live/player_live.ex index ed32f2e..abc7240 100644 --- a/lib/live_beats_web/live/player_live.ex +++ b/lib/live_beats_web/live/player_live.ex @@ -49,15 +49,15 @@ defmodule LiveBeatsWeb.PlayerLive do <% end %> - - - - + - - - - From aec76630d15cfd0d8eae61d60e45b9894ca03a58 Mon Sep 17 00:00:00 2001 From: Chris McCord Date: Mon, 22 Nov 2021 10:36:18 -0500 Subject: [PATCH 5/5] Remove unnecessary attr --- lib/live_beats_web/live/live_helpers.ex | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/live_beats_web/live/live_helpers.ex b/lib/live_beats_web/live/live_helpers.ex index 290345e..0e8aca5 100644 --- a/lib/live_beats_web/live/live_helpers.ex +++ b/lib/live_beats_web/live/live_helpers.ex @@ -50,7 +50,6 @@ defmodule LiveBeatsWeb.LiveHelpers do id="flash" class="rounded-md bg-red-50 p-4 fixed top-1 right-1 w-96 fade-in-scale" phx-click={JS.push("lv:clear-flash") |> JS.remove_class("fade-in-scale", to: "#flash") |> hide("#flash")} - phx-value-key="error" phx-hook="Flash" >