-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Resolve white screen caused by clicking graph blocks and PDF links #16339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 fixes white screen issues that occur when clicking hyperlinks in graph blocks and PDF links within the Electron app. The solution enhances navigation control by restricting window navigation to only allowed paths based on window type, preventing unintended navigation that causes white screens.
Key changes:
- Added window type-based navigation restrictions to the
windowNavigatefunction - External links are now prevented from navigating within the app and are instead opened in the system browser
- Each window type (main app, new window, export window) is restricted to its specific allowed paths
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| case "export": | ||
| // 导出预览窗口:允许导出临时文件路径 | ||
| isAllowed = pathname.startsWith("/export/temp/"); | ||
| break; |
Copilot
AI
Dec 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The switch statement lacks a default case to handle unexpected windowType values. If an unknown windowType is passed, isAllowed will remain false and navigation will be blocked, which may cause unexpected behavior. Consider adding a default case that either logs a warning or sets a reasonable default behavior.
| break; | |
| break; | |
| default: | |
| // 未知窗口类型:保持不允许导航,但记录警告以便调试 | |
| console.warn( | |
| `Unexpected window type in windowNavigate: "${windowType}" for path "${pathname}"` | |
| ); | |
| break; |
fix #9991 #14701
fix https://ld246.com/article/1763457508822