fix: show device link dropdown inline below clicked row in Preseem devices table

The linking row was rendered in a separate loop after all device rows,
causing it to always appear at the bottom of the table. Changed to use
a single for loop with an inline if check so the linking row appears
immediately after the corresponding device row.
This commit is contained in:
Graham McIntire 2026-03-13 10:45:45 -05:00
parent 19abd5508a
commit 88ee55d603
No known key found for this signature in database

View file

@ -155,8 +155,8 @@
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white dark:divide-white/5 dark:bg-transparent">
<%= for ap <- @access_points do %>
<tr
:for={ap <- @access_points}
id={"ap-row-#{ap.id}"}
class="hover:bg-gray-50 dark:hover:bg-white/5"
>
@ -224,7 +224,7 @@
</td>
</tr>
<%!-- Inline linking row --%>
<%= for ap <- @access_points, ap.id == @linking_ap_id do %>
<%= if ap.id == @linking_ap_id do %>
<tr id={"linking-row-#{ap.id}"} class="bg-indigo-50 dark:bg-indigo-900/20">
<td colspan="6" class="px-4 py-4">
<div class="flex items-center gap-4">
@ -292,6 +292,7 @@
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
</div>