feat(preview): inline .xlsx/.xls/.ods rendering via SheetJS (#297) #318
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/xlsx-preview"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Second slice of #297. Renders spreadsheets inline as HTML tables instead of the download card.
Approach
vendor-xlsx.full.min.js(SheetJS CE, Apache-2.0, ~930 KB) sits flat inweb/static/, bundled into the embeddedwebdistand served from Cairn's own origin (behind auth). Lazy-loaded on first spreadsheet preview via the same_loadScripthelper added for docx.XLSX.read(bytes)→XLSX.utils.sheet_to_htmlinto a scrollable, scoped-styled container. Multi-sheet workbooks get a<select>sheet picker; single-sheet ones render directly. 25 MB guard;pvPathstaleness guard after each await; failure falls back to thepvNoPreviewcard.xlsx/xls/ods(all read by SheetJS).csv/tsvkeep their existing text-preview behaviour (unchanged). pptx is the last slice.Verification
node --checkon all page script blocks (passed in the build workflow). Real spreadsheet rendering is the operator's visual check on the dogfood after deploy.