Skip to content

Conversation

@vviers
Copy link
Contributor

@vviers vviers commented Jul 28, 2025

Follow up to #275

Still very much WIP. What remains to be done at the very least:

  • figure out how to make the preview fetch the document without NGINX complaining about CORS locally
    • ok for csv-viewer
    • for grist-viewer, it might be cleaner to open a PR in the project so fetch are made with {credentials: "include"}
  • host + serve our own grist-static (prototype fetches grist-static from Grist Lab's CDN)
    • @hexaltation and I managed to build grist-static from source today 🎉
  • remove useless UI elements in the context of unauthenticated, read-only use
  • (optionnal ?) use DSFR colors ?

Wishlist for a separate PR:

  • edits and saves (this was done for puter.com so that's possible)
  • "save to Grist" if a sister Grist installation is available (for example, in the context of LaSuite)

Fixes #281

@vviers vviers changed the base branch from main to add_grist_types July 28, 2025 14:41
@vviers vviers force-pushed the add_grist_types branch from 1a003c4 to 11c1e4e Compare July 28, 2025 14:42
@vviers vviers force-pushed the grist-static-preview branch from 7dea7bc to b8fb52a Compare July 28, 2025 14:44
{
...file,
category: getMimeCategory(file.mimetype),
category: getMimeCategory(file.mimetype, file.url.split('.').pop() || null),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: refactor this

<div className="file-preview-title">
<img
src={getIconByMimeType(currentFile.mimetype, "mini").src}
src={getIconByMimeType(currentFile.mimetype, "mini", currentFile.url.split('.').pop()).src}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fix. When opening a .grist preview, the header showed a SQLite logo.

@vviers
Copy link
Contributor Author

vviers commented Jul 28, 2025

Grist document preview

Capture.video.du.2025-07-28.16-48-53.webm

CSV preview

Capture.video.du.2025-07-28.17-17-23.webm

vviers added 5 commits July 29, 2025 16:22
This is needed for the rest of the work.
They are the same proportions as other icons
I'll add the Grist exeption in a separate commit
Using the generic logo so its relevant to all instances of drive.
Interops for the win !
A generic SQL icon seems to be OK for now
@vviers vviers force-pushed the add_grist_types branch from 11c1e4e to 1312308 Compare July 29, 2025 14:23
@vviers vviers force-pushed the grist-static-preview branch from 24f446f to ba2a6b1 Compare July 29, 2025 14:27
@vviers vviers force-pushed the grist-static-preview branch from 2dcd716 to 0fbd4ee Compare July 31, 2025 15:13
@NathanVss NathanVss force-pushed the add_grist_types branch 2 times, most recently from d00d1f7 to 4b07850 Compare September 12, 2025 09:55
@NathanVss
Copy link
Contributor

Grist document preview

Capture.video.du.2025-07-28.16-48-53.webm

CSV preview

Capture.video.du.2025-07-28.17-17-23.webm

Wow it's amazing !! Keep us tuned once the PR is ready, I love it 🤩

@NathanVss NathanVss force-pushed the add_grist_types branch 2 times, most recently from fd7ee70 to b80b850 Compare October 3, 2025 14:45
Base automatically changed from add_grist_types to main October 3, 2025 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preview grist files using grist-static

3 participants