fix(tree): stabilize filetree mindmap switching
Open filetree mindmap assets inside the primary document pane so the sidebar root is not rebuilt during rapid mindmap/page switching. Keep filetree active rows on doc:<documentId> and asset:<mindmapId>, shorten generated mindmap filenames, and preserve legacy index rows only as compatibility input. Add task438-task445 browser smokes and close the 4-27/4-38/4-39/4-40 tree-domain bug records.
This commit is contained in:
@@ -78,6 +78,8 @@ function extractMindmapImageAssetIdsFromData(input: unknown): string[] {
|
||||
|
||||
function toMindmapAsset(row: MindmapRow, workspaceId: string) {
|
||||
const isLegacy = row.mindmap_id.startsWith("legacy-");
|
||||
const suffix = row.mindmap_id.match(/(\d{4,})$/)?.[1]?.slice(-4) ?? row.mindmap_id.replace(/^mindmap[_-]?/i, "").slice(-6);
|
||||
const fileName = suffix ? `思维导图-${suffix}.json` : "思维导图.json";
|
||||
return {
|
||||
id: row.mindmap_id,
|
||||
workspace_id: row.workspace_id ?? workspaceId,
|
||||
@@ -87,7 +89,7 @@ function toMindmapAsset(row: MindmapRow, workspaceId: string) {
|
||||
thumbnail_url: null,
|
||||
bucket: null,
|
||||
storage_path: null,
|
||||
file_name: isLegacy ? "mindmap.json" : `mindmap-${row.mindmap_id}.json`,
|
||||
file_name: isLegacy ? "思维导图.json" : fileName,
|
||||
file_size: null,
|
||||
mime_type: "application/json",
|
||||
ocr_payload: undefined,
|
||||
|
||||
@@ -191,6 +191,8 @@ export function extractMindmapImageAssetIdsFromData(input: unknown): string[] {
|
||||
|
||||
function toMindmapAsset(row: MindmapRow, workspaceId: string): MediaAsset {
|
||||
const isLegacy = row.mindmap_id.startsWith("legacy-");
|
||||
const suffix = row.mindmap_id.match(/(\d{4,})$/)?.[1]?.slice(-4) ?? row.mindmap_id.replace(/^mindmap[_-]?/i, "").slice(-6);
|
||||
const fileName = suffix ? `思维导图-${suffix}.json` : "思维导图.json";
|
||||
return {
|
||||
id: row.mindmap_id,
|
||||
workspace_id: row.workspace_id ?? workspaceId,
|
||||
@@ -200,7 +202,7 @@ function toMindmapAsset(row: MindmapRow, workspaceId: string): MediaAsset {
|
||||
thumbnail_url: null,
|
||||
bucket: null,
|
||||
storage_path: null,
|
||||
file_name: isLegacy ? "mindmap.json" : `mindmap-${row.mindmap_id}.json`,
|
||||
file_name: isLegacy ? "思维导图.json" : fileName,
|
||||
file_size: null,
|
||||
mime_type: "application/json",
|
||||
ocr_payload: undefined,
|
||||
|
||||
Reference in New Issue
Block a user