@@ -17,8 +17,8 @@ use vite_task_plan::{ExecutionGraph, ExecutionItemDisplay, ExecutionItemKind, Le
1717use super :: {
1818 CACHE_MISS_STYLE , COMMAND_STYLE , ColorizeExt , ExitStatus , GraphExecutionReporter ,
1919 GraphExecutionReporterBuilder , LeafExecutionPath , LeafExecutionReporter , StdioConfig ,
20- StdioSuggestion , format_cache_hit_message , format_command_display ,
21- format_command_with_cache_status , format_error_message,
20+ StdioSuggestion , format_command_display , format_command_with_cache_status ,
21+ format_error_message,
2222} ;
2323use crate :: session:: {
2424 cache:: format_cache_status_summary,
@@ -28,9 +28,7 @@ use crate::session::{
2828/// Information tracked for each leaf execution, used in the final summary.
2929#[ derive( Debug ) ]
3030struct ExecutionInfo {
31- /// Display info for this execution. `None` for displayless executions
32- /// (e.g., synthetics reached via nested expansion).
33- display : Option < ExecutionItemDisplay > ,
31+ display : ExecutionItemDisplay ,
3432 /// Cache status, determined at `start()`.
3533 cache_status : CacheStatus ,
3634 /// Exit status from the process. `None` means no process was spawned (cache hit or in-process).
@@ -146,8 +144,7 @@ pub struct LabeledGraphReporter {
146144) ]
147145impl GraphExecutionReporter for LabeledGraphReporter {
148146 fn new_leaf_execution ( & mut self , path : & LeafExecutionPath ) -> Box < dyn LeafExecutionReporter > {
149- // Look up display info from the graph using the path
150- let display = path. resolve_display ( & self . graph ) . cloned ( ) ;
147+ let display = path. resolve_item ( & self . graph ) . execution_item_display . clone ( ) ;
151148 Box :: new ( LabeledLeafReporter {
152149 shared : Rc :: clone ( & self . shared ) ,
153150 writer : Rc :: clone ( & self . writer ) ,
@@ -164,16 +161,8 @@ impl GraphExecutionReporter for LabeledGraphReporter {
164161 let ( summary_buf, result) = {
165162 let shared = self . shared . borrow ( ) ;
166163
167- // Print summary.
168- // Special case: single execution without display info (e.g., synthetic via
169- // nested expansion) → skip summary since there's nothing meaningful to show.
170- let is_single_displayless =
171- shared. executions . len ( ) == 1 && shared. executions [ 0 ] . display . is_none ( ) ;
172- let summary_buf = if is_single_displayless {
173- None
174- } else {
175- Some ( format_summary ( & shared. executions , & shared. stats , & self . workspace_path ) )
176- } ;
164+ let summary_buf =
165+ Some ( format_summary ( & shared. executions , & shared. stats , & self . workspace_path ) ) ;
177166
178167 // Determine exit code based on failed tasks and infrastructure errors:
179168 // - Infrastructure errors (cache lookup, spawn failure) have error_message set
@@ -231,7 +220,7 @@ struct LabeledLeafReporter {
231220 shared : Rc < RefCell < SharedReporterState > > ,
232221 writer : Rc < RefCell < Box < dyn AsyncWrite + Unpin > > > ,
233222 /// Display info for this execution, looked up from the graph via the path.
234- display : Option < ExecutionItemDisplay > ,
223+ display : ExecutionItemDisplay ,
235224 workspace_path : Arc < AbsolutePath > ,
236225 /// Whether `start()` has been called. Used to determine if stats should be updated
237226 /// in `finish()` and whether to push an `ExecutionInfo` entry.
@@ -281,16 +270,14 @@ impl LeafExecutionReporter for LabeledLeafReporter {
281270
282271 // Format command line with cache status (sync), then write asynchronously.
283272 // The shared borrow to read cache_status is brief and dropped before the await.
284- if let Some ( ref display) = self . display {
285- let line = {
286- let shared = self . shared . borrow ( ) ;
287- let cache_status = & shared. executions . last ( ) . unwrap ( ) . cache_status ;
288- format_command_with_cache_status ( display, & self . workspace_path , cache_status)
289- } ;
290- let mut writer = self . writer . borrow_mut ( ) ;
291- let _ = writer. write_all ( line. as_bytes ( ) ) . await ;
292- let _ = writer. flush ( ) . await ;
293- }
273+ let line = {
274+ let shared = self . shared . borrow ( ) ;
275+ let cache_status = & shared. executions . last ( ) . unwrap ( ) . cache_status ;
276+ format_command_with_cache_status ( & self . display , & self . workspace_path , cache_status)
277+ } ;
278+ let mut writer = self . writer . borrow_mut ( ) ;
279+ let _ = writer. write_all ( line. as_bytes ( ) ) . await ;
280+ let _ = writer. flush ( ) . await ;
294281
295282 StdioConfig {
296283 suggestion,
@@ -352,12 +339,6 @@ impl LeafExecutionReporter for LabeledLeafReporter {
352339 buf. extend_from_slice ( format_error_message ( message) . as_bytes ( ) ) ;
353340 }
354341
355- // For executions without display info (synthetics via nested expansion) that are
356- // cache hits, print the cache hit message
357- if self . started && self . display . is_none ( ) && self . is_cache_hit {
358- buf. extend_from_slice ( format_cache_hit_message ( ) . as_bytes ( ) ) ;
359- }
360-
361342 // Add a trailing newline after each task's output for readability.
362343 // Skip if start() was never called (e.g. cache lookup failure) — there's
363344 // no task output to separate.
@@ -516,10 +497,7 @@ fn format_summary(
516497 ) ;
517498
518499 for ( idx, exec) in executions. iter ( ) . enumerate ( ) {
519- // Skip executions without display info (they have nothing to show in the summary)
520- let Some ( ref display) = exec. display else {
521- continue ;
522- } ;
500+ let display = & exec. display ;
523501
524502 let task_display = & display. task_display ;
525503
@@ -677,13 +655,16 @@ mod tests {
677655 /// Build a `LabeledGraphReporter` for the given graph and return a leaf reporter
678656 /// for the first node's first item.
679657 fn build_labeled_leaf ( graph : ExecutionGraph ) -> Box < dyn LeafExecutionReporter > {
658+ use vite_task_plan:: execution_graph:: ExecutionNodeIndex ;
659+
680660 let graph_arc = Arc :: new ( graph) ;
681661 let builder =
682662 Box :: new ( LabeledReporterBuilder :: new ( test_path ( ) , Box :: new ( tokio:: io:: sink ( ) ) ) ) ;
683663 let mut reporter = builder. build ( & graph_arc) ;
684664
685- // Create a leaf reporter for the first node
686- let path = LeafExecutionPath :: default ( ) ;
665+ // Create a leaf reporter for the first node's first item
666+ let mut path = LeafExecutionPath :: default ( ) ;
667+ path. push ( ExecutionNodeIndex :: new ( 0 ) , 0 ) ;
687668 reporter. new_leaf_execution ( & path)
688669 }
689670
0 commit comments