Remove "obsolete" extensions group

Obsolete extensions are not grouped at the top of the extension page anymore and instead show an "OBSOLETE" warning text with a the "uninstall" action.
This commit is contained in:
schroda
2026-05-02 20:11:45 +02:00
parent bfc401c9ee
commit b032b32ec2
6 changed files with 40 additions and 25 deletions

View File

@@ -17,7 +17,7 @@ import { useLingui } from '@lingui/react/macro';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
import type { InstalledStates, TExtension } from '@/features/extension/Extensions.types.ts';
import { ExtensionAction, ExtensionState, InstalledState } from '@/features/extension/Extensions.types.ts';
import { ExtensionAction, ExtensionState } from '@/features/extension/Extensions.types.ts';
import {
EXTENSION_ACTION_TO_NEXT_ACTION_MAP,
EXTENSION_ACTION_TO_STATE_MAP,
@@ -118,12 +118,34 @@ export function ExtensionCard(props: IProps) {
{name}
</Typography>
<Typography variant="caption">
{isInstalled ? `${languageCodeToName(lang)} ` : ''}
{versionName}
{isNsfw && (
<Typography variant="caption" color="error">
{' 18+'}
{isInstalled ? `${languageCodeToName(lang)}` : ''}
{isInstalled ? (
<Typography variant="caption" sx={{ px: 1 }}>
</Typography>
) : (
''
)}
{versionName}
{isObsolete && (
<>
<Typography variant="caption" sx={{ px: 1 }}>
</Typography>
<Typography variant="caption" color="warning" sx={{ textTransform: 'uppercase' }}>
{t`Obsolete`}
</Typography>
</>
)}
{isNsfw && (
<>
<Typography variant="caption" sx={{ px: 1 }}>
</Typography>
<Typography variant="caption" color="error">
18+
</Typography>
</>
)}
</Typography>
{showSourceRepo && <Typography variant="caption">{repo}</Typography>}
@@ -137,10 +159,7 @@ export function ExtensionCard(props: IProps) {
)}
<Button
variant="outlined"
sx={{
color: installedState === InstalledState.OBSOLETE ? 'red' : 'inherit',
flexShrink: 0,
}}
sx={{ flexShrink: 0 }}
onClick={(e) => {
e.preventDefault();
handleButtonClick();

View File

@@ -33,7 +33,7 @@ export const INSTALLED_STATE_TO_TRANSLATION_MAP: { [installedState in InstalledS
[InstalledState.UNINSTALL]: msg`Uninstall`,
[InstalledState.INSTALL]: msg`Install`,
[InstalledState.UPDATE]: msg`Update`,
[InstalledState.OBSOLETE]: msg`Obsolete`,
[InstalledState.OBSOLETE]: msg`Uninstall`,
[InstalledState.UPDATING]: msg`Updating`,
[InstalledState.UNINSTALLING]: msg`Uninstalling`,
[InstalledState.INSTALLING]: msg`Installing`,

View File

@@ -72,10 +72,6 @@ export function groupExtensionsByLanguage(extensions: TExtension[]): GroupedExte
return ExtensionGroupState.UPDATE_PENDING;
}
if (extension.isObsolete) {
return ExtensionGroupState.OBSOLETE;
}
return ExtensionGroupState.INSTALLED;
});

View File

@@ -25,10 +25,8 @@ export const ActionButton = ({ pkgName, isInstalled, isObsolete, hasUpdate }: TE
return (
<Box sx={{ px: 1, flexGrow: 1, flexBasis: 0 }}>
<Button
sx={{
width: '100%',
color: installedState === InstalledState.OBSOLETE ? 'red' : 'inherit',
}}
sx={{ width: '100%' }}
color={installedState === InstalledState.OBSOLETE ? 'error' : undefined}
variant="outlined"
size="large"
onClick={async () => {