obsidian-tasks icon indicating copy to clipboard operation
obsidian-tasks copied to clipboard

option to disable processing of Reading View (Tasks assumes single-line task items which affects much rendering)

Open huyz opened this issue 3 years ago • 12 comments
trafficstars

Edit on 2022-11-16 Updated for clarity and for more comprehensive feature request (re-including content of post https://github.com/obsidian-tasks-group/obsidian-tasks/issues/1259#issuecomment-1315636716 later in this thread)

Ok I redid the sample code and the screenshots. Hopefully this is clearer, and also you can see this is not just about embeds, it's also about fenced code blocks, blockquotes, and callouts (which are rendered above!). I don't think this is an edge case. It would be great if there was an option to simply not touch the Reading View, which I never use to toggle checkboxes.

The Markdown source

## A block just for embedding

Nothing to see here 😃

## The Tasks bug in Reading View

- [ ] first item with embed:  ✅  ![[Obsidian playground#A block just for embedding]]
- [ ] Second item with embed: ❌ ![[Obsidian playground#A block just for embedding]]
- [ ] Third item with a code block ❌ 
	      ```
	      code block
	      ```
- [ ] Fourth item with a blockquote ❌ 
    > block quote
- [ ] Fifth item with a callout ❌ 
    > [!NOTE] this is a note
- [ ] Sixth item with a subtask ✅ 
	- [ ]  Subtask
- [ ] Seventh item with an item ✅ 
	- Subitem

What Reading View looks like without Obsidian Tasks

image

What Reading View looks like with Obsidian Tasks

image

Issue information

Feature Request

An option to disable any processing of the Reading View, so as to circumvent any possible issues here.

Obsidian Version

1.0.3

Tasks Plugin Version

1.18.1


Original post from 2022-10-26

Expected Behavior

  1. In file called Obsidian Playground, create:
- [ ] first item
- [ ] ![[Obsidian playground#^635d8c]]

New paragraph

- [ ] ![[Obsidian playground#^635d8c]]

New paragraph

^635d8c
  1. Compare Live Preview and Reading view. I expect them to be the same and look like Live Preview:

screenshot 2022-10-26T054523Z

Current behaviour

Reading View is rendered as: screenshot 2022-10-26T054531Z

Steps to reproduce

See "Expected Behavior" above.

Which Operating Systems are you using?

  • [ ] Android
  • [ ] iPhone/iPad
  • [ ] Linux
  • [X] macOS
  • [ ] Windows

Obsidian Version

1.0.2

Tasks Plugin Version

1.15.1

Checks

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

Possible solution

No response

huyz avatar Oct 26 '22 05:10 huyz

Thank you for reporting this behaviour.

claremacrae avatar Oct 26 '22 06:10 claremacrae

Tasks expects each Task to be a single line, and to be rendered as a single line.

I am struggling to understand the pictures and what they are actually saying - some annotation on them to point out the bits to be looked at would make them easier to understand.

However, I think this is rather a corner case of rendering, and unfortunately it is unlikely to be treated as a priority.

claremacrae avatar Nov 01 '22 20:11 claremacrae

I'll address each of these lines. But quick question: why does Obsidian Tasks even interfere with the Reading View rendering? I can understand why Tasks handles the rendering of Tasks queries, but why the Reading View when there are no queries there.

huyz avatar Nov 02 '22 02:11 huyz

But quick question: why does Obsidian Tasks even interfere with the Reading View rendering? I can understand why Tasks handles the rendering of Tasks queries, but why the Reading View when there are no queries there.

Hmm. That is a good question.

@schemar Can you remember why in Reading mode Tasks changes the rendering of tasks (and lists in general)?

claremacrae avatar Nov 02 '22 07:11 claremacrae

It injects the logic to handle task completion. In theory, it could be only necessary to add the handler to the checkbox. However, I remember trying to refactor that once and it turned out to be more complicated. I don't remember the details, sorry.

schemar avatar Nov 02 '22 07:11 schemar

Oh I see. I wonder if there's an easy way to disable the handler in the reading view, as I never touch checkboxes there (I always do it in the editor in my left pane). Even if I have to fork the repo and make that change.

huyz avatar Nov 02 '22 08:11 huyz

Ok I redid the sample code and the screenshots. Hopefully this is clearer, and also you can see this is not just about embeds, it's also about fenced code blocks, blockquotes, and callouts (which are rendered above!). I don't think this is an edge case. It would be great if there was an option to simply not touch the Reading View, which I never use to toggle checkboxes.

The Markdown source

## A block just for embedding

Nothing to see here 😃

## The Tasks bug in Reading View

- [ ] first item with embed:  ✅  ![[Obsidian playground#A block just for embedding]]
- [ ] Second item with embed: ❌ ![[Obsidian playground#A block just for embedding]]
- [ ] Third item with a code block ❌ 
	      ```
	      code block
	      ```
- [ ] Fourth item with a blockquote ❌ 
    > block quote
- [ ] Fifth item with a callout ❌ 
    > [!NOTE] this is a note
- [ ] Sixth item with a subtask ✅ 
	- [ ]  Subtask
- [ ] Seventh item with an item ✅ 
	- Subitem

What Reading View looks like without Obsidian Tasks

image

What Reading View looks like with Obsidian Tasks

image

huyz avatar Nov 15 '22 17:11 huyz

Thank you for the example, it is a lot easier to understand the point now. The checkmarks and crosses really help.

The first and second ones are interesting in that when they are reversed the one called second works, and the one called first does not. So the problem is not the content of the line, but the order in which it appears.

It would be great if there was an option to simply not touch the Reading View, which I never use to toggle checkboxes.

That's an interesting suggestion - I would need to think about the consequences of it, but it seems to have diverged quite a lot from the initial summary of the ticket.

It would be really helpful if the summary could be edited to reflect the new request please.

claremacrae avatar Nov 15 '22 18:11 claremacrae

Thank you for updating the title. That's very clear.

claremacrae avatar Nov 24 '22 21:11 claremacrae

It injects the logic to handle task completion. In theory, it could be only necessary to add the handler to the checkbox. However, I remember trying to refactor that once and it turned out to be more complicated. I don't remember the details, sorry.

I saw an idea in Discord that has a small chance of helping with this, so I've started a Developer Discussion to track possibly useful info....

  • https://github.com/obsidian-tasks-group/obsidian-tasks/discussions/2323

claremacrae avatar Oct 09 '23 10:10 claremacrae

Stumbled upon something that looks like the same issue. Even image embedding into a task is broken in reading mode (on the left - editing, on the right - reading)

Tasks enabled

image

Tasks disabled

image

kykc avatar Apr 06 '24 12:04 kykc

Stumbled upon something that looks like the same issue. Even image embedding into a task is broken in reading mode (on the left - editing, on the right - reading)

@kykc That is being tracked in https://github.com/obsidian-tasks-group/obsidian-tasks/issues/2554

claremacrae avatar Apr 06 '24 12:04 claremacrae