refactor: remove non-functional compact view button from devices page

Removed:
- Compact view toggle button from the header
- toggle_compact_mode event handler
- @compact_mode assign

The button was not connected to any actual functionality.
This commit is contained in:
Graham McIntire 2026-03-10 11:02:12 -05:00
parent 1920c7bc5a
commit f19fb958cb
No known key found for this signature in database
2 changed files with 0 additions and 17 deletions

View file

@ -36,7 +36,6 @@ defmodule ToweropsWeb.DeviceLive.Index do
|> assign(:sites_enabled, organization.use_sites)
|> assign(:has_sites, sites != [])
|> assign(:reorder_mode, false)
|> assign(:compact_mode, false)
|> assign(:total_devices, length(devices))
|> assign(:total_up, Enum.count(devices, &(&1.status == :up)))
|> assign(:total_down, Enum.count(devices, &(&1.status == :down)))
@ -176,11 +175,6 @@ defmodule ToweropsWeb.DeviceLive.Index do
{:noreply, assign(socket, :reorder_mode, !socket.assigns.reorder_mode)}
end
@impl true
def handle_event("toggle_compact_mode", _params, socket) do
{:noreply, assign(socket, :compact_mode, !socket.assigns.compact_mode)}
end
@impl true
def handle_event("reset_order", _params, socket) do
organization_id = socket.assigns.current_scope.organization.id

View file

@ -94,17 +94,6 @@
<.button type="button" phx-click="toggle_reorder_mode" title="Reorder devices and sites">
<.icon name="hero-bars-arrow-up" class="h-4 w-4" />
</.button>
<.button
type="button"
phx-click="toggle_compact_mode"
title={if @compact_mode, do: "Normal view", else: "Compact view"}
variant={if @compact_mode, do: "primary", else: nil}
>
<.icon
name={if @compact_mode, do: "hero-view-columns", else: "hero-table-cells"}
class="h-4 w-4"
/>
</.button>
<% end %>
<% end %>
<.button :if={!@sites_enabled || @has_sites} navigate={~p"/devices/new"} variant="primary">