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/9377

Vanessa06c54f43ef45
diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts
index 0d56bb9869..2d1bce0be6 100644
--- a/app/src/card/openCard.ts
+++ b/app/src/card/openCard.ts
@@ -182,6 +182,11 @@ export const bindCardEvent = (options: {
const countElement = options.element.querySelector('[data-type="count"] span');
countElement.innerHTML = (index + 1).toString();
const actionElements = options.element.querySelectorAll(".card__action");
+ if (options.index === 0) {
+ actionElements[0].firstElementChild.setAttribute("disabled", "disabled");
+ } else {
+ actionElements[0].firstElementChild.removeAttribute("disabled");
+ }
const filterElement = options.element.querySelector('[data-type="filter"]');
const fetchNewRound = () => {
const currentCardType = filterElement.getAttribute("data-cardtype");
@@ -248,7 +253,7 @@ export const bindCardEvent = (options: {
icon: "iconRiffCard",
title: window.siyuan.languages.spaceRepetition,
data: {
- blocks: options.cardsData.cards,
+ cardsData: options.cardsData,
index,
cardType: filterElement.getAttribute("data-cardtype") as TCardType,
id: filterElement.getAttribute("data-id"),
@@ -351,7 +356,7 @@ export const bindCardEvent = (options: {
}
event.preventDefault();
event.stopPropagation();
- hideElements(["toolbar", "hint", "util"], editor.protyle);
+ hideElements(["toolbar", "hint", "util", "gutter"], editor.protyle);
if (type === "-1") { // 显示答案
if (actionElements[0].classList.contains("fn__none")) {
type = "3";
diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts
index 7c07d275f9..35355a67d6 100644
--- a/app/src/layout/util.ts
+++ b/app/src/layout/util.ts
@@ -680,15 +680,6 @@ export const newModelByInitData = (app: App, tab: Tab, json: any) => {
let model: Model;
if (json.instance === "Custom") {
if (json.customModelType === "siyuan-card") {
- // https://github.com/siyuan-note/siyuan/issues/9377 历史数据兼容
- if (!json.customModelData.cardsData) {
- json.customModelData.cardsData = {
- cards: json.customModelData.blocks,
- unreviewedCount: json.customModelData.blocks.length,
- unreviewedNewCardCount: 0,
- unreviewedOldCardCount: json.customModelData.blocks.length
- }
- }
model = newCardModel({
app,
tab: tab,