Make recent logs available in the top dropdown#97
Conversation
Instead of showing example logs in the top dropdown, show a list of recently pasted logs or logs from loaded files if they are available. This utilizes the localData npm package that uses indexedDb.
8944b5f to
56f1ca0
Compare
| (text: string) => { | ||
| const rawLines = text.split("\n"); | ||
| loadLog(rawLines); | ||
| updateStoredLogs(rawLines); |
There was a problem hiding this comment.
We have a couple of ways to load the input: paste, query link, server-injected link and file dialog.
I wonder if we can find a single point of "load" to updateStoredLogs? processRawLines maybe?...
There was a problem hiding this comment.
We want to be selective about what goes into storedLogs - for example we don't want anything already in stored logs to be re-added. We probably also don't want url param content to be added to storedLogs as that already has a save-able URL.
theihor
left a comment
There was a problem hiding this comment.
Great feature, thanks! I left a couple of non-blocking suggestions.
|
|
||
| const handleLoadExample = useCallback( | ||
| async (exampleLink: string) => { | ||
| async (example: string, isLink: boolean) => { |
There was a problem hiding this comment.
I noticed that we hide the example dropdown if there is anthing in stored logs. Maybe we can show both?
There was a problem hiding this comment.
I thought about that but then the text next to it doesn't make sense "Example Logs" and "Previous Logs" - seems a little verbose to say "Example and Previous Logs"
There was a problem hiding this comment.
I was thinking making those separate drop downs. But never mind, not important.
There was a problem hiding this comment.
Kk, we can always update it later if people want the examples back.
Instead of showing example logs in the top
dropdown, show a list of recently pasted logs
or logs from loaded files if they are available.
This utilizes the localData npm package
that uses indexedDb.