diff options
| author | AAGaming <aagaming@riseup.net> | 2026-11-21 22:23:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-21 22:23:03 -0500 |
| commit | 24082fe63cdcdf41993f9e1430d1405152a2c930 (patch) | |
| tree | 59454b25fc5cffcbce82e7947d8e3803952fc5ba /frontend/src/components | |
| parent | ffd103b9c1a4ce5bf305e7c0998eda6e05457dad (diff) | |
| download | decky-loader-4.0.0-pre1.tar.gz decky-loader-4.0.0-pre1.zip | |
feat: Support new Steam Betas (only) and Frame (#1019)v4.0.0-pre1
Diffstat (limited to 'frontend/src/components')
| -rw-r--r-- | frontend/src/components/NotificationBadge.tsx | 55 | ||||
| -rw-r--r-- | frontend/src/components/PluginView.tsx | 40 | ||||
| -rw-r--r-- | frontend/src/components/QuickAccessVisibleState.tsx | 17 | ||||
| -rw-r--r-- | frontend/src/components/Toast.tsx | 47 | ||||
| -rw-r--r-- | frontend/src/components/settings/pages/developer/index.tsx | 33 | ||||
| -rw-r--r-- | frontend/src/components/settings/pages/general/index.tsx | 3 | ||||
| -rw-r--r-- | frontend/src/components/store/Store.tsx | 8 |
7 files changed, 129 insertions, 74 deletions
diff --git a/frontend/src/components/NotificationBadge.tsx b/frontend/src/components/NotificationBadge.tsx index 3c5d8215..1d14d576 100644 --- a/frontend/src/components/NotificationBadge.tsx +++ b/frontend/src/components/NotificationBadge.tsx @@ -2,23 +2,52 @@ import { CSSProperties, FunctionComponent } from 'react'; interface NotificationBadgeProps { show?: boolean; + vr?: boolean; style?: CSSProperties; } -const NotificationBadge: FunctionComponent<NotificationBadgeProps> = ({ show, style }) => { +const NotificationBadge: FunctionComponent<NotificationBadgeProps> = ({ show, style, vr }) => { return show ? ( - <div - style={{ - position: 'absolute', - top: '8px', - right: '8px', - height: '10px', - width: '10px', - background: 'orange', - borderRadius: '50%', - ...style, - }} - /> + vr ? ( + // whoever made transform:scale completely break absolute positioning goes straight to super turbo hell this took me an hour + <div + style={{ + top: 0, + left: 0, + marginLeft: 'auto', + width: 0, + height: 0, + overflow: 'visible', + transform: 'translate(0px, 0px)', + }} + > + <div + style={{ + position: 'fixed', + top: '-18px', + right: '-6px', + width: '10px', + height: '10px', + background: 'orange', + borderRadius: '50%', + ...style, + }} + /> + </div> + ) : ( + <div + style={{ + position: 'absolute', + top: '8px', + right: '8px', + height: '10px', + width: '10px', + background: 'orange', + borderRadius: '50%', + ...style, + }} + /> + ) ) : null; }; diff --git a/frontend/src/components/PluginView.tsx b/frontend/src/components/PluginView.tsx index fbafaf05..27c1f2f1 100644 --- a/frontend/src/components/PluginView.tsx +++ b/frontend/src/components/PluginView.tsx @@ -1,4 +1,12 @@ -import { ButtonItem, ErrorBoundary, Focusable, PanelSection, PanelSectionRow } from '@decky/ui'; +import { + ButtonItem, + ErrorBoundary, + Focusable, + PanelSection, + PanelSectionRow, + joinClassNames, + vrDashboardClasses, +} from '@decky/ui'; import { FC, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { FaBan, FaEyeSlash } from 'react-icons/fa'; @@ -8,7 +16,7 @@ import NotificationBadge from './NotificationBadge'; import { useQuickAccessVisible } from './QuickAccessVisibleState'; import TitleView from './TitleView'; -const PluginView: FC = () => { +const PluginView: FC<{ vr?: boolean }> = ({ vr }) => { const { plugins, disabledPlugins, @@ -40,20 +48,38 @@ const PluginView: FC = () => { if (activePlugin) { return ( - <Focusable onCancelButton={closeActivePlugin}> + <Focusable + onCancelButton={closeActivePlugin} + className={ + (vr && joinClassNames(vrDashboardClasses.QuickAccessPopupPanel, vrDashboardClasses.BottomFade)) || '' + } + style={{ + display: 'flex', + flexDirection: 'column', + paddingBottom: '20px', // override bottomfade, there is prolly a better way + }} + > <TitleView /> - <div style={{ height: '100%', paddingTop: '16px' }}> + <div style={{ paddingTop: '16px', overflowY: vr ? 'auto' : undefined }}> <ErrorBoundary>{(visible || activePlugin.alwaysRender) && activePlugin.content}</ErrorBoundary> </div> </Focusable> ); } return ( - <> + <div + className={(vr && joinClassNames(vrDashboardClasses.QuickAccessPopupPanel, vrDashboardClasses.BottomFade)) || ''} + style={{ + display: 'flex', + flexDirection: 'column', + paddingBottom: '20px', // override bottomfade, there is prolly a better way + }} + > <TitleView /> <div style={{ - paddingTop: '16px', + paddingTop: vr ? '16px' : '16px', + overflowY: vr ? 'auto' : undefined, }} > <PanelSection> @@ -92,7 +118,7 @@ const PluginView: FC = () => { </div> </PanelSection> </div> - </> + </div> ); }; diff --git a/frontend/src/components/QuickAccessVisibleState.tsx b/frontend/src/components/QuickAccessVisibleState.tsx index f90c24b4..83e45177 100644 --- a/frontend/src/components/QuickAccessVisibleState.tsx +++ b/frontend/src/components/QuickAccessVisibleState.tsx @@ -1,16 +1,21 @@ import { FC, PropsWithChildren, createContext, useContext, useState } from 'react'; -const QuickAccessVisibleState = createContext<boolean>(false); +export const QuickAccessVisibleState = createContext<boolean>(false); export const useQuickAccessVisible = () => useContext(QuickAccessVisibleState); -export const QuickAccessVisibleStateProvider: FC<PropsWithChildren<{ tab: any }>> = ({ children, tab }) => { - const initial = tab.initialVisibility; +export const QuickAccessVisibleStateProvider: FC<PropsWithChildren<{ tab?: any; initialVal?: boolean }>> = ({ + children, + tab, + initialVal, +}) => { + const initial = initialVal || tab?.initialVisibility; const [visible, setVisible] = useState<boolean>(initial); // HACK but i can't think of a better way to do this - tab.qAMVisibilitySetter = (val: boolean) => { - if (val != visible) setVisible(val); - }; + if (tab) + tab.qAMVisibilitySetter = (val: boolean) => { + if (val != visible) setVisible(val); + }; return <QuickAccessVisibleState.Provider value={visible}>{children}</QuickAccessVisibleState.Provider>; }; diff --git a/frontend/src/components/Toast.tsx b/frontend/src/components/Toast.tsx index e86e9337..8b6b9d63 100644 --- a/frontend/src/components/Toast.tsx +++ b/frontend/src/components/Toast.tsx @@ -1,5 +1,5 @@ import type { ToastData } from '@decky/api'; -import { Focusable, Navigation, findClassModule, joinClassNames } from '@decky/ui'; +import { Focusable, Navigation, joinClassNames, toastClasses } from '@decky/ui'; import { FC, memo } from 'react'; import Logger from '../logger'; @@ -23,7 +23,14 @@ interface ToastRendererProps extends ToastProps { location: ToastLocation; } -const templateClasses = findClassModule((m) => m.ShortTemplate) || {}; +const popupClasses = { + ShortTemplate: 'kg8VJS07NZk-', + Content: 'vjeKRorxqWY-', + Header: 'UWjdKshdhD8-', + Icon: 'q9vQBNOskjU-', + Title: 'RZ1644uUH-k-', + Body: '_5LTIC-a3DVw-', +}; // These are memoized as they like to randomly rerender @@ -32,15 +39,15 @@ const GamepadUIPopupToast: FC<Omit<ToastProps, 'newIndicator'>> = memo(({ toast <div style={{ '--toast-duration': `${toast.duration}ms` } as React.CSSProperties} onClick={toast.onClick} - className={joinClassNames(templateClasses.ShortTemplate, toast.className || '', 'DeckyGamepadUIPopupToast')} + className={joinClassNames(popupClasses.ShortTemplate, toast.className || '', 'DeckyGamepadUIPopupToast')} > - {toast.logo && <div className={templateClasses.StandardLogoDimensions}>{toast.logo}</div>} - <div className={joinClassNames(templateClasses.Content, toast.contentClassName || '')}> - <div className={templateClasses.Header}> - {toast.icon && <div className={templateClasses.Icon}>{toast.icon}</div>} - <div className={templateClasses.Title}>{toast.title}</div> + {toast.logo && <div className={toastClasses.StandardLogoDimensions}>{toast.logo}</div>} + <div className={joinClassNames(popupClasses.Content, toast.contentClassName || '')}> + <div className={popupClasses.Header}> + {toast.icon && <div className={popupClasses.Icon}>{toast.icon}</div>} + <div className={popupClasses.Title}>{toast.title}</div> </div> - <div className={templateClasses.Body}>{toast.body}</div> + <div className={popupClasses.Body}>{toast.body}</div> </div> </div> ); @@ -55,30 +62,30 @@ const GamepadUIQAMToast: FC<ToastProps> = memo(({ toast, newIndicator }) => { Navigation.CloseSideMenus(); }} className={joinClassNames( - templateClasses.StandardTemplateContainer, + toastClasses.StandardTemplateContainer, toast.className || '', 'DeckyGamepadUIQAMToast', )} > - <div className={templateClasses.StandardTemplate}> - {toast.logo && <div className={templateClasses.StandardLogoDimensions}>{toast.logo}</div>} - <div className={joinClassNames(templateClasses.Content, toast.contentClassName || '')}> - <div className={templateClasses.Header}> - {toast.icon && <div className={templateClasses.Icon}>{toast.icon}</div>} - {toast.title && <div className={templateClasses.Title}>{toast.title}</div>} + <div className={toastClasses.StandardTemplate}> + {toast.logo && <div className={toastClasses.StandardLogoDimensions}>{toast.logo}</div>} + <div className={joinClassNames(toastClasses.Content, toast.contentClassName || '')}> + <div className={toastClasses.Header}> + {toast.icon && <div className={toastClasses.Icon}>{toast.icon}</div>} + {toast.title && <div className={toastClasses.Title}>{toast.title}</div>} {/* timestamp should always be defined by toaster */} {/* TODO check how valve does this */} {toast.timestamp && ( - <div className={templateClasses.Timestamp}> + <div className={toastClasses.Timestamp}> {toast.timestamp.toLocaleTimeString(undefined, { timeStyle: 'short' })} </div> )} </div> - {toast.body && <div className={templateClasses.StandardNotificationDescription}>{toast.body}</div>} - {toast.subtext && <div className={templateClasses.StandardNotificationSubText}>{toast.subtext}</div>} + {toast.body && <div className={toastClasses.StandardNotificationDescription}>{toast.body}</div>} + {toast.subtext && <div className={toastClasses.StandardNotificationSubText}>{toast.subtext}</div>} </div> {newIndicator && ( - <div className={templateClasses.NewIndicator}> + <div className={toastClasses.NewIndicator}> <svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50" fill="none"> <circle fill="currentColor" cx="25" cy="25" r="25"></circle> </svg> diff --git a/frontend/src/components/settings/pages/developer/index.tsx b/frontend/src/components/settings/pages/developer/index.tsx index 17187675..b6a337f0 100644 --- a/frontend/src/components/settings/pages/developer/index.tsx +++ b/frontend/src/components/settings/pages/developer/index.tsx @@ -9,7 +9,7 @@ import { Toggle, showModal, } from '@decky/ui'; -import { useRef, useState } from 'react'; +import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { FaFileArchive, FaLink, FaReact, FaSteamSymbol, FaTerminal } from 'react-icons/fa'; @@ -49,7 +49,6 @@ export default function DeveloperSettings() { const [acceptedWarning, setAcceptedWarning] = useSetting<boolean>('developer.warn.third_party', false); const waitTime = acceptedWarning ? 0 : 5; const [pluginURL, setPluginURL] = useState(''); - const textRef = useRef<HTMLDivElement>(null); const { t } = useTranslation(); return ( @@ -82,13 +81,6 @@ export default function DeveloperSettings() { </Field> <Field label={t('SettingsDeveloperIndex.third_party_plugins.label_url')} - description={ - <TextField - label={t('SettingsDeveloperIndex.third_party_plugins.label_desc')} - value={pluginURL} - onChange={(e) => setPluginURL(e?.target.value)} - /> - } icon={<FaLink style={{ display: 'block' }} />} > <DialogButton @@ -114,6 +106,11 @@ export default function DeveloperSettings() { {t('SettingsDeveloperIndex.third_party_plugins.button_install')} </DialogButton> </Field> + <TextField + label={t('SettingsDeveloperIndex.third_party_plugins.label_desc')} + value={pluginURL} + onChange={(e) => setPluginURL(e?.target.value)} + /> </DialogControlsSection> <DialogControlsSection> <DialogControlsSectionHeader>{t('SettingsDeveloperIndex.header')}</DialogControlsSectionHeader> @@ -160,18 +157,7 @@ export default function DeveloperSettings() { <Field label={t('SettingsDeveloperIndex.react_devtools.label')} description={ - <> - <span style={{ whiteSpace: 'pre-line' }}>{t('SettingsDeveloperIndex.react_devtools.desc')}</span> - <br /> - <br /> - <div ref={textRef}> - <TextField - label={t('SettingsDeveloperIndex.react_devtools.ip_label')} - value={reactDevtoolsIP} - onChange={(e) => setReactDevtoolsIP(e?.target.value)} - /> - </div> - </> + <span style={{ whiteSpace: 'pre-line' }}>{t('SettingsDeveloperIndex.react_devtools.desc')}</span> } icon={<FaReact style={{ display: 'block' }} />} > @@ -184,6 +170,11 @@ export default function DeveloperSettings() { }} /> </Field> + <TextField + label={t('SettingsDeveloperIndex.react_devtools.ip_label')} + value={reactDevtoolsIP} + onChange={(e) => setReactDevtoolsIP(e?.target.value)} + /> </DialogControlsSection> </DialogBody> ); diff --git a/frontend/src/components/settings/pages/general/index.tsx b/frontend/src/components/settings/pages/general/index.tsx index 401da1d2..215d392c 100644 --- a/frontend/src/components/settings/pages/general/index.tsx +++ b/frontend/src/components/settings/pages/general/index.tsx @@ -58,7 +58,8 @@ export default function GeneralSettings({ <DialogControlsSectionHeader>{t('SettingsGeneralIndex.about.header')}</DialogControlsSectionHeader> <Field label={t('SettingsGeneralIndex.about.decky_version')} focusable={true}> <div style={{ color: 'var(--gpSystemLighterGrey)' }}> - {versionInfo?.current} ({versionInfo?.repo}#{versionInfo?.gitBranch}) + {versionInfo?.current} ({versionInfo?.repo}#{versionInfo?.gitBranch} + {versionInfo?.gitPR ? ` (#${versionInfo.gitPR})` : ''}) </div> </Field> </DialogControlsSection> diff --git a/frontend/src/components/store/Store.tsx b/frontend/src/components/store/Store.tsx index cfa83aff..e66899be 100644 --- a/frontend/src/components/store/Store.tsx +++ b/frontend/src/components/store/Store.tsx @@ -7,7 +7,7 @@ import { SteamSpinner, Tabs, TextField, - findModule, + tabsClasses, } from '@decky/ui'; import { Dispatch, FC, SetStateAction, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -32,10 +32,6 @@ const logger = new Logger('Store'); const StorePage: FC<{}> = () => { const [currentTabRoute, setCurrentTabRoute] = useState<string>('browse'); const [pluginCount, setPluginCount] = useState<number | null>(null); - const { TabCount } = findModule((m) => { - if (m?.TabCount && m?.TabTitle) return true; - return false; - }); const { t } = useTranslation(); @@ -58,7 +54,7 @@ const StorePage: FC<{}> = () => { title: t('Store.store_tabs.title'), content: <BrowseTab setPluginCount={setPluginCount} />, id: 'browse', - renderTabAddon: () => <span className={TabCount}>{pluginCount}</span>, + renderTabAddon: () => <span className={tabsClasses.TabCount}>{pluginCount}</span>, }, { title: t('Store.store_tabs.about'), |
