feat: configurable filename template for materialized occurrences (#2126)#2134
Open
raphaelfaouakhiri wants to merge 3 commits into
Open
feat: configurable filename template for materialized occurrences (#2126)#2134raphaelfaouakhiri wants to merge 3 commits into
raphaelfaouakhiri wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #2126.
Materialized occurrences are currently named by dedup suffix (
Pay rent-2,Pay rent-3), which carries no meaning. This PR adds a filename template for them:{{occurrenceDate}}(2026-08-01),{{occurrenceWeek}}(2026-W31, ISO),{{occurrenceMonth}}(2026-08),{{occurrenceYear}},{{occurrenceMonthName}}, and{{occurrencePeriod}}— which auto-selects the granularity from the parent'sFREQ(daily→date, weekly→week, monthly→month, yearly→year; complex rules fall back to full date). All regular filename variables also work. Injected via the existingadditionalVariablesmechanism (same as ICS notes).occurrenceFilenameTemplate(Task properties → Title card). Empty = current behavior (parent title +-N).occurrenceFilenameTemplateProperty, defaultoccurrenceFilenameTemplate) overrides the global template for that task's occurrences. Implemented plugin-side because the coreFieldMappinglives in@tasknotes/model.-Ndedup suffix is kept as a collision safety net; no template error can abort materialization (falls back to sanitized title); i18n strings added for en + pt.{{title}} — {{occurrencePeriod}}, so after updating, newly materialized occurrences get meaningful names by default (existing files are never renamed). I believe this is the better default for users, but if you prefer opt-in, flipping the default to""indefaults.tsis a one-line change — happy to do it.Known limitation (pre-existing behavior, unchanged): with
storeTitleInFilenameenabled, later editing an occurrence's title renames the file to the plain title (the old-Nsuffix was equally lost).Tests: new unit suite for the variables/generator + 3 wiring tests in the materialization suite (20 passing);
tscclean; validated in my own vault (daily/weekly/monthly recurrences, global + per-parent override).