@@ -9,9 +9,10 @@ import {
9
9
import ResultNavigation from "./nav" ;
10
10
import {
11
11
createState ,
12
+ createSearchParams ,
12
13
mapToResultInfo ,
13
14
} from "@site/src/components/conformance/utils" ;
14
- import { useHistory } from "@docusaurus/router" ;
15
+ import { useHistory , useLocation } from "@docusaurus/router" ;
15
16
16
17
import styles from "./styles.module.css" ;
17
18
@@ -20,6 +21,7 @@ type ResultsProps = {
20
21
} ;
21
22
22
23
export default function ResultsDisplay ( props : ResultsProps ) : JSX . Element {
24
+ const location = useLocation < ConformanceState > ( )
23
25
const [ currentSuite , setCurrentSuite ] = React . useState < SuiteResult | null > (
24
26
null ,
25
27
) ;
@@ -30,9 +32,10 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
30
32
// History handling
31
33
const history = useHistory < ConformanceState > ( ) ;
32
34
33
- const pushStateToHistory = ( state : ConformanceState ) : void => {
35
+ const pushStateToHistory = ( search : string , state : ConformanceState ) : void => {
34
36
history . push ( {
35
37
pathname : "/conformance" ,
38
+ search,
36
39
state,
37
40
} ) ;
38
41
} ;
@@ -91,6 +94,7 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
91
94
const navigateToSuite = ( newSuiteName : string ) => {
92
95
const newPath = [ ...props . state . testPath , newSuiteName ] ;
93
96
pushStateToHistory (
97
+ createSearchParams ( props . state . version , newPath ) ,
94
98
createState (
95
99
props . state . version ,
96
100
newPath ,
@@ -106,6 +110,7 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
106
110
const sliceNavToIndex = ( nonInclusiveIndex : number ) => {
107
111
const slicedPath = [ ...props . state . testPath . slice ( 0 , nonInclusiveIndex ) ] ;
108
112
pushStateToHistory (
113
+ createSearchParams ( props . state . version , slicedPath ) ,
109
114
createState (
110
115
props . state . version ,
111
116
slicedPath ,
@@ -119,6 +124,7 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
119
124
const setEcmaScriptFlag = ( flag : string ) => {
120
125
const nulledFlag = flag ? flag : undefined ;
121
126
pushStateToHistory (
127
+ createSearchParams ( props . state . version , props . state . testPath , props . state . selectedTest ) ,
122
128
createState (
123
129
props . state . version ,
124
130
props . state . testPath ,
@@ -131,6 +137,7 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
131
137
// Sets the sorting option
132
138
const setSortOption = ( option : string ) => {
133
139
pushStateToHistory (
140
+ createSearchParams ( props . state . version , props . state . testPath , props . state . selectedTest ) ,
134
141
createState (
135
142
props . state . version ,
136
143
props . state . testPath ,
@@ -143,6 +150,7 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
143
150
// Sets a selected test.
144
151
const setSelectedTest = ( test : string | undefined ) => {
145
152
pushStateToHistory (
153
+ createSearchParams ( props . state . version , props . state . testPath , test ) ,
146
154
createState (
147
155
props . state . version ,
148
156
props . state . testPath ,
0 commit comments