fix: stabilize local folder AI document workflow
- scope local-folder PageTree revision and document sidebar rendering to fileTreeScope - preserve projected table/image attrs for local Markdown aggregate fallback - avoid FileTree restore forced layouts on cold design open - add API ChatOnly provider runtime and local OCR task handling regressions
This commit is contained in:
@@ -28,6 +28,10 @@ function paragraphText(doc) {
|
||||
return doc?.content?.[0]?.content?.[0]?.text || "";
|
||||
}
|
||||
|
||||
function firstTableCellText(doc) {
|
||||
return doc?.content?.[0]?.content?.[0]?.content?.[0]?.content?.[0]?.content?.[0]?.text || "";
|
||||
}
|
||||
|
||||
const {
|
||||
pageBodyTiptapDocumentSource,
|
||||
pageBodyTiptapDocument,
|
||||
@@ -62,6 +66,39 @@ assert.equal(
|
||||
"Block truth",
|
||||
);
|
||||
|
||||
const localWithProjectedTable = {
|
||||
projectionSource: "local_markdown.content",
|
||||
blockDocument: {
|
||||
documentId: "local-md:design~2F07-ai~2Fdone~2F7-45-chatonly-api-provider-runtime-v1.md",
|
||||
rootBlockIds: ["table-1"],
|
||||
blocks: [{
|
||||
blockId: "table-1",
|
||||
type: "table",
|
||||
attrs: {
|
||||
tiptapTable: {
|
||||
type: "table",
|
||||
content: [{
|
||||
type: "tableRow",
|
||||
content: [{
|
||||
type: "tableCell",
|
||||
attrs: { colspan: 1, rowspan: 1, colwidth: null },
|
||||
content: [{
|
||||
type: "paragraph",
|
||||
content: [{ type: "text", text: "Provider 类别" }],
|
||||
}],
|
||||
}],
|
||||
}],
|
||||
},
|
||||
},
|
||||
contentNodes: [],
|
||||
}],
|
||||
},
|
||||
};
|
||||
assert.equal(
|
||||
firstTableCellText(pageBodyTiptapDocument(localWithProjectedTable)),
|
||||
"Provider 类别",
|
||||
);
|
||||
|
||||
const localLegacyOnly = {
|
||||
projectionSource: "local_markdown.content",
|
||||
content: legacyContent,
|
||||
|
||||
Reference in New Issue
Block a user