mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-04-18 21:17:30 -04:00
3.5 KiB
3.5 KiB
- Compare tool overlay regressions: check shared CSS before changing page logic; global canvas positioning rules can hide rendered PDF content while leaving highlight layers visible.
- When hardening code after a type-safety follow-up, never leave empty
catch {}blocks in the touched path. Either guard the risky call up front or catch the error into a variable and handle it intentionally with a safe fallback, warning, or typed default. - When adding or refining form creator models, keep reusable types and interfaces in
src/js/typesinstead of defining them inline in logic files or tests. Logic modules should import shared types rather than owning them. - Shared app types must be exported from
src/js/types/index.tsand imported through the@/typesalias. Do not import shared types from individual type files or relativetypes/indexpaths in feature code or tests. - After a user correction about type safety, capture the lesson immediately: never leave
anyin a bug fix if the surrounding library types can be modeled or narrowed. Prefer extracting the logic into a typed helper and adding regression tests for the corrected path. - pdf.js assigns document-scoped font name prefixes (
g_d0_,g_d1_, ...) per loaded document. Always normalize these before comparing font names across documents to avoid false positive style changes. - LibreOffice PDF conversion support can depend on explicit import filters. Before concluding
sofficeor LibreOffice WASM cannot convertpdf -> docx/pptx, test the exact filtered path such as--infilter=writer_pdf_importor--infilter=impress_pdf_importand inspect wrapper code for hardcoded capability gates. - LibreOfficeKit
documentLoadWithOptions()is not the same as CLI--infilter. In the current WASM/LOK build, the options string is forwarded asFilterOptions, not media-descriptorFilterName, so passingFilterName=writer_pdf_importfrom JS does not force PDF to load as Writer or Impress. - When a consolidated patch contains unrelated features (e.g. abort API + PDF filter fix), a compile failure in one breaks the whole build. Never bundle unrelated features in one patch — split by concern. If already bundled, surgically remove the broken feature from the single patch rather than layering a second "undo" patch on top.
- Never add new C++ APIs (enums, functions) to a WASM build patch without confirming the header declarations are visible at compile time in all translation units that use them. The
OperationTypeenum was declared inlok.hxxbut the.cxxfailed because of include ordering or missing header propagation. - When removing hunks from a unified diff patch: (1) update hunk line counts in
@@headers, (2) remove entire file sections if no +/- lines remain, (3) verify the old-side line numbers still match the actual source (removing earlier hunks shifts offsets), (4) verify the-lines match the actual source text character-for-character (e.g.xInteractionvsuno::Reference<task::XInteractionHandler2>(pInteraction)). - ALWAYS check the existing API before rebuilding WASM or forking libraries. The matbee libreoffice-converter already had
inputFiltersupport in ConversionOptions, browser.worker.ts, and buildLoadOptions(). The entire WASM rebuild was unnecessary and replacing browser.worker.global.js with a fork build caused a DeploymentException that broke all LibreOffice conversions. - Never replace compiled vendor assets (browser.worker.global.js, soffice.wasm.gz, etc.) unless absolutely necessary. These are tightly coupled and a mismatched worker JS + WASM binary causes initialization failures.