mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	The main reasoning for this change is as follows:
    * When the search bar contains multiple search queries
        but no search results, the last search operand does
        not get displayed.
        This happens due to the fact that filter object
        contained 2 terms having the operator key value as
        "search" instead of a single term where operator is
        "search" and operand is a single string containing
        the space seperated search queries. This condition
        occurs for search_pills_enabled case only because
        we used to Filter.parse the query twice
        (once for the `base_operators` and once for the
        `suggestion_operator instead of doing both at once).
        Thus the `search_query` value inside the
        `narrow.show_search_query` function which only
        selected the operands of the first term displayed
        an incomplete result.
    * Another benefit of this commit is to display the narrow
        operators in the URL fragment the same way as when
        search_pills_enabled = False.
        For example, On entering the queries in the mentioned
        order -> 'is: starred', 'abc', 'def', 'is: private',
        'ghi'. This is the URL:
        Previously:
        /#narrow/is/starred/is/private/search/abc.20def/search/ghi
        Now (same as pills disabled case):
        /#narrow/is/starred/is/private/search/abc.20def.20ghi
    * We are also able to de-duplicate the non-typeahead search
        query code path.