From 9c63d8d433219bba37bd4f7ea58aebb0a3f02513 Mon Sep 17 00:00:00 2001 From: LukeGus Date: Sun, 11 Oct 2026 17:10:09 -0500 Subject: [PATCH] feat: hide installed plugins in the browse tab by default --- CHANGELOG.md | 1 + src/ui/locales/en.json | 3 ++ src/ui/plugins/PluginsTab.tsx | 45 +++++++++++++++++++----- src/ui/tests/plugins/PluginsTab.test.tsx | 13 +++++++ 4 files changed, 53 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58aed7ab1..31b1c0bfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Every language is now fully translated, in Termix and in every plugin, and stays up to date with each release - Languages with more than two plural forms, like Russian, Polish and Arabic, now use the right one - The Plugins tab shows how many times each plugin was downloaded, in a Downloads column +- Plugins, Browse hides plugins you already have. Turn on Show installed to see them ### Fixed diff --git a/src/ui/locales/en.json b/src/ui/locales/en.json index f541ee85e..479bc52e7 100644 --- a/src/ui/locales/en.json +++ b/src/ui/locales/en.json @@ -2085,6 +2085,9 @@ "noneInstalled": "No plugins installed yet. Browse to add some.", "nothingHere": "Nothing here.", "nothingHereHint": "Try another category or search.", + "showInstalled": "Show installed", + "allInstalled": "Everything here is already installed.", + "allInstalledHint": "Turn on Show installed to see them.", "communitySubmit": "How to submit", "registries": { "intro": "Registries are lists of plugins you can install. The official one is always on. You can turn on the community registry or add your own.", diff --git a/src/ui/plugins/PluginsTab.tsx b/src/ui/plugins/PluginsTab.tsx index 19f7d2924..d6fe1520f 100644 --- a/src/ui/plugins/PluginsTab.tsx +++ b/src/ui/plugins/PluginsTab.tsx @@ -952,6 +952,12 @@ function BrowseSection({ const [category, setCategory] = useState(null); const [registry, setRegistry] = useState(null); const [sort, setSort] = useState("popular"); + const [installedChoice, setInstalledChoice] = useStoredChoice( + "pluginsTab.browseInstalled", + ["hide", "show"], + "hide", + ); + const showInstalled = installedChoice === "show"; const categories = useMemo(() => categoriesOf(plugins), [plugins]); const registries = manager.registries; const registryFilter = registries.some((entry) => entry.id === registry) @@ -961,6 +967,7 @@ function BrowseSection({ const rows = sortPlugins( plugins.filter( (p) => + (showInstalled || !p.installed) && matchesQuery(p, query) && (category === null || p.category === category) && (registryFilter === null || p.registryId === registryFilter), @@ -968,6 +975,9 @@ function BrowseSection({ sort, ); + const allInstalledHidden = + !showInstalled && plugins.length > 0 && plugins.every((p) => p.installed); + const listColumns: DataColumn[] = [ { key: "name", @@ -1029,6 +1039,15 @@ function BrowseSection({ placeholder={t("plugins.manager.searchPlugins")} >
+ {registries.length > 1 && (