From 98e631a9c7362ee412975b91f77c0de6a353b836 Mon Sep 17 00:00:00 2001 From: Paulo Jorge Reis Date: Mon, 12 Apr 2021 10:23:25 +0100 Subject: [PATCH] New logs UI out of beta + fixes (#3868) * Update new logs pane: remove beta icons, add specific surveys * Remove unneeded reset of log entries * Remove unneeded reset of the autocompile linting error flag * Lower compile event sampling rate ahead of prod release * Never send logs UI subvariant when user is getting the existing UI GitOrigin-RevId: ab726761ba372c6806e56fc0cf841099cc30df50 --- .../web/frontend/extracted-translations.json | 4 +-- .../components/preview-first-error-pop-up.js | 14 ++++----- .../preview/components/preview-logs-pane.js | 29 +++++++++++++------ .../preview/components/preview-pane.js | 1 + .../js/ide/pdf/controllers/PdfController.js | 11 +++---- .../stylesheets/components/beta-badges.less | 5 ++++ services/web/locales/en.json | 6 ++-- 7 files changed, 42 insertions(+), 28 deletions(-) diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 511dab4744..25c612be28 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -121,8 +121,8 @@ "loading_recent_github_commits": "", "log_entry_description": "", "log_hint_extra_info": "", - "logs_pane_beta_message": "", - "logs_pane_beta_message_popup": "", + "logs_pane_info_message": "", + "logs_pane_info_message_popup": "", "main_file_not_found": "", "make_private": "", "math_display": "", diff --git a/services/web/frontend/js/features/preview/components/preview-first-error-pop-up.js b/services/web/frontend/js/features/preview/components/preview-first-error-pop-up.js index 2e99974c91..3eb955a4ea 100644 --- a/services/web/frontend/js/features/preview/components/preview-first-error-pop-up.js +++ b/services/web/frontend/js/features/preview/components/preview-first-error-pop-up.js @@ -26,7 +26,7 @@ function PreviewFirstErrorPopUp({ > } + headerIcon={} rawContent={logEntry.content} formattedContent={logEntry.humanReadableHintComponent} extraInfoURL={logEntry.extraInfoURL} @@ -60,22 +60,22 @@ function PreviewFirstErrorPopUp({ ) } -function FirstErrorPopUpBetaBadge() { +function FirstErrorPopUpInfoBadge() { const { t } = useTranslation() - const logsPaneBetaMessage = t('logs_pane_beta_message_popup') + const logsPaneInfoMessage = t('logs_pane_info_message_popup') const tooltip = ( - {logsPaneBetaMessage} + {logsPaneInfoMessage} ) return ( - {logsPaneBetaMessage} + {logsPaneInfoMessage} ) diff --git a/services/web/frontend/js/features/preview/components/preview-logs-pane.js b/services/web/frontend/js/features/preview/components/preview-logs-pane.js index 14df7b82c2..3f879cb510 100644 --- a/services/web/frontend/js/features/preview/components/preview-logs-pane.js +++ b/services/web/frontend/js/features/preview/components/preview-logs-pane.js @@ -18,6 +18,7 @@ function PreviewLogsPane({ isClearingCache, isCompiling = false, autoCompileHasLintingError = false, + variantWithFirstErrorPopup, onLogEntryLocationClick, onClearCache }) { @@ -113,7 +114,9 @@ function PreviewLogsPane({ return (
- + {autoCompileHasLintingError ? : null} {errors ? errorsUI : null} {validationIssues ? validationIssuesUI : null} @@ -141,28 +144,31 @@ function AutoCompileLintingErrorEntry() { ) } -function LogsPaneBetaNotice() { +function LogsPaneInfoNotice({ variantWithFirstErrorPopup }) { const { t } = useTranslation() - const [dismissedBetaNotice, setDismissedBetaNotice] = usePersistedState( - `logs_pane.dismissed_beta_notice`, + const [dismissedInfoNotice, setDismissedInfoNotice] = usePersistedState( + `logs_pane.dismissed_info_notice`, false ) + const surveyLink = variantWithFirstErrorPopup + ? 'https://forms.gle/AUbDDRvroQ7KFwHR9' + : 'https://forms.gle/bRxevtGzBHRk8BKw8' function handleDismissButtonClick() { - setDismissedBetaNotice(true) + setDismissedInfoNotice(true) } - return dismissedBetaNotice ? null : ( + return dismissedInfoNotice ? null : (
- +

- {t('logs_pane_beta_message')} + {t('logs_pane_info_message')}

) : null} diff --git a/services/web/frontend/js/ide/pdf/controllers/PdfController.js b/services/web/frontend/js/ide/pdf/controllers/PdfController.js index 1a4e6b01fb..ffe6617ea7 100644 --- a/services/web/frontend/js/ide/pdf/controllers/PdfController.js +++ b/services/web/frontend/js/ide/pdf/controllers/PdfController.js @@ -213,7 +213,6 @@ App.controller('PdfController', function( } function onDocChanged() { - $scope.autoCompileLintingError = false _updateDocLastChangedAt() } @@ -237,6 +236,7 @@ App.controller('PdfController', function( $scope.$watch('autocompile_enabled', (newValue, oldValue) => { if (newValue != null && oldValue !== newValue) { if (newValue === true) { + $scope.autoCompileLintingError = false autoCompileIfReady() } localStorage(`autocompile_enabled:${$scope.project_id}`, newValue) @@ -534,7 +534,6 @@ App.controller('PdfController', function( function fetchLogs(fileByPath, options) { let blgFile, chktexFile, logFile - $scope.pdf.logEntries = {} if (options != null ? options.validation : undefined) { chktexFile = fileByPath['output.chktex'] @@ -702,21 +701,19 @@ App.controller('PdfController', function( function sendCompileMetrics() { const hasCompiled = $scope.pdf.view !== 'errors' && $scope.pdf.view !== 'validation-problems' - const sendMetricsForUser = - window.user.betaProgram && !window.user.alphaProgram - if (hasCompiled && sendMetricsForUser) { + if (hasCompiled && !window.user.alphaProgram) { const metadata = { errors: $scope.pdf.logEntries.errors.length, warnings: $scope.pdf.logEntries.warnings.length, typesetting: $scope.pdf.logEntries.typesetting.length, newLogsUI: window.showNewLogsUI, - subvariant: window.logsUISubvariant || null + subvariant: window.showNewLogsUI ? window.logsUISubvariant : null } eventTracking.sendMBSampled( 'compile-result', JSON.stringify(metadata), - 0.05 + 0.01 ) } } diff --git a/services/web/frontend/stylesheets/components/beta-badges.less b/services/web/frontend/stylesheets/components/beta-badges.less index 71c18233f2..f3b2578828 100644 --- a/services/web/frontend/stylesheets/components/beta-badges.less +++ b/services/web/frontend/stylesheets/components/beta-badges.less @@ -25,6 +25,11 @@ } } +.info-badge-fade-bg { + .info-badge; + background-color: rgba(0, 0, 0, 0.25); +} + .beta-badge { background-color: @orange; border-radius: @border-radius-base; diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 4d79e8207b..511b878480 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -1,11 +1,11 @@ { + "logs_pane_info_message": "We are testing a new logs pane", + "logs_pane_info_message_popup": "We are testing a new logs pane. Click here to give feedback.", "github_symlink_error": "Your Github repository contains symbolic link files, which are not currently supported by Overleaf. Please remove these and try again.", "address_line_1": "Address", "address_line_2": "Address (line 2, optional)", "postal_code": "Postal Code", "reload_editor": "Reload editor", - "logs_pane_beta_message": "We are beta testing a new logs pane", - "logs_pane_beta_message_popup": "We are beta testing a new logs pane. Click here to give feedback and manage your beta program membership.", "compile_error_description": "This project did not compile because of an error", "validation_issue_description": "This project did not compile because of a validation issue", "compile_error_entry_description": "An error which prevented this project from compiling", @@ -1374,4 +1374,4 @@ "your_affiliation_is_confirmed": "Your <0>__institutionName__ affiliation is confirmed.", "thank_you": "Thank you!", "add_email": "Add Email" -} +} \ No newline at end of file