Repository navigation
PromptLab v2.7.0 introduces a breakthrough visual output pipeline, dedicated split-screen drafting capabilities, and a comprehensive memory-safe backup overhaul. This release debuts the Auteur Script Visualizer (AuteurScriptView), rendering structured procedural prompt outputs into dynamic macro-states, collapsible staging blocks, and compact execution cards with zero-overhead format auto-detection. Alongside it, the new Output Renderer (OutputRendererModal) delivers an edge-to-edge split-screen workspace with live multi-mode preview, persistent local drafting, and full-height Lossless PNG Export at 2x retina sharpness (html-to-image). Under the hood, a unified v1.1 Content-Addressable Image Pool and Chunked Streaming Blob Serialization across Project Workspaces, Asset Library, and User Presets completely eliminates V8 single-string heap crashes (RangeError), coupled with rich pre-import visual inspection dashboards, duplicate-detection intelligence, scope controls, and defensive package validation.
✨ Highlights
🎬 Auteur Script Visual Rendering Pipeline & Quad-Surface Integration
PromptLab now provides first-class visual rendering for prompt templates producing procedural scripts divided into staging protocols and execution state-machines:
- 🎭 Dedicated Retro Lab Visualizer (
AuteurScriptView.tsx) — transforms raw procedural text into structured, high-density retro lab components featuring collapsible staging directives and compact execution timeline cards. - 🧩 Schema-Tolerant Dynamic Parser (
lib/auteur-parser.ts) — employs an open-ended dynamic regex pattern\[([A-Z0-9 _%-]+)\]to parse arbitrary macro-blocks ([INTENT],[LOGIC],[CONTINUITY PROTOCOL],[REFERENCES],[EXECUTION]) without rigid whitelists. Dynamically extracts sub-states (STEP 1,STATE 1,1., etc.) into structured action, speech, and metadata channels. - ⚡ Zero-Overhead Smart Auto-Detection (
isAuteurScript) — lightweight regex detector immediately identifies Auteur Script formatted outputs without parsing latency, dynamically surfacing theAUTEURview toggle in output toolbars. - 📂 Persistent Collapsible Staging (
localStorage) — auxiliary staging blocks ([INTENT],[LOGIC], etc.) remain visible and uncollapsed by default for immediate auditing, with interactive collapse toggles persisted across sessions underprompt_generator_auteur_collapsed_staging. The primary[EXECUTION]payload is permanently locked open. - 🎚️ Calibrated Typography Scale — specifically calibrated font sizing prevents reading fatigue:
text-[12.5px]–13px(font-mono) withleading-relaxedfor dialogue and visual actions,text-[11px]–11.5pxfor sub-state pills, andtext-[9px]–10pxfor technical instrumentation metadata. - 🔲 Quad-Surface Parity — fully integrated across all four generation, history, and editing surfaces:
- Main Generation Result panel (
GenerationResultView.tsx) - History Detail Viewer (
HistoryOutputViewer.tsx) - Distraction-Free Fullscreen Focus Modal (
HistoryFullscreenOutputModal.tsx) - Output Renderer Split Workspace (
OutputRendererModal.tsx)
- Main Generation Result panel (
🖥️ Output Renderer Split-Screen Workspace & Lossless PNG Export
A dedicated split-screen creative workspace for formatting, drafting, and previewing generation outputs or arbitrary prompt text:
- 🌐 Top Header Navigation Trigger (
AppHeader.tsx) — retro cyan navigation button (Renderer,#output-renderer-header-btn) withEyeicon provides instant access to the renderer from anywhere in the workspace. - 🪟 Distraction-Free Split Workspace (
OutputRendererModal.tsx) — full-bleed split dialog (Tier 2z-50) registered with the universal LIFO Escape key stack (useModalEscape) and compound modal safety gates (isAnyModalActive). - ✍️ Edge-to-Edge Source Editor — full-height monospace text editor equipped with live line and character counters, alongside one-click "Workspace" (import active generation result) and "Clear" actions.
- 💾 Persistent Draft Text (
localStorage) — preserves editor text across modal open/close cycles and page refreshes (prompt_generator_output_renderer_draft), adhering to a strict non-destructive invariant that never overwrites user text automatically. - 📸 Full-Height Lossless Retina PNG Export (
lib/image-export.ts) — integrated export button (Cameraicon) in the preview toolbar measures the unconstrainedscrollHeightof rendered output usinghtml-to-imageat 2x retina pixel ratio (pixelRatio: 2). Captures extensive long-form outputs and complete Auteur Script timelines in a single seamless, uncropped image with standardized filenames:screenshot_promptlab_{projectSlug}_{viewMode}_{YYYY-MM-DD}_{HHMMSS}_{uniqueId}.png.
🔀 Unified Multi-Mode Output Pipeline & Codebase Deduplication
Generation output rendering across the entire application has been unified into a single, high-craft architecture:
- 🎛️ Universal Multi-Mode Output View (
MultiModeOutputView.tsx) — reusable 4-mode viewer component implementing segmented controls:- MD — Formatted Markdown with custom-styled typography, tables, and code fences
- RAW — Monospace plain text preserving whitespace and lineation
- JSON — Syntax-highlighted JSON with line numbers, token color coding, and line counters
- AUTEUR — Procedural script visualization with collapsible staging blocks
- 🧹 Shared Output Helpers (
lib/output-render-helpers.tsx) — centralized JSON extraction (extractCleanJson), JSON line syntax highlighting (highlightJsonLine), and brutalist Markdown typography mappings (outputMarkdownComponents). - 🚀 Eliminated 450+ Lines of Duplication — refactored
GenerationResultView.tsx,HistoryOutputViewer.tsx, andHistoryFullscreenOutputModal.tsxonto the unified rendering engine.
📦 Project Workspace Backups: v1.1 Image Pool, Scope Controls & Pre-Import Inspection
Multi-project workspace backup and migration has been overhauled for crash-proof scalability, data integrity, and complete inspection visibility:
- 🛡️ Critical History Image Preservation Fix — resolved an issue where project backups previously omitted reference images attached to generation history records. Both
assetLibraryandproject.historyimages are now aggregated into a single unified export pool. - 🗜️ v1.1 Deduplicated Image Pool — stores unique image Base64 payloads once in a top-level
images: Record<string, string>dictionary keyed by SHA-256contentHash(or fallback ID), stripping inline payloads from individual history items (img.base64 = ""). - 🌊 Chunked Streaming Blob Serialization — streams discrete string parts directly into
new Blob(chunks, { type: "application/json" }), bypassing the V8 single-string memory ceiling (~512MB) and eliminatingRangeError: Invalid string lengthcrashes on large projects. - 🎛️ Configurable Export Scope Modal (
ProjectExportModal.tsx) — Tier 3 (z-[60]) dialog providing 3 quick-scope presets:- Full Backup — complete archive with prompts, presets, assets, and full history with images
- Compact History — all prompts, presets, assets, and history text/metrics with history images stripped for lightweight sharing
- Starter Template — prompts, presets, and assets only; zero history records
- 🔍 Pre-Import Inspection Dashboard (
ProjectImportConfirmModal.tsx) — Tier 3 (z-[60]) inspection dialog featuring a real-time summary breakdown ribbon (PRESETS,HISTORY,ASSETS,IMAGES), project name collision resolution with auto-incrementing suffixes, prompt inspection tabs, and an auto-switch toggle. - ⚡ Event-Loop Yielding Hydration — pre-hydrates IndexedDB
imagesstore in batches of 10 withsetTimeout(0), ensuring a fluid 60 FPS browser UI throughout large workspace imports.
🖼️ Asset Library Import/Export Overhaul: v1.1 Pool & Visual Inspection
Backing up and restoring image assets is now faster, memory-safe, and visually auditable:
- 🗜️ v1.1 Content-Addressable Image Pool — eliminates multi-megabyte Base64 payload duplication by consolidating shared images under SHA-256
contentHashkeys with 100% backward compatibility for legacy v1.0 imports. - 🌊 Chunked Streaming Blob Construction — replaces monolithic string concatenation with streaming array chunks, making library exports immune to V8 string heap limits.
- 🔍 Pre-Import Visual Inspection Modal (
AssetImportModal.tsx) — Tier 3 (z-[60]) inspection dashboard featuring a real-time breakdown ribbon (TOTAL IN FILE,+NEW UNIQUE,ALREADY EXISTS), scrollable thumbnail preview grid withNEW(emerald) andEXISTS(amber) status tags, and merge strategy controls. - 🎯 Dual-Criteria Duplicate Detection — checks incoming assets against both SHA-256
contentHashandid, backed by an asynchronous background hash resolver for existing session assets. - ⭐ Export Favorites / Pinned — added dedicated favorite/pinned export action in
AssetExportDropdown.tsxwith live count badges and capture-phase Escape isolation.
🛡️ User Presets Import/Export System Hardening & Defensive Validation
Preset management is now fully fortified against accidental file misplacements and format collisions:
- 🛡️ Defensive Type Validation —
lib/preset-export.tsstrictly validates package types, immediately rejecting accidental uploads of History exports (promptlab_history_export), Asset Library backups (promptlab_asset_library), or Project backups (promptlab_project) with descriptive guidance pointing users to the correct dialog. - 🔎 Heuristic History Collision Prevention — examines untyped containers with
items: [...]for signature history fields (generationResult,outputs,specs), preventing generation records from polluting user preset libraries. - 📐 Standardized Inspection Contract (
readAndValidatePresetsJSON) — provides asynchronous validation returning{ success, data, rawItems, error }, establishing full architectural parity with Project and Asset Library import contracts. - 🔄 100% Backward-Compatible Multi-Format Parser — seamlessly parses versioned packages (
presets), legacy containers (items), rawUserPreset[]arrays, single preset wrappers, and raw preset objects.
📐 Modal Overlay Architecture & Tier Alignment
Overlay behavior across the application has been aligned with the 5-Tier Z-Index Stacking Context Scale:
- 🏢 Tier 3 Elevation (
z-[60]) —PresetImportConfirmModal,PresetReplaceConfirmModal,ProjectImportConfirmModal,ProjectExportModal, andAssetImportModalare normalized to Tier 3, guaranteeing clean stacking above primary Tier 2 (z-50) modals. - 🔒 Capture-Phase Escape Key Isolation (Tier 4
z-[70]) —PresetExportDropdownandAssetExportDropdownattach document capture-phase Escape listeners (e.stopImmediatePropagation()), ensuring dropdown dismissals never close underlying parent dialogs. - 📚 Universal LIFO Escape Stack Integration — all sub-dialogs register directly with
useModalEscape, guaranteeing predictable, single-level dismissals on Escape.
✨ What's New
- 🎬 Auteur Script Visualizer (
components/AuteurScriptView.tsx) — specialized high-density retro lab renderer for procedural prompt outputs. - 🧩 Auteur Parser Engine (
lib/auteur-parser.ts) — open-ended dynamic regex macro-block parser withisAuteurScriptauto-detection. - 🖥️ Output Renderer Split Workspace (
components/OutputRendererModal.tsx) — split-screen editor and live multi-mode preview with persistent drafts. - 📸 Retina PNG Screenshot Exporter (
lib/image-export.ts) — uncompressed 2x retina DOM-to-PNG export measuring full unconstrainedscrollHeight. - 🔀 Universal Multi-Mode Output View (
components/MultiModeOutputView.tsx) — consolidated 4-mode viewer (MD, Raw, JSON, Auteur). - 🧹 Output Rendering Helpers (
lib/output-render-helpers.tsx) — centralized JSON parser, syntax highlighter, and Markdown styling mappings. - 📦 Project Scope Export Modal (
components/ProjectExportModal.tsx) — export dialog with Full, Compact History, and Starter Template scopes. - 🔍 Project Import Inspection Modal (
components/ProjectImportConfirmModal.tsx) — inspection modal with breakdown ribbon, collision resolution, and prompt preview. - 🖼️ Asset Import Inspection Modal (
components/AssetImportModal.tsx) — visual pre-import inspection dashboard with thumbnail grid and status tags. - ⭐ Export Favorites for Assets (
components/AssetExportDropdown.tsx) — one-click export for pinned/favorited asset images. - 🛡️ Defensive Preset Validator (
lib/preset-export.ts) — foreign package rejection and heuristic collision prevention. - 🏷️ Dynamic Version Badge — footer status bar displays dynamic version (
PromptLab v2.7.0 by Taruma Sakti) sourced directly frompackage.json.
🔄 Changed
- Quad-Surface Multi-Mode Output Rendering:
GenerationResultView,HistoryOutputViewer,HistoryFullscreenOutputModal, andOutputRendererModalall share the unifiedMultiModeOutputViewrendering engine. - Project Export Image Aggregation:
exportProjectJSONaggregates bothassetLibraryandhistoryreference images into the v1.1 deduplicated image pool, eliminating data loss during project backup and restore. - Streaming Blob Serialization: Asset Library, Project Workspaces, and History exports now use chunked array streaming into
new Blob(chunks)to bypass V8 single-string heap limits. - Modal Z-Index Alignment:
PresetImportConfirmModalandPresetReplaceConfirmModalrealigned from genericz-50to Tier 3z-[60]. - Dropdown Escape Key Isolation:
PresetExportDropdownandAssetExportDropdownelevated to Tier 4z-[70]with capture-phase Escape dismissal.
🐛 Fixed
- Project Backup History Image Loss: Resolved bug where project exports omitted reference images stored on generation history records.
- V8 Single-String Heap Crashes (
RangeError): Replaced monolithic JSON serialization with streaming chunked Blobs across Project and Asset exports. - Preset Import Collision from History Files: Added heuristic inspection on untyped
items: [...]containers to prevent generation history items from polluting preset libraries. - Foreign Package Import Guidance: Accidental cross-uploads of History, Asset Library, Project, or Preset files now display helpful error messages directing users to the correct workspace dialog.
- Dropdown Escape Propagation: Fixed issue where pressing Escape while closing an Export JSON dropdown inadvertently closed the parent modal.
📁 Files Affected
package.json&package-lock.json— version bump to2.7.0CHANGELOG.md— finalized[v2.7.0]release entrycomponents/AuteurScriptView.tsx— new Auteur Script procedural visualizer componentlib/auteur-parser.ts— new schema-tolerant macro/sub-state parser withisAuteurScriptdetectorcomponents/OutputRendererModal.tsx— new split-screen editor and live multi-mode preview modalcomponents/MultiModeOutputView.tsx— new universal 4-mode output viewer componentlib/output-render-helpers.tsx— new shared output rendering and syntax highlighting helperslib/image-export.ts— new full-height DOM-to-PNG export utilitycomponents/AppHeader.tsx— added top navigation trigger button (Renderer)components/GenerationResultView.tsx— refactored to use sharedMultiModeOutputViewcomponents/history/HistoryOutputViewer.tsx— refactored to use sharedMultiModeOutputViewcomponents/history/HistoryFullscreenOutputModal.tsx— refactored to use sharedMultiModeOutputViewcomponents/ProjectExportModal.tsx— new project export scope selection modalcomponents/ProjectImportConfirmModal.tsx— new project import inspection modalcomponents/ProjectManagerModal.tsx— integrated new export and import modal workflowslib/projects.ts— unified image pool aggregation, v1.1 deduplication, chunked streaming, and defensive validationcomponents/AssetImportModal.tsx— overhauled pre-import visual inspection dashboardcomponents/AssetExportDropdown.tsx— added favorite export scope and capture-phase Escape isolationcomponents/AssetLibrarySidebar.tsx— integrated updated export/import modals and lifecycle hashinglib/asset-library-export.ts— v1.1 image pooling, chunked streaming, and dual-criteria duplicate detectionlib/preset-export.ts— defensive type validation, heuristic collision prevention, andreadAndValidatePresetsJSONcomponents/PresetImportConfirmModal.tsx— realigned to Tier 3z-[60]and wired touseModalEscapecomponents/PresetReplaceConfirmModal.tsx— realigned to Tier 3z-[60]and wired touseModalEscapecomponents/PresetExportDropdown.tsx— elevated to Tier 4z-[70]with capture-phase Escape listenerhooks/use-url-preset-import.ts— integrated defensive validation and error handlingapp/page.tsx— registeredOutputRendererModal, updated preset error handling, and wired safety gatesAGENTS.md— codified Rule V, Rule W, and updated file registriesREADME.md— updated feature specifications for Output Renderer, Auteur Script, and v1.1 backups.agents/rules/modal-overlay-architecture.md— verified stacking context tiers and event hierarchy