@@ -175,9 +175,11 @@ class RoomStateExplorer extends React.Component {
175175
176176 this . onBack = this . onBack . bind ( this ) ;
177177 this . editEv = this . editEv . bind ( this ) ;
178+ this . onQuery = this . onQuery . bind ( this ) ;
178179 }
179180
180181 state = {
182+ query : '' ,
181183 eventType : null ,
182184 event : null ,
183185 } ;
@@ -213,6 +215,10 @@ class RoomStateExplorer extends React.Component {
213215 } ) ;
214216 }
215217
218+ onQuery ( ev ) {
219+ this . setState ( { query : ev . target . value } ) ;
220+ }
221+
216222 render ( ) {
217223 if ( this . state . event ) {
218224 return < div className = "mx_ViewSource" >
@@ -230,6 +236,9 @@ class RoomStateExplorer extends React.Component {
230236
231237 if ( this . state . eventType === null ) {
232238 Object . keys ( this . roomStateEvents ) . forEach ( ( evType ) => {
239+ // Skip this entry if does not contain search query
240+ if ( this . state . query && ! evType . includes ( this . state . query ) ) return ;
241+
233242 const stateGroup = this . roomStateEvents [ evType ] ;
234243 const stateKeys = Object . keys ( stateGroup ) ;
235244
@@ -248,6 +257,9 @@ class RoomStateExplorer extends React.Component {
248257 const evType = this . state . eventType ;
249258 const stateGroup = this . roomStateEvents [ evType ] ;
250259 Object . keys ( stateGroup ) . forEach ( ( stateKey ) => {
260+ // Skip this entry if does not contain search query
261+ if ( this . state . query && ! stateKey . includes ( this . state . query ) ) return ;
262+
251263 const ev = stateGroup [ stateKey ] ;
252264 rows . push ( < button className = "mx_DevTools_RoomStateExplorer_button" key = { stateKey }
253265 onClick = { this . onViewSourceClick ( ev ) } >
@@ -258,6 +270,7 @@ class RoomStateExplorer extends React.Component {
258270
259271 return < div >
260272 < div className = "mx_Dialog_content" >
273+ < input onChange = { this . onQuery } placeholder = { _t ( 'Filter results' ) } size = "64" className = "mx_TextInputDialog_input mx_DevTools_RoomStateExplorer_query" value = { this . state . query } />
261274 { rows }
262275 </ div >
263276 < div className = "mx_Dialog_buttons" >
0 commit comments