( container: HTMLElement, plugin: TaskNotesPlugin, save: () => void )
| 33 | * Renders the Features tab - optional plugin modules and their configuration |
| 34 | */ |
| 35 | export function renderFeaturesTab( |
| 36 | container: HTMLElement, |
| 37 | plugin: TaskNotesPlugin, |
| 38 | save: () => void |
| 39 | ): void { |
| 40 | container.empty(); |
| 41 | |
| 42 | const translate = (key: TranslationKey, params?: Record<string, string | number>) => |
| 43 | plugin.i18n.translate(key, params); |
| 44 | |
| 45 | // Inline Tasks Section |
| 46 | const availableProperties = getAvailableProperties(plugin); |
| 47 | const currentInlineProperties = plugin.settings.inlineVisibleProperties || [ |
| 48 | "status", |
| 49 | "priority", |
| 50 | "due", |
| 51 | "scheduled", |
| 52 | "recurrence", |
| 53 | ]; |
| 54 | const currentInlineLabels = getPropertyLabels(plugin, currentInlineProperties); |
| 55 | |
| 56 | createSettingGroup( |
| 57 | container, |
| 58 | { |
| 59 | heading: translate("settings.features.inlineTasks.header"), |
| 60 | description: translate("settings.features.inlineTasks.description"), |
| 61 | }, |
| 62 | (group) => { |
| 63 | group.addSetting( |
| 64 | (setting) => |
| 65 | void configureToggleSetting(setting, { |
| 66 | name: translate("settings.features.overlays.taskLinkToggle.name"), |
| 67 | desc: translate("settings.features.overlays.taskLinkToggle.description"), |
| 68 | getValue: () => plugin.settings.enableTaskLinkOverlay, |
| 69 | setValue: async (value: boolean) => { |
| 70 | plugin.settings.enableTaskLinkOverlay = value; |
| 71 | save(); |
| 72 | renderFeaturesTab(container, plugin, save); |
| 73 | }, |
| 74 | }) |
| 75 | ); |
| 76 | |
| 77 | if (plugin.settings.enableTaskLinkOverlay) { |
| 78 | group.addSetting( |
| 79 | (setting) => |
| 80 | void configureToggleSetting(setting, { |
| 81 | name: translate("settings.features.overlays.aliasExclusion.name"), |
| 82 | desc: translate( |
| 83 | "settings.features.overlays.aliasExclusion.description" |
| 84 | ), |
| 85 | getValue: () => plugin.settings.disableOverlayOnAlias, |
| 86 | setValue: async (value: boolean) => { |
| 87 | plugin.settings.disableOverlayOnAlias = value; |
| 88 | save(); |
| 89 | }, |
| 90 | }) |
| 91 | ); |
| 92 |
no test coverage detected