summaryrefslogtreecommitdiff
path: root/Omni/Jr/Web
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-29 22:18:46 -0500
committerBen Sima <ben@bensima.com>2025-11-29 22:18:46 -0500
commitd58b2f547f474648edbacdf2ffdfdef6e019fe7d (patch)
tree9d56564c2b3d2d0b6947d4d3c91698716a4c5b0e /Omni/Jr/Web
parenta5180facf2375cf629ce7d90f851e6c667f66197 (diff)
Add sorting options to task list pages
The implementation is complete and all tests pass. Here's a summary of w 1. Added `SortOrder` data type with 5 options: `SortNewest`, `SortOldest 2. Added helper functions: `parseSortOrder`, `sortOrderToParam`, `sortOr 3. Updated API routes to include `?sort=` query param for `/ready`, `/bl 4. Updated page data types to include `SortOrder` 5. Updated all list handlers to parse sort param and apply sorting 6. Added `sortDropdown` component that renders a dropdown with all sort 7. Added `sortOption` helper to render individual sort options with acti 8. Updated all `ToHtml` instances for list pages to render the sort drop 1. Added `sortDropdownStyles` for the page header row and sort dropdown 2. Added dark mode styles for the sort dropdown Task-Id: t-181
Diffstat (limited to 'Omni/Jr/Web')
-rw-r--r--Omni/Jr/Web/Style.hs57
1 files changed, 57 insertions, 0 deletions
diff --git a/Omni/Jr/Web/Style.hs b/Omni/Jr/Web/Style.hs
index e0cc51e..02352ec 100644
--- a/Omni/Jr/Web/Style.hs
+++ b/Omni/Jr/Web/Style.hs
@@ -37,6 +37,7 @@ stylesheet = do
retryBannerStyles
taskMetaStyles
timeFilterStyles
+ sortDropdownStyles
responsiveStyles
darkModeStyles
@@ -1217,6 +1218,52 @@ timeFilterStyles = do
backgroundColor "#0055aa"
borderColor "#0055aa"
+sortDropdownStyles :: Css
+sortDropdownStyles = do
+ ".page-header-row" ? do
+ display flex
+ alignItems center
+ justifyContent spaceBetween
+ flexWrap Flexbox.wrap
+ Stylesheet.key "gap" ("12px" :: Text)
+ marginBottom (px 8)
+ ".page-header-row" |> "h1" ? do
+ margin (px 0) (px 0) (px 0) (px 0)
+ ".sort-dropdown" ? do
+ display flex
+ alignItems center
+ Stylesheet.key "gap" ("6px" :: Text)
+ fontSize (px 13)
+ ".sort-label" ? do
+ color "#6b7280"
+ fontWeight (weight 500)
+ ".sort-dropdown-wrapper" ? do
+ position relative
+ ".sort-dropdown-btn" ? do
+ padding (px 4) (px 10) (px 4) (px 10)
+ fontSize (px 13)
+ fontWeight (weight 500)
+ border (px 1) solid "#d0d0d0"
+ borderRadius (px 4) (px 4) (px 4) (px 4)
+ backgroundColor white
+ color "#374151"
+ cursor pointer
+ transition "all" (ms 150) ease (sec 0)
+ whiteSpace nowrap
+ ".sort-dropdown-btn" # hover ? do
+ borderColor "#999"
+ backgroundColor "#f3f4f6"
+ ".sort-dropdown-content" ? do
+ minWidth (px 160)
+ right (px 0)
+ left auto
+ ".sort-dropdown-item" ? do
+ padding (px 8) (px 12) (px 8) (px 12)
+ fontSize (px 13)
+ ".sort-dropdown-item.active" ? do
+ backgroundColor "#e0f2fe"
+ fontWeight (weight 600)
+
taskMetaStyles :: Css
taskMetaStyles = do
".task-meta" ? do
@@ -1489,6 +1536,16 @@ darkModeStyles =
".time-filter-btn.active" # hover ? do
backgroundColor "#2563eb"
borderColor "#2563eb"
+ ".sort-label" ? color "#9ca3af"
+ ".sort-dropdown-btn" ? do
+ backgroundColor "#374151"
+ borderColor "#4b5563"
+ color "#d1d5db"
+ ".sort-dropdown-btn" # hover ? do
+ backgroundColor "#4b5563"
+ borderColor "#6b7280"
+ ".sort-dropdown-item.active" ? do
+ backgroundColor "#1e3a5f"
-- Responsive dark mode: dropdown content needs background on mobile
query Media.screen [Media.maxWidth (px 600)] <| do
".navbar-dropdown-content" ? do