Hacker News new | ask | show | jobs
by nxc18 2038 days ago
I’m working on some Windows apps currently in the native-ish WPF and UWP frameworks. Being somewhat detail-oriented, I’ve noticed a few major areas where Electron apps tend to deviate from native:

* button/link handling: win desktop uses the pointer with hover effects; electron uses a hand cursor with hover effects

* minimize/maximize/close buttons, and title bars in general; electron apps tend to have them being bigger than native. Native tends to vary by framework, with UWP explicitly not allowing some of the desired customization.

* Electron and web apps in general tend to allow more text selection than native does, and with different patterns; there are pros and cons to this.

* Electron apps tend to handle high and mixed DPI better than the native frameworks (I can’t believe I’m typing this). UWP dialogs are super buggy on high and mixed DPI. WPF needs lots of manual configuration otherwise it will look blurry at least some of the time (the very latest changes _may_ have fixed this)

I tend to support native development in general, but in the case of win desktop, the native frameworks are so bad and inconsistent, I’d rather just follow the web patterns. E.g. I think the hand cursor on buttons and things is actually quite nice and worth emulating, same with non-shit titlebars.

Because so many daily use apps (VS Code, Teams, Slack, all of the web) are electron, electron often feels more native than native, at least on Windows.

Edit, since I was suddenly triggered: SVG support on Windows is shit. WPF can sort of do it if you convert to Path geometries, but that isn’t a perfect match or convenient in any way. UWP does that, but with the added bonus of an extremely buggy rendering engine that falls down on even the simplest icons.

2 comments

The button hover and the text selection issues are one line CSS changes.
Yes, the fact this issue is literally a one line CSS change is what attracted me so strongly to using Electron.js. I'm all for software engineers building amazing macOS/Windows apps, but I wouldn't have any idea how to make text non-selectable.

In CSS it's "user-select: none;" and you're done. Playing to your strengths is important when building a business so that's exactly what I did :)

Hopefully WinUI3 will help with a lot of Windows native UI toolkits' shortcomings. I haven't looked much into it myself though.