Skip to content

Conversation

@TCOTC
Copy link
Contributor

@TCOTC TCOTC commented Nov 13, 2025

@Vanessa219 Vanessa219 added this to the 3.5.2 milestone Dec 27, 2025
@Vanessa219 Vanessa219 merged commit 8701c2a into siyuan-note:dev Dec 27, 2025
8 checks passed
@TCOTC TCOTC deleted the fix/white branch December 27, 2025 09:40
Copy link

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 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 windowNavigate function
  • 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;
Copy link

Copilot AI Dec 27, 2025

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.

Suggested change
break;
break;
default:
// 未知窗口类型:保持不允许导航,但记录警告以便调试
console.warn(
`Unexpected window type in windowNavigate: "${windowType}" for path "${pathname}"`
);
break;

Copilot uses AI. Check for mistakes.
@88250 88250 changed the title Resolve white screen caused by clicking Graph blocks and PDF links Resolve white screen caused by clicking graph blocks and PDF links Dec 27, 2025
Vanessa219 added a commit that referenced this pull request Dec 27, 2025
@Vanessa219 Vanessa219 self-assigned this Dec 27, 2025
Vanessa219 added a commit that referenced this pull request Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants