ESC is primary back hotkey, use helper in more places

This commit is contained in:
Jason Zimdars
2025-12-01 13:54:08 -06:00
parent e240897dd0
commit 7644b0e793
16 changed files with 16 additions and 51 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ module ApplicationHelper
def back_link_to(label, url, action, **options)
link_to url, class: "btn btn--back", data: { controller: "hotkey", action: action }, **options do
icon_tag("arrow-left") + tag.strong("Back to #{label}", class: "overflow-ellipsis") + tag.kbd("", class: "txt-x-small hide-on-touch").html_safe
icon_tag("arrow-left") + tag.strong("Back to #{label}", class: "overflow-ellipsis") + tag.kbd("ESC", class: "txt-x-small hide-on-touch").html_safe
end
end
end
+1 -1
View File
@@ -1,6 +1,6 @@
module BoardsHelper
def link_back_to_board(board)
back_link_to board.name, board, "keydown.left@document->hotkey#click click->turbo-navigation#backIfSamePath"
back_link_to board.name, board, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click click->turbo-navigation#backIfSamePath"
end
def link_to_edit_board(board)
+1 -7
View File
@@ -2,13 +2,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= link_to account_join_code_path, class: "btn btn--back borderless txt-medium", data: { controller: "hotkey", action: "keydown.left@document->hotkey#click" } do %>
<span class="overflow-ellipsis flex align-center">
<%= icon_tag "arrow-left" %>
<strong>Back to Invite link</strong>
<kbd class="txt-x-small margin-inline-start hide-on-touch">&larr;</kbd>
</span>
<% end %>
<%= back_link_to "Invite link", account_join_code_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<% end %>
+1 -7
View File
@@ -2,13 +2,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= link_to account_settings_path, class: "btn btn--back borderless txt-medium", data: { controller: "hotkey", action: "keydown.left@document->hotkey#click" } do %>
<span class="overflow-ellipsis flex align-center">
<%= icon_tag "arrow-left" %>
<strong>Back to Account Settings</strong>
<kbd class="txt-x-small margin-inline-start hide-on-touch">&larr;</kbd>
</span>
<% end %>
<%= back_link_to "Account Settings", account_settings_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<% end %>
@@ -2,13 +2,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= link_to events_path, class: "btn btn--back", data: { controller: "hotkey", action: "keydown.left@document->hotkey#click" } do %>
<span class="overflow-ellipsis flex align-center">
<%= icon_tag "arrow-left" %>
<strong>Back to Actvity</strong>
<kbd class="txt-x-small margin-inline-start hide-on-touch">&larr;</kbd>
</span>
<% end %>
<%= back_link_to "Actvity", root_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<h1 class="header__title">
@@ -2,7 +2,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= back_link_to @board.name, published_board_url(@board), "keydown.left@document->hotkey#click" %>
<%= back_link_to @board.name, published_board_url(@board), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<h1 class="header__title divider divider--fade full-width">
@@ -2,7 +2,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= back_link_to @board.name, published_board_url(@board), "keydown.left@document->hotkey#click" %>
<%= back_link_to @board.name, published_board_url(@board), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<h1 class="header__title divider divider--fade full-width">
@@ -2,7 +2,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= back_link_to @column.board.name, published_board_url(@column.board), "keydown.left@document->hotkey#click" %>
<%= back_link_to @column.board.name, published_board_url(@column.board), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<h1 class="header__title divider divider--fade full-width">
@@ -2,7 +2,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= back_link_to @board.name, published_board_url(@board), "keydown.left@document->hotkey#click" %>
<%= back_link_to @board.name, published_board_url(@board), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<h1 class="header__title divider divider--fade full-width">
+1 -1
View File
@@ -14,7 +14,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= back_link_to @card.board.name, published_board_url(@card.board), "keydown.left@document->hotkey#click", style: "view-transistion-name: card-board-title;" %>
<%= back_link_to @card.board.name, published_board_url(@card.board), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click", style: "view-transistion-name: card-board-title;" %>
</div>
<% end %>
+1 -7
View File
@@ -2,13 +2,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= link_to user_path(@user), class: "btn btn--back borderless txt-medium", data: { controller: "hotkey", action: "keydown.left@document->hotkey#click" } do %>
<span class="overflow-ellipsis flex align-center">
<%= icon_tag "arrow-left" %>
<strong>Back to profile</strong>
<kbd class="txt-x-small margin-inline-start hide-on-touch">&larr;</kbd>
</span>
<% end %>
<%= back_link_to "profile", user_path(@user), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<% end %>
@@ -2,12 +2,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= link_to edit_user_path(@user, script_name: @user.account.slug), class: "btn borderless txt-medium", data: { controller: "hotkey", action: "keydown.left@document->hotkey#click" } do %>
<span class="overflow-ellipsis flex align-center">
<strong>Back to My profile</strong>
<kbd class="txt-x-small margin-inline-start hide-on-touch">&larr;</kbd>
</span>
<% end %>
<%= back_link_to "My profile", edit_user_path(@user, script_name: @user.account.slug), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<% end %>
+1 -7
View File
@@ -2,13 +2,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= link_to edit_user_path(@user, script_name: @user.account.slug), class: "btn btn--back borderless txt-medium", data: { controller: "hotkey", action: "keydown.left@document->hotkey#click" } do %>
<span class="overflow-ellipsis flex align-center">
<%= icon_tag "arrow-left" %>
<strong>Back to My profile</strong>
<kbd class="txt-x-small margin-inline-start hide-on-touch">&larr;</kbd>
</span>
<% end %>
<%= back_link_to "My profile", edit_user_path(@user, script_name: @user.account.slug), "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<% end %>
+1 -1
View File
@@ -2,7 +2,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= back_link_to @page_title, @webhook, "keydown.left@document->hotkey#click" %>
<%= back_link_to @page_title, @webhook, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<% end %>
+1 -1
View File
@@ -2,7 +2,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= back_link_to "Webhooks", board_webhooks_path, "keydown.left@document->hotkey#click" %>
<%= back_link_to "Webhooks", board_webhooks_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<h1 class="header__title"><%= @page_title %></h1>
+1 -1
View File
@@ -3,7 +3,7 @@
<% content_for :header do %>
<div class="header__actions header__actions--start">
<div class="header__actions header__actions--start">
<%= back_link_to "Webhooks", board_webhooks_path, "keydown.left@document->hotkey#click" %>
<%= back_link_to "Webhooks", board_webhooks_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
</div>