Files
sure/app/views/chats/_chat.html.erb
Alessio Cappa 00086bdca0 Fix title overflow issue in chats (#331)
* fix: Truncate title in chats view if too long

* Add hover

---------

Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
2025-11-15 10:17:25 +01:00

31 lines
906 B
Plaintext

<%# locals: (chat:) %>
<%= tag.div class: "flex items-center justify-between px-4 py-3 bg-container shadow-border-xs rounded-lg" do %>
<div class="grow truncate">
<%= turbo_frame_tag dom_id(chat, :title), title: chat.title do %>
<%= render "chats/chat_title", chat: chat, ctx: "list" %>
<% end %>
<p class="text-sm text-secondary">
<%= time_ago_in_words(chat.updated_at) %> ago
</p>
</div>
<%= render DS::Menu.new(icon_vertical: true) do |menu| %>
<% menu.with_item(
variant: "link",
text: "Edit chat title",
href: edit_chat_path(chat, ctx: "list"),
icon: "pencil",
frame: dom_id(chat, "title")) %>
<% menu.with_item(
variant: "button",
text: "Delete chat",
href: chat_path(chat),
icon: "trash-2",
method: :delete,
confirm: CustomConfirm.for_resource_deletion("chat")) %>
<% end %>
<% end %>