Add file picker and improve input json validation and error messages #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not cleaned up - I don't have the time to make a nice PR right now. Maybe @jameshadfield you can copy/paste what you'd be happy to use wherever you'd like to use it. For now we just use this branch locally with
npm run startas it works well enough.Description of proposed changes
Grab bag of fixes/changes that @marie3003 and I used to help us debug the JSON produced by some MLR modelling code.
We got uninformative error messages that didn't make it obvious what the issue was, for example just this:
Error during file reading / parsing: Cannot read properties of undefined (reading 'get').We got Claude to help us improve validation and error messages to make it faster to find issues in the JSON one uploads.
Now one gets nice console errors and stack traces:

We also ran into a (new?) macOS issue where you can't actually drag&drop from Finder, so we worked around that by adding a file picker.
Checklist