You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: begin renaming bookmark to saved searches (#1407)
* refactor: begin renaming bookmark to saved searches
Previously, we used the phrases `bookmark` and `saved search` interchangeably.
However, after creating the APIs, `saved searches` are the saved query objects
and `bookmarks` describe a user's specific status related to a saved search.
This commit starts to rename a lot of the references to `bookmark` to `saved search`.
We still need to rename the appBookmarkInfo to appSavedSearchInfo
(since it's all about reading from the saved searches API), but that can come later.
Besides the renaming mentioned above, there is one new thing: `CurrentSavedSearch`.
`CurrentSavedSearch` is a new interface that can hold either one of the new interfaces:
`UserSavedSearch` and `GlobalSavedSearch` This is done through a discriminated [union](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes-func.html#discriminated-unions).
I used this type of union vs the regular union with `|` because GlobalSavedSearch and UserSavedSearch had different fields
but previously I was just allowing them to use both one interface and mark all the fields optional.
These two specific interfaces let consumers know that fields are actually expected for each interface.
Additionally, the typescript compiler in vscode is smart enough to know what once you have checked for a certain type, it knows it is using that type.
* change type->scope
it('reorderByQueryTerms() sorts correctly with DEFAULT_BOOKMARKS',async()=>{
113
+
it('reorderByQueryTerms() sorts correctly with DEFAULT_GLOBAL_SAVED_SEARCHES',async()=>{
104
114
constcssQuery=
105
115
'id:anchor-positioning OR id:container-queries OR id:has OR id:nesting OR id:view-transitions OR id:subgrid OR id:grid OR name:scrollbar OR id:scroll-driven-animations OR id:scope';
0 commit comments