Conversation
- Optimize column_widths representation with compact format for workspace storage - Enhance exception handling with specific exception types and logging - Fix multi-file loading to open all selected files in tabs - Optimize _close_all_active_editors performance with view caching - Extract _is_debug_enabled() helper method to reduce code duplication - Improve error handling granularity across custom_widgets.py All changes maintain backward compatibility while improving performance, debugging capabilities, and code maintainability.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a comprehensive workspace management system with tabbed editing capabilities for the Diablo II text editor. The implementation adds persistent workspace storage, multi-file management, and enhanced UI layout.
- Adds workspace save/load/delete functionality with JSON persistence
- Introduces tabbed editor interface with file management panel
- Implements extensive editor ownership tracking and debug logging
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| workspaces.json | Initial workspace configuration with sample data |
| workspace_manager.py | Core workspace persistence with thread-safe JSON operations |
| ui.py | Major UI redesign with tabs, workspace panel, and enhanced editor management |
| main_v2.py | Added Qt logging filters and environment configuration |
| custom_widgets.py | Enhanced editor delegation with ownership tracking and debug features |
| config.json | Updated configuration with workspace settings |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| "F:\\ProjectsNew\\Diablo2TextEditor\\CubeMainNotWorking.txt" | ||
| ], | ||
| "active_file": "F:\\ProjectsNew\\Diablo2TextEditor\\CubeMainNotWorking.txt", |
There was a problem hiding this comment.
Hard-coded absolute Windows file paths make the workspace file non-portable across different systems and users. Consider using relative paths or implementing path resolution logic.
| "F:\\ProjectsNew\\Diablo2TextEditor\\CubeMainNotWorking.txt" | |
| ], | |
| "active_file": "F:\\ProjectsNew\\Diablo2TextEditor\\CubeMainNotWorking.txt", | |
| "CubeMainNotWorking.txt" | |
| ], | |
| "active_file": "CubeMainNotWorking.txt", |
| tmp = self.path + ".tmp" | ||
| with open(tmp, "w", encoding="utf-8") as f: | ||
| json.dump(data, f, indent=2) |
There was a problem hiding this comment.
The temporary file creation doesn't use secure temporary file handling. Consider using tempfile.NamedTemporaryFile or ensuring proper permissions on the temporary file to prevent unauthorized access to workspace data.
| tmp = self.path + ".tmp" | |
| with open(tmp, "w", encoding="utf-8") as f: | |
| json.dump(data, f, indent=2) | |
| dir_name = os.path.dirname(os.path.abspath(self.path)) | |
| with tempfile.NamedTemporaryFile("w", encoding="utf-8", dir=dir_name, delete=False) as f: | |
| json.dump(data, f, indent=2) | |
| tmp = f.name |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.