mugiwara85 / CodeblockCustomizer

Codeblock Customizer plugin for Obsidian
MIT License
147 stars 7 forks source link

Performance Issues #54

Closed 3dot141 closed 7 months ago

3dot141 commented 9 months ago

i encountered problem like this link

when i drag file or heading, the move will very slow.

after i use chrome devtools to debug, in style.css,i found some code which will cause some performance issues in Obisidian's some actions

body:not(:not([class*='codeblock-customizer-show-langnames'])) .codeblock-customizer-header-text,
body:not(:not([class*='codeblock-customizer-show-langicons'])) .codeblock-customizer-header-container-specific:has(.codeblock-customizer-icon) .codeblock-customizer-header-text,
body:not(:not([class*='codeblock-customizer-header-collapse-command'])):not(:not([class*='codeblock-customizer-show-langnames-always'])) .codeblock-customizer-header-container:has([class^="codeblock-customizer-header-language-tag-"]) .codeblock-customizer-header-text,
body:not(:not([class*='codeblock-customizer-header-collapse-command'])):not(:not([class*='codeblock-customizer-show-langicons-always'])) .codeblock-customizer-header-container:has(.codeblock-customizer-icon) .codeblock-customizer-header-text {
  padding-left: 0px;
}

i think this css selector is too complex, and will cause render html slower.

Can anyone reproduce this issue and rectify it?

i upload one movie that display this problem https://github.com/mugiwara85/CodeblockCustomizer/assets/19152476/4ff6a715-34e0-4699-9213-4bbfdefa372a

mugiwara85 commented 9 months ago

Unfortunately, I can't reproduce it. Could you try disabling all plugins, and then check? After that you could try to enable your plugins one by one. Maybe we get a little closer to what causes this?

3dot141 commented 9 months ago

i try again, and find another condition which is use other themes like minimal. this is my reproduce steps:

  1. open sandbox vault
  2. install new theme like minimal
  3. install codeblock customizer
  4. try to drag heading or file and reproduce it

sandbox vault only has 1 theme and 1 community plugin which is codeblock custimizer. i try to only install other theme like lts, and not install plugin. the drag is normal.

mugiwara85 commented 9 months ago

Ok, I can reproduce it now. I will look at it, what could be the problem.

mugiwara85 commented 9 months ago

This will be fixed in the next release. If you want you can test it now. You just have to replace the styles.css file manually. Maybe you find anything else.

3dot141 commented 7 months ago

i try it, the issue is resolved, thanks