Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/editor/ReadingModeTaskLinkProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ export class ReadingModeTaskLinkProcessor {
// Get the original link text for display
const originalText = linkEl.textContent || `[[${originalLinkPath}]]`;

// Check for alias exclusion
if (this.plugin.settings.disableOverlayOnAlias) {
// In reading mode, we check if the displayed text differs from the path or title
// If it does, it's likely an alias/custom text
const currentText = linkEl.textContent || "";

// If text doesn't match path AND doesn't match task title, it's an alias
if (currentText !== originalLinkPath && currentText !== taskInfo.title) {
return;
}
}

// Parse display text if it's a piped link
let displayText: string | undefined;
const linkContent = linkEl.textContent || "";
Expand Down
8 changes: 8 additions & 0 deletions src/editor/TaskLinkOverlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ export function buildTaskLinkDecorations(
continue;
}

// Check for alias exclusion
if (plugin.settings.disableOverlayOnAlias) {
// Skip Wikilinks with pipes [[Path|Alias]]
if (link.type === "wikilink" && link.match.includes("|")) {
continue;
}
}

// Parse the link to get the link path (handle both wikilinks and markdown links)
const parsed =
link.type === "wikilink"
Expand Down
1 change: 1 addition & 0 deletions src/settings/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ export const DEFAULT_SETTINGS: TaskNotesSettings = {
pomodoroMobileSidebar: "tab",
// Editor defaults
enableTaskLinkOverlay: true,
disableOverlayOnAlias: false,
enableInstantTaskConvert: true,
useDefaultsOnInstantConvert: true,
enableNaturalLanguageInput: true,
Expand Down
12 changes: 12 additions & 0 deletions src/settings/tabs/featuresTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ export function renderFeaturesTab(
);

if (plugin.settings.enableTaskLinkOverlay) {
group.addSetting((setting) =>
configureToggleSetting(setting, {
name: translate("settings.features.overlays.aliasExclusion.name"),
desc: translate("settings.features.overlays.aliasExclusion.description"),
getValue: () => plugin.settings.disableOverlayOnAlias,
setValue: async (value: boolean) => {
plugin.settings.disableOverlayOnAlias = value;
save();
},
})
);

group.addSetting((setting) => {
setting
.setName("Inline Task Card Properties")
Expand Down
1 change: 1 addition & 0 deletions src/types/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export interface TaskNotesSettings {
pomodoroMobileSidebar: "tab" | "left" | "right"; // where to open pomodoro view on mobile
// Editor settings
enableTaskLinkOverlay: boolean;
disableOverlayOnAlias: boolean;
enableInstantTaskConvert: boolean;
useDefaultsOnInstantConvert: boolean;
enableNaturalLanguageInput: boolean;
Expand Down