Repository navigation
refactor(mdbase): use the model package's vocabulary check, and share custom field names - #2536
Merged
Merged
Conversation
The plugin compared the binding's statuses, priorities and defaults with the schema's by hand and reported any difference as an inconsistent type. @tasknotes/model 0.3.0-rc.21 now reads every value either copy names and can make the copies agree, so a status added to the schema by hand is read instead of blocking the type. The next write from settings stores one list. A custom field's name is written to the type as the property's title and read back from it, so it reaches other devices and the TaskNotes app.
Removes the vendored build of the unpublished release and restores the dependency order in package.json that the earlier install had changed.
callumalpass
marked this pull request as ready for review
November 10, 2026 23:42
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.
Why
The plugin, the TaskNotes app and
@tasknotes/modeleach had their own code for the statuses, priorities and custom fields a task type holds. callumalpass/tasknotes-model#26 puts the editing and checking in the model package. This moves the plugin's checking onto it. The plugin still writes the type by generating it from settings and merging, because that also covers field mapping, task identification and filenames, which the model's editor does not; the model now tests that its generator and its editor produce the same type.What changes
validateCanonicalTaskTypeno longer compares the binding with the schema by hand. It uses the model'staskNotesMdbaseTypeDisagreementsandreconcileTaskNotesMdbaseTypeVocabulary. A type whose two lists differ is read with every value either list names, and is valid if that list is one a collection can hold. A type that cannot be reconciled is reported as before, with the same messages.title(the model's generator does this from rc.21), wins over the stale title when the plugin merges, is part of the settings fingerprint so a rename is saved, and is read back in preference to this device's name.Behaviour people can notice
Deleting a status that tasks still use is unchanged: the plugin still allows it after its confirmation, and the collection check finds those tasks.
Dependency
@tasknotes/modelis pinned to 0.3.0-rc.21 from npm, published from tasknotes-model#26. The vendored build used while it was unpublished is removed.Testing
npx jest: 830 suites, 6,705 tests pass against the npm package. New tests cover a schema-only status, a status the schema lost, a type that cannot be reconciled, and a field name going both ways.npm run lint,npx tsc --noEmit,npm run build, run locally; no CI runs on this branch.