Nasty. FWIW if anyone hits the same issue, here’s the workaround I added, which I guess has to stay then:
// we need to force a user agent that is recognized by Discourse as mobile
webView.evaluateJavaScript("navigator.userAgent") { [weak self] result, error in
if let userAgent = result as? String, error == nil {
self?.webView.customUserAgent = userAgent + " Mobile"
}
}