Improve LightRAG knowledge search locator alignment
This commit is contained in:
@@ -240,10 +240,10 @@ export const createSidebarFileTreeOpenRuntime = (dependencies = {}) => {
|
||||
var relativePath = String(input.path || workspacePath && (workspacePath.relativePath || workspacePath.localRelativePath) || '').trim();
|
||||
var rootUri = String(input.rootUri || workspacePath && workspacePath.rootUri || currentRootUri() || '').trim();
|
||||
var fallback = String(input.fallback || '').trim();
|
||||
if (relativePath && rootUri) return 'resource:file:' + rootUri + ':' + relativePath;
|
||||
if (objectKind === 'mindmap' && assetId) return 'resource:mindmap:' + documentId + ':' + assetId;
|
||||
if ((objectKind === 'only_office' || objectKind === 'office') && assetId) return 'resource:onlyoffice:' + documentId + ':' + assetId;
|
||||
if (objectKind === 'pdf' && assetId) return 'resource:pdf:' + documentId + ':' + assetId;
|
||||
if (relativePath && rootUri) return 'resource:file:' + rootUri + ':' + relativePath;
|
||||
if (assetId && documentId) return 'resource:' + (objectKind || 'attachment') + ':' + documentId + ':' + assetId;
|
||||
return fallback || assetId || '';
|
||||
}
|
||||
@@ -282,26 +282,32 @@ export const createSidebarFileTreeOpenRuntime = (dependencies = {}) => {
|
||||
if (!relativePath || !rootUri) return false;
|
||||
var title = String(input && input.title || '').trim() || relativePath.split('/').pop() || relativePath;
|
||||
var kind = String(input && input.kind || fileTreeIconKindForFileName(title) || '').trim();
|
||||
var documentId = String(input && input.documentId || currentDocumentId() || '').trim();
|
||||
var assetId = String(input && input.assetId || '').trim() || 'local-file:' + relativePath;
|
||||
var officeUrl = String(input && input.officeUrl || '').trim();
|
||||
if (!officeUrl && kind === 'office') {
|
||||
officeUrl = buildLocalOnlyOfficeOpenUrl(relativePath, title, documentId, assetId, 'view');
|
||||
}
|
||||
var workspacePath = input && input.workspacePath && typeof input.workspacePath === 'object' ? input.workspacePath : null;
|
||||
var objectIdentity = resourceObjectIdentityFromWorkspacePath({
|
||||
workspacePath: workspacePath,
|
||||
objectKind: kind,
|
||||
documentId: input && input.documentId,
|
||||
assetId: input && input.assetId,
|
||||
documentId: documentId,
|
||||
assetId: assetId,
|
||||
path: relativePath,
|
||||
rootUri: rootUri
|
||||
});
|
||||
return await window.__mnoteDocumentPaneRuntime.openResourceInActiveTab({
|
||||
objectIdentity: objectIdentity,
|
||||
assetId: String(input && input.assetId || '').trim() || 'local-file:' + relativePath,
|
||||
assetId: assetId,
|
||||
title: title,
|
||||
fileName: title,
|
||||
kind: kind,
|
||||
rootUri: rootUri,
|
||||
path: relativePath,
|
||||
href: String(input && input.href || buildLocalFileOpenUrl(relativePath, false) || '').trim(),
|
||||
officeUrl: String(input && input.officeUrl || '').trim(),
|
||||
documentId: String(input && input.documentId || currentDocumentId() || '').trim(),
|
||||
officeUrl: officeUrl,
|
||||
documentId: documentId,
|
||||
workspaceId: String(input && input.workspaceId || resolveWorkspaceId(document.body) || '').trim(),
|
||||
workspacePath: workspacePath,
|
||||
paneRole: String(input && input.paneRole || 'primary').trim() || 'primary',
|
||||
@@ -310,6 +316,7 @@ export const createSidebarFileTreeOpenRuntime = (dependencies = {}) => {
|
||||
bbox: input && input.bbox,
|
||||
sourceMapPath: String(input && input.sourceMapPath || '').trim(),
|
||||
blockId: String(input && input.blockId || '').trim(),
|
||||
evidenceText: String(input && input.evidenceText || '').trim(),
|
||||
lineRange: input && input.lineRange,
|
||||
charRange: input && input.charRange
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user