Skip to content
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

'show tree' does not update its results if parent list items are edited (and likely if the parents are tasks not matched by the search) #3155

Open
2 of 7 tasks
claremacrae opened this issue Oct 28, 2024 · 0 comments
Labels
priority: high A high priority/important request scope: rendering of tasks How the plugin displays tasks (except CSS issues) scope: sub-tasks and super-tasks nested/parent/child: controlling their display, filtering them, and similar type: bug Something isn't working

Comments

@claremacrae
Copy link
Collaborator

claremacrae commented Oct 28, 2024

Please check that this issue hasn't been reported before.

  • I searched previous Bug Reports didn't find any similar reports.

Steps to reproduce

  1. Create a note called 'Heading Edits'

  2. Paste in this content:

    - Other
        - [ ] #task Cash for admission
    - Clothing
        - [ ] #task Costume
        - [ ] #task Goggles
    - Changing
        - [ ] #task Towel
    
    ```tasks
    path includes {{query.file.path}}
    
    group by function task.parent?.description ?? ''
    ```
    
    • Note that the group by function code groups the tasks by their parent list items
  3. Arrange view so that you can see the file in both Source mode and Reading mode, like this:

    image

  4. Change the Other list item to 1 Other

Expected Behavior

The search results should be updated to show the renamed (and re-ordered) heading.

image

Current behaviour

The search results do not update until the Reading mode file is closed and reopened - or the vault reloaded.

image

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Obsidian Version

1.7.4

Tasks Plugin Version

7.12.1

Checks

  • I have tried it with all other plugins disabled and the error still occurs

Possible solution

The relevant code is Task.identicalTo() and ListItem.identicalTo()

The problem is that Tasks is checking to see if any tasks have been edited.
But it is only checking the children of the tasks that are displayed, and not their parents.

Things to consider in the implementation.

  • the parent may be any of:
    • null
    • a list item
    • a task line that has the global filter (if set)
    • a task line that does not have the global filter, so is ignored by Tasks
  • the parent may have been edited to change between any of the states listed above, such as converted from a list item to a task
  • the immediate parents may be the same, but the parents of the parents may have changed, for example
@claremacrae claremacrae added type: bug Something isn't working scope: rendering of tasks How the plugin displays tasks (except CSS issues) scope: sub-tasks and super-tasks nested/parent/child: controlling their display, filtering them, and similar labels Oct 28, 2024
@claremacrae claremacrae changed the title 'show tree' does not update its results if parent list items are edited, that are not children of other tasks in the search results 'show tree' does not update its results if parent list items are edited (and likely if the parents are tasks not matched by the search) Oct 28, 2024
@claremacrae claremacrae added the priority: high A high priority/important request label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high A high priority/important request scope: rendering of tasks How the plugin displays tasks (except CSS issues) scope: sub-tasks and super-tasks nested/parent/child: controlling their display, filtering them, and similar type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant