Expand description
§WebviewState Module (ApplicationState)
§RESPONSIBILITIES
Manages webview panels state including webview metadata, content, and presentation state.
§ARCHITECTURAL ROLE
WebviewState is part of the FeatureState module, representing webview panels state organized by webview ID.
§KEY COMPONENTS
- WebviewState: Main struct containing active webviews map
- Default: Initialization implementation
- Helper methods: Webview manipulation utilities
§ERROR HANDLING
- Thread-safe access via
Arc<Mutex<...>> - Proper lock error handling with
MapLockErrorhelpers
§LOGGING
State changes are logged at appropriate levels (debug, info, warn, error).
§PERFORMANCE CONSIDERATIONS
- Lock mutexes briefly and release immediately
- Avoid nested locks to prevent deadlocks
- Use Arc for shared ownership across threads
§TODO
- Add webview validation invariants
- Implement webview lifecycle events
- Add webview metrics collection
Structs§
- Webview
State - Active webviews state containing webviews by ID.