@@ -9,9 +9,10 @@ import {
99import ResultNavigation from "./nav" ;
1010import {
1111 createState ,
12+ createSearchParams ,
1213 mapToResultInfo ,
1314} from "@site/src/components/conformance/utils" ;
14- import { useHistory } from "@docusaurus/router" ;
15+ import { useHistory , useLocation } from "@docusaurus/router" ;
1516
1617import styles from "./styles.module.css" ;
1718
@@ -20,6 +21,7 @@ type ResultsProps = {
2021} ;
2122
2223export default function ResultsDisplay ( props : ResultsProps ) : JSX . Element {
24+ const location = useLocation < ConformanceState > ( )
2325 const [ currentSuite , setCurrentSuite ] = React . useState < SuiteResult | null > (
2426 null ,
2527 ) ;
@@ -30,9 +32,10 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
3032 // History handling
3133 const history = useHistory < ConformanceState > ( ) ;
3234
33- const pushStateToHistory = ( state : ConformanceState ) : void => {
35+ const pushStateToHistory = ( search : string , state : ConformanceState ) : void => {
3436 history . push ( {
3537 pathname : "/conformance" ,
38+ search,
3639 state,
3740 } ) ;
3841 } ;
@@ -91,6 +94,7 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
9194 const navigateToSuite = ( newSuiteName : string ) => {
9295 const newPath = [ ...props . state . testPath , newSuiteName ] ;
9396 pushStateToHistory (
97+ createSearchParams ( props . state . version , newPath ) ,
9498 createState (
9599 props . state . version ,
96100 newPath ,
@@ -106,6 +110,7 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
106110 const sliceNavToIndex = ( nonInclusiveIndex : number ) => {
107111 const slicedPath = [ ...props . state . testPath . slice ( 0 , nonInclusiveIndex ) ] ;
108112 pushStateToHistory (
113+ createSearchParams ( props . state . version , slicedPath ) ,
109114 createState (
110115 props . state . version ,
111116 slicedPath ,
@@ -119,6 +124,7 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
119124 const setEcmaScriptFlag = ( flag : string ) => {
120125 const nulledFlag = flag ? flag : undefined ;
121126 pushStateToHistory (
127+ createSearchParams ( props . state . version , props . state . testPath , props . state . selectedTest ) ,
122128 createState (
123129 props . state . version ,
124130 props . state . testPath ,
@@ -131,6 +137,7 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
131137 // Sets the sorting option
132138 const setSortOption = ( option : string ) => {
133139 pushStateToHistory (
140+ createSearchParams ( props . state . version , props . state . testPath , props . state . selectedTest ) ,
134141 createState (
135142 props . state . version ,
136143 props . state . testPath ,
@@ -143,6 +150,7 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
143150 // Sets a selected test.
144151 const setSelectedTest = ( test : string | undefined ) => {
145152 pushStateToHistory (
153+ createSearchParams ( props . state . version , props . state . testPath , test ) ,
146154 createState (
147155 props . state . version ,
148156 props . state . testPath ,
0 commit comments