@skitterbyte/skitterspec-jira 1.0.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -570,6 +570,15 @@ const UNSTARTED_BUCKETS = ['backlog', 'cancelled']
570
570
  // Buckets where a spec is FINISHED, and so has nobody working on it.
571
571
  const TERMINAL_BUCKETS = ['complete', 'cancelled']
572
572
 
573
+ // A phase's state once its SPEC's bucket has a say. Cancelling a spec abandons
574
+ // every phase not already done — left alone, those sub-issues stay open in
575
+ // Backlog under a closed parent, which reads as work still owed. A phase that
576
+ // was finished keeps `complete`: it shipped before the spec was dropped.
577
+ function phaseStateUnder(workflowState, phaseState) {
578
+ if (workflowState === 'cancelled' && phaseState !== 'complete') return 'cancelled'
579
+ return phaseState
580
+ }
581
+
573
582
  /**
574
583
  * The Linear user this spec is assigned to, AS PROJECTED — which is not simply
575
584
  * what the frontmatter records.
@@ -714,7 +723,7 @@ function normalizeLocal(snapshotDir, config) {
714
723
  ref: p.phase,
715
724
  name: p.name,
716
725
  goal: subIssueBody(p, tasksMode, config.sync.localOnlySections, dialect),
717
- state: p.state,
726
+ state: phaseStateUnder(workflowState, p.state),
718
727
  })),
719
728
  workflowState,
720
729
  // Who is building this. `toFieldSet` drops it unless the repo listed