[PR #722] [CLOSED] feat: document thumbnails #1140

Closed
opened 2026-02-26 19:32:00 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/722
Author: @mikezzb
Created: 12/3/2023
Status: Closed

Base: mainHead: feat


📝 Commits (7)

📊 Changes

9 files changed (+185 additions, -22 deletions)

View changed files

📝 apps/web/src/app/(dashboard)/documents/data-table-title.tsx (+16 -1)
📝 apps/web/src/app/(dashboard)/documents/upload-document.tsx (+76 -1)
packages/lib/server-only/document-thumbnail/create-document-thumbnail.ts (+17 -0)
📝 packages/lib/server-only/document/create-document.ts (+8 -1)
packages/prisma/migrations/20231203192538_/migration.sql (+23 -0)
📝 packages/prisma/schema.prisma (+32 -15)
📝 packages/trpc/server/document-router/router.ts (+2 -1)
📝 packages/trpc/server/document-router/schema.ts (+1 -0)
📝 packages/ui/primitives/pdf-viewer.tsx (+10 -3)

📄 Description

Closes #704

Implementation:

  • Generate a thumbnail on the client side using the rendering of an invisible LazyPDFViewer
  • Store the base 64 string of the thumbnail in the database
  • Error handling: reject the thumbnail generation if timeout (500ms)
  • Keep the aspect ratio of the thumbnail but enforce the max dimension
  • Implemented the primitive UI to display thumbnails in the table

Preview:

Screenshot 2023-12-03 at 05 07 48 (For compatibility, previous document without thumbnail will show default icon as last one)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/722 **Author:** [@mikezzb](https://github.com/mikezzb) **Created:** 12/3/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat` --- ### 📝 Commits (7) - [`c1a3507`](https://github.com/documenso/documenso/commit/c1a350712fc0e739ba2b529ab720e3c3817ab49e) feat: document thumbnails - [`60fc522`](https://github.com/documenso/documenso/commit/60fc5220d642d57b451ea940e94b03f61b3c3393) feat: load only first page for thumbnail - [`2548094`](https://github.com/documenso/documenso/commit/25480944779bb13c72e76d7382722a9c22bc5f17) Update upload-document.tsx - [`d2f33d3`](https://github.com/documenso/documenso/commit/d2f33d339a44adf52f6ddaee4f535f1d1a049bdf) chore: styles - [`5c6984d`](https://github.com/documenso/documenso/commit/5c6984d86af0b91ed4fb556ce463bd94c20778ec) feat: thumbnail schema - [`af13691`](https://github.com/documenso/documenso/commit/af13691e49d3c9aa3406b2b422a2b735401397c7) feat: update schema - [`43ac976`](https://github.com/documenso/documenso/commit/43ac9765ae4e71ae0666c7501af98a5af5c37180) feat: update fields ### 📊 Changes **9 files changed** (+185 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/src/app/(dashboard)/documents/data-table-title.tsx` (+16 -1) 📝 `apps/web/src/app/(dashboard)/documents/upload-document.tsx` (+76 -1) ➕ `packages/lib/server-only/document-thumbnail/create-document-thumbnail.ts` (+17 -0) 📝 `packages/lib/server-only/document/create-document.ts` (+8 -1) ➕ `packages/prisma/migrations/20231203192538_/migration.sql` (+23 -0) 📝 `packages/prisma/schema.prisma` (+32 -15) 📝 `packages/trpc/server/document-router/router.ts` (+2 -1) 📝 `packages/trpc/server/document-router/schema.ts` (+1 -0) 📝 `packages/ui/primitives/pdf-viewer.tsx` (+10 -3) </details> ### 📄 Description Closes #704 ### Implementation: - Generate a thumbnail on the client side using the rendering of an invisible LazyPDFViewer - Store the base 64 string of the thumbnail in the database - Error handling: reject the thumbnail generation if timeout (500ms) - Keep the aspect ratio of the thumbnail but enforce the max dimension - Implemented the primitive UI to display thumbnails in the table ### Preview: <img width="900" alt="Screenshot 2023-12-03 at 05 07 48" src="https://github.com/documenso/documenso/assets/23418428/ca0289b4-63e2-4afc-b93a-26ead4dfed04"> (For compatibility, previous document without thumbnail will show default icon as last one) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:32:00 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1140
No description provided.