Merge pull request #1444 from basecamp/card-back-button

Treat the collection link like a back button rather than a title
This commit is contained in:
Jason Zimdars
2025-10-31 16:25:39 -05:00
committed by GitHub
2 changed files with 5 additions and 4 deletions
+2 -3
View File
@@ -1,9 +1,8 @@
module CollectionsHelper
def link_back_to_collection(collection)
link_to collection, class: "header__title btn borderless txt-large",
style: "--btn-padding: 0.25ch 1ch 0.25ch 0.75ch; view-transistion-name: card-collection-title;",
link_to collection, class: "btn borderless txt-medium",
data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click click->turbo-navigation#backIfSamePath" } do
tag.span ("←" + tag.strong(collection.name, class: "font-black")).html_safe
tag.span ("←" + tag.strong(collection.name, class: "overflow-ellipsis")).html_safe
end
end
+3 -1
View File
@@ -6,7 +6,9 @@
<% end %>
<% content_for :header do %>
<%= link_back_to_collection(@card.collection) %>
<div class="header__actions header__actions--start">
<%= link_back_to_collection(@card.collection) %>
</div>
<% end %>
<%= turbo_stream_from @card %>