[web] Recreate workbench with Overleaf styles (#29651)

GitOrigin-RevId: 52ca336f70b29edf6e39cf95aa164f3ae32c0a79
This commit is contained in:
Mathias Jakobsen
2025-11-19 09:05:14 +00:00
committed by Copybot
parent b1009d3b1f
commit 7b331b0222
16 changed files with 460 additions and 3743 deletions
@@ -60,6 +60,7 @@ import { useEditorPropertiesContext } from '@/features/ide-react/context/editor-
import { SearchQuery } from '@codemirror/search'
import { beforeChangeDocEffect } from '@/features/source-editor/extensions/before-change-doc'
import { useActiveOverallTheme } from '@/shared/hooks/use-active-overall-theme'
import { useEditorSelectionContext } from '@/shared/context/editor-selection-context'
function useCodeMirrorScope(view: EditorView) {
const { fileTreeData } = useFileTreeData()
@@ -106,6 +107,8 @@ function useCodeMirrorScope(view: EditorView) {
const { referenceKeys, searchLocalReferences } = useReferencesContext()
const { setEditorSelection } = useEditorSelectionContext()
const ranges = useRangesContext()
const threads = useThreadsContext()
@@ -335,6 +338,7 @@ function useCodeMirrorScope(view: EditorView) {
initialSearchQuery: searchQueryRef.current,
showBoundary,
handleException,
setEditorSelection,
}),
})
view.setState(state)
@@ -364,7 +368,7 @@ function useCodeMirrorScope(view: EditorView) {
}
// IMPORTANT: This effect must not depend on anything variable apart from currentDocument,
// as the editor state is recreated when the effect runs.
}, [view, currentDocument, showBoundary, handleException])
}, [view, currentDocument, showBoundary, handleException, setEditorSelection])
useEffect(() => {
if (openDocName) {