diff --git a/client/web/src/codeintel/ReferencesPanel.mocks.ts b/client/web/src/codeintel/ReferencesPanel.mocks.ts index 1a019ef6ee00..e67a5666180e 100644 --- a/client/web/src/codeintel/ReferencesPanel.mocks.ts +++ b/client/web/src/codeintel/ReferencesPanel.mocks.ts @@ -321,7 +321,13 @@ export const defaultProps: ReferencesPanelProps = { telemetryService: NOOP_TELEMETRY_SERVICE, settingsCascade: { subjects: null, - final: null, + final: { + // TODO: we won't need to set experimental features explicitly once we cover CodeMirror side blob view with tests: + // https://github.com/sourcegraph/sourcegraph/issues/48049 + experimentalFeatures: { + enableCodeMirrorFileView: false, + }, + }, }, platformContext: NOOP_PLATFORM_CONTEXT as any, isLightTheme: false, diff --git a/client/web/src/codeintel/ReferencesPanel.test.tsx b/client/web/src/codeintel/ReferencesPanel.test.tsx index 1014d421319b..91eb8a9ac103 100644 --- a/client/web/src/codeintel/ReferencesPanel.test.tsx +++ b/client/web/src/codeintel/ReferencesPanel.test.tsx @@ -4,6 +4,8 @@ import { MockedTestProvider, waitForNextApolloResponse } from '@sourcegraph/shar import '@sourcegraph/shared/dev/mockReactVisibilitySensor' import { renderWithBrandedContext } from '@sourcegraph/wildcard/src/testing' +import { setExperimentalFeaturesFromSettings } from '../stores' + import { ReferencesPanel } from './ReferencesPanel' import { buildReferencePanelMocks, defaultProps } from './ReferencesPanel.mocks' @@ -11,6 +13,10 @@ describe('ReferencesPanel', () => { async function renderReferencesPanel() { const { url, requestMocks } = buildReferencePanelMocks() + // TODO: we won't need to set experimental features explicitly once we cover CodeMirror side blob view with tests: + // https://github.com/sourcegraph/sourcegraph/issues/48049 + setExperimentalFeaturesFromSettings(defaultProps.settingsCascade) + const result = renderWithBrandedContext( diff --git a/client/web/src/codeintel/ReferencesPanel.tsx b/client/web/src/codeintel/ReferencesPanel.tsx index b459709ecd39..f3fbe4bf11fc 100644 --- a/client/web/src/codeintel/ReferencesPanel.tsx +++ b/client/web/src/codeintel/ReferencesPanel.tsx @@ -695,7 +695,7 @@ function parseSideBlobProps( } const SideBlob: React.FunctionComponent> = props => { - const useCodeMirror = useExperimentalFeatures(features => features.enableCodeMirrorFileView ?? false) + const useCodeMirror = useExperimentalFeatures(features => features.enableCodeMirrorFileView ?? true) const BlobComponent = useCodeMirror ? CodeMirrorBlob : LegacyBlob const highlightFormat = useCodeMirror ? HighlightResponseFormat.JSON_SCIP : HighlightResponseFormat.HTML_HIGHLIGHT diff --git a/client/web/src/repo/blob/backend.ts b/client/web/src/repo/blob/backend.ts index c55a3455c4d5..591f0dfc420a 100644 --- a/client/web/src/repo/blob/backend.ts +++ b/client/web/src/repo/blob/backend.ts @@ -120,7 +120,7 @@ export const fetchBlob = memoizeObservable((options: FetchBlobOptions): Observab * Note: This format should match the format used when the blob is 'normally' fetched. E.g. in `BlobPage.tsx`. */ export const usePrefetchBlobFormat = (): HighlightResponseFormat => { - const enableCodeMirror = useExperimentalFeatures(features => features.enableCodeMirrorFileView ?? false) + const enableCodeMirror = useExperimentalFeatures(features => features.enableCodeMirrorFileView ?? true) const enableLazyHighlighting = useExperimentalFeatures( features => features.enableLazyBlobSyntaxHighlighting ?? false )