diff --git a/CHANGELOG.md b/CHANGELOG.md index 99a8f372..e7377ea2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ ### 🎨 Enhancements - [#522](https://github.com/estruyf/vscode-front-matter/issues/522): Configuration support added for [Astro](https://astro.build) +- [#524](https://github.com/estruyf/vscode-front-matter/issues/524): Removed the **Global settings** view from the panel. You can still get it back by configuring a [custom view mode](https://frontmatter.codes/docs/panel#view-modes). ### ⚡️ Optimizations diff --git a/src/panelWebView/ViewPanel.tsx b/src/panelWebView/ViewPanel.tsx index f3351adc..c3d50cd8 100644 --- a/src/panelWebView/ViewPanel.tsx +++ b/src/panelWebView/ViewPanel.tsx @@ -13,7 +13,7 @@ import { FeatureFlag } from '../components/features/FeatureFlag'; import { FEATURE_FLAG } from '../constants/Features'; import { GitAction } from './components/Git/GitAction'; import { CustomView } from './components/CustomView'; -import { useEffect, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; export interface IViewPanelProps { } @@ -32,6 +32,10 @@ export const ViewPanel: React.FunctionComponent = ( mode } = useMessages(); + const allPanelValues = useMemo(() => { + return Object.values(FEATURE_FLAG.panel).filter(v => v !== FEATURE_FLAG.panel.globalSettings) + }, [FEATURE_FLAG.panel]); + useEffect(() => { if (window.fmExternal && window.fmExternal.isDevelopment) { setIsDevMode(true); @@ -80,7 +84,7 @@ export const ViewPanel: React.FunctionComponent = ( - + diff --git a/src/panelWebView/components/BaseView.tsx b/src/panelWebView/components/BaseView.tsx index 2158fa9e..c0e95939 100644 --- a/src/panelWebView/components/BaseView.tsx +++ b/src/panelWebView/components/BaseView.tsx @@ -11,6 +11,7 @@ import { FeatureFlag } from '../../components/features/FeatureFlag'; import { FEATURE_FLAG } from '../../constants/Features'; import { Messenger } from '@estruyf/vscode/dist/client'; import { GitAction } from './Git/GitAction'; +import { useMemo } from 'react'; export interface IBaseViewProps { settings: PanelSettings | undefined; @@ -50,6 +51,10 @@ const BaseView: React.FunctionComponent = ({ (s) => s.bulk && (s.type === 'content' || !s.type) ); + const allPanelValues = useMemo(() => { + return Object.values(FEATURE_FLAG.panel).filter(v => v !== FEATURE_FLAG.panel.globalSettings) + }, [FEATURE_FLAG.panel]); + return (
@@ -63,7 +68,7 @@ const BaseView: React.FunctionComponent = ({ <> - +