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

Inconsistent indentation with dataview embedded lists #410

Open
zerowidth opened this issue Sep 9, 2022 · 8 comments
Open

Inconsistent indentation with dataview embedded lists #410

zerowidth opened this issue Sep 9, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@zerowidth
Copy link

Is the bug present when using the default Obsidian theme?

No

Is the bug present when snippets and plugins are disabled?

Yes

Minimal theme version

6.0.4

Describe the bug

The styles for dataview embedded lists are applied inconsistently in two ways:

  • The rendered view (right pane) has an indent applied to the taskList that isn't present in the live preview (see Grouped section). I'd prefer the non-indented, "strict embed" style, but consistency between the two would be nice, and/or an easy way to override.
  • The first-level list items (see Ungrouped section) are outdented when the taskList is rendered without grouping. The ungrouped version lacks a div with dataview result-group class wrapping the ul.

Screen Shot 2022-09-08 at 9 12 32 PM

Raw markdown:

## Tasks

- [ ] one
    - [ ] subtask
- [ ] two

## Dataview

### Grouped

```js
dv.taskList(dv.current().file.tasks, true)
```

```dataviewjs
dv.taskList(dv.current().file.tasks, true)
```

### Ungrouped

```js
dv.taskList(dv.current().file.tasks, false)
```

```dataviewjs
dv.taskList(dv.current().file.tasks, false)
```

Debug info

SYSTEM INFO:
	Obsidian version: v0.16.2
	Installer version: v0.15.9
	Operating system: Darwin Kernel Version 21.6.0: Wed Aug 10 14:28:23 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_T6000 21.6.0
	Login status: logged in
	Catalyst license: insider
	Insider build toggle: on
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: Minimal
	Snippets enabled: 1
	Restricted mode: off
	Plugins installed: 57
	Plugins enabled: 2
		1: Dataview v0.5.45
		2: Minimal Theme Settings v6.0.5

RECOMMENDATIONS:
	Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

I notice this says I have 1 snippet enabled still, but the two custom css files I use are disabled in settings.

@zerowidth zerowidth added the bug Something isn't working label Sep 9, 2022
@zerowidth
Copy link
Author

I was able to get alignment to be more consistent by resetting the max-width:var(--max-width); from line-width.scss. My override (using the generated selectors)

body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataview h4,
body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataview>h4,
body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataviewjs h4,
body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataviewjs>h1,
body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataviewjs>h2,
body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataviewjs>h3,
body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataviewjs>h4,
body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataviewjs>p,
body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .dataview.dataview-container>.contains-task-list,
body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .dataview.dataview-error,
body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .dataview.list-view-ul,
body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .dataview.result-group {
  max-width: 100%;
}

@StevenGLee
Copy link

StevenGLee commented Nov 28, 2022

Same problem in the strict-embedded block. Waiting to be fixed officially.

image

image

@Koderok
Copy link

Koderok commented Mar 18, 2023

I'm also stuck trying to debug this issue. Please update if anyone was able to find a workaround. I'm using Minimal theme.

@kepano
Copy link
Owner

kepano commented Jun 30, 2023

Please try again with Minimal 7.0+

@paolo-santucci
Copy link

paolo-santucci commented Jul 24, 2023

I still have this issue:

Preview
image


Edit
image


But it's also present while using the default theme:

Preview
image


Edit
image

@zerowidth
Copy link
Author

zerowidth commented Jul 26, 2023

Still looks like it's not quite consistent. Edit mode on the left, view mode on the right:

image

@paolo-santucci
Copy link

OK, this seems to solve the issue for me:

/* fix for Dataview checklists */
.is-live-preview ul[class="contains-task-list"]{
	padding-left: 1.9em !important;
	text-indent: -1.5em !important
}

/* fix for Tasks checklists */
.is-live-preview ul > li.plugin-tasks-list-item {
	padding-left: 0em !important;
	text-indent: -1.5em !important
}

@claremacrae
Copy link
Contributor

I found this issue whilst investigating the non-indentation of task lines in Tasks query blocks in Live Preview.

The discussion here has been helpful.

Summary

After much more experimentation, I am now as confident as I can be that it happens in many themes and multiple plugins, and so should be fixed in Obsidian, and not in individual themes in plugins (especially as the fix requires !important so is intrusive).

Reasoning

Please see the self-contained comment: obsidian-tasks-group/obsidian-tasks#2361 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants