From 69a7ae9ebf3e142a58612037ed19040db358868e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Normen=20Mu=CC=88ller?= Date: Wed, 28 Jan 2026 19:27:55 +0100 Subject: [PATCH 1/3] fix: prevent group titles from resolving plain strings --- PR.md | 19 +++++++++++++++++++ src/bases/groupTitleRenderer.ts | 13 +++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 PR.md diff --git a/PR.md b/PR.md new file mode 100644 index 00000000..211a3b27 --- /dev/null +++ b/PR.md @@ -0,0 +1,19 @@ +# fix/context-group-title + +## Context Group Header Rendering + +Prevent group headers from resolving plain strings as file links. Only explicit links or values that look like file paths are resolved, so context values like "STY" stay intact. + +Examples (illustrative): + +- Current: contexts = "STY" and a file `sty.md` exists with `title: Foo` -> header shows "Foo" (linked). +- Target: contexts = "STY" always shows "STY" as plain text. + +## Changelog + +- Treat non-link, non-path group titles as plain text. +- Keep file link rendering for explicit wiki/markdown links and path-like values. + +## Tests + +- Not run (manual testing only) diff --git a/src/bases/groupTitleRenderer.ts b/src/bases/groupTitleRenderer.ts index 4280772c..b326067e 100644 --- a/src/bases/groupTitleRenderer.ts +++ b/src/bases/groupTitleRenderer.ts @@ -2,6 +2,14 @@ import { parseLinktext, TFile } from "obsidian"; import { appendInternalLink, type LinkServices } from "../ui/renderers/linkRenderer"; import { parseLinkToPath } from "../utils/linkUtils"; +function looksLikeFilePath(value: string): boolean { + const trimmed = value.trim(); + if (trimmed.length === 0) return false; + if (trimmed.startsWith("./") || trimmed.startsWith("../")) return true; + if (trimmed.includes("/") || trimmed.includes("\\")) return true; + return trimmed.endsWith(".md"); +} + function resolveDisplayText( filePath: string, displayText: string, @@ -87,6 +95,11 @@ export function renderGroupTitle( // Check if title is a file path (with or without .md extension) // Try to resolve it as a file + if (!looksLikeFilePath(title)) { + container.textContent = title; + return; + } + const filePathToTry = title.endsWith(".md") ? title.replace(/\.md$/, "") : title; const file = linkServices.metadataCache.getFirstLinkpathDest(filePathToTry, ""); From 85e0a77f506fb953d152f2f540b2ec381124c86f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Normen=20Mu=CC=88ller?= Date: Wed, 28 Jan 2026 19:58:45 +0100 Subject: [PATCH 2/3] docs: update tests for context group fix --- PR.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PR.md b/PR.md index 211a3b27..2e8d3031 100644 --- a/PR.md +++ b/PR.md @@ -16,4 +16,5 @@ Examples (illustrative): ## Tests -- Not run (manual testing only) +- `node generate-release-notes-import.mjs` +- `npm run typecheck` From 6165a5c993b9c2317d6e25ce04466772ea0f2fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Normen=20Mu=CC=88ller?= Date: Wed, 28 Jan 2026 20:05:41 +0100 Subject: [PATCH 3/3] docs: record ci baseline results --- PR.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PR.md b/PR.md index 2e8d3031..b45e3702 100644 --- a/PR.md +++ b/PR.md @@ -16,5 +16,12 @@ Examples (illustrative): ## Tests +- `npm run i18n:sync` +- `npm run lint` (warnings only; matches upstream) - `node generate-release-notes-import.mjs` - `npm run typecheck` +- `npm run test:ci -- --verbose` (fails: `due-date-timezone-inconsistency.test.ts`, also failing in upstream) +- `npm run test:integration` +- `npm run test:performance` +- `npm run build` (warns about missing OAuth env vars) +- `npm run test:build`