feat: Consolidate documentation into a single comprehensive guide
- Created `CONSOLIDATED_DOCS.md` to serve as the primary documentation source, integrating user and developer guides, API references, and troubleshooting sections. - Updated `README.md` to reference the new consolidated documentation. - Preserved existing documentation files for backward compatibility, including `USER_GUIDE.md`, `DEVELOPER_GUIDE.md`, and others. - Enhanced navigation structure in `docs/README.md` to facilitate easier access to documentation. - Implemented UI flickering fixes, including auto-save optimizations, debounced filter updates, and efficient tree updates to improve user experience. - Added verification script `verify_docs_consolidation.py` to ensure successful documentation consolidation and integrity.
This commit is contained in:
+40
-2
@@ -288,9 +288,16 @@ class UIManager:
|
||||
table_frame, columns=columns, show="headings", style="Modern.Treeview"
|
||||
)
|
||||
|
||||
# Configure treeview selection behavior
|
||||
# Configure treeview for optimal scrolling performance
|
||||
tree.configure(selectmode="browse") # Single selection mode
|
||||
|
||||
# Disable some visual effects that can cause flickering during scroll
|
||||
import contextlib
|
||||
|
||||
with contextlib.suppress(tk.TclError):
|
||||
# These settings help reduce redraws during scrolling
|
||||
tree.configure(displaycolumns=columns)
|
||||
|
||||
# Configure row tags for alternating colors
|
||||
theme_colors = self.theme_manager.get_theme_colors()
|
||||
tree.tag_configure("evenrow", background=theme_colors["bg"])
|
||||
@@ -321,11 +328,14 @@ class UIManager:
|
||||
|
||||
tree.pack(side="left", fill="both", expand=True)
|
||||
|
||||
# Add scrollbar
|
||||
# Add scrollbar with optimized scroll handling
|
||||
scrollbar = ttk.Scrollbar(table_frame, orient="vertical", command=tree.yview)
|
||||
tree.configure(yscrollcommand=scrollbar.set)
|
||||
scrollbar.pack(side="right", fill="y")
|
||||
|
||||
# Optimize tree scrolling performance
|
||||
self._optimize_tree_scrolling(tree)
|
||||
|
||||
return {"frame": table_frame, "tree": tree}
|
||||
|
||||
def create_graph_frame(self, parent_frame: ttk.Frame) -> ttk.LabelFrame:
|
||||
@@ -1529,3 +1539,31 @@ class UIManager:
|
||||
except tk.TclError:
|
||||
# Handle potential errors when accessing children
|
||||
pass
|
||||
|
||||
def _optimize_tree_scrolling(self, tree: ttk.Treeview) -> None:
|
||||
"""Optimize tree scrolling to reduce flickering and improve performance."""
|
||||
# Store scroll state to prevent unnecessary updates
|
||||
last_scroll_position = [0.0, 1.0]
|
||||
|
||||
def optimized_yscrollcommand(first, last):
|
||||
"""Optimized scroll command to reduce update frequency."""
|
||||
nonlocal last_scroll_position
|
||||
|
||||
# Only update if position significantly changed
|
||||
first_f, last_f = float(first), float(last)
|
||||
if (
|
||||
abs(first_f - last_scroll_position[0]) > 0.001
|
||||
or abs(last_f - last_scroll_position[1]) > 0.001
|
||||
):
|
||||
last_scroll_position = [first_f, last_f]
|
||||
# Update scrollbar position
|
||||
scrollbar = None
|
||||
for child in tree.master.winfo_children():
|
||||
if isinstance(child, ttk.Scrollbar):
|
||||
scrollbar = child
|
||||
break
|
||||
if scrollbar:
|
||||
scrollbar.set(first, last)
|
||||
|
||||
# Apply the optimized scroll command
|
||||
tree.configure(yscrollcommand=optimized_yscrollcommand)
|
||||
|
||||
Reference in New Issue
Block a user