@@ -41,31 +41,27 @@ const DiagnosticSchema = z.object({
41
41
z . object ( {
42
42
issue : z . string ( ) ,
43
43
description : z . string ( ) ,
44
- howToFix : z . array ( z . object ( {
45
- step : z . string ( ) ,
46
- description : z . string ( ) ,
47
- type : z . enum ( [ 'rapidload_fix' , 'wordpress_fix' , 'theme_fix' , 'another_plugin_fix' , 'code_fix' , 'server_config_fix' , 'server_upgrade_fix' , 'other' ] ) ,
48
- substeps : z . array ( z . object ( {
49
- step : z . string ( ) ,
50
- description : z . string ( ) ,
51
- } ) ) . optional ( ) . describe ( 'Substeps to fix the issue.' ) ,
52
- rapidload_setting_input : z . object ( {
53
- name : z . string ( ) ,
54
- value : z . string ( ) . nullable ( ) ,
55
- original_current_value : z . string ( ) . nullable ( ) ,
56
- } ) . optional ( ) ,
57
- } ) ) ,
58
- how_to_fix_reasoning_memory : z . string ( ) ,
59
- how_to_fix_questions : z . array ( z . object ( {
60
- question : z . string ( ) ,
61
- explanation : z . string ( ) ,
62
- type : z . enum ( [ 'single_choice' , 'multiple_choice' , 'text' , 'number' ] ) ,
63
- options : z . array ( z . object ( {
64
- value : z . string ( ) ,
65
- label : z . string ( ) ,
44
+ solutions : z . object ( {
45
+ solutions_reasoning : z . array ( z . object ( {
46
+ block_type : z . enum ( [ 'observation' , 'analysis' , 'hypothesis' , 'validation' , 'conclusion' ] ) ,
47
+ thought : z . string ( ) ,
48
+ reasoning : z . string ( ) ,
49
+ confidence_level : z . number ( ) . min ( 0 ) . max ( 100 ) ,
50
+ supporting_evidence : z . array ( z . string ( ) ) ,
51
+ related_blocks : z . array ( z . string ( ) ) . optional ( ) ,
52
+ } ) ) ,
53
+ solutions_list : z . array ( z . object ( {
54
+ type : z . enum ( [ 'rapidload_fix' , 'wordpress_fix' , 'theme_fix' , 'another_plugin_fix' , 'code_fix' , 'server_config_fix' , 'server_upgrade_fix' ] ) ,
55
+ title : z . string ( ) ,
66
56
description : z . string ( ) ,
57
+ steps : z . array ( z . object ( {
58
+ step : z . number ( ) ,
59
+ action : z . string ( ) ,
60
+ details : z . string ( ) ,
61
+ verification : z . string ( ) . optional ( )
62
+ } ) ) ,
67
63
} ) ) ,
68
- } ) ) ,
64
+ } ) ,
69
65
resources : z . array ( z . object ( {
70
66
name : z . string ( ) ,
71
67
url : z . string ( ) ,
@@ -99,6 +95,8 @@ const Optimizations = ({ }) => {
99
95
const { headerUrl, diagnosticLoading } = useCommonDispatch ( ) ;
100
96
const [ remainingTime , setRemainingTime ] = useState ( 0 ) ;
101
97
const [ serverDetails , setServerDetails ] = useState ( null ) ;
98
+ const [ input , setInput ] = useState ( null ) ;
99
+
102
100
useEffect ( ( ) => {
103
101
console . log ( 'diagnosticLoading' , diagnosticLoading )
104
102
} , [ diagnosticLoading ] )
@@ -230,7 +228,7 @@ const Optimizations = ({ }) => {
230
228
231
229
try {
232
230
233
- console . log ( input )
231
+ setInput ( input )
234
232
submit ( input )
235
233
setDiagnosticsProgress ( 95 ) ;
236
234
@@ -612,8 +610,8 @@ const Optimizations = ({ }) => {
612
610
</ button >
613
611
</ div >
614
612
< iframe
615
- // src={showIframe ? `${optimizerUrl}/?rapidload_preview` : ''}
616
- src = { showIframe ? 'http://rapidload.local/?rapidload_preview' : '' }
613
+ src = { showIframe ? `${ optimizerUrl } /?rapidload_preview` : '' }
614
+ // src={showIframe ? 'http://rapidload.local/?rapidload_preview' : ''}
617
615
className = "w-full h-[600px] border-0"
618
616
title = "Optimization Test"
619
617
/>
@@ -622,7 +620,13 @@ const Optimizations = ({ }) => {
622
620
) }
623
621
</ div >
624
622
625
- { diagnosticResults ?. AnalysisSummary ?. length && < AnalysisResults object = { diagnosticResults } relatedAudits = { relatedAudits } /> }
623
+ { diagnosticResults ?. AnalysisSummary ?. length &&
624
+ < AnalysisResults
625
+ object = { diagnosticResults }
626
+ relatedAudits = { relatedAudits }
627
+ input = { input }
628
+ />
629
+ }
626
630
</ m . div >
627
631
</ AnimatePresence >
628
632
)
0 commit comments