[2.1.55+] UI breakage due to force-applied styles

Sizable portions of the Rust and TypeScript code are already available in the alpha builds

That’s good.

Is there any text above or below that which might hint at the cause?

I got this
QT_DEBUG_PLUGINS=1 ./run
    Finished dev [unoptimized + debuginfo] target(s) in 0.35s
[1/54; 6 active; 0.024s] pyenv
FAILED: /home/ren/Downloads/anki_git/out/pyenv/bin/python /home/ren/Downloads/anki_git/out/pyenv/bin/pip /home/ren/Downloads/anki_git/out/pyenv/bin/pip-compile /home/ren/Downloads/anki_git/out/pyenv/bin/pip-sync /home/ren/Downloads/anki_git/out/pyenv/bin/mypy /home/ren/Downloads/anki_git/out/pyenv/bin/black /home/ren/Downloads/anki_git/out/pyenv/bin/isort /home/ren/Downloads/anki_git/out/pyenv/bin/pylint /home/ren/Downloads/anki_git/out/pyenv/bin/pytest /home/ren/Downloads/anki_git/out/pyenv/bin/protoc-gen-mypy
/home/ren/Downloads/anki_git/out/rust/debug/runner pyenv /home/ren/Downloads/anki_git/out/extracted/python/bin/python3 /home/ren/Downloads/anki_git/out/pyenv  python/requirements.base.txt python/requirements.dev.txt python/requirements.qt6_4.txt
Command failed:

/home/ren/Downloads/anki_git/out/extracted/python/bin/python3: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory

[6/54; 1 active; 8.534s] ts:lib:backend_proto.d.ts
ninja: build stopped: subcommand failed.

Build failed.
QT_DEBUG_PLUGINS=1 ./run  12.32s user 0.67s system 145% cpu 8.938 total

I was able to solve it eventually by running sudo pacman -S libxcrypt-compat. This is something that I believe wasn’t mentioned in the docs. Now I can proceed with testing.

For some reason Anki crashes every time I close it but fortunately it doesn’t cause any harm while running.

System log
Dec 28 15:45:07 nadeshiko [521214]: Could not parse number of program headers from core file: invalid `Elf' handle
Dec 28 15:45:07 nadeshiko systemd-coredump[521180]: [🡕] Process 520903 (python) of user 1000 dumped core.

Module /home/ren/Downloads/anki_git/out/extracted/python/bin/python3.9 without build-id.
Module /home/ren/Downloads/anki_git/out/pyenv/lib/python3.9/site-packages/google/_upb/_message.abi3.so without build-id.
Module /home/ren/Downloads/anki_git/out/pyenv/lib/python3.9/site-packages/google/_upb/_message.abi3.so
Module /home/ren/Downloads/anki_git/out/extracted/python/lib/libpython3.9.so.1.0 without build-id.
Stack trace of thread 520903:
#0  0x00007f1dfa404b4c n/a (/home/ren/Downloads/anki_git/out/extracted/python/lib/libpython3.9.so.1.0 + 0x404b4c)
ELF object binary architecture: AMD x86-64
Dec 28 15:45:07 nadeshiko systemd[1]: systemd-coredump@0-521179-0.service: Deactivated successfully.

2.1.55 is the product of a lot of time and effort over 6 months by multiple developers, and every change is an attempt at making Anki better.

I think it’s a good idea to space out releases so that people have at least some time to enjoy stability without having to adapt to changes. What I don’t understand conceptually is the desire to change/replace something that was already working.

Is there a way to test your changes live (at least temporarily) without recompiling the whole program? I have the webview inspector addon installed but it’s quite limiting.

Also, when I start Anki by running ./run, fcitx doesn’t work.

I have fixed the notch and made a PR.

Then I wanted to run git bisect to determine what commit broke GTK themes, but I ran into trouble. When I try running Anki from source, my GTK theme is not applied regardless of Anki version. This is weird.

The last version that worked well with GTK themes was 2.1.54, but it is reproducible only when you install it with pip install. It’s probably somehow related to the bundled python 3.9. When installing with pip, python 3.10 from /usr/bin/ is used. What I can say for sure is that 2.1.55b1 already breaks most of my GTK theme, but not completely. So apparently the regression was introduced gradually in several commits.

I already got a PR that allows you to disable the new theming + stylesheets via the debug console.

I can push it tonight so you can test it - I don’t have any experience with those GTK themes on Manjaro, so I’m not sure how to go about testing this myself.

I’m sure you can switch GTK themes using something like lxappearance.

I disagree with trying to make it look the same on all platforms. If possible, allow the platform to make it consistent with what users of that platform are accustomed to. Especially, don’t make Mac users have to use the upper right corner to exit/expand or Windows users have to use the upper left.

Trying to parse this thread as best as I can as a bit of novice, but is there any solution/workaround to the forced PushButton size changes that @tatsumoto mentioned above? Had some custom widgets that are very goofy looking now on 2.1.55!

In 2.1.55 QPushbuttons have min-width: 75px;. Try applying a custom stylesheet to your buttons with min-width set to auto. It seems the change was reverted recently so it won’t be a problem in the future.

2 Likes

That’s the domain of window decorations (i.e. the frame of the window), which we aren’t planning to redesign anyway.

What I’m advocating for mostly is a uniform theme for the web components. Those need custom CSS because the browser defaults are very old-fashioned and do not fit together well.

It would add a lot of complexity if we tried to imitate OS-specific styles, and it is also not a common thing in the web industry to do that.

The stylesheets are an attempt to make the Qt widgets fit together with the theme we’re creating for the web components (e.g. the editor). Overall I’m trying to create a modern looking mix of macOS styles and Material design.

You see, Qt only provides native styles for macOS and Windows. The theme you’re used to from previous versions is “Fusion”, a platform-agnostic style. There is no easy way to apply a system wide GTK theme to the Qt widgets, I’m afraid.

1 Like

./run after some changes to scss files should only take a few seconds, and you can use tools/ts-watch to rebuild while Anki is still running.

./run uses the PyQt wheels from PyPi. You may be able to resolve the fcitx issue by copying the fcitx Qt plugins into out/pyenv/lib/…/PyQt6/Qt6/plugins, or by building the Anki wheels and running them in your own venv that uses your distro’s PyQt packages.

Your GTK issues are likely a combination of that, and Matthias’s styling changes.

./run uses the PyQt wheels from PyPi

Could it be that GTK themes don’t work for the same reason?

That’s what I was trying to communicate in my previous reply.

2 Likes

Fully agree with Damien

This scrollbar looks a little too wide. But in Browser it is narrower.

This might be fixed by Reduce Qt margins, tweak scrollbar and splitters by kleinerpirat · Pull Request #2260 · ankitects/anki · GitHub. Once we got the toolbar figured out, that PR is next on the line.

Another very annoying thing. Some default styles are interfering with my custom styles, so this <button> on the card is broken when I hover over it. This didn’t happen before.

I’m guessing that’s because there’s background set somewhere and it takes precedence over background-color.

You can use background instead of background-color in your CSS. It would have taken you ~1s, creating that post was probably a matter of minutes.
(Or switch on minimalist mode.)

On a more serious note: The new styling for buttons currently applies to the reviewer. The advantage is that buttons used in a default template will look in line with the rest of the UI.

You already describes the disadvantage. We can of course discuss this.

Yes, I already changed the template, obviously.

https://invidious.silur.me/watch?v=iGkK-5il6Mk