generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Major improvements to toggling tasks in Reading view #1780
Merged
Conversation
This file contains 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
This confims that the timeout mechanism really is working.
This is an optimisation for cases where the file has not been edited and the line number is valid. It removes the uncertainty of the existing sections-based mechanism.
The code now works well without it. It seems that if we don't auto-save, Obsidian takes care of merging any changes made in to the file correctly.
1680 - Reading Mode line numbers not updated on editing.md
Also increase the message duration to 15 seconds, to allow user time to read this longer message. Example output: Tasks: Could not find the correct task line to update. The task line not updated is: - [ ] #task task2b ^ca47c7 In this markdown file: "Manual Testing/Task Toggling Scenarios/Embed Task in to Note.md" Note: further clicks on this checkbox will usually now be ignored until the file is opened (or certain, specific edits are made - it's complicated). Recommendations: 1. Close all panes that have the above file open, and then re-open the file. 2. Check for exactly identical copies of the task line, in this file, and see if you can make them different.
This will be tidied up later, as part of #1778.
claremacrae
added
the
scope: data integrity
Problems that may cause loss or corruption of user data
label
Mar 21, 2023
6 tasks
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.
Description
tl;dr
Numerous improvements to the behaviour of toggling tasks in Reading view.
This started as a spike/experiment to see what I could learn about how
File.replaceTaskWithTasks()
worked. By the end of it, I had made enough improvements that I decided to submit it as-is.For the cases where a task markdown line appears only once in the file it:
Gory Detail
File.ts
File.ts
logging.ts
so it can now be usedlogging.ts
messagesresources/sample_vaults/Tasks-Demo/Manual Testing/Task Toggling Scenarios/
Motivation and Context
See above.
How has this been tested?
Screenshots (if appropriate)
Example error message that is shown if the line to toggle cannot be found:
Types of changes
Changes visible to users:
fix
- non-breaking change which fixes an issue)vault
- improvements to the Tasks-Demo sample vault)Internal changes:
refactor
- non-breaking change which only improves the design or structure of existing code, and making no changes to its external behaviour)test
- additions and improvements to unit tests and the smoke tests)Checklist
yarn run lint
.Terms