From 8b0aef0599cd1ee692def5a644d91c091c9319fd Mon Sep 17 00:00:00 2001 From: Rahix Date: Fri, 23 Jan 2026 14:48:49 +0100 Subject: [PATCH] Treat elements with "Ultimate Goal" label specially Mainly restyle them to appear different from other techtree elements. Also ignore any element status for these, because it is meaningless (they can never be reached). --- techtree-manager/src/collect.rs | 8 +++++++- techtree-manager/src/tree.rs | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/techtree-manager/src/collect.rs b/techtree-manager/src/collect.rs index 0660eb0..9a2d6ba 100644 --- a/techtree-manager/src/collect.rs +++ b/techtree-manager/src/collect.rs @@ -128,9 +128,15 @@ fn element_from_issue(issue: &forgejo_api::structs::Issue) -> anyhow::Result { - if has_completed_label { + if has_ultimate_label { + crate::tree::ElementStatus::UltimateGoal + } else if has_completed_label { crate::tree::ElementStatus::Completed } else if issue.assignee.is_some() || issue.assignees.as_ref().is_some_and(|v| !v.is_empty()) diff --git a/techtree-manager/src/tree.rs b/techtree-manager/src/tree.rs index 19a8a5f..303b75d 100644 --- a/techtree-manager/src/tree.rs +++ b/techtree-manager/src/tree.rs @@ -55,6 +55,7 @@ impl Element { let (color, background) = match (subtree_role, status) { (Some(SubtreeElementRole::ElementOfInterest), _) => ("black", "white"), (Some(SubtreeElementRole::Dependant), _) => ("gray", "gray"), + (_, ElementStatus::UltimateGoal) => ("black", "white"), (_, ElementStatus::Missing) => ( "#800", // Highlight root elements @@ -100,6 +101,7 @@ impl Element { let class = match (role, status) { (Some(SubtreeElementRole::ElementOfInterest), _) => "eoi", (Some(SubtreeElementRole::Dependant), _) => "dependant", + (_, ElementStatus::UltimateGoal) => "ultimate", (_, ElementStatus::Missing) => "dep_missing", (_, ElementStatus::Assigned) => "dep_assigned", (_, ElementStatus::Completed) => "dep_completed", @@ -116,6 +118,7 @@ fn mermaid_classes() -> String { r##" classDef eoi fill:#fff, stroke:#000, color:#000; classDef dependant fill:#fff, stroke:#888, color:#888; + classDef ultimate fill:#fff, stroke:#000, color:#000; classDef dep_missing fill:#fcc, stroke:#800, color:#000; classDef dep_assigned fill:#ffa, stroke:#a50, color:#000; classDef dep_completed fill:#afa, stroke:#080, color:#000; @@ -128,6 +131,7 @@ pub enum ElementStatus { Missing, Assigned, Completed, + UltimateGoal, } impl std::fmt::Display for ElementStatus { @@ -136,6 +140,7 @@ impl std::fmt::Display for ElementStatus { ElementStatus::Missing => "MISSING", ElementStatus::Assigned => "ASSIGNED", ElementStatus::Completed => "COMPLETED", + ElementStatus::UltimateGoal => "ULTIMATE GOAL", }) } }