Config open assets#17698
Open
mdzz2048 wants to merge 2 commits into
Open
Conversation
Contributor
|
我觉得可以再加上:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds configurable link/asset opening behavior via a new editor.openLink configuration object, and exposes a cancellable open-link plugin event so plugins can override link opening behavior (per #10641 / #17690).
Changes:
- Introduce
Editor.OpenLinkconfig (kernel) with defaults + nil-migration on config load. - Extend frontend config/types to include
editor.openLinkand newopen-linkevent bus type. - Update
openLinkhandling to resolve action from config/modifier keys and notify plugins before opening.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| kernel/model/conf.go | Ensure Conf.Editor.OpenLink is defaulted when missing (migration). |
| kernel/conf/editor.go | Add OpenLink config struct and default openLink values in NewEditor(). |
| app/src/types/index.d.ts | Add open-link to the plugin TEventBus union. |
| app/src/types/config.d.ts | Add TLinkOpenAction + IOpenLink and editor.openLink typing. |
| app/src/editor/openLink.ts | Resolve open action from config/modifiers; emit open-link; route opening logic via switch(action). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+153
to
+156
| case "right-tab": | ||
| const isOpenRight = !window.siyuan.config.fileTree.noSplitScreenWhenOpenTab ? "right" : null | ||
| openAsset(protyle.app, linkAddress, pdfParams, isOpenRight); | ||
| break; |
Comment on lines
+153
to
+156
| case "right-tab": | ||
| const isOpenRight = !window.siyuan.config.fileTree.noSplitScreenWhenOpenTab ? "right" : null | ||
| openAsset(protyle.app, linkAddress, pdfParams, isOpenRight); | ||
| break; |
Comment on lines
+149
to
+152
| switch (action) { | ||
| case "current-tab": | ||
| openAsset(protyle.app, linkAddress, pdfParams); | ||
| break; |
Comment on lines
+293
to
+295
| if nil == Conf.Editor.OpenLink { | ||
| Conf.Editor.OpenLink = defaultEditor.OpenLink | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description / 描述
#10641
editor.openLink)open-link自定义链接打开方式Type of change / 变更类型
缺陷修复
代码重构
新功能
修改文案或增加新语言
Checklist / 检查清单
我对自己的代码进行了自我审查
我拥有所提交代码的完整权利,并同意其以本项目的 AGPL-3.0 许可证授权
devbranch and has no merge conflictsPR 提交到
dev分支,并且没有合并冲突