-
Notifications
You must be signed in to change notification settings - Fork 2
Better handling of large documents in data preview
#1879
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
base: main
Are you sure you want to change the base?
Conversation
documents much easier.
Starting to plumb through progress
monaco editor. Due to both trying to fill up as much width as possible.
| if (error === null && data) { | ||
| return data.documents.reduce( | ||
| (acc, record) => { | ||
| acc[buildRecordKey(record)] = record; | ||
| return acc; | ||
| }, | ||
| {} as Record<string, JournalRecord<Record<string, any>>> | ||
| ); |
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.
No big change just trying to get a tiny perf boost.
| const rows = useMemo( | ||
| () => Object.keys(rowsByKey).map((k) => ({ key: k, id: k })), | ||
| [rowsByKey] | ||
| ); | ||
|
|
||
| const selectedRecordJson = useMemo( | ||
| () => stringifyJSON(rowsByKey[selectedKey]), | ||
| [rowsByKey, selectedKey] | ||
| ); |
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.
These memos only really help when the data is larger but shouldn't add a bunch of overhead for smaller data sets 🤷
| 'journals.tooManyBytes.title': `Large documents`, | ||
| 'journals.tooManyBytes.message': `Exceeded the maximum bytes before reaching the desired number of documents. This probably means that your documents are large.`, | ||
| 'journals.tooManyBytesAndNoDocuments.title': `Read limit reached`, | ||
| 'journals.tooManyBytesAndNoDocuments.message': `We reached the limit of how much data a web browser can comfortably read, and didn't find even reach the end of one document! This probably means that your documents are huge.`, |
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.
This message was worded very odd so changed it.
PR: commenting some potential future work
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.
intl component -> hook.
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.
This was FRUSTRATING and I just got it working and moved on. Commented with a todo even though it isn't a true todo but something we need to research in the future.
| }} | ||
| > | ||
| <Box | ||
| // TODO (monaco resize) |
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.
Marking this because this is close but not exactly the same as the other wrapper.
…-too-big-doc-preview
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.
tested on my local and all looks good.
A minor styling change to consider - row highlighting is enough, no need to change typography variant (also compensate left padding for thick border on selected rows)
Screen.Recording.2026-01-30.at.1.41.59.PM.mov |
Screen.Recording.2026-01-30.at.1.41.33.PM.mov |
simple color change when selected
Issues
#1243
Changes
1243
Misc
Tests
Manually tested
Automated tests
Playwright tests ran locally
Screenshots
Large docs in data preview show this warning

Switching to using monaco editor
