Skip to content

Feat/workspace v1#4

Merged
Xcesius merged 4 commits intomainfrom
feat/workspace-v1
Aug 24, 2025
Merged

Feat/workspace v1#4
Xcesius merged 4 commits intomainfrom
feat/workspace-v1

Conversation

@Xcesius
Copy link
Copy Markdown
Owner

@Xcesius Xcesius commented Aug 24, 2025

No description provided.

- 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.
Copilot AI review requested due to automatic review settings August 24, 2025 21:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread workspaces.json
Comment on lines +29 to +31
"F:\\ProjectsNew\\Diablo2TextEditor\\CubeMainNotWorking.txt"
],
"active_file": "F:\\ProjectsNew\\Diablo2TextEditor\\CubeMainNotWorking.txt",
Copy link

Copilot AI Aug 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"F:\\ProjectsNew\\Diablo2TextEditor\\CubeMainNotWorking.txt"
],
"active_file": "F:\\ProjectsNew\\Diablo2TextEditor\\CubeMainNotWorking.txt",
"CubeMainNotWorking.txt"
],
"active_file": "CubeMainNotWorking.txt",

Copilot uses AI. Check for mistakes.
Comment thread workspaces.json Outdated
Comment thread workspace_manager.py
Comment on lines +30 to +32
tmp = self.path + ".tmp"
with open(tmp, "w", encoding="utf-8") as f:
json.dump(data, f, indent=2)
Copy link

Copilot AI Aug 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Xcesius Xcesius merged commit f09bc1f into main Aug 24, 2025
1 check passed
@Xcesius Xcesius deleted the feat/workspace-v1 branch September 3, 2025 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants