Automated changelog | Aug 24 - Aug 28 | 18 hours (2 active days)
UI/UX Enhancements:
- Script Display Sidebar for Shot List: A new
ScriptDisplayWidgetwas implemented within the Shot List feature. This widget renders a formatted screenplay, dynamically adjusting its layout based on available width usingcalculateLayoutDimensions. The calculation incorporates responsive padding, clamping the sidebar to a maximum width for consistency. TheScriptDisplayWidgetleveragesListView.builderfor efficient rendering, employing several performance optimizations likecacheExtent,addRepaintBoundaries, and avoidance of unnecessary semantic indexes and keep-alives. Individual scene parts (ScenePart) are rendered with calculated margins based on their type (ScenePartType), enhancing readability. Highlighting is implemented for selected scenes/parts. A global registry (ScriptDisplayRegistry) was introduced to allow external components (specifically, theScriptScrollSyncService) to trigger scrolling to a specific scene within thisScriptDisplayWidgetinstance, allowing seamless scene-level synchronization between the shot list and the script display. Scene numbers are now displayed to the left of scene headings, with scene-specific highlights added for visual feedback during auto-scrolling. Global keys are assigned to each scene heading to facilitate smooth scrolling to specific scenes. - Shot List Screen UI Improvements: The
LinearShotListScreenremoved temporary auto-navigation to the script editor screen. TheLinearShotListTopMenuBarnow includes a button to toggle the script sidebar’s visibility. This button features hotkey support (‘Shift+S’). - Improved Script Sidebar Toggle: The script sidebar functionality was reorganized. Two new components were added:
ScriptDisplayStatefor managing UI state andShotListScriptDisplayControllerfor handling control logic (open, close, toggle). These replace and improve upon previously scattered functionality. The effective width of the sidebar is now dynamically calculated and provided viascriptSidebarEffectiveWidthProvider. - Improved Script Sidebar Responsiveness: The script sidebar now updates its width dynamically in response to window resize events using a
didChangeMetricsoverride in the_ShotListStateclass.
Architecture & Data Model Changes:
- In-Memory Persistence for Script Editor: The
ScriptEditorRepositorynow uses in-memory storage (_documentsand_documentChanges). The repository takes aRefobject in its constructor. This change paves the way for future migration to a persistent storage mechanism like IndexedDB. The previously used persistence mechanisms (ScriptEditorPersistenceServiceandScriptEditorSyncService) are now refactored intoScriptDataServiceandScriptFormatServicefor clarity and improved organization. - ScriptDataService: This new service handles all script persistence and retrieval, loading scripts by ID (
loadScript), saving complete scripts (saveScript), and handling script import/export. The service manages the current script ID (_currentScriptId) to improve managing a single script per project. Methods to load, check, and handle the project script were added. - ScriptFormatService: This new service handles the conversion between
MutableDocument(Super Editor) andScriptEditorDocument(internal representation). - ScriptImportService: This new service handles the workflow of importing a script from an external file, including file selection, format detection and parsing, and conversion to the internal representation.
- Reactive Script Management: The
scriptNotifierProviderwas added which provides reactive state management for script content, integrating with the newScriptDataService,ScriptFormatService, andScriptImportService. It allows for seamless loading, saving, updating, importing, and converting of script data. It offers methods to clear existing scripts (clearScript), and checks for the existence of a script.
Other Changes:
- Script Breakdown Store Removed: The
script_breakdown_store.dartfile was removed. This store is obsolete now and it’s functionality is either removed or delegated to the new services and notifiers. - Updated Import Logic: The
FountainEditorWidgetnow uses theScriptNotifierfor script import instead of directly calling the service layer. This simplifies the import logic and improves maintainability by centralizing the import workflow within theScriptNotifier.