$stage_row ) {
if ( ( $stage_row['stage'] ?? '' ) !== $stage_name ) {
continue;
}
$rendered_stages[] = $role_key;
$log_rows = $log_index[ $stage_name ] ?? array();
require PRAUTOBLOGGER_PLUGIN_DIR . 'templates/admin/dossier-stage-section.php';
}
}
// Remaining unordered stages.
foreach ( $stages as $role_key => $stage_row ) {
if ( in_array( $role_key, $rendered_stages, true ) ) {
continue;
}
$stage_name = (string) ( $stage_row['stage'] ?? 'unknown' );
$log_rows = $log_index[ $stage_name ] ?? array();
require PRAUTOBLOGGER_PLUGIN_DIR . 'templates/admin/dossier-stage-section.php';
}
// M3/F3: stages that exist only in generation_log (images,
// llm_research, ...) render from their real data source.
foreach ( ( $dossier['log_only_stages'] ?? array() ) as $stage_name ) {
$log_rows = $log_index[ $stage_name ] ?? array();
if ( empty( $log_rows ) ) {
continue;
}
require PRAUTOBLOGGER_PLUGIN_DIR . 'templates/admin/dossier-log-stage-section.php';
}
if ( empty( $stages ) ) :
?>