fix(rover-planning): truncate long rover-site notes on a single row
This commit is contained in:
parent
39c4c287a5
commit
e84f28643f
1 changed files with 18 additions and 5 deletions
|
|
@ -381,12 +381,25 @@ defmodule MicrowavepropWeb.RoverPlanningLive.Show do
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul :if={@rover_sites != []} class="text-sm space-y-1 mb-3">
|
<ul :if={@rover_sites != []} class="text-sm space-y-1 mb-3">
|
||||||
<li :for={site <- @rover_sites} class="flex flex-wrap items-center gap-2">
|
<%!--
|
||||||
<span class="font-mono">{Maidenhead.from_latlon(site.lat, site.lon, 10)}</span>
|
`flex` (no `flex-wrap`) + `min-w-0` on the row, plus `shrink-0`
|
||||||
<span class="text-base-content/60 font-mono text-xs">
|
on the identifier columns and `truncate flex-1 min-w-0` on the
|
||||||
|
notes cell, keeps the row to a single line: long notes get
|
||||||
|
ellipsised instead of pushing the trash button onto a new line.
|
||||||
|
`title={site.notes}` preserves the full text on hover.
|
||||||
|
--%>
|
||||||
|
<li :for={site <- @rover_sites} class="flex items-center gap-2 min-w-0">
|
||||||
|
<span class="font-mono shrink-0">
|
||||||
|
{Maidenhead.from_latlon(site.lat, site.lon, 10)}
|
||||||
|
</span>
|
||||||
|
<span class="text-base-content/60 font-mono text-xs shrink-0">
|
||||||
({Float.round(site.lat, 4)}, {Float.round(site.lon, 4)})
|
({Float.round(site.lat, 4)}, {Float.round(site.lon, 4)})
|
||||||
</span>
|
</span>
|
||||||
<span :if={site.notes && site.notes != ""} class="text-base-content/60 text-xs">
|
<span
|
||||||
|
:if={site.notes && site.notes != ""}
|
||||||
|
class="text-base-content/60 text-xs truncate min-w-0 flex-1"
|
||||||
|
title={site.notes}
|
||||||
|
>
|
||||||
· {site.notes}
|
· {site.notes}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
|
|
@ -395,7 +408,7 @@ defmodule MicrowavepropWeb.RoverPlanningLive.Show do
|
||||||
phx-click="delete_rover_site"
|
phx-click="delete_rover_site"
|
||||||
phx-value-id={site.id}
|
phx-value-id={site.id}
|
||||||
data-confirm="Remove this rover site? This affects every mission that uses it."
|
data-confirm="Remove this rover site? This affects every mission that uses it."
|
||||||
class="btn btn-ghost btn-xs text-error ml-auto"
|
class="btn btn-ghost btn-xs text-error ml-auto shrink-0"
|
||||||
title="Remove rover site"
|
title="Remove rover site"
|
||||||
>
|
>
|
||||||
<.icon name="hero-trash" class="w-4 h-4" />
|
<.icon name="hero-trash" class="w-4 h-4" />
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue