Make the notifications tray reload on broadcasted refreshes

We can't use the normal refresh: :morph because everything is contained in a turbo permanent section
so that the trays persist across regular navigation.
This commit is contained in:
Jorge Manrubia
2025-11-21 09:41:03 +01:00
parent e813b7eaf0
commit 85b9e3dfd4
2 changed files with 11 additions and 7 deletions
@@ -15,4 +15,8 @@ export default class extends Controller {
this.element.reload()
}
}
reload() {
this.element.reload()
}
}
+7 -7
View File
@@ -2,13 +2,13 @@
<section class="tray tray--pins" data-controller="dialog">
<%= tag.dialog id: "pin-tray", class: "tray__dialog", data: {
action: "keydown->navigable-list#navigate dialog:show@document->navigable-list#reset keydown.esc->dialog#close:stop click@document->dialog#closeOnClickOutside",
controller: "navigable-list",
dialog_target: "dialog",
navigable_list_actionable_items_value: "true",
navigable_list_reverse_navigation_value: "true" },
turbo_permanent: true do %>
<%= turbo_frame_tag "pins", src: my_pins_path %>
action: "keydown->navigable-list#navigate dialog:show@document->navigable-list#reset keydown.esc->dialog#close:stop click@document->dialog#closeOnClickOutside",
controller: "navigable-list",
dialog_target: "dialog",
navigable_list_actionable_items_value: "true",
navigable_list_reverse_navigation_value: "true" },
turbo_permanent: true do %>
<%= turbo_frame_tag "pins", src: my_pins_path, data: { controller: "frame", action: "turbo:morph@document->frame#reload" } %>
<% end %>
<button class="tray__toggle" data-action="dialog#toggle keydown.p@document->hotkey#click" data-controller="hotkey" aria-label="Toggle pins stack" aria-haspopup="true">