@@ -185,16 +185,18 @@ protected function renderTimelineRecursive(array $rows, float $startTime, int $s
185185
186186 foreach ($ rows as $ row ) {
187187 $ hasChildren = isset ($ row ['children ' ]) && ! empty ($ row ['children ' ]);
188+ $ isQuery = isset ($ row ['query ' ]) && ! empty ($ row ['query ' ]);
188189
190+ // Open controller timeline by default
189191 $ open = $ row ['name ' ] === 'Controller ' ;
190192
191- if ($ hasChildren ) {
193+ if ($ hasChildren || $ isQuery ) {
192194 $ output .= '<tr class="timeline-parent ' . ($ open ? ' timeline-parent-open ' : '' ) . '" id="timeline- ' . $ styleCount . '_parent" onclick="ciDebugBar.toggleChildRows( \'timeline- ' . $ styleCount . '\');"> ' ;
193195 } else {
194196 $ output .= '<tr> ' ;
195197 }
196198
197- $ output .= '<td class=" ' . ($ isChild ? 'debug-bar-width30 ' : '' ) . '" style="--level: ' . $ level . ';"> ' . ($ hasChildren ? '<nav></nav> ' : '' ) . $ row ['name ' ] . '</td> ' ;
199+ $ output .= '<td class=" ' . ($ isChild ? 'debug-bar-width30 ' : '' ) . '" style="--level: ' . $ level . ';"> ' . ($ hasChildren || $ isQuery ? '<nav></nav> ' : '' ) . $ row ['name ' ] . '</td> ' ;
198200 $ output .= '<td class=" ' . ($ isChild ? 'debug-bar-width10 ' : '' ) . '"> ' . $ row ['component ' ] . '</td> ' ;
199201 $ output .= '<td class=" ' . ($ isChild ? 'debug-bar-width10 ' : '' ) . 'debug-bar-alignRight"> ' . number_format ($ row ['duration ' ] * 1000 , 2 ) . ' ms</td> ' ;
200202 $ output .= "<td class='debug-bar-noverflow' colspan=' {$ segmentCount }'> " ;
@@ -211,12 +213,22 @@ protected function renderTimelineRecursive(array $rows, float $startTime, int $s
211213 $ styleCount ++;
212214
213215 // Add children if any
214- if ($ hasChildren ) {
216+ if ($ hasChildren || $ isQuery ) {
215217 $ output .= '<tr class="child-row" id="timeline- ' . ($ styleCount - 1 ) . '_children" style=" ' . ($ open ? '' : 'display: none; ' ) . '"> ' ;
216218 $ output .= '<td colspan=" ' . ($ segmentCount + 3 ) . '" class="child-container"> ' ;
217219 $ output .= '<table class="timeline"> ' ;
218220 $ output .= '<tbody> ' ;
219- $ output .= $ this ->renderTimelineRecursive ($ row ['children ' ], $ startTime , $ segmentCount , $ segmentDuration , $ styles , $ styleCount , $ level + 1 , true );
221+
222+ if ($ isQuery ) {
223+ // Output query string if query
224+ $ output .= '<tr> ' ;
225+ $ output .= '<td class="query-container" style="--level: ' . ($ level + 1 ) . ';"> ' . $ row ['query ' ] . '</td> ' ;
226+ $ output .= '</tr> ' ;
227+ } else {
228+ // Recursively render children
229+ $ output .= $ this ->renderTimelineRecursive ($ row ['children ' ], $ startTime , $ segmentCount , $ segmentDuration , $ styles , $ styleCount , $ level + 1 , true );
230+ }
231+
220232 $ output .= '</tbody> ' ;
221233 $ output .= '</table> ' ;
222234 $ output .= '</td> ' ;
0 commit comments