From d92edb8ea50efdd9a9e5529725c3384c0117f951 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 1 May 2018 09:40:32 -0700 Subject: [PATCH] css: Remove support for legacy desktop app. We haven't seen significant traffic from the legacy desktop app in over a year, and users using it get a warning to upgrade since last summer, so it's probably OK to stop providing special fonts for it. --- templates/zerver/app/index.html | 6 +----- zerver/views/home.py | 11 ----------- zproject/settings.py | 33 --------------------------------- 3 files changed, 1 insertion(+), 49 deletions(-) diff --git a/templates/zerver/app/index.html b/templates/zerver/app/index.html index 8957484487..3d010257dc 100644 --- a/templates/zerver/app/index.html +++ b/templates/zerver/app/index.html @@ -29,12 +29,8 @@ - {% if nofontface %} - {# We can't use @font-face on qtwebkit, so use differently minified CSS #} - {% stylesheet 'app-fontcompat' %} - {% else %} {% stylesheet 'app' %} - {% endif %} + {{ minified_js('app', csp_nonce)|safe }} {{ render_bundle('translations', attrs='nonce="%s"' % (csp_nonce)) }} diff --git a/zerver/views/home.py b/zerver/views/home.py index cd429ecb31..bad43e9704 100644 --- a/zerver/views/home.py +++ b/zerver/views/home.py @@ -243,7 +243,6 @@ def home_real(request: HttpRequest) -> HttpResponse: context={'user_profile': user_profile, 'page_params': JSONEncoderForHTML().encode(page_params), 'csp_nonce': csp_nonce, - 'nofontface': is_buggy_ua(request.META.get("HTTP_USER_AGENT", "Unspecified")), 'avatar_url': avatar_url(user_profile), 'show_debug': settings.DEBUG and ('show_debug' in request.GET), @@ -265,13 +264,3 @@ def apps_view(request: HttpRequest, _: str) -> HttpResponse: if settings.ZILENCER_ENABLED: return render(request, 'zerver/apps.html') return HttpResponseRedirect('https://zulipchat.com/apps/', status=301) - -def is_buggy_ua(agent: str) -> bool: - """Discrimiate CSS served to clients based on User Agent - - Due to QTBUG-3467, @font-face is not supported in QtWebKit. - This may get fixed in the future, but for right now we can - just serve the more conservative CSS to all our desktop apps. - """ - return ("Zulip Desktop/" in agent or "ZulipDesktop/" in agent) and \ - "Mac" not in agent diff --git a/zproject/settings.py b/zproject/settings.py index c498d8de6d..c2d64aa868 100644 --- a/zproject/settings.py +++ b/zproject/settings.py @@ -896,39 +896,6 @@ PIPELINE = { ), 'output_filename': 'min/landing.css' }, - # Two versions of the app CSS exist because of QTBUG-3467 - 'app-fontcompat': { - 'source_filenames': ( - 'third/bootstrap-notify/css/bootstrap-notify.css', - 'third/spectrum/spectrum.css', - 'third/thirdparty-fonts.css', - 'generated/icons/style.css', - 'node_modules/flatpickr/dist/flatpickr.css', - 'node_modules/flatpickr/dist/plugins/confirmDate/confirmDate.css', - 'styles/components.css', - 'styles/app_components.css', - 'styles/zulip.css', - 'styles/alerts.css', - 'styles/settings.css', - 'styles/subscriptions.css', - 'styles/drafts.css', - 'styles/input_pill.css', - 'styles/informational-overlays.css', - 'styles/compose.css', - 'styles/reactions.css', - 'styles/left-sidebar.css', - 'styles/right-sidebar.css', - 'styles/lightbox.css', - 'styles/popovers.css', - 'styles/pygments.css', - 'styles/media.css', - 'styles/typing_notifications.css', - 'styles/hotspots.css', - 'styles/night_mode.css', - # We don't want fonts.css on QtWebKit, so its omitted here - ), - 'output_filename': 'min/app-fontcompat.css' - }, 'app': { 'source_filenames': ( 'third/bootstrap-notify/css/bootstrap-notify.css',