Run ruff format changes and finalize indentation and lint fixes.
This commit is contained in:
@@ -15,7 +15,7 @@ The UI elements were flickering when the user scrolled through the table, causin
|
||||
|
||||
## Solutions Implemented
|
||||
|
||||
### 1. Auto-save Optimization (`src/main.py`)
|
||||
### 1. Auto-save Optimization (`thechart` main application)
|
||||
```python
|
||||
def _auto_save_callback(self) -> None:
|
||||
"""Callback function for auto-save operations."""
|
||||
@@ -28,7 +28,7 @@ def _auto_save_callback(self) -> None:
|
||||
```
|
||||
**Impact**: Eliminates UI interruptions during auto-save operations.
|
||||
|
||||
### 2. Debounced Filter Updates (`src/search_filter_ui.py`)
|
||||
### 2. Debounced Filter Updates (`thechart.ui.search_filter_ui`)
|
||||
- Added 300ms debouncing mechanism to prevent excessive filter updates
|
||||
- Consolidated filter updates into a single batch operation
|
||||
- Replaced immediate callbacks with debounced updates
|
||||
@@ -47,7 +47,7 @@ def _debounced_update(self) -> None:
|
||||
```
|
||||
**Impact**: Reduces filter update frequency from every keystroke to maximum once per 300ms.
|
||||
|
||||
### 3. Efficient Tree Updates (`src/main.py`)
|
||||
### 3. Efficient Tree Updates (application update path)
|
||||
- Separated tree update logic into `_update_tree_efficiently()` method
|
||||
- Added scroll position preservation
|
||||
- Eliminated redundant data loading
|
||||
@@ -71,7 +71,7 @@ def _update_tree_efficiently(self, df: pd.DataFrame) -> None:
|
||||
```
|
||||
**Impact**: Maintains scroll position and reduces visual disruption during updates.
|
||||
|
||||
### 4. Optimized Data Loading (`src/main.py`)
|
||||
### 4. Optimized Data Loading (application update path)
|
||||
- Eliminated redundant `load_data()` calls
|
||||
- Used single data copy for both filtered and unfiltered operations
|
||||
- Improved memory efficiency
|
||||
@@ -88,7 +88,7 @@ def refresh_data_display(self, apply_filters: bool = False) -> None:
|
||||
```
|
||||
**Impact**: Reduces I/O operations and memory usage.
|
||||
|
||||
### 5. Scroll Optimization (`src/ui_manager.py`)
|
||||
### 5. Scroll Optimization (`thechart.ui.ui_manager`)
|
||||
- Added optimized scroll command with threshold-based updates
|
||||
- Reduced scrollbar update frequency for better performance
|
||||
|
||||
@@ -117,9 +117,9 @@ The application now runs without the previous UI flickering issues:
|
||||
|
||||
## Files Modified
|
||||
|
||||
1. `src/main.py` - Auto-save optimization and efficient tree updates
|
||||
2. `src/search_filter_ui.py` - Debounced filter updates
|
||||
3. `src/ui_manager.py` - Optimized scroll handling
|
||||
1. Main application - Auto-save optimization and efficient tree updates
|
||||
2. `thechart.ui.search_filter_ui` - Debounced filter updates
|
||||
3. `thechart.ui.ui_manager` - Optimized scroll handling
|
||||
|
||||
## Verification
|
||||
|
||||
|
||||
Reference in New Issue
Block a user