GrafanaUI: Add noBackdropBlur feature toggle (#102128)

* Create new noBackdropBlur feature toggle

* Disable backdrop blur with feature toggle
This commit is contained in:
Josh Hunt
2025-03-14 15:21:35 +00:00
committed by GitHub
parent b3452ae720
commit bf172dfd29
9 changed files with 62 additions and 3 deletions
@@ -258,4 +258,5 @@ export interface FeatureToggles {
infinityRunQueriesInParallel?: boolean; infinityRunQueriesInParallel?: boolean;
inviteUserExperimental?: boolean; inviteUserExperimental?: boolean;
extraLanguages?: boolean; extraLanguages?: boolean;
noBackdropBlur?: boolean;
} }
@@ -14,6 +14,7 @@ import { getExtraStyles } from './extra';
import { getFilterTableStyles } from './filterTable'; import { getFilterTableStyles } from './filterTable';
import { getFontStyles } from './fonts'; import { getFontStyles } from './fonts';
import { getFormElementStyles } from './forms'; import { getFormElementStyles } from './forms';
import { getHacksStyles } from './hacks';
import { getJsonFormatterStyles } from './jsonFormatter'; import { getJsonFormatterStyles } from './jsonFormatter';
import { getLegacySelectStyles } from './legacySelect'; import { getLegacySelectStyles } from './legacySelect';
import { getMarkdownStyles } from './markdownStyles'; import { getMarkdownStyles } from './markdownStyles';
@@ -24,9 +25,14 @@ import { getSlateStyles } from './slate';
import { getUplotStyles } from './uPlot'; import { getUplotStyles } from './uPlot';
import { getUtilityClassStyles } from './utilityClasses'; import { getUtilityClassStyles } from './utilityClasses';
interface GlobalStylesProps {
hackNoBackdropBlur?: boolean;
}
/** @internal */ /** @internal */
export function GlobalStyles() { export function GlobalStyles(props: GlobalStylesProps) {
const theme = useTheme2(); const theme = useTheme2();
const { hackNoBackdropBlur } = props;
return ( return (
<Global <Global
@@ -52,6 +58,7 @@ export function GlobalStyles() {
getUplotStyles(theme), getUplotStyles(theme),
getUtilityClassStyles(theme), getUtilityClassStyles(theme),
getLegacySelectStyles(theme), getLegacySelectStyles(theme),
getHacksStyles({ hackNoBackdropBlur }),
]} ]}
/> />
); );
@@ -0,0 +1,21 @@
import { css } from '@emotion/react';
export interface Hacks {
hackNoBackdropBlur?: boolean;
}
export function getHacksStyles(hacks: Hacks) {
return css([
/**
* Disables all backdrop blur effects to improve performance on extremely
* resource constrained devices.
*
* Controlled via the `noBackdropBlur` feature toggle in Grafana
*/
hacks.hackNoBackdropBlur && {
'*, *:before, *:after': {
backdropFilter: 'none !important',
},
},
]);
}
+9
View File
@@ -1811,6 +1811,15 @@ var (
Owner: grafanaFrontendPlatformSquad, Owner: grafanaFrontendPlatformSquad,
FrontendOnly: true, FrontendOnly: true,
}, },
{
Name: "noBackdropBlur",
Description: "Disables backdrop blur",
Stage: FeatureStageExperimental,
Owner: grafanaFrontendPlatformSquad,
HideFromAdminPage: true,
HideFromDocs: true,
FrontendOnly: true,
},
} }
) )
+1
View File
@@ -239,3 +239,4 @@ grafanaManagedRecordingRulesDatasources,experimental,@grafana/alerting-squad,fal
infinityRunQueriesInParallel,privatePreview,@grafana/oss-big-tent,false,false,false infinityRunQueriesInParallel,privatePreview,@grafana/oss-big-tent,false,false,false
inviteUserExperimental,experimental,@grafana/sharing-squad,false,false,true inviteUserExperimental,experimental,@grafana/sharing-squad,false,false,true
extraLanguages,experimental,@grafana/grafana-frontend-platform,false,false,true extraLanguages,experimental,@grafana/grafana-frontend-platform,false,false,true
noBackdropBlur,experimental,@grafana/grafana-frontend-platform,false,false,true
1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
239 infinityRunQueriesInParallel privatePreview @grafana/oss-big-tent false false false
240 inviteUserExperimental experimental @grafana/sharing-squad false false true
241 extraLanguages experimental @grafana/grafana-frontend-platform false false true
242 noBackdropBlur experimental @grafana/grafana-frontend-platform false false true
+4
View File
@@ -966,4 +966,8 @@ const (
// FlagExtraLanguages // FlagExtraLanguages
// Enables additional languages // Enables additional languages
FlagExtraLanguages = "extraLanguages" FlagExtraLanguages = "extraLanguages"
// FlagNoBackdropBlur
// Disables backdrop blur
FlagNoBackdropBlur = "noBackdropBlur"
) )
+15
View File
@@ -2913,6 +2913,21 @@
"hideFromDocs": true "hideFromDocs": true
} }
}, },
{
"metadata": {
"name": "noBackdropBlur",
"resourceVersion": "1741879106163",
"creationTimestamp": "2025-03-13T15:18:26Z"
},
"spec": {
"description": "Disables backdrop blur",
"stage": "experimental",
"codeowner": "@grafana/grafana-frontend-platform",
"frontend": true,
"hideFromAdminPage": true,
"hideFromDocs": true
}
},
{ {
"metadata": { "metadata": {
"name": "nodeGraphDotLayout", "name": "nodeGraphDotLayout",
+1 -1
View File
@@ -121,7 +121,7 @@ export class AppWrapper extends Component<AppWrapperProps, AppWrapperState> {
actions={[]} actions={[]}
options={{ enableHistory: true, callbacks: { onSelectAction: commandPaletteActionSelected } }} options={{ enableHistory: true, callbacks: { onSelectAction: commandPaletteActionSelected } }}
> >
<GlobalStyles /> <GlobalStyles hackNoBackdropBlur={config.featureToggles.noBackdropBlur} />
<MaybeTimeRangeProvider> <MaybeTimeRangeProvider>
<SidecarContext_EXPERIMENTAL.Provider value={sidecarServiceSingleton_EXPERIMENTAL}> <SidecarContext_EXPERIMENTAL.Provider value={sidecarServiceSingleton_EXPERIMENTAL}>
<ScopesContextProvider> <ScopesContextProvider>
+2 -1
View File
@@ -6,6 +6,7 @@ import { CompatRouter } from 'react-router-dom-v5-compat';
import { GrafanaTheme2 } from '@grafana/data/'; import { GrafanaTheme2 } from '@grafana/data/';
import { import {
config,
locationService, locationService,
LocationServiceProvider, LocationServiceProvider,
useChromeHeaderHeight, useChromeHeaderHeight,
@@ -114,7 +115,7 @@ export function ExperimentalSplitPaneRouterWrapper(props: RouterWrapperProps) {
<Router history={locationService.getHistory()}> <Router history={locationService.getHistory()}>
<LocationServiceProvider service={locationService}> <LocationServiceProvider service={locationService}>
<CompatRouter> <CompatRouter>
<GlobalStyles /> <GlobalStyles hackNoBackdropBlur={config.featureToggles.noBackdropBlur} />
<div className={styles.secondAppChrome}> <div className={styles.secondAppChrome}>
<div className={styles.secondAppToolbar}> <div className={styles.secondAppToolbar}>
<IconButton <IconButton