diff --git a/services/web/frontend/js/features/history/components/change-list/all-history-list.tsx b/services/web/frontend/js/features/history/components/change-list/all-history-list.tsx
index c2ce26dfdf..15ab7c08ca 100644
--- a/services/web/frontend/js/features/history/components/change-list/all-history-list.tsx
+++ b/services/web/frontend/js/features/history/components/change-list/all-history-list.tsx
@@ -3,14 +3,17 @@ import HistoryVersion from './history-version'
import LoadingSpinner from '../../../../shared/components/loading-spinner'
import { OwnerPaywallPrompt } from './owner-paywall-prompt'
import { NonOwnerPaywallPrompt } from './non-owner-paywall-prompt'
-import {
- isVersionSelected,
- ItemSelectionState,
-} from '../../utils/history-details'
+import { isVersionSelected } from '../../utils/history-details'
import { useUserContext } from '../../../../shared/context/user-context'
import useDropdownActiveItem from '../../hooks/use-dropdown-active-item'
import { useHistoryContext } from '../../context/history-context'
import { useEditorContext } from '../../../../shared/context/editor-context'
+import { Overlay, Popover } from 'react-bootstrap'
+import Close from '@/shared/components/close'
+import { Trans, useTranslation } from 'react-i18next'
+import MaterialIcon from '@/shared/components/material-icon'
+import useAsync from '@/shared/hooks/use-async'
+import { completeHistoryTutorial } from '../../services/api'
type CompletedTutorials = {
'react-history-buttons-tutorial': Date
@@ -20,11 +23,6 @@ type EditorTutorials = {
setCompletedTutorial: (key: string) => void
}
-const unselectedStates: ItemSelectionState[] = [
- 'aboveSelected',
- 'belowSelected',
-]
-
function AllHistoryList() {
const { id: currentUserId } = useUserContext()
const {
@@ -104,25 +102,113 @@ function AllHistoryList() {
const { completedTutorials, setCompletedTutorial }: EditorTutorials =
useEditorContext()
- // only show tutorial popover if they havent dismissed ("completed") it yet
+ // only show tutorial popover if they haven't dismissed ("completed") it yet
const showTutorial = !completedTutorials?.['react-history-buttons-tutorial']
const completeTutorial = useCallback(() => {
setCompletedTutorial('react-history-buttons-tutorial')
}, [setCompletedTutorial])
- // only show tutorial popover on the first icon
- const firstUnselectedIndex = visibleUpdates.findIndex(update => {
- const selectionState = isVersionSelected(
- selection,
- update.fromV,
- update.toV
+ const { runAsync } = useAsync()
+
+ const { t } = useTranslation()
+
+ // wait for the layout to settle before showing popover, to avoid a flash/ instant move
+ const [layoutSettled, setLayoutSettled] = useState(false)
+ const [resizing, setResizing] = useState(false)
+
+ // When there is a paywall and only two version's to compare,
+ // they are not comparable because the one that has a paywall will not have the compare button
+ // so we should not display on-boarding popover in that case
+ const isPaywallAndNonComparable =
+ visibleUpdates.length === 2 && updatesInfo.freeHistoryLimitHit
+
+ const isMoreThanOneVersion = visibleUpdates.length > 1
+ let popover = null
+
+ if (
+ isMoreThanOneVersion &&
+ !isPaywallAndNonComparable &&
+ showTutorial &&
+ layoutSettled &&
+ !resizing
+ ) {
+ const dismissModal = () => {
+ completeTutorial()
+ runAsync(completeHistoryTutorial()).catch(console.error)
+ }
+
+ popover = (
+