Tech4biz-channel/memory.md

2.5 KiB

Developer Memory Log

This document records the exact state of the project, completed features, solved bugs, and historical changes to maintain continuity.


1. Core Completed Features

  • Onboarding Skip: Implemented "None (No agreement required)" legal options. When a partner is invited or updated with no NDA/MSA requirement, the backend AuthService automatically bypasses signing steps and sets the user's status to APPROVED.
  • MFA Toggle: Added mfaEnabled options inside the partner invitation modal, partner editing forms, and backend API routes.

B. Client-Side Document Previews

  • Word Document Preview: Integrated docx-preview to parse raw OpenXML array buffers and render them in-browser.
  • Spreadsheet & CSV Preview: Integrated SheetJS (xlsx) to parse spreadsheet buffers and generate clean HTML cell tables.
  • Online Preview Button: Enabled online preview buttons (Eye icon) for CSV files and text/code files by expanding the isRenderable utility in AssetCard.tsx.

C. Responsive Full-Bleed Thumbnails

  • Word & Spreadsheet Card Thumbnails: Replaced static placeholders with dynamic rendered previews of the first page/sheet.
  • Responsive Scaling: Integrated a React ResizeObserver hook inside DocxThumbnail.tsx and SpreadsheetThumbnail.tsx to automatically calculate scaling factor based on card width, making cards fit their containers perfectly instead of sticking to the top-left corner.

D. Clean Admin Deletion

  • S3 Deletion Hook: Updated backend AssetService.deleteAsset to detect files under /uploads/ and dispatch a DeleteObjectCommand to the MinIO container bucket, cleaning up disk space on deletion.

2. Key Resolved Bugs

A. CSV Text Preview Bypass

  • Symptom: CSV files were being treated as plain text files, rendering as comma-separated text blocks in a code viewport.
  • Resolution: Excluded .csv files and mime-types from the isTextOrCodeAsset filter inside AssetViewerModal.tsx. This routed them correctly to the SheetJS spreadsheet parser.

B. Dark Mode Cell Invisible Text

  • Symptom: In dark mode, spreadsheet/CSV cells rendered as blank grids because text inherited the light mode/system white text color.
  • Resolution: Added explicit .excel-thumbnail-container table { color: #0f172a } and .excel-preview-container table { color: #0f172a } CSS rules to override dark mode layout text colors and keep tables fully readable.