Enhance UI and functionality for Chain Workbench and related features
- Introduced a wide two-column layout for the Chain Workbench modal, improving user experience and accessibility. - Added new styles for workbench components, including headers, filters, and main containers, to enhance visual organization. - Updated chain templates to allow for multiple distinct matches per template, improving flexibility in template matching. - Enhanced documentation to clarify the new settings and commands related to the Chain Workbench and edge detection features. - Implemented logging for better tracking of missing configurations, ensuring users are informed about any loading issues.
This commit is contained in:
1 parent
c044d6e8db
commit
725adb5302
47 files changed
+4161
-646
No files matched your search
@@ -34,15 +34,40 @@ export interface SectionNode {
|
||||
const NOTE_LINKS_HEADING = "Note-Verbindungen";
|
||||
const CANDIDATES_HEADING = "Kandidaten";
|
||||
|
||||
/** Intra-note block reference: [[#^block-id]] or [[#^block-id|alias]] */
|
||||
const INTRA_NOTE_BLOCK_REF_RE = /^#\^([a-zA-Z0-9_-]+)(?:\s*\|.*)?$/;
|
||||
|
||||
/**
|
||||
* Parse target from link text: [[file]] or [[file#Heading]]
|
||||
* Resolve [[#^block-id]] to (currentFile, sectionHeading) using section blockIds.
|
||||
* Returns null if not an intra-note block ref.
|
||||
*/
|
||||
function parseTarget(linkText: string): EdgeTarget {
|
||||
function resolveIntraNoteBlockRef(
|
||||
linkText: string,
|
||||
currentFilePath: string,
|
||||
sections: NoteSection[]
|
||||
): EdgeTarget | null {
|
||||
const trimmed = linkText.trim();
|
||||
const match = trimmed.match(INTRA_NOTE_BLOCK_REF_RE);
|
||||
if (!match) return null;
|
||||
const blockId = match[1];
|
||||
const section = sections.find((s) => s.blockId === blockId);
|
||||
return {
|
||||
file: currentFilePath,
|
||||
heading: section?.heading ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse target from link text: [[file]], [[file#Heading]], or [[#^block-id]] (intra-note).
|
||||
*/
|
||||
function parseTarget(linkText: string, currentFilePath: string, sections: NoteSection[]): EdgeTarget {
|
||||
const intraNote = resolveIntraNoteBlockRef(linkText, currentFilePath, sections);
|
||||
if (intraNote) return intraNote;
|
||||
|
||||
const normalized = normalizeLinkTarget(linkText);
|
||||
const parts = linkText.split("#");
|
||||
|
||||
|
||||
if (parts.length > 1) {
|
||||
// Has heading: [[file#Heading]]
|
||||
const file = normalized;
|
||||
const headingPart = parts[1]?.split("|")[0]?.trim();
|
||||
return {
|
||||
@@ -50,8 +75,7 @@ function parseTarget(linkText: string): EdgeTarget {
|
||||
heading: headingPart || null,
|
||||
};
|
||||
}
|
||||
|
||||
// No heading: [[file]]
|
||||
|
||||
return {
|
||||
file: normalized,
|
||||
heading: null,
|
||||
@@ -100,9 +124,9 @@ export async function buildNoteIndex(
|
||||
? { file: file.path }
|
||||
: { file: file.path, sectionHeading: section.heading };
|
||||
|
||||
// Process each target
|
||||
// Process each target (resolve [[#^block-id]] to same-note section)
|
||||
for (const targetLink of parsedEdge.targets) {
|
||||
const target = parseTarget(targetLink);
|
||||
const target = parseTarget(targetLink, file.path, sections);
|
||||
|
||||
edges.push({
|
||||
rawEdgeType: parsedEdge.rawType,
|
||||
|
||||
Reference in new issue
Block a user