Open-Source (MIT) | Built for the Trailblazer & Salesforce Developer Community | 100% Native & Enterprise-Grade
Standard Salesforce "Files" related lists on record pages are notoriously sluggish and inefficient:
- Painful File Inspection: Users must click into each individual attachment, wait for the standard modal to render, close it, and repeat for every single file.
- No Bulk Downloading: Downloading multiple attachments requires opening files one-by-one or setting up heavy third-party archiving services.
- Zero Visual Previews: Standard related lists display generic icons without high-resolution thumbnail cards or responsive galleries.
- AI Blindspot: Autonomous Agentforce AI agents and Flow automations have no simple, native way to inspect attached documents and generate conversational file summaries.
Universal Quick File Viewer & Bulk Downloader replaces this with an enterprise-grade, 100% native Lightning Web Component and Apex suite that provides an instant visual gallery, full-screen lightbox previewer, 1-click bulk ZIP downloader, drag-and-drop uploader, and native Agentforce AI readiness.
Install the official Second-Generation Managed Package (2GP Released v0.1.0) directly into your Salesforce environment:
| Target Org Environment | 1-Click Direct Installation Link |
|---|---|
| Production / Developer Edition | π Install in Production / Dev Org (04tg7000000WDi5AAG) |
| Sandbox Environment | π Install in Sandbox (04tg7000000WDi5AAG) |
sf package install --package 04tg7000000WDi5AAG --wait 20 --target-org <YOUR_ORG_ALIAS>| Capability | Standard Salesforce "Files" Related List | Universal Quick File Viewer |
|---|---|---|
| Preview Experience | Multi-click modal open/close per file |
Instant Lightbox Filmstrip: Sequentially flip through all attachments via keyboard arrow keys (β / β) |
| Thumbnail Gallery | Generic gray document icons | Responsive Card Grid: Clean high-res thumbnails for images, PDFs, Word, Excel, and presentations |
| Bulk Download | Not supported natively; 1-by-1 manual clicks |
1-Click Bulk ZIP: Select multiple files |
| Search & Filtering | None inside the related list card |
Live Search & Category Pills: Instant client-side search and pills (All, Images, PDFs, Docs, Sheets) |
| Direct Drag-Drop | Requires navigating to separate upload dialog | Inline Drag-and-Drop: Drop files anywhere on the component to link them directly to the record |
| Agentforce AI Invocable | No native conversational file inspector | Conversational AI Action: Invocable action returns counts, formatted sizes, file lists, and AI summaries |
| Security & Privacy | Standard |
100% Native & LWS Compliant: No external servers, zero callouts, strict with sharing and user mode CRUD/FLS |
Drop the component onto any record page to view high-resolution image previews, doctype icons, category counts, and live search.
Click any thumbnail to launch a distraction-free, full-screen lightbox. Flip through images and documents with arrow keys or the interactive bottom thumbnail strip.
Select multiple files or click "Select All" to download a single compressed ZIP archive packaged directly by Salesforce with zero lag.
Attach documents without leaving the record page, and empower Agentforce autonomous sales/service agents to inspect attachments conversationally.
Assign the Universal_Quick_File_Viewer_User permission set to users, admins, or integration personas:
sf org assign permset -n Universal_Quick_File_Viewer_User- Navigate to any standard or custom object record page (e.g. Opportunity, Account, Case, WorkOrder, or
Invoice__c). - Click Setup (Gear Icon)
$\rightarrow$ Edit Page. - In the Lightning Components sidebar on the left, locate Universal Quick File Viewer & Bulk Downloader.
- Drag and drop the component into your main column or sidebar tab.
- Configure App Builder properties in the right-hand panel:
-
Component Title: e.g.,
Files & AttachmentsorProject Documents -
Default Layout:
Grid(responsive card layout) orList(compact table view) -
Default Category Filter:
ALL,IMAGES,PDFS,DOCUMENTS,SPREADSHEETS -
Enable 1-Click Bulk ZIP Download:
true(enables multi-select bulk downloading) -
Enable Direct File Uploader:
true(displays upload buttons and drag-drop area)
-
Component Title: e.g.,
- Click Save and Activate.
The package includes a first-class @InvocableMethod (FileViewerInvocable.cls) designed for autonomous Agentforce AI agents and Salesforce Flows.
- Inputs (
FileRequest):recordId(Id, Required) β Target record to inspect for attachments.categoryFilter(String, Optional) β Filter byALL,IMAGES,PDFS,DOCUMENTS,SPREADSHEETS.searchTerm(String, Optional) β Partial title match.maxFiles(Integer, Optional) β Limit results (defaults to 50).
- Outputs (
FileResult):hasFiles(Boolean) β True if one or more matching files exist.fileCount(Integer) β Number of files found.fileNames(List) β List of file titles.fileNamesCsv(String) β Comma-separated list of file titles.totalSizeBytes(Long) β Total aggregate size in bytes.totalSizeFormatted(String) β Human-readable size (e.g.4.6 MB).bulkDownloadUrl(String) β 1-Click URL to download all matching files in a single ZIP archive.summary(String) β Conversational natural language summary (e.g. "Found 4 file(s) (4.6 MB total): System_Architecture.png, Contract.pdf, and 2 more.").
FileViewerInvocable.FileRequest req = new FileViewerInvocable.FileRequest();
req.recordId = opportunityId;
req.categoryFilter = 'ALL';
req.maxFiles = 25;
List<FileViewerInvocable.FileResult> results = FileViewerInvocable.getFiles(
new List<FileViewerInvocable.FileRequest>{ req }
);
System.debug('Agentforce AI File Summary: ' + results[0].summary);
System.debug('1-Click Bulk Download URL: ' + results[0].bulkDownloadUrl);force-app/main/default/
βββ classes/
β βββ FileViewerService.cls # Enterprise Service Layer: ContentDocument querying, formatting, security
β βββ FileViewerController.cls # AuraEnabled Controller for LWC wire adapters & imperative actions
β βββ FileViewerInvocable.cls # Invocable Action for Agentforce AI & Salesforce Flows
β βββ FileViewerServiceTest.cls # Service layer unit tests (96% coverage)
β βββ FileViewerControllerTest.cls # Controller unit tests (80% coverage)
β βββ FileViewerInvocableTest.cls # Invocable action unit tests (100% coverage)
βββ lwc/
β βββ universalQuickFileViewer/ # Main responsive gallery, lightbox, and bulk download component
β βββ universalQuickFileViewer.html
β βββ universalQuickFileViewer.js
β βββ universalQuickFileViewer.css
β βββ universalQuickFileViewer.js-meta.xml
β βββ __tests__/
β βββ universalQuickFileViewer.test.js
βββ permissionsets/
βββ Universal_Quick_File_Viewer_User.permissionset-meta.xml
sf apex run test --class-names FileViewerServiceTest FileViewerControllerTest FileViewerInvocableTest --code-coverage --result-format human --target-org dev-orgResults:
FileViewerInvocable: 100% code coverageFileViewerService: 96% code coverageFileViewerController: 80% code coverage- Overall Apex Code Coverage: 92.00%
- Test Pass Rate: 100% (24 of 24 tests pass across positive, negative, edge cases, and bulk scenarios)
npm run test:unitResults: 7 passed, 7 total (100% pass rate).
npm run lint
npm run prettier:check- ESLint: 0 errors, 0 warnings.
- Prettier: 100% compliant.
-
Pull Request Verification (CI -
.github/workflows/ci.yml):- Runs ESLint, Prettier, and LWC Jest unit tests on every pull request.
- Headlessly validates metadata and runs Apex tests (
sf project deploy validate --test-level RunLocalTests). - Guards the
mainbranch with strict status check enforcement.
-
Continuous Deployment (CD -
.github/workflows/cd.yml):- Triggers automatically upon merge to
main. - Deploys source metadata and runs full regression tests (
sf project deploy start --test-level RunLocalTests). - Publishes deployment summaries directly to GitHub Actions.
- Triggers automatically upon merge to
- Responsive thumbnail grid layout for images, PDFs, spreadsheets, and documents.
- Full-screen lightbox with sequential keyboard navigation (
β/βarrow keys). - 1-Click native bulk ZIP download endpoint integration.
- Direct drag-and-drop file uploader linked to active record.
- First-class Agentforce AI invocable action integration.
- Released 2GP Package (
v0.1.0) with 92% test coverage. - Multi-page PDF inline page flipper within thumbnail cards.
- Custom tag taxonomy filter chips for enterprise categorization.
Distributed under the MIT License. Contributions, bug reports, and feature suggestions are welcome via GitHub Issues and Pull Requests.




