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

Issue: Obsidian freezes after I activate the theme #8

Open
Drakemoor opened this issue Nov 21, 2024 · 10 comments
Open

Issue: Obsidian freezes after I activate the theme #8

Drakemoor opened this issue Nov 21, 2024 · 10 comments
Assignees
Labels
bug Something isn't working on hold Nothing to do except waiting

Comments

@Drakemoor
Copy link

Obsidian freezes after I activate the theme, and I have to force close the whole app. It doesn't happen instantaneously but with a delay of 5-10 seconds.

There are no errors in the console.

I don't know where else can I look so to pinpoint the issue.

It looks great though, and have a lot of useful futures.

It works fine in the sandbox vault, so, the problem probably lays in the plugins I'm using. And I have a lot installed. ;)

@ElsaTam
Copy link
Owner

ElsaTam commented Nov 22, 2024

Hi!

If this issue appears only with the theme, the console won't show anything because it doesn't really show messages from the CSS code.
If you say it's not happening in the sandbox vault, it does indeed come from an issue with a plugin. And I think you will have to find which one. Here is what you can do:

  1. Make sure it's caused by a plugin + my theme. Enable "Restricted mode" in your current vault (it will disable the plugins) and enable my theme. If the freezing disappears, it's because a plugin was causing it.
  2. If the freeze is still there, check your snippets, one might cause a bug. If you have the MCL snippets, test them first, they are heavy (and my theme is also heavy, so combo of both could cause issues)
  3. If it's caused by a plugin (step 1 fixed it), you can use the plugin "Divide & Conquer" which will let you disable 50% of the plugin in one click. It will be faster than check every plugin one by one. If the freezing persists, the cuplrit plugin is still enabled. If the freezing stops, the culprit is among the one that got disabled and you can just try this half. And go on until you find the one.

Let me know how it goes!

@ElsaTam ElsaTam self-assigned this Nov 22, 2024
@ElsaTam ElsaTam added the question Further information is requested label Nov 22, 2024
@gypsyav
Copy link

gypsyav commented Nov 23, 2024

I've had the same issue and have tested it. There is an extreme slowdown when the theme is used with the Tasks plugin enabled and nothing else. Timing a very simple query on the default theme it takes 10 seconds to load, with Fancy a Story that same query takes 1 minute 27 seconds to load.

Obsidian freezes when the theme is enabled if the Tasks plugin is enabled though how long it takes before it does so varies. If the Day Planner or Time Ruler plugins are enabled there is a better change of a freeze sooner rather than later.

The common denominator seems to be when there is a plugin that queries the vault and displays the results is enabled.

@ElsaTam
Copy link
Owner

ElsaTam commented Nov 23, 2024

Hi @gypsyav
Thank you very much for further details on this issue.
With those three plugins installed, I was able to reproduce the issue (from 5s to 1mn07s with my theme). I will investigate that further!

@ElsaTam ElsaTam added bug Something isn't working and removed question Further information is requested labels Nov 23, 2024
@ElsaTam ElsaTam moved this to In progress in Fancy a Story - Obsidian Theme Nov 23, 2024
@ElsaTam ElsaTam moved this from In progress to Done in Fancy a Story - Obsidian Theme Dec 2, 2024
@ElsaTam ElsaTam closed this as completed by moving to Done in Fancy a Story - Obsidian Theme Dec 2, 2024
@ElsaTam ElsaTam moved this from Done to In progress in Fancy a Story - Obsidian Theme Dec 2, 2024
@ElsaTam ElsaTam reopened this Dec 2, 2024
@ElsaTam
Copy link
Owner

ElsaTam commented Dec 7, 2024

Hi @Drakemoor and @gypsyav
Sorry, this issue takes longer than others to resolve. Sometimes my computer has the freezing, sometimes it doesn't. So it's hard to work on it. But I think I have managed to at least identify the issue. Could you please try the following to let me know if it works better for you?

This is only a temporary file. Right now I disabled a lot of parts of the code that rely on heavy computations (everything with :has() selectors), therefore this file is missing multiple features from the theme. If it works best for you, it means I'm on the right track. I will then try to remove only what is necessary instead of removing big parts of the theme.

@gypsyav
Copy link

gypsyav commented Dec 8, 2024

This loaded much faster and didn't give me an immediate freeze. I'll post if I notice any more slowdowns or freezes.

@ElsaTam
Copy link
Owner

ElsaTam commented Dec 8, 2024

Great, thanks! I should be able to fix that in the next release then.

@gypsyav
Copy link

gypsyav commented Dec 8, 2024

Spoke too soon. I worked with it for a while and it started freezing again.

I've noticed this behavior with a few themes since Obsidian updated to 1.7. Not sure if that info helps.

@ElsaTam
Copy link
Owner

ElsaTam commented Dec 8, 2024

Do you know if it freezes more with my theme? If it's the same than with other themes, it could be caused by an update with 1.7 and some incompatibilities mysteries. But if it's more proned to lags with my theme, then the issue definitively lies in my theme.

It's very hard for me to debug because indeed the issue is not constant. I just tried with the old code, with which I experienced on minute freeze before being able to use Obsidian. I wanted to compare to the new code. And... Well, I now have to wait only 5 seconds with the old code. The lag has just disappeared on its own.
I guess it depends on the ressources available on my CPU/GPU when I open the Vault.

@gypsyav
Copy link

gypsyav commented Dec 8, 2024

It happens with multiple themes. I was trying to find a theme I could use without a freeze last night and ran into the same thing on most of them. It's only been happening since the 1.7 Obsidian update. Prior to that I didn't have any problems with themes or snippets.

@ElsaTam
Copy link
Owner

ElsaTam commented Dec 8, 2024

I really hope you will managed to solve this for you.
I will let this issue open, in case the next update of Obsidian fixes the lags for most of the themes and you want to try this theme again but it's still not working.
Thanks a lot for all the details and the help.

@ElsaTam ElsaTam added the on hold Nothing to do except waiting label Dec 8, 2024
@ElsaTam ElsaTam moved this from In progress to In testing in Fancy a Story - Obsidian Theme Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working on hold Nothing to do except waiting
Projects
Status: In testing
Development

No branches or pull requests

3 participants