Remove editor split tests (#14985)
* Remove source-editor-toolbar split test * Remove editor-left-menu split test * Remove paste-html split test * Remove figure-modal split test * Remove rich-text split test * Remove table-generator split test GitOrigin-RevId: e3fe415b81ff0135d8764cd3f3c91b1dd4a77cf0
This commit is contained in:
@@ -5,7 +5,6 @@ import { sendMB } from '../../../infrastructure/event-tracking'
|
||||
import getMeta from '../../../utils/meta'
|
||||
import isValidTeXFile from '../../../main/is-valid-tex-file'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import SplitTestBadge from '../../../shared/components/split-test-badge'
|
||||
|
||||
function Badge() {
|
||||
const content = (
|
||||
@@ -125,10 +124,6 @@ function EditorSwitch() {
|
||||
handleChange={handleChange}
|
||||
/>
|
||||
</fieldset>
|
||||
|
||||
{!!richTextOrVisual && (
|
||||
<SplitTestBadge splitTestName="rich-text" displayOnVariants={['cm6']} />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import Tooltip from '../../../shared/components/tooltip'
|
||||
import { sendMB } from '../../../infrastructure/event-tracking'
|
||||
import isValidTeXFile from '../../../main/is-valid-tex-file'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import SplitTestBadge from '../../../shared/components/split-test-badge'
|
||||
import { PromotionOverlay } from './table-generator/promotion/popover'
|
||||
import { FeedbackBadge } from '@/shared/components/feedback-badge'
|
||||
|
||||
function EditorSwitch() {
|
||||
const { t } = useTranslation()
|
||||
@@ -71,12 +71,24 @@ function EditorSwitch() {
|
||||
</fieldset>
|
||||
|
||||
{!!richTextOrVisual && (
|
||||
<SplitTestBadge splitTestName="rich-text" displayOnVariants={['cm6']} />
|
||||
<FeedbackBadge
|
||||
id="visual-editor-feedback"
|
||||
url="https://forms.gle/AUqHmKNiEH3DRniPA"
|
||||
text={<VisualEditorFeedbackContent />}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const VisualEditorFeedbackContent = () => (
|
||||
<>
|
||||
We have a new Visual Editor!
|
||||
<br />
|
||||
Click to give feedback
|
||||
</>
|
||||
)
|
||||
|
||||
const RichTextToggle: FC<{
|
||||
checked: boolean
|
||||
disabled: boolean
|
||||
|
||||
+5
-4
@@ -11,7 +11,6 @@ import { FigureModalFooter } from './figure-modal-footer'
|
||||
import { memo, useCallback, useEffect } from 'react'
|
||||
import { useCodeMirrorViewContext } from '../codemirror-editor'
|
||||
import { ChangeSpec } from '@codemirror/state'
|
||||
import SplitTestBadge from '../../../../shared/components/split-test-badge'
|
||||
import {
|
||||
FigureData,
|
||||
PastedImageData,
|
||||
@@ -22,6 +21,7 @@ import { ensureEmptyLine } from '../../extensions/toolbar/commands'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import useEventListener from '../../../../shared/hooks/use-event-listener'
|
||||
import { prepareLines } from '../../utils/prepare-lines'
|
||||
import { FeedbackBadge } from '@/shared/components/feedback-badge'
|
||||
|
||||
export const FigureModal = memo(function FigureModal() {
|
||||
return (
|
||||
@@ -268,9 +268,10 @@ const FigureModalContent = () => {
|
||||
: sourcePickerShown
|
||||
? t('replace_figure')
|
||||
: getTitle(source)}{' '}
|
||||
<SplitTestBadge
|
||||
splitTestName="figure-modal"
|
||||
displayOnVariants={['enabled']}
|
||||
<FeedbackBadge
|
||||
id="figure-modal-feedback"
|
||||
url="https://forms.gle/PfEtwceYBNQ32DF4A"
|
||||
text="Please click to give feedback about editing figures."
|
||||
/>
|
||||
</Modal.Title>
|
||||
</Modal.Header>
|
||||
|
||||
+8
-8
@@ -12,8 +12,7 @@ import { useTranslation } from 'react-i18next'
|
||||
import { EditorView } from '@codemirror/view'
|
||||
import { PastedContent } from '../../extensions/visual/pasted-content'
|
||||
import useEventListener from '../../../../shared/hooks/use-event-listener'
|
||||
import SplitTestBadge from '../../../../shared/components/split-test-badge'
|
||||
import { useSplitTestContext } from '../../../../shared/context/split-test-context'
|
||||
import { FeedbackBadge } from '@/shared/components/feedback-badge'
|
||||
|
||||
const isMac = /Mac/.test(window.navigator?.platform)
|
||||
|
||||
@@ -30,8 +29,6 @@ export const PastedContentMenu: FC<{
|
||||
const [menuOpen, setMenuOpen] = useState(false)
|
||||
const toggleButtonRef = useRef<HTMLButtonElement | null>(null)
|
||||
const { t } = useTranslation()
|
||||
const { splitTestInfo } = useSplitTestContext()
|
||||
const feedbackURL = splitTestInfo['paste-html']?.badgeInfo?.url
|
||||
|
||||
// record whether the Shift key is currently down, for use in the `paste` event handler
|
||||
const shiftRef = useRef(false)
|
||||
@@ -138,13 +135,16 @@ export const PastedContentMenu: FC<{
|
||||
<MenuItem
|
||||
style={{ borderTop: '1px solid #eee' }}
|
||||
onClick={() => {
|
||||
window.open(feedbackURL, '_blank')
|
||||
window.open(
|
||||
'https://docs.google.com/forms/d/e/1FAIpQLSc7WcHrwz9fnCkUP5hXyvkG3LkSYZiR3lVJWZ0o6uqNQYrV7Q/viewform',
|
||||
'_blank'
|
||||
)
|
||||
setMenuOpen(false)
|
||||
}}
|
||||
>
|
||||
<SplitTestBadge
|
||||
splitTestName="paste-html"
|
||||
displayOnVariants={['enabled']}
|
||||
<FeedbackBadge
|
||||
id="paste-html-feedback"
|
||||
url="https://docs.google.com/forms/d/e/1FAIpQLSc7WcHrwz9fnCkUP5hXyvkG3LkSYZiR3lVJWZ0o6uqNQYrV7Q/viewform"
|
||||
/>
|
||||
<span className="ol-cm-pasted-content-menu-item-label">
|
||||
{t('give_feedback')}
|
||||
|
||||
+13
-4
@@ -20,8 +20,8 @@ import {
|
||||
import { useCodeMirrorViewContext } from '../../codemirror-editor'
|
||||
import { useTableContext } from '../contexts/table-context'
|
||||
import { useTabularContext } from '../contexts/tabular-context'
|
||||
import SplitTestBadge from '../../../../../shared/components/split-test-badge'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { FeedbackBadge } from '@/shared/components/feedback-badge'
|
||||
|
||||
export const Toolbar = memo(function Toolbar() {
|
||||
const { selection, setSelection } = useSelectionContext()
|
||||
@@ -359,12 +359,21 @@ export const Toolbar = memo(function Toolbar() {
|
||||
command={showHelp}
|
||||
/>
|
||||
<div className="toolbar-beta-badge">
|
||||
<SplitTestBadge
|
||||
displayOnVariants={['enabled']}
|
||||
splitTestName="table-generator"
|
||||
<FeedbackBadge
|
||||
id="table-generator-feedback"
|
||||
url="https://forms.gle/ri3fzV1oQDAjmfmD7"
|
||||
text={<FeedbackBadgeContent />}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
||||
const FeedbackBadgeContent = () => (
|
||||
<>
|
||||
We have a new way to insert and edit tables.
|
||||
<br />
|
||||
Click to give feedback
|
||||
</>
|
||||
)
|
||||
|
||||
+2
-14
@@ -36,7 +36,6 @@ export const ToolbarItems: FC<{
|
||||
const isActive = withinFormattingCommand(state)
|
||||
const addCommentEmitter = useScopeEventEmitter('comment:start_adding')
|
||||
const { setReviewPanelOpen } = useLayoutContext()
|
||||
const splitTestVariants = getMeta('ol-splitTestVariants', {})
|
||||
const addComment = useCallback(
|
||||
(view: EditorView) => {
|
||||
const range = view.state.selection.main
|
||||
@@ -52,8 +51,6 @@ export const ToolbarItems: FC<{
|
||||
[addCommentEmitter, setReviewPanelOpen]
|
||||
)
|
||||
|
||||
const showFigureModal = splitTestVariants['figure-modal'] === 'enabled'
|
||||
const showTableGenerator = splitTestVariants['table-generator'] === 'enabled'
|
||||
const symbolPaletteAvailable = getMeta('ol-symbolPaletteAvailable')
|
||||
const showGroup = (group: string) => !overflowed || overflowed.has(group)
|
||||
|
||||
@@ -157,17 +154,8 @@ export const ToolbarItems: FC<{
|
||||
icon="comment"
|
||||
hidden // enable this if an alternative to the floating "Add Comment" button is needed
|
||||
/>
|
||||
{showFigureModal ? (
|
||||
<InsertFigureDropdown />
|
||||
) : (
|
||||
<ToolbarButton
|
||||
id="toolbar-figure"
|
||||
label={t('toolbar_insert_figure')}
|
||||
command={commands.insertFigure}
|
||||
icon="picture-o"
|
||||
/>
|
||||
)}
|
||||
{showTableGenerator && <TableInserterDropdown />}
|
||||
<InsertFigureDropdown />
|
||||
<TableInserterDropdown />
|
||||
</div>
|
||||
)}
|
||||
{showGroup('group-list') && (
|
||||
|
||||
Reference in New Issue
Block a user