Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/16134

Vanessa5fcb2d3539ac
diff --git a/app/src/boot/globalEvent/keydown.ts b/app/src/boot/globalEvent/keydown.ts
index 2508b3059f..437590f146 100644
--- a/app/src/boot/globalEvent/keydown.ts
+++ b/app/src/boot/globalEvent/keydown.ts
@@ -636,10 +636,6 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
action: "addFlashcards",
deckID: Constants.QUICK_DECK_ID,
blockIDs: ids,
- }], [{
- action: "removeFlashcards",
- deckID: Constants.QUICK_DECK_ID,
- blockIDs: ids,
}]);
}
event.preventDefault();
diff --git a/app/src/card/makeCard.ts b/app/src/card/makeCard.ts
index fe098dae57..c855b7b4fd 100644
--- a/app/src/card/makeCard.ts
+++ b/app/src/card/makeCard.ts
@@ -183,11 +183,24 @@ export const quickMakeCard = (protyle: IProtyle, nodeElement: Element[]) => {
return;
}
item.classList.remove("protyle-wysiwyg--select");
- ids.push(item.getAttribute("data-node-id"));
if ((item.getAttribute(Constants.CUSTOM_RIFF_DECKS) || "").indexOf(Constants.QUICK_DECK_ID) === -1) {
isRemove = false;
}
});
+ nodeElement.forEach(item => {
+ if (item.getAttribute("data-type") === "NodeThematicBreak") {
+ return;
+ }
+ if (isRemove) {
+ if ((item.getAttribute(Constants.CUSTOM_RIFF_DECKS) || "").indexOf(Constants.QUICK_DECK_ID) > -1) {
+ ids.push(item.getAttribute("data-node-id"));
+ }
+ } else {
+ if ((item.getAttribute(Constants.CUSTOM_RIFF_DECKS) || "").indexOf(Constants.QUICK_DECK_ID) === -1) {
+ ids.push(item.getAttribute("data-node-id"));
+ }
+ }
+ });
if (isRemove) {
transaction(protyle, [{
action: "removeFlashcards",
diff --git a/app/src/menus/navigation.ts b/app/src/menus/navigation.ts
index 24604ee332..e336f66532 100644
--- a/app/src/menus/navigation.ts
+++ b/app/src/menus/navigation.ts
@@ -111,10 +111,6 @@ const initMultiMenu = (selectItemElements: NodeListOf<Element>, app: App) => {
action: "addFlashcards",
deckID: Constants.QUICK_DECK_ID,
blockIDs,
- }], [{
- action: "removeFlashcards",
- deckID: Constants.QUICK_DECK_ID,
- blockIDs,
}]);
}
}, {
@@ -126,10 +122,6 @@ const initMultiMenu = (selectItemElements: NodeListOf<Element>, app: App) => {
action: "removeFlashcards",
deckID: Constants.QUICK_DECK_ID,
blockIDs,
- }], [{
- action: "addFlashcards",
- deckID: Constants.QUICK_DECK_ID,
- blockIDs,
}]);
}
}];
@@ -602,10 +594,6 @@ export const initFileMenu = (app: App, notebookId: string, pathString: string, l
action: "addFlashcards",
deckID: Constants.QUICK_DECK_ID,
blockIDs: [id]
- }], [{
- action: "removeFlashcards",
- deckID: Constants.QUICK_DECK_ID,
- blockIDs: [id]
}]);
}
}, {
@@ -617,10 +605,6 @@ export const initFileMenu = (app: App, notebookId: string, pathString: string, l
action: "removeFlashcards",
deckID: Constants.QUICK_DECK_ID,
blockIDs: [id]
- }], [{
- action: "addFlashcards",
- deckID: Constants.QUICK_DECK_ID,
- blockIDs: [id]
}]);
}
}];