[WEB] Move Review Toggle into the toolbar (#34066)

* move Review Toggle into the toolbar

* cleaning up and adding a comment

* adding the cursor styling

* adding isolation on writefull toolbar to adjust z-index of writefull toolbar

* fixing the dark mode colours for review dropdown trigger

* Fix review mode switcher dark mode styles

GitOrigin-RevId: 36847e0debdc4dce5f96492261d25e7cc46b2e96
This commit is contained in:
Davinder Singh
2026-06-02 08:06:34 +00:00
committed by Copybot
parent ac83bc520c
commit e0f542a241
5 changed files with 103 additions and 97 deletions
@@ -18,6 +18,7 @@ import useDropdown from '../../../shared/hooks/use-dropdown'
import { getPanel } from '@codemirror/view'
import { createToolbarPanel } from '../extensions/toolbar/toolbar-panel'
import EditorSwitch from './editor-switch'
import ReviewModeSwitcher from '@/features/review-panel/components/review-mode-switcher'
import SwitchToPDFButton from './switch-to-pdf-button'
import { DetacherSynctexControl } from '../../pdf-preview/components/detach-synctex-control'
import DetachCompileButtonWrapper from '../../pdf-preview/components/detach-compile-button-wrapper'
@@ -33,6 +34,7 @@ import Breadcrumbs from '@/features/source-editor/extensions/breadcrumbs'
import classNames from 'classnames'
import { useUserSettingsContext } from '@/shared/context/user-settings-context'
import { useFeatureFlag } from '@/shared/context/split-test-context'
import { useProjectContext } from '@/shared/context/project-context'
import importOverleafModules from '../../../../macros/import-overleaf-module.macro'
const sourceEditorToolbarComponents = importOverleafModules(
@@ -62,6 +64,7 @@ const Toolbar = memo(function Toolbar() {
userSettings: { breadcrumbs },
} = useUserSettingsContext()
const visualPreviewEnabled = useFeatureFlag('visual-preview')
const { features } = useProjectContext()
const [overflowed, setOverflowed] = useState(false)
@@ -206,6 +209,7 @@ const Toolbar = memo(function Toolbar() {
ref={handleButtons}
>
{!visualPreviewEnabled && <EditorSwitch />}
{features.trackChangesVisible && <ReviewModeSwitcher />}
{sourceEditorToolbarEndButtons.map(
({ import: { default: Component }, path }) => (
<Component key={path} />