From: Taran Nathan Date: Sun, 27 Sep 2026 04:21:17 +0000 (-0700) Subject: order by defcon then date X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=d98a6f21f9f6fe910c717cc85f33bc8ebd9f7976;p=robotics-task-manager.git order by defcon then date --- diff --git a/client/src/client.gleam b/client/src/client.gleam index 64184da..4b8be57 100644 --- a/client/src/client.gleam +++ b/client/src/client.gleam @@ -4,6 +4,7 @@ import gleam/int import gleam/json import gleam/list import gleam/option.{type Option, None, Some} +import gleam/order import gleam/result import gleam/string import lustre @@ -752,7 +753,12 @@ fn kanban_column(title: String, tasks: List(shared.Task)) -> Element(Message) { ]), ], tasks - |> list.sort(fn(a, b) { string.compare(a.due_date, b.due_date) }) + |> list.sort(fn(a, b) { + case int.compare(a.defcon, b.defcon) { + order.Eq -> string.compare(a.due_date, b.due_date) + a -> a + } + }) |> list.map(task_view), ), )