feat(plugins/settings): add optional descriptions for plugin list filters

This commit is contained in:
PalmDevs 2025-08-31 20:02:34 +07:00
parent 408c8463ac
commit ab81c4b726
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA
2 changed files with 6 additions and 1 deletions

View file

@ -9,6 +9,7 @@ export interface FilterAndSortActionSheetProps {
string,
{
icon: AssetId
desc?: string
filter: (p: AnyPlugin, meta: InternalPluginMeta) => boolean
}
>
@ -57,7 +58,7 @@ export default function FilterAndSortActionSheet({
<ActionSheet>
<BottomSheetTitleHeader title="Filter & Sort" />
<TableRowGroup title="Filter by">
{Object.entries(filters).map(([label, { icon }]) => {
{Object.entries(filters).map(([label, { icon, desc }]) => {
const checked = filter_.includes(label)
return (
@ -65,6 +66,7 @@ export default function FilterAndSortActionSheet({
key={label}
icon={<TableRowAssetIcon id={icon} />}
label={label}
subLabel={desc}
value={label}
checked={checked}
onPress={() => {

View file

@ -65,14 +65,17 @@ const Filters: FilterAndSortActionSheetProps['filters'] = {
},
Internal: {
icon: RevengeIcon,
desc: 'Included with Revenge.',
filter: (_, meta) => isPluginInternal(meta),
},
Essential: {
icon: getAssetIdByName('StarIcon')!,
desc: 'Required for Revenge to function properly.',
filter: (_, meta) => isPluginEssential(meta),
},
'Non-APIs': {
icon: getAssetIdByName('PaperIcon')!,
desc: 'Exclude essential plugins that provide APIs for other plugins.',
filter: (_, meta) =>
!(meta.iflags & InternalPluginFlags.ImplicitDependency),
},