-
Notifications
You must be signed in to change notification settings - Fork 4
Make recent logs available in the top dropdown #97
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking making those separate drop downs. But never mind, not important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.