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
This commit is contained in:
Paulo Jorge Reis 2021-04-12 10:23:25 +01:00 committed by Copybot
parent 04fa863f9f
commit 98e631a9c7
7 changed files with 42 additions and 28 deletions

View file

@ -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": "",

View file

@ -26,7 +26,7 @@ function PreviewFirstErrorPopUp({
>
<PreviewLogsPaneEntry
headerTitle={logEntry.message}
headerIcon={<FirstErrorPopUpBetaBadge />}
headerIcon={<FirstErrorPopUpInfoBadge />}
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 = (
<Tooltip id="file-tree-badge-tooltip">{logsPaneBetaMessage}</Tooltip>
<Tooltip id="file-tree-badge-tooltip">{logsPaneInfoMessage}</Tooltip>
)
return (
<OverlayTrigger placement="bottom" overlay={tooltip} delayHide={100}>
<a
href="/beta/participate"
href="https://forms.gle/AUbDDRvroQ7KFwHR9"
target="_blank"
rel="noopener noreferrer"
className="beta-badge"
className="info-badge-fade-bg"
>
<span className="sr-only">{logsPaneBetaMessage}</span>
<span className="sr-only">{logsPaneInfoMessage}</span>
</a>
</OverlayTrigger>
)

View file

@ -18,6 +18,7 @@ function PreviewLogsPane({
isClearingCache,
isCompiling = false,
autoCompileHasLintingError = false,
variantWithFirstErrorPopup,
onLogEntryLocationClick,
onClearCache
}) {
@ -113,7 +114,9 @@ function PreviewLogsPane({
return (
<div className="logs-pane">
<div className="logs-pane-content">
<LogsPaneBetaNotice />
<LogsPaneInfoNotice
variantWithFirstErrorPopup={variantWithFirstErrorPopup}
/>
{autoCompileHasLintingError ? <AutoCompileLintingErrorEntry /> : 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 : (
<div className="log-entry">
<div className="log-entry-header log-entry-header-raw">
<div className="log-entry-header-icon-container">
<span className="beta-badge" />
<span className="info-badge" />
</div>
<h3 className="log-entry-header-title">
{t('logs_pane_beta_message')}
{t('logs_pane_info_message')}
</h3>
<a
href="/beta/participate"
href={surveyLink}
target="_blank"
rel="noopener noreferrer"
className="log-entry-header-link log-entry-header-link-raw"
@ -184,6 +190,10 @@ function LogsPaneBetaNotice() {
)
}
LogsPaneInfoNotice.propTypes = {
variantWithFirstErrorPopup: PropTypes.bool
}
PreviewLogsPane.propTypes = {
logEntries: PropTypes.shape({
all: PropTypes.array,
@ -196,6 +206,7 @@ PreviewLogsPane.propTypes = {
outputFiles: PropTypes.array,
isClearingCache: PropTypes.bool,
isCompiling: PropTypes.bool,
variantWithFirstErrorPopup: PropTypes.bool,
onLogEntryLocationClick: PropTypes.func.isRequired,
onClearCache: PropTypes.func.isRequired,
validationIssues: PropTypes.object,

View file

@ -133,6 +133,7 @@ function PreviewPane({
onLogEntryLocationClick={onLogEntryLocationClick}
isClearingCache={compilerState.isClearingCache}
isCompiling={compilerState.isCompiling}
variantWithFirstErrorPopup={variantWithFirstErrorPopup}
onClearCache={onClearCache}
/>
) : null}

View file

@ -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
)
}
}

View file

@ -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;

View file

@ -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__</0> affiliation is confirmed.",
"thank_you": "Thank you!",
"add_email": "Add Email"
}
}