Add history navigation to cache tab#1394
Conversation
#503 Bundle Size — 1.26MiB (+0.29%).Warning Bundle contains 12 duplicate packages – View duplicate packages Bundle metrics
Bundle size by type
Bundle analysis report Branch jerel/cache-history Project dashboard |
| { | ||
| variants: { | ||
| variant: { | ||
| error: [ |
There was a problem hiding this comment.
For now we only need the error variant, so I've only implemented this one. We can add others as we need them.
| ); | ||
| } | ||
|
|
||
| const history = new History("ROOT_QUERY"); |
There was a problem hiding this comment.
Instantiating this outside of the component allows us to keep the history when changing tabs, otherwise this resets anytime the Cache component unmounts.
| setCacheId={setCacheId} | ||
| searchTerm={searchTerm} | ||
| /> | ||
| <List> |
There was a problem hiding this comment.
This component was fairly small and "EntityList" wasn't a super great name for this anyways, so I went ahead and inlined the implementation here and removed the old component.
alessbell
left a comment
There was a problem hiding this comment.
Great feature that will make navigating the cache much nicer! 🚀
| }: TooltipProps) { | ||
| return ( | ||
| <Root> | ||
| <Root delayDuration={delayDuration}> |
Adds a forward/back button with history to the cache tab. This should make it easier to navigate back and forth when digging into more complex objects that have lots of nested normalized data.
Previously getting back to where you were would require you to start back at either the root query or have to manually search the cache for the entry you came from.