Repository navigation
refactor(settings): use the model package's task type editor - #403
Merged
Merged
Conversation
The app carried its own editor for a task type's statuses, priorities and custom fields, and a second reader for early binding spellings. Both now live in @tasknotes/model (0.3.0-rc.21), shared with the Obsidian plugin. A settings save that writes the type also leaves it with one vocabulary when a hand edit made its schema and binding disagree.
Editing statuses no longer rewrites a schema rule the collection wrote itself; only the rule that requires a completion date follows the completed statuses.
The vendored build of the unpublished release is no longer needed.
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
#399 added an app-side editor for a task type's statuses, priorities and custom fields (
src/domain/task-type-vocabulary.ts). The Obsidian plugin has its own way of writing the same parts of the type, and@tasknotes/modelhad a third. callumalpass/tasknotes-model#26 makes the model'spatchTaskNotesMdbaseTypeSettingsthe one editor; this moves the app onto it.What changes
src/domain/task-type-vocabulary.tsand its test are deleted. Validation, the in-use check, value and key generation and the type rewrite come from@tasknotes/model/mdbase.TaskModelSettingsPatchno longer has avocabularywrapper:statuses,prioritiesanduserFieldssit beside the defaults, as in the model's patch, and go to the type in one call.task-configuration.tsloses its own status, priority and occurrence resolvers. They existed for camel-case spellings in early bindings, which the model now reads.Behaviour people can notice
A status or priority that only the type's schema allows now appears in the app (labelled from its value) instead of being hidden.
A custom field's name set in the Obsidian plugin is shown in the app once the plugin has written it to the type, and the reverse.
Fixes a defect shipped in feat(settings): edit statuses, priorities and custom fields #399: editing statuses rewrote the status condition of every
allOfrule in the type's schema, so a rule a collection wrote itself (for example "an open task needs a scheduled date") was overwritten with the completed statuses. Only the rule that requires the completion date is rewritten now.Nothing else in the interface changes; no copy is added or removed.
Before merging
@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; the registry tarball has the same integrity hash.mainis merged in (through perf(startup): show tasks ~0.3 s sooner after ready #405).maindeploys to production.Testing
rpnpm test: 247 files, 1,975 tests pass on the repinned branch withmainmerged in, including a new repository test for the reconcile-on-save case.rpnpm run typecheck,rpnpm run lint(0 errors; the warnings are in files this does not touch),pnpm i18n:check,pnpm format:check.e2e/demo.spec.ts"a status and a custom field added in Settings reach the task editor" passes.