Closed Henry8192 closed 1 month ago
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.
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
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:
- (Likely only need to modify ) Add a button which copies the link with logEventNum=theLastLogEvent to the clipboard.
- (Likely only need to modify ) Set logEventNum in the URL after a page is loaded.
- (Likely only need to modify ) Support loading a specific log by changing the logEventNum in the URL.
(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