I’m not sure I fully understand what you’re envisioning by saying:
Instead of removing the actual QT interface (front-end), a new front-end (Javascript) could be written using the new Rust back-end.
If you mean having two alternate front-ends (FE) on desktop, one with the current technology stack (JS/Python/Qt), and one JS-only, then to me that would be functionally the same as switching away from Qt. A coexistence of two FEs is simply not tenable in the long run, and one of them will eventually win out in terms of development focus.
If instead you mean retaining the current PyQt stack in order to provide the web view for the new JS FE, then I don’t see how that would address any of the issues we’re currently facing with Qt. We’d still have to deal with the headaches created by hardware acceleration and QtWebEngine’s problems in general.
Though getting back to the overarching thought, a JS front-end / Rust back-end was what I was alluding to in the previous post. (Full stack switch to JS was a misnomer there. By that I just meant the scenario where both Qt and all its supporting Python code would be replaced by JS.)
I realize that having the same FE/BE on all platforms is the fabled cross-platform panacea. But I’ve yet to see this work well in practice for any app of significant complexity. Quite a few major development teams that were early adopters of ideas like this have since abandoned that approach e.g. AirBnB with React Native, or DropBox with their custom C++ core. As it turns out, while you do write less platform-specific code, you still have to deal with platform-specific bugs and performance issues (not too dissimilar from Qt, just the with additional headaches of mobile platforms). So creating one “universal” code base ends up being almost as much work as working with each platform’s native technologies.
Straying away for a moment from the dev perspective and all the concerns I have for the add-on dev community, even just as a user I’d hate to see Anki Desktop, AnkiMobile, and AnkiDroid entirely switch to non-native frontends. Users already lament that 2.1 is much slower than 2.0 in any UI interaction that largely depends on web views. Now imagine this for Anki desktop as a whole – how janky the browser would be, how annoying the delays would be for each dialog to render its own little web view.
There’s a reason why users will often state their disdain for Electron – there just aren’t many examples of performant Electron apps out there. VS Code might just be the only one I know of, but that required the full development force of Microsoft to forge something usable out of the technology stack. Just compare it to the dreadful performance of Atom (which funnily enough is now also under Microsoft’s umbrella). I fear that, if Anki were ever to switch to a full JS front end, we’d have more of an Atom situation than a VS Code situation on our hands.
This scenario is worse still for AnkiDroid and AnkiMobile of course. Both mobile apps are very performant for the workloads they’re commonly facing, and I know that AnkiDroid has made some great new performance wins recently. I would hate to see that performance lost in favor of chasing after that pipe dream of unification.
Also, from a UI/UX standpoint, both Anki Desktop, AnkiDroid, and AnkiMobile behave exactly as you would expect them to do on each platform. Android users don’t have to deal with inconsistent interactions that might make sense on iOS and vice versa. And desktop users don’t have to suffer because of concessions made to the fact that the same stack is also used on mobile or on the web. App unification more often than not means settling for the lowest common denominator, and that leads you to an app that doesn’t look or work properly on any platform.
Moving back to the development side of things: Qt might have its faults, but it’s super quick and easy to use for creating UIs, and the results also basically look native to each platform with next to no additional work required. Same with Python: It might not be the most performant language out there, but it’s very easy to grasp and successfully use for add-on development. One of the reasons why Anki’s add-on ecosystem is so rich for Anki’s relative size is because these technologies are so approachable. The basic Python syntax you might learn in high school or programming 101 can already get you quite far, and tools like Qt designer make it super easy to create your first add-on UI.
Compared to that, the learning track for JS/CSS is much more arduous and lined with pitfalls, especially when stacked with whatever framework the fabled unified FE would end up using (be it React, Vue, Svelte, or others).
I also greatly dread the inconsistency that completely leaving widget/component design to add-on authors would introduce. Not only does Qt help with making Anki look native to the platform, it also makes add-ons look native to Anki (starting with the basic look of widgets right up to night mode / theming support). To achieve the same with whatever JS framework you have in mind would mean that Anki would have to provide ready-made UI components that could be used by add-ons. Once again a case where you’d end up duplicating work that’s already served on a platter with a widget toolkit like Qt.
Speaking about Qt: While I think it’s very cool what you did in your PR, I have to point out that there’s nothing preventing us from implementing automated UI tests for Qt. Qutebrowser, which basically has a nearly identical Qt/Python technolgy stack, has been doing so successfully for years now using pytest-qt.