From 7e03d8f323d44b972aeceb009928c977ee64fed2 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 1 Dec 2025 13:51:21 -0500 Subject: Replace HumanTask type with NeedsHelp status - Remove HumanTask from TaskType enum (now Epic | WorkTask only) - Add NeedsHelp to Status enum for tasks requiring human guidance - Update getReadyTasks to filter NeedsHelp instead of HumanTask - Rename humanTasks to tasksNeedingHelp in HumanActionItems - Add CLI parsing for needs-help status in list/update commands - Add badge styling for NeedsHelp (amber/yellow theme) - Update all status pattern matches in tree view and print functions - Update tests to verify NeedsHelp exclusion from ready queue Task-Id: t-210 --- Omni/Jr/Web.hs | 16 ++++++++++------ Omni/Jr/Web/Style.hs | 6 ++++++ 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'Omni/Jr') diff --git a/Omni/Jr/Web.hs b/Omni/Jr/Web.hs index 2e4ee66..8508560 100644 --- a/Omni/Jr/Web.hs +++ b/Omni/Jr/Web.hs @@ -680,6 +680,7 @@ statusBadge status = TaskCore.Review -> ("badge badge-review", "Review") TaskCore.Approved -> ("badge badge-approved", "Approved") TaskCore.Done -> ("badge badge-done", "Done") + TaskCore.NeedsHelp -> ("badge badge-needshelp", "Needs Help") in Lucid.span_ [Lucid.class_ cls] label complexityBadge :: (Monad m) => Int -> Lucid.HtmlT m () @@ -770,6 +771,7 @@ clickableBadge status _tid = TaskCore.Review -> ("badge badge-review status-badge-clickable", "Review") TaskCore.Approved -> ("badge badge-approved status-badge-clickable", "Approved") TaskCore.Done -> ("badge badge-done status-badge-clickable", "Done") + TaskCore.NeedsHelp -> ("badge badge-needshelp status-badge-clickable", "Needs Help") in Lucid.span_ [ Lucid.class_ cls, Lucid.tabindex_ "0", @@ -797,6 +799,7 @@ statusDropdownOptions currentStatus tid = statusOption TaskCore.Review currentStatus tid statusOption TaskCore.Approved currentStatus tid statusOption TaskCore.Done currentStatus tid + statusOption TaskCore.NeedsHelp currentStatus tid statusOption :: (Monad m) => TaskCore.Status -> TaskCore.Status -> Text -> Lucid.HtmlT m () statusOption opt currentStatus tid = @@ -807,6 +810,7 @@ statusOption opt currentStatus tid = TaskCore.Review -> ("badge badge-review", "Review") TaskCore.Approved -> ("badge badge-approved", "Approved") TaskCore.Done -> ("badge badge-done", "Done") + TaskCore.NeedsHelp -> ("badge badge-needshelp", "Needs Help") isSelected = opt == currentStatus optClass = cls <> " status-dropdown-option" <> if isSelected then " selected" else "" in Lucid.form_ @@ -1083,8 +1087,8 @@ instance Lucid.ToHtml InterventionPage where let crumbs = [Breadcrumb "Jr" (Just "/"), Breadcrumb "Needs Human Action" Nothing] failed = TaskCore.failedTasks actionItems epicsReady = TaskCore.epicsInReview actionItems - human = TaskCore.humanTasks actionItems - totalCount = length failed + length epicsReady + length human + needsHelp = TaskCore.tasksNeedingHelp actionItems + totalCount = length failed + length epicsReady + length needsHelp in Lucid.doctypehtml_ <| do pageHead "Needs Human Action - Jr" pageBodyWithCrumbs crumbs <| do @@ -1103,10 +1107,10 @@ instance Lucid.ToHtml InterventionPage where Lucid.h2_ [Lucid.class_ "section-header"] <| Lucid.toHtml ("Epics Ready for Review (" <> tshow (length epicsReady) <> ")") Lucid.p_ [Lucid.class_ "info-msg"] "Epics with all children completed. Verify before closing." Lucid.div_ [Lucid.class_ "task-list"] <| traverse_ renderEpicReviewCard epicsReady - unless (null human) <| do - Lucid.h2_ [Lucid.class_ "section-header"] <| Lucid.toHtml ("Human Tasks (" <> tshow (length human) <> ")") - Lucid.p_ [Lucid.class_ "info-msg"] "Tasks explicitly marked as needing human work." - Lucid.div_ [Lucid.class_ "task-list"] <| traverse_ renderTaskCard (sortTasks currentSort human) + unless (null needsHelp) <| do + Lucid.h2_ [Lucid.class_ "section-header"] <| Lucid.toHtml ("Needs Help (" <> tshow (length needsHelp) <> ")") + Lucid.p_ [Lucid.class_ "info-msg"] "Tasks where Jr needs human guidance or decisions." + Lucid.div_ [Lucid.class_ "task-list"] <| traverse_ renderTaskCard (sortTasks currentSort needsHelp) renderEpicReviewCard :: (Monad m) => TaskCore.EpicForReview -> Lucid.HtmlT m () renderEpicReviewCard epicReview = do diff --git a/Omni/Jr/Web/Style.hs b/Omni/Jr/Web/Style.hs index 08fda5d..9a0c12d 100644 --- a/Omni/Jr/Web/Style.hs +++ b/Omni/Jr/Web/Style.hs @@ -584,6 +584,9 @@ statusBadges = do ".badge-done" ? do backgroundColor "#d1fae5" color "#065f46" + ".badge-needshelp" ? do + backgroundColor "#fef3c7" + color "#92400e" ".status-badge-dropdown" ? do position relative display inlineBlock @@ -1864,6 +1867,9 @@ darkModeStyles = ".badge-done" ? do backgroundColor "#064e3b" color "#6ee7b7" + ".badge-needshelp" ? do + backgroundColor "#78350f" + color "#fcd34d" ".badge-p0" ? do backgroundColor "#7f1d1d" color "#fca5a5" -- cgit v1.2.3