obsidian-tasks
obsidian-tasks copied to clipboard
If user selects dataview for their task format, Reading mode still shows signifiers with Tasks emojis - consider adding option to retain the current display...
Please check that this issue hasn't been reported before.
- [X] I searched previous Bug Reports didn't find any similar reports.
Expected Behavior
When I have chosen Dataview as my Tasks Format, and then view a note with dataview field values in Reading mode, I would like the fields to be shown in Dataview format.
Current behaviour
When I have chosen Dataview as my Tasks Format, and then view a note with dataview field values in Reading mode, the values are shown in Tasks emoji formats.
Steps to reproduce
- Install Tasks (3.3.0 - the upcoming release)
- Change the Tasks format to Dataview and then restart Obsidian
- Open any note in Source or Live Preview modes
- Paste in this line:
- [ ] #task This was dataview [priority:: high] [repeat:: every day] [start:: 2023-04-05] [scheduled:: 2023-04-06] [due:: 2023-04-07]
- View the note in Reading mode
Expected result:
Task is displayed with dataview fields, something like this:
Actual result:
Task is displayed with emojis:
Which Operating Systems are you using?
- [ ] Android
- [ ] iPhone/iPad
- [ ] Linux
- [X] macOS
- [ ] Windows
Obsidian Version
1.2.3
Tasks Plugin Version
3.3.0 pre-release
Checks
- [ ] I have tried it with all other plugins disabled and the error still occurs
Possible solution
No response
This is closely related to #1890 - fixing that will likely fix this.
I've begun to get used to the compressed format of view. Can we preserve that as an option such as: "- [ ] Use task emojis in Reader view"
So I just saw the conversation in https://github.com/obsidian-tasks-group/obsidian-tasks/issues/1890 and I apologize for posting before searching, and so duplicating @dubaaron's request.
For what it's worth, I also like the query-ability of the dataview format in source, but prefer to generally see the simplified view presented by the use of emojis.
I do understand you have reservations and I can't at this time contribute to the project rather than ask more of you, so I'll see if I can't find some other way to either make emoji's easier to utilize and reference, or make dataview easier on the eyes. Till then, I'll use this Bug as a "Feature" so please don't feel you have to prioritize 'fixing' the results blocks ;P
One option I am still pursuing (so if anyone knows a way, please lmk) is to hide or only show selected tags and properties when I'm not editing the line so I can use dataview task format but not have the actual text of the todo get lost in the metadata when I'm not actively editing the line. This would have the added benefit of allowing me to choose to display only the metadata I want to actually see in the results of my query.
Seconding continuing to have emojis for display mode with dataview format in the source as an option
Oddly this only has one upvote...
I don't have time to track all the comments.... Upvotes (π ) are what counts... π
I've edit the description to add: - consider adding option to retain the current display..
Please, no more comments asking for an option for the original behaviour... Additional comments will not change the likelihood of that happening. Thank you.
With so few votes on this issue, itβs unlikely to be implemented in the foreseeable future.
I appreciate the visual uniformity of the dataview, especially if I have devices with not-so-great emoji-art. I respect that It might not be an easy rework, but I wanted to put my two cents.
Thanks for the plugin!
For whatever it's worth, I'm disappointed to see emojis as the default on reader mode. Can't stand them. Like @jaylinwylie, I too appreciate the uniformity of dataview. Emojis just make everything look cluttered. I use a minimalistic theme because it helps me function. These "forced" emojis go against what makes Obsidian work for me. I also imagine they're not great for people with some visual disabilities. As someone who's not neurotypical, they also mess up my information processing... please, at least give us a choice to have dataview in reader mode.
For whatever it's worth, I'm disappointed to see emojis as the default on reader mode.
Wow, that's a bit strong for free software.
Hi @UnwovenPepsiCola, I understand that Tasks does not work for you, and I genuinely understand that being not neurotypical, this can cause you problems.
And I apologise for not having read that far when I sent my initial reply.
However, as we are never going to be able to fix all the user requests, it sounds like your best bet is to use the dataview plugin instead for the time being.
I see this currently has 16 π - which is a lot for requests in Issues, so I have added the priority: high
label.
It's not likely that I will be working anywhere near this area for the foreseeable future.
So instead, I will pop below some information that should give initial pointers, if anyone with TypeScript experience was inclined to try and address this...
Getting started developing Tasks
I've written an Obsidian Publish site to help those interested in developing the Tasks plugin: Contributing to Tasks.
Change in behaviour
Note that this issue is specifically about changing the rendering of Tasks in Reading Mode.
The same code that renders tasks in Reading Mode also renders them in search results.
So it may turn out that making Reading Mode respect user format may also make the search results do the same.
However, if not, work on this issue should ignore the search results - we need PRs to only change one behaviour at a time.
Where in Tasks are emojis used in Reading Mode?
- The code for the Tasks and Dataview task formats is in:
-
src/TaskSerializer/
- The two formats are:
- DefaultTaskSerializer.ts
- DataviewTaskSerializer.ts
-
src/TaskSerializer/
- The starting point for Tasks Reading Mode code is:
- So to address this issue, we would be looking for how it is that
InlineRenderer
always usesDefaultTaskSerializer
-
InlineRenderer
usesTaskLineRenderer
- And
TaskLineRenderer
code says it specifically usesDefaultTaskSerializer
with emoji symbols:
- See also
TaskFieldRenderer
So somehow the fix for this issue needs to figure out how to refactor TaskLineRenderer
to control the task format it uses, at run-time.
How to access the settings
This is the code to call to obtain the user's selected format:
https://github.com/obsidian-tasks-group/obsidian-tasks/blob/4f11d21ee98e7ff2a34ec472e3bd168fef711b23/src/Config/Settings.ts#L236-L244
Tests
- The relevant tests are:
Note the approval tests files (tests/Renderer/TaskLineRenderer.test.Visualise_HTML_Full_task_-_full_mode.approved.html and similar)
https://github.com/obsidian-tasks-group/obsidian-tasks/blob/4464f32658fccd62f9c1eb298b3a32f969756c09/tests/Renderer/TaskLineRenderer.test.ts#L572-L586
At a minimum, the change should:
- add individual tests for the rendering in HTML of Task fields in dataview format,
- extend the approval tests to also show the HTML used to render task lines in dataview format.