Merge pull request #31329 from overleaf/mj-dark-mode-notification

[web] Introduce notification for dashboard dark mode

GitOrigin-RevId: da5045d412ddc87a4b18823a4a5fa3192fe15c89
This commit is contained in:
Mathias Jakobsen
2026-02-12 09:05:36 +00:00
committed by Copybot
parent 55c3b6b7ea
commit 498c89c6ed
20 changed files with 369 additions and 89 deletions
@@ -4,6 +4,7 @@ import { EditorProviders } from '../../helpers/editor-providers'
import { EditorView } from '@codemirror/view'
import type { FC, PropsWithChildren } from 'react'
import { EditorViewContext } from '@/features/ide-react/context/editor-view-context'
import { TutorialProvider } from '@/shared/context/tutorial-context'
describe('Workbench', { scrollBehavior: false }, function () {
beforeEach(function () {
@@ -34,7 +35,7 @@ describe('Workbench', { scrollBehavior: false }, function () {
return (
<EditorProviders
features={{ aiErrorAssistant: aiAssistEnabled }}
providers={{ EditorViewProvider }}
providers={{ EditorViewProvider, TutorialProvider }}
>
<div style={{ backgroundColor: '#1b222c' }}>{children}</div>
</EditorProviders>
@@ -55,6 +55,7 @@ import { DetachCompileContext } from '@/shared/context/detach-compile-context'
import { type CompileContext } from '@/shared/context/local-compile-context'
import { EditorContext } from '@/shared/context/editor-context'
import { Cobranding } from '@ol-types/cobranding'
import { TutorialContext } from '@/shared/context/tutorial-context'
// these constants can be imported in tests instead of
// using magic strings
@@ -248,6 +249,7 @@ export function EditorProviders({
LayoutProvider: makeLayoutProvider(layoutContext),
ProjectProvider: makeProjectProvider(project),
ReferencesProvider: makeReferencesProvider(),
TutorialProvider: makeTutorialProvider(),
...providers,
}
@@ -284,10 +286,6 @@ export function makeEditorProvider({
isProjectOwner,
renameProject,
isPendingEditor: false,
deactivateTutorial: () => {},
inactiveTutorials: [],
currentPopup: null,
setCurrentPopup: () => {},
hasPremiumSuggestion: false,
setHasPremiumSuggestion: () => {},
premiumSuggestionResetDate: new Date(),
@@ -307,6 +305,25 @@ export function makeEditorProvider({
return EditorProvider
}
export const makeTutorialProvider = (opts?: {
inactiveTutorials: string[]
}) => {
const TutorialProvider: FC<PropsWithChildren> = ({ children }) => {
const value = {
deactivateTutorial: () => {},
inactiveTutorials: opts?.inactiveTutorials ?? [],
currentPopup: null,
setCurrentPopup: () => {},
}
return (
<TutorialContext.Provider value={value}>
{children}
</TutorialContext.Provider>
)
}
return TutorialProvider
}
const makeReferencesProvider = () => {
const ReferencesProvider: FC<PropsWithChildren> = ({ children }) => {
return (