In-Memory Batch Page Generation & Modal Interaction

In-Memory Batch Page Generation & Modal Interaction

Following the introduction of the bulk image import system in version 5.1.1, users running Open Publisher inside standalone desktop wrappers (NW.js) occasionally experienced unresponsive buttons inside the import routing dialog, and importing large batches of high-resolution pictures caused noticeable CPU layout thrashing. Version 5.1.2 re-engineers both the modal interaction architecture and the multi-page creation pipeline, constructing pages directly in memory for instant, glitch-free bulk imports.

IMBGW

Bulk image imports build page structures in memory before rendering, providing instant multi-page generation without UI stutter.

Pointer-Events Shields & Webview Optimization

Investigation into the unclickable modal issue revealed that clicks inside desktop webviews were being swallowed by nested elements:

  • Sub-Element Click Trapping: Clicks landing directly on SVG icons or descriptive subheadings failed to bubble up to the parent card's onclick listener in certain webview engines.

  • Pointer-Events Shield: Added .batch-import-card * { pointer-events: none !important; } in style.css, ensuring that clicks anywhere on the card surface hit the parent container cleanly.

  • Multi-Event Listeners: Cards are wired with programmatic click, pointerdown, and keyboard (Enter / Space) listeners, with explicit accessibility roles (role="button" and tabindex="0").

  • Intuitive Iconography: Replaced the ambiguous fa-copy icon with fa-file-circle-plus, clearly signaling the creation of new pages rather than clipboard actions.

In-Memory Batch Page Pipeline

The core multi-page creation loop in extensions/smart-images.js was completely overhauled:

  • Eliminating DOM Layout Thrashing: Previously, the loop invoked addNewPage() for each picture, forcing full-page re-renders, DOM reflows, and expensive base64 serialization on every iteration.

  • Direct Memory Construction: Pages are now constructed directly inside state.pages. Each new page inherits the active document's dimensions, margins, and DPI without touching the live DOM.

  • Single Consolidated Render: Canvas rendering, sidebar thumbnail generation, and undo history recording are performed once at the conclusion of the entire batch.

Desktop Wrapper Zero-Rebuild Architecture

Because the Open Publisher desktop application (publisher.exe) is an NW.js wrapper hosting the web app, all architectural fixes take effect immediately upon deployment without requiring users to download or reinstall desktop binaries.

Note: Batch imports of 20 or more large photos now execute in seconds with zero dropped frames.