File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -332,6 +332,10 @@ export default function Page() {
332332 const results = useTypedActionData < typeof action > ( ) ;
333333 const navigation = useNavigation ( ) ;
334334
335+ // Use most recent history item if available, otherwise fall back to defaults
336+ const initialQuery = history . length > 0 ? history [ 0 ] . query : defaultQuery ;
337+ const initialScope : QueryScope = history . length > 0 ? history [ 0 ] . scope : "environment" ;
338+
335339 const editorRef = useRef < QueryEditorFormHandle > ( null ) ;
336340 const [ prettyFormatting , setPrettyFormatting ] = useState ( true ) ;
337341 const [ resultsView , setResultsView ] = useState < "table" | "graph" > ( "table" ) ;
@@ -368,8 +372,8 @@ export default function Page() {
368372 { /* Query editor - isolated component to prevent re-renders */ }
369373 < QueryEditorForm
370374 ref = { editorRef }
371- defaultQuery = { defaultQuery }
372- defaultScope = "environment"
375+ defaultQuery = { initialQuery }
376+ defaultScope = { initialScope }
373377 history = { history }
374378 isLoading = { isLoading }
375379 />
You can’t perform that action at this time.
0 commit comments