File tree Expand file tree Collapse file tree
routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.tasks.standard.$taskParam Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -171,21 +171,21 @@ export class TaskDetailPresenter {
171171 }
172172
173173 const bucketMap = new Map < number , Record < string , number > > ( ) ;
174- const usedGroups = new Set < GroupLabel > ( ) ;
175174 for ( const row of rows ) {
176175 const group = groupForStatus ( row . status ) ?? "RUNNING" ;
177- usedGroups . add ( group ) ;
178176 const ts = row . bucket * 1000 ;
179177 const existing = bucketMap . get ( ts ) ?? { } ;
180178 existing [ group ] = ( existing [ group ] ?? 0 ) + row . val ;
181179 bucketMap . set ( ts , existing ) ;
182180 }
183181
182+ // Always emit every status group so the chart legend is stable across
183+ // time ranges (even when a group has no runs in the current window).
184184 const bucketMs = bucketSeconds * 1000 ;
185185 const start = Math . floor ( from . getTime ( ) / bucketMs ) * bucketMs ;
186186 const end = Math . ceil ( to . getTime ( ) / bucketMs ) * bucketMs ;
187187 const points : TaskActivityPoint [ ] = [ ] ;
188- const orderedStatuses = GROUP_LABEL . filter ( ( g ) => usedGroups . has ( g ) ) ;
188+ const orderedStatuses = [ ... GROUP_LABEL ] ;
189189 for ( let ts = start ; ts < end ; ts += bucketMs ) {
190190 const existing = bucketMap . get ( ts ) ?? { } ;
191191 const point : TaskActivityPoint = { bucket : ts } ;
You can’t perform that action at this time.
0 commit comments