kepano / obsidian-minimal

A distraction-free and highly customizable theme for Obsidian.
https://minimal.guide
MIT License
3.68k stars 185 forks source link

maxwidth not respected in dataviewjs blocks #643

Closed fredcallaway closed 2 months ago

fredcallaway commented 1 year ago

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

7.2.1

Describe the bug

image

The top Meetings block is a dataview block, the bottom is dataviewjs. Replacing dataviewjs with dataview using the dev tools fixes it.


# Meetings
```dataview
LIST
FROM "Meetings"
WHERE file.day = date(this.file.name)
const res = await dv.queryMarkdown(`
LIST
FROM "Meetings"
WHERE file.day = date(this.file.name)
`)
if (res.value) {
  dv.span('# Meetings')
  dv.span(res.value)
}


### Debug info

SYSTEM INFO:
    Obsidian version: v1.4.13
    Installer version: v1.4.13
    Operating system: Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 21.4.0
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: adapt to system
    Community theme: Minimal v7.2.1
    Snippets enabled: 2
    Restricted mode: off
    Plugins installed: 48
    Plugins enabled: 38
        1: Calendar v1.5.10
        2: Templater v1.16.0
        3: Dataview v0.5.58
        4: QuickAdd v0.20.1
        5: Natural Language Dates v0.6.1
        6: Hider v1.2.4
        7: Toggle Case v1.1.0
        8: Quick Switcher++ v3.2.1
        9: Style Settings v1.0.3
        10: Note Refactor v1.7.1
        11: Citations v0.4.5
        12: Shell commands v0.18.2
        13: Task Marker v0.4.2
        14: Metadata Extractor v1.1.0
        15: Advanced URI v1.35.0
        16: User Plugins v1.3.0
        17: Code Editor Shortcuts v1.13.1
        18: Navigate Cursor History v1.1.0
        19: Commander v0.5.0
        20: Hotkeys for specific files v1.3.0
        21: Pandoc Plugin v0.4.1
        22: Contextual Typography v2.2.5
        23: Minimal Theme Settings v6.3.1
        24: Better Word Count v0.9.6
        25: Various Complements v8.2.1
        26: Jump to link v0.4.4
        27: Archiver v0.23.2
        28: Obsidian42 - Text Transporter v1.0.3
        29: Obsidian42 - Jump-to-Date v1.0.14
        30: Sentence Navigator v1.3.0
        31: Multi-Column Markdown v0.8.0
        32: Outliner v4.4.0
        33: Omnisearch v1.14.2
        34: Tasks v3.1.0
        35: Supercharged Links v0.9.7
        36: Version History Diff v2.1.0
        37: Auto Link Title v1.4.1
        38: Zotero Integration v2.3.8

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.
jharst commented 11 months ago

I have the same issue. Could you please explain what you mean by "Replacing dataviewjs with dataview using the dev tools"? Thanks!

fredcallaway commented 11 months ago

@jharst It's not actually a fix. Dev tools let you temporarily edit the obsidian-generated HTML, for debugging purposes.

All that needs to be done is that every occurrence of the dataview class in the theme be duplicated for dataviewjs.

jharst commented 11 months ago

Thanks, @fredcallaway , I understand that better now. I also found out that using a css helper class like table-max fixes the issue for me.

harrisj commented 7 months ago

Is there any plan to fix this? Right now, I am doing this gross hack in my databviewJS blocks to keep the same spacing for both types

dv.container.classList.replace("block-language-dataviewjs", "block-language-dataview")
kepano commented 7 months ago

I am not able to reproduce this issue. I need more information about the settings you are using:

jharst commented 7 months ago

Thank you for taking care of this! My configuration is as follows:

x-desire commented 2 months ago

I'm experiencing the same issue where table-max, table-wide, and similar don't work as expected. These styles function properly with dataview tables but not with dataviewjs tables. The problem started when I upgraded Minimal from version 7.7.2 to 7.7.9.

To investigate, I downloaded the theme.css files for each version, starting from 7.7.2 where the tables rendered correctly. The dataviewjs tables work fine up until version 7.7.7; the issue starts with version 7.7.8.