Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/11127

Vanessabd426f9eb4a6
diff --git a/app/src/block/Panel.ts b/app/src/block/Panel.ts
index b3393ea0f0..39b2029abe 100644
--- a/app/src/block/Panel.ts
+++ b/app/src/block/Panel.ts
@@ -15,6 +15,7 @@ import {showMessage} from "../dialog/message";
import {App} from "../index";
import {isMobile} from "../util/functions";
import {resize} from "../protyle/util/resize";
+import {openFileById} from "../editor/util";
export class BlockPanel {
public element: HTMLElement;
@@ -118,6 +119,12 @@ export class BlockPanel {
/// #if !BROWSER
openNewWindowById(this.nodeIds[0]);
/// #endif
+ } else if (type === "stickTab") {
+ openFileById({
+ app: options.app,
+ id: this.nodeIds[0],
+ action: this.editors[0].protyle.block.rootID !== this.nodeIds[0] ? [Constants.CB_GET_ALL] : [Constants.CB_GET_CONTEXT],
+ });
}
event.preventDefault();
event.stopPropagation();
@@ -231,7 +238,9 @@ export class BlockPanel {
let openHTML = "";
/// #if !BROWSER
if (this.nodeIds.length === 1) {
- openHTML = `<span data-type="open" class="block__icon block__icon--show b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.openByNewWindow}"><svg><use xlink:href="#iconOpenWindow"></use></svg></span>
+ openHTML = `<span data-type="stickTab" class="block__icon block__icon--show b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.openInNewTab}"><svg><use xlink:href="#iconLayoutRight"></use></svg></span>
+<span class="fn__space"></span>
+<span data-type="open" class="block__icon block__icon--show b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.openByNewWindow}"><svg><use xlink:href="#iconOpenWindow"></use></svg></span>
<span class="fn__space"></span>`;
}
/// #endif
diff --git a/app/src/protyle/header/openTitleMenu.ts b/app/src/protyle/header/openTitleMenu.ts
index 1dd674bd54..0af807957c 100644
--- a/app/src/protyle/header/openTitleMenu.ts
+++ b/app/src/protyle/header/openTitleMenu.ts
@@ -22,6 +22,7 @@ import {openNewWindowById} from "../../window/openNewWindow";
import {genImportMenu} from "../../menus/navigation";
import {transferBlockRef} from "../../menus/block";
import {addEditorToDatabase} from "../render/av/addToDatabase";
+import {openFileById} from "../../editor/util";
export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
hideTooltip();
@@ -195,6 +196,21 @@ export const openTitleMenu = (protyle: IProtyle, position: IPosition) => {
transferBlockRef(protyle.block.rootID);
}
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
+ /// #if !MOBILE
+ if (!protyle.model) {
+ window.siyuan.menus.menu.append(new MenuItem({
+ label: window.siyuan.languages.openInNewTab,
+ icon: "iconLayoutRight",
+ click() {
+ openFileById({
+ app: protyle.app,
+ id: protyle.block.id,
+ action: protyle.block.rootID !== protyle.block.id ? [Constants.CB_GET_ALL] : [Constants.CB_GET_CONTEXT],
+ });
+ }
+ }).element);
+ }
+ /// #endif
/// #if !BROWSER
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.openByNewWindow,