From 327b4fc5610005e8b00e46dfccff39fb6b2a3de5 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sun, 3 May 2026 13:54:46 -0500 Subject: [PATCH] feat(rover-planning): inline per-group delete, drop standalone site list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'Rover sites' card no longer renders the long list of every site — each rover-location now appears once as a path-profile group heading, which carries its own delete button next to the n/m progress text. The add-site form stays in place. --- .../live/rover_planning_live/show.ex | 61 ++++++------------- .../live/rover_planning_live_test.exs | 24 ++++++++ 2 files changed, 42 insertions(+), 43 deletions(-) diff --git a/lib/microwaveprop_web/live/rover_planning_live/show.ex b/lib/microwaveprop_web/live/rover_planning_live/show.ex index a980d728..02a7034e 100644 --- a/lib/microwaveprop_web/live/rover_planning_live/show.ex +++ b/lib/microwaveprop_web/live/rover_planning_live/show.ex @@ -374,55 +374,17 @@ defmodule MicrowavepropWeb.RoverPlanningLive.Show do
-

Rover sites

+

Add rover site

{length(@rover_sites)} site(s) — paths recompute on add/remove
- - -

- No rover sites match this mission's scope yet — add one below. -

- <%!-- The add form takes the same flexible input the station inputs use: callsign, Maidenhead grid, or `lat, lon`. Sign-in required. + The site list itself is rendered inline as path-profile group + headings below — each heading carries its own delete button. --%>
-
- {group_progress(group_paths)} +
+ + {group_progress(group_paths)} + +
diff --git a/test/microwaveprop_web/live/rover_planning_live_test.exs b/test/microwaveprop_web/live/rover_planning_live_test.exs index fe9e28d2..69cad704 100644 --- a/test/microwaveprop_web/live/rover_planning_live_test.exs +++ b/test/microwaveprop_web/live/rover_planning_live_test.exs @@ -398,6 +398,30 @@ defmodule MicrowavepropWeb.RoverPlanningLiveTest do assert Repo.aggregate(Location, :count) == 0 end + test "delete button lives inside the path-profile group heading, not above it", + %{conn: conn} do + user = AccountsFixtures.user_fixture() + mission = create_mission(user, "Per-group delete mission") + conn = log_in_user(conn, user) + + [site] = Repo.all(Location) + + {:ok, lv, html} = live(conn, ~p"/rover-planning/#{mission.id}") + + # The standalone "Rover sites" list is gone — the heading now reads + # "Add rover site" (still the form). Each path-profile group + # heading carries its own per-location delete button. Asserting on + # the structural ancestor (`[data-rover-group]`) ensures the button + # is INSIDE the grouping, not in some legacy list above it. + refute html =~ "Rover sites" + assert html =~ "Add rover site" + + assert has_element?( + lv, + "[data-rover-group] button[phx-click='delete_rover_site'][phx-value-id='#{site.id}']" + ) + end + test "add_rover_site rejects whitespace-only input with a flash error", %{conn: conn} do user = AccountsFixtures.user_fixture()