Repository navigation
Keep the task ID under the type's mapped property (tasknotes#2574) - #499
Open
callumalpass wants to merge 4 commits into
Open
callumalpass wants to merge 4 commits into
callumalpass wants to merge 4 commits into
Conversation
A collection's task type can map the tasknotes.task id field to another property (callumalpass/tasknotes#2574). Writes now use the mapped name instead of always writing id, and the summary index reads it. Reading already goes through the model mapping. Requires @tasknotes/model 0.3.1.
# Conflicts: # pnpm-workspace.yaml
callumalpass
marked this pull request as ready for review
November 18, 2026 21:34
callumalpass
marked this pull request as draft
November 18, 2026 21:35
# Conflicts: # pnpm-workspace.yaml
callumalpass
marked this pull request as ready for review
November 18, 2026 21:47
This branch has not been deployed
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.
Companion to callumalpass/tasknotes#2576. A collection's task type can now map the
tasknotes.taskidfield to another property, for exampletasknote_id. The app read the ID through the model mapping, but always wrote the literalidkey. With a remapped type, saving a task would have put a second ID inidand clobbered whatever the user keeps there.Needs
@tasknotes/model0.3.1 (callumalpass/tasknotes-model#30), published to npm. With 0.3.1,resolveTaskNotesModelConfigFrom…readsimplements[].fields.idintofieldMapping.id, andtoUserField(mapping, "id")resolves it.Changes
TaskNotesTaskModel.writeFrontmatterwrites the ID to the mapped property instead ofid. This covers create, update, occurrences and every other write path.summaryFields()indexes the mapped ID property instead ofid.id(all current ones) are unchanged.src/domain/tasknotes-model.test.ts. Release note indocs/releases/unreleased.md.Not changed
task-configuration.ts,task-model-settings.tsx) and view read-only properties (view-mutation.ts) still reserve the literalidas well. That's consistent with how the app reserves every role name even when the role is remapped.mobileRevisionhandling are untouched.Checks
Run through rpnpm against a locally packed build of the model branch, swapped in temporarily and not committed:
i18n:check,format:check,typecheck,lint,test:coverage(257 files),test:coverage:layers,test:conformanceandbuildpass.test:release: 410 passed, 2 failed. Both failures were the import-workspace guard rejecting the temporaryfile:dependency.node --test scripts/import-workspace.node-test.mjspasses (7/7).