Agent Zero AI framework
Add Plugin Hub "New" filter for recent plugins
Alessandro3ded1885422e
diff --git a/plugins/_plugin_installer/webui/install-index.html b/plugins/_plugin_installer/webui/install-index.htmlindex 9887f6a50..8b4062987 100644--- a/plugins/_plugin_installer/webui/install-index.html+++ b/plugins/_plugin_installer/webui/install-index.html@@ -36,6 +36,7 @@<select class="pi-sort-select"x-model="$store.pluginInstallStore.sortBy"><option value="stars">Stars</option>+ <option value="updated">Newest</option><option value="name">Name</option></select></label>@@ -56,7 +57,8 @@class="pi-filter-chip":class="{active: $store.pluginInstallStore.browseFilter === filter.key,- 'pi-filter-chip-update': filter.key === 'update' && filter.count > 0+ 'pi-filter-chip-update': filter.key === 'update' && filter.count > 0,+ 'pi-filter-chip-new': filter.key === 'new' && filter.count > 0}"@click="$store.pluginInstallStore.setBrowseFilter(filter.key)"><span x-text="filter.label"></span>@@ -142,6 +144,12 @@<span class="pi-card-bubble-text">New version</span></span></template>+ <template x-if="$store.pluginInstallStore.isNewPlugin(plugin)">+ <span class="pi-card-bubble pi-card-bubble-new">+ <span class="material-symbols-outlined">new_releases</span>+ <span class="pi-card-bubble-text">New</span>+ </span>+ </template></div></div>@@ -363,6 +371,23 @@color: #bfdbfe;}+ .pi-filter-chip-new {+ border-color: rgba(34, 197, 94, 0.22);+ color: #86efac;+ }++ .pi-filter-chip-new:hover,+ .pi-filter-chip-new.active {+ border-color: rgba(34, 197, 94, 0.4);+ background: rgba(34, 197, 94, 0.14);+ color: #bbf7d0;+ }++ .pi-filter-chip-new .pi-filter-count {+ background: rgba(34, 197, 94, 0.16);+ color: #bbf7d0;+ }+body.light-mode .pi-filter-chip-update {border-color: rgba(37, 99, 235, 0.35);background: rgba(37, 99, 235, 0.08);@@ -381,6 +406,24 @@color: #1e3a8a;}+ body.light-mode .pi-filter-chip-new {+ border-color: rgba(22, 163, 74, 0.35);+ background: rgba(22, 163, 74, 0.08);+ color: #166534;+ }++ body.light-mode .pi-filter-chip-new:hover,+ body.light-mode .pi-filter-chip-new.active {+ border-color: rgba(21, 128, 61, 0.5);+ background: rgba(22, 163, 74, 0.14);+ color: #14532d;+ }++ body.light-mode .pi-filter-chip-new .pi-filter-count {+ background: rgba(22, 163, 74, 0.16);+ color: #14532d;+ }+.pi-filter-count {padding: 0.12rem 0.4rem;border-radius: 0.5rem;@@ -647,6 +690,19 @@border-color: rgba(59, 130, 246, 0.3);}+ .pi-card-bubble-new .material-symbols-outlined {+ color: #4ade80;+ }++ .pi-card-bubble-new .pi-card-bubble-text {+ color: #4ade80;+ }++ .pi-card-bubble-new:hover {+ background: rgba(34, 197, 94, 0.1);+ border-color: rgba(34, 197, 94, 0.3);+ }+.pi-card-bubble-suspended .material-symbols-outlined {color: #f59e0b;}@@ -680,6 +736,16 @@border-color: rgba(59, 130, 246, 0.35);}+ body.light-mode .pi-card-bubble-new .material-symbols-outlined,+ body.light-mode .pi-card-bubble-new .pi-card-bubble-text {+ color: #166534;+ }++ body.light-mode .pi-card-bubble-new:hover {+ background: rgba(34, 197, 94, 0.12);+ border-color: rgba(34, 197, 94, 0.35);+ }+body.light-mode .pi-card-bubble-suspended .material-symbols-outlined,body.light-mode .pi-card-bubble-suspended .pi-card-bubble-text {color: #b45309;diff --git a/plugins/_plugin_installer/webui/pluginInstallStore.js b/plugins/_plugin_installer/webui/pluginInstallStore.jsindex 665103386..d49843193 100644--- a/plugins/_plugin_installer/webui/pluginInstallStore.js+++ b/plugins/_plugin_installer/webui/pluginInstallStore.js@@ -12,6 +12,7 @@ import { store as pluginSettingsStore } from "/components/plugins/plugin-settingconst PLUGIN_API = "plugins/_plugin_installer/plugin_install";const PER_PAGE = 24;const POPULAR_PLUGIN_MIN_STARS = 3;+const NEW_PLUGIN_WINDOW_DAYS = 14;const SECURITY_WARNING = {title: "Security Warning",@@ -68,7 +69,11 @@ const model = {},setBrowseFilter(filter) {- this.browseFilter = filter || "all";+ const nextFilter = filter || "all";+ this.browseFilter = nextFilter;+ if (nextFilter === "new" && this.sortBy === "stars") {+ this.sortBy = "updated";+ }this.page = 1;},@@ -98,6 +103,21 @@ const model = {return (plugin?.stars || 0) >= POPULAR_PLUGIN_MIN_STARS;},+ _isNewPlugin(plugin) {+ const updatedAt = (plugin?.updated || "").trim();+ if (!updatedAt) return false;+ const updatedMs = Date.parse(updatedAt);+ if (Number.isNaN(updatedMs)) return false;++ const nowMs = Date.now();+ const cutoffMs = nowMs - NEW_PLUGIN_WINDOW_DAYS * 24 * 60 * 60 * 1000;+ return updatedMs >= cutoffMs;+ },++ isNewPlugin(plugin) {+ return this._isNewPlugin(plugin);+ },+_getSuspensionReason(plugin) {return typeof plugin?.suspended === "string" ? plugin.suspended.trim() : "";},@@ -111,6 +131,7 @@ const model = {if (filterKey === "installed") return !!plugin?.installed;if (filterKey === "update") return !!plugin?.has_update;if (filterKey === "popular") return this._isPopularPlugin(plugin);+ if (filterKey === "new") return this._isNewPlugin(plugin);if (filterKey.startsWith("tag:")) {return this._pluginPrimaryTag(plugin) === filterKey.slice(4);}@@ -155,6 +176,14 @@ const model = {return (a.title || a.key).localeCompare(b.title || b.key);},+ _comparePluginsByUpdated(a, b) {+ const updatedComparison = this._compareTimestamp(a?.updated, b?.updated);+ if (updatedComparison !== 0) {+ return updatedComparison > 0 ? -1 : 1;+ }+ return this._comparePluginsByStars(a, b);+ },+// ── ZIP Install ──────────────────────────────handleFileUpload(event) {@@ -400,6 +429,11 @@ const model = {filters.push({ key: "popular", label: "Popular", count: popularCount });}+ const newCount = plugins.filter((plugin) => this._isNewPlugin(plugin)).length;+ if (newCount) {+ filters.push({ key: "new", label: "New", count: newCount });+ }+const tagCounts = new Map();for (const plugin of plugins) {const tag = this._pluginPrimaryTag(plugin);@@ -435,7 +469,9 @@ const model = {(p.tags || []).some((t) => t.toLowerCase().includes(q)));}- if (this.sortBy === "stars") {+ if (this.sortBy === "updated" || this.browseFilter === "new") {+ list.sort((a, b) => this._comparePluginsByUpdated(a, b));+ } else if (this.sortBy === "stars") {list.sort((a, b) => this._comparePluginsByStars(a, b));} else {list.sort((a, b) =>