-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new-log-viewer: Add UrlContextProvider
to provide URL parameters and use them in the StateContextProvider
.
#48
Conversation
Thanks for the changes. Some significant refinements are needed before we can merge the PR. Let's use this patch file as a reference changes.patch and feel free to ask any questions offline. |
Let's also add some demo elements in the and/or so we can better demo the usages and be more confident that our implementations are working:
|
(2.) has been implemented. Let's continue to work on (1.) and (3.). Let me know if you need help for (3.). I believe we also need to update some of the service worker code. |
Description
UrlContextProvider
provides 3 main functions:setSearchParamSet
,setHashParamSet
andcopyToClipboard
.setSearchParamSet
takes in new search parameters and replace its current search parameters. It then updates the URL on the search bar.setHashParamSet
replaces with new hash parameters. However, it stores the current hash parameter using auseState
hook.Validation performed
In
Layout.tsx
, add this test code block afteruseContext(UrlContext)
:Results:
Moded URL:
http://localhost:3010/?seek=begin&filePath=path/to/file#searchEventIdx=114514
Clipboard:
http://localhost:3010/?seek=begin&filePath=path%2Fto%2FfilePath#searchEventIdx=1919810