MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / openTagInput

Method openTagInput

src/components/TaskContextMenu.ts:1469–1493  ·  view source on GitHub ↗
(
		task: TaskInfo,
		plugin: TaskNotesPlugin,
		mode: "add" | "remove"
	)

Source from the content-addressed store, hash-verified

1467 }
1468
1469 private async openTagInput(
1470 task: TaskInfo,
1471 plugin: TaskNotesPlugin,
1472 mode: "add" | "remove"
1473 ): Promise<void> {
1474 const input = await showTextInputModal(plugin.app, {
1475 title:
1476 mode === "add"
1477 ? this.t("contextMenus.task.addTag")
1478 : this.t("contextMenus.task.removeTagInput"),
1479 placeholder: this.t("contextMenus.task.tagPlaceholder"),
1480 confirmText: this.t("common.confirm"),
1481 cancelText: this.t("common.cancel"),
1482 onInputReady: (inputEl) => {
1483 new TagSuggest(plugin.app, inputEl, plugin);
1484 },
1485 });
1486
1487 const tags = parseTaskTagInput(input);
1488 if (tags.length === 0) return;
1489
1490 const nextTags =
1491 mode === "add" ? addTagsToList(task.tags, tags) : removeTagsFromList(task.tags, tags);
1492 await this.updateTaskTags(task, plugin, nextTags);
1493 }
1494
1495 private async updateTaskTags(
1496 task: TaskInfo,

Callers 1

addTagOptionsMethod · 0.95

Calls 6

tMethod · 0.95
updateTaskTagsMethod · 0.95
showTextInputModalFunction · 0.90
parseTaskTagInputFunction · 0.90
addTagsToListFunction · 0.90
removeTagsFromListFunction · 0.90

Tested by

no test coverage detected