193193 <div class =" report-subview-toggle" >
194194 <button
195195 :class =" ['subview-btn', { active: reportViewMode === 'cards' }]"
196- @click =" reportViewMode = 'cards'"
196+ @click =" $emit('update: reportViewMode', 'cards') "
197197 >Cards</button >
198198 <button
199199 :class =" ['subview-btn', { active: reportViewMode === 'json' }]"
200- @click =" reportViewMode = 'json'"
200+ @click =" $emit('update: reportViewMode', 'json') "
201201 >JSON</button >
202202 </div >
203203
@@ -299,20 +299,22 @@ const props = withDefaults(defineProps<{
299299 position? : ' bottom' | ' side' ;
300300 report? : AuditReportDocument | null ;
301301 isReportModeActive? : boolean ;
302+ reportViewMode? : ' cards' | ' json' ;
302303}>(), {
303304 position: ' bottom' ,
304305 report: null ,
305306 isReportModeActive: false ,
307+ reportViewMode: ' cards' ,
306308});
307309
308310const emit = defineEmits <{
309311 (e : ' clear' ): void ;
310312 (e : ' clear-report' ): void ;
311313 (e : ' toggle-position' ): void ;
314+ (e : ' update:reportViewMode' , mode : ' cards' | ' json' ): void ;
312315}>();
313316
314317const activeTab = ref <' console' | ' report' >(' console' );
315- const reportViewMode = ref <' cards' | ' json' >(' cards' );
316318const isCollapsed = ref <boolean >(false );
317319const drawerHeight = ref <number >(240 );
318320const drawerWidth = ref <number >(620 );
@@ -323,7 +325,6 @@ const totalReportViolations = computed(() => {
323325 return props .report ?.summary ?.total_violations ?? 0 ;
324326});
325327
326- // Distinguishes non-fatal warnings from fatal exceptions
327328const isWarningOnly = computed (() => {
328329 if (! props .stderr ) return false ;
329330 const text = props .stderr ;
@@ -342,10 +343,21 @@ const isWarningOnly = computed(() => {
342343 );
343344});
344345
345- // Auto-switch to Audit Report tab when report data arrives
346- watch (() => props .report , (newRep ) => {
347- if (newRep && newRep .violations && newRep .violations .length > 0 ) {
348- activeTab .value = ' report' ;
346+ watch (
347+ [() => props .isReportModeActive , () => props .report ],
348+ ([isReportMode , newReport ]) => {
349+ if (isReportMode && newReport && newReport .violations && newReport .violations .length > 0 ) {
350+ activeTab .value = ' report' ;
351+ } else if (! isReportMode && ! newReport ) {
352+ activeTab .value = ' console' ;
353+ }
354+ },
355+ { immediate: true }
356+ );
357+
358+ watch (() => props .isRunning , (running ) => {
359+ if (running && ! props .isReportModeActive ) {
360+ activeTab .value = ' console' ;
349361 }
350362});
351363
@@ -698,6 +710,7 @@ defineExpose({
698710 background : var (--vp-c-bg-soft );
699711}
700712
713+ /* Console View */
701714.console-view {
702715 padding : 12px 14px ;
703716}
@@ -720,6 +733,7 @@ defineExpose({
720733 border-radius : 4px ;
721734}
722735
736+ /* Non-blocking PHP Warnings / Notices (Amber/Gold) */
723737.stderr-stream.is-warning {
724738 color : #fbbf24 ;
725739 background : rgba (245 , 158 , 11 , 0.08 );
@@ -768,6 +782,9 @@ defineExpose({
768782 animation : spin 0.8s linear infinite ;
769783}
770784
785+ /* ========================================================
786+ Audit Report Layout & Cards View
787+ ======================================================== */
771788.report-view {
772789 display : flex ;
773790 flex-direction : column ;
@@ -820,17 +837,20 @@ defineExpose({
820837 color : #ef4444 ;
821838}
822839
840+ /* Actions Group inside Summary Bar */
823841.summary-actions {
824842 display : flex ;
825843 align-items : center ;
826844 gap : 6px ;
845+ flex-shrink : 0 ;
827846}
828847
829848.report-subview-toggle {
830849 display : inline-flex ;
831850 border : 1px solid var (--vp-c-divider );
832851 border-radius : 4px ;
833852 overflow : hidden ;
853+ flex-shrink : 0 ;
834854}
835855
836856.subview-btn {
@@ -862,6 +882,7 @@ defineExpose({
862882 color : var (--vp-c-text-2 );
863883 cursor : pointer ;
864884 transition : all 0.15s ease ;
885+ flex-shrink : 0 ;
865886}
866887
867888.report-action-btn :hover {
0 commit comments