]> git.taranathan.com Git - robotics-task-manager.git/commitdiff
order by defcon then date
authorTaran Nathan <moogoesmeow123@gmail.com>
Sun, 27 Sep 2026 04:21:17 +0000 (21:21 -0700)
committerTaran Nathan <moogoesmeow123@gmail.com>
Sun, 27 Sep 2026 04:29:27 +0000 (21:29 -0700)
client/src/client.gleam

index 64184da853ff4f82ee8f14f94804652e89fd74c5..4b8be575aee96e41c0c02cd7edd131c1c0848481 100644 (file)
@@ -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),
     ),
   )