Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(plugins): data-driven category sections, brand tiles, longevity badge

Ruben Lütke94c03bf8e6ec
diff --git a/jarvis/marketplace/seed_catalog.json b/jarvis/marketplace/seed_catalog.json
index 3341b406fe..f8ba2c11c8 100644
--- a/jarvis/marketplace/seed_catalog.json
+++ b/jarvis/marketplace/seed_catalog.json
@@ -23,7 +23,8 @@
"url": "https://api.githubcopilot.com/mcp/",
"auth_header_template": "Authorization: Bearer $plugin_github_access_token"
},
- "post_install_hint_md": "Uses GitHub's hosted MCP server, so Docker is not required. If you use SAML SSO, authorize the token at https://github.com/settings/tokens after connecting."
+ "post_install_hint_md": "Uses GitHub's hosted MCP server, so Docker is not required. If you use SAML SSO, authorize the token at https://github.com/settings/tokens after connecting.",
+ "logo_color": "24292E"
},
{
"id": "vercel",
@@ -42,7 +43,8 @@
"instruction_md": "1. Click 'Create Token'\n2. Name: 'Personal Jarvis'\n3. Choose 'Full Account' or a specific team\n4. Copy the token (shown once)\n5. Paste below"
},
"native_tool": "vercel",
- "future_v2_note": "Apply for mcp.vercel.com client-allowlist; switch mode to hosted_mcp_allowlist when approved."
+ "future_v2_note": "Apply for mcp.vercel.com client-allowlist; switch mode to hosted_mcp_allowlist when approved.",
+ "logo_color": "000000"
},
{
"id": "supabase",
@@ -64,7 +66,8 @@
"url": "https://mcp.supabase.com/mcp?read_only=true",
"auth_header_template": "Authorization: Bearer $plugin_supabase_access_token"
},
- "post_install_hint_md": "Uses Supabase's hosted MCP server, so Node.js is not required. Read-only mode is enforced in the server URL."
+ "post_install_hint_md": "Uses Supabase's hosted MCP server, so Node.js is not required. Read-only mode is enforced in the server URL.",
+ "logo_color": "3FCF8E"
},
{
"id": "notion",
@@ -94,7 +97,8 @@
"transport": "http",
"url": "https://mcp.notion.com/mcp",
"auth_header_template": "Authorization: Bearer ${plugin_notion_access_token}"
- }
+ },
+ "logo_color": "000000"
},
{
"id": "slack",
@@ -135,7 +139,8 @@
"url": "https://mcp.slack.com/mcp",
"auth_header_template": "Authorization: Bearer ${plugin_slack_access_token}"
},
- "post_install_hint_md": "Slack PKCE apps use user-level scopes only — Jarvis acts as you, not as a bot. If your workspace admin requires approval, the OAuth flow will surface that prompt automatically."
+ "post_install_hint_md": "Slack PKCE apps use user-level scopes only — Jarvis acts as you, not as a bot. If your workspace admin requires approval, the OAuth flow will surface that prompt automatically.",
+ "logo_color": "4A154B"
},
{
"id": "linear",
@@ -155,7 +160,8 @@
"transport": "http",
"url": "https://mcp.linear.app/mcp",
"auth_header_template": "Authorization: Bearer ${plugin_linear_access_token}"
- }
+ },
+ "logo_color": "5E6AD2"
},
{
"id": "stripe",
@@ -177,7 +183,8 @@
"url": "https://mcp.stripe.com",
"auth_header_template": "Authorization: Bearer ${plugin_stripe_access_token}"
},
- "post_install_hint_md": "Restricted key (rk_), validated against GET /v1/balance, sent as a Bearer token to Stripe's hosted MCP server — the documented path for non-OAuth clients (bypasses the OAuth client-allowlist; no Node needed). Read-only is controlled by the key's scope."
+ "post_install_hint_md": "Restricted key (rk_), validated against GET /v1/balance, sent as a Bearer token to Stripe's hosted MCP server — the documented path for non-OAuth clients (bypasses the OAuth client-allowlist; no Node needed). Read-only is controlled by the key's scope.",
+ "logo_color": "635BFF"
},
{
"id": "cloudflare",
@@ -203,7 +210,8 @@
"url": "https://observability.mcp.cloudflare.com/mcp",
"auth_header_template": "Authorization: Bearer ${plugin_cloudflare_access_token}"
},
- "post_install_hint_md": "Defaults to the read-only observability/analytics server. Pick read scopes on Cloudflare's consent screen."
+ "post_install_hint_md": "Defaults to the read-only observability/analytics server. Pick read scopes on Cloudflare's consent screen.",
+ "logo_color": "F38020"
},
{
"id": "discord",
@@ -222,7 +230,8 @@
"validation_endpoint": "https://discord.com/api/v10/users/@me",
"instruction_md": "1. Open https://discord.com/developers/applications and click 'New Application'.\n2. Go to the 'Bot' page, click 'Reset Token', and copy it (shown once).\n3. Under 'Privileged Gateway Intents', enable 'Message Content Intent' so the bot can read message text.\n4. Invite the bot to your server: OAuth2 -> URL Generator -> scope 'bot' + the permissions you want (View Channels, Read Message History, Send Messages), open the link, pick your server, Authorize.\n5. Paste the bot token below, plus your numeric Discord user id (Developer Mode -> right-click yourself -> Copy User ID) so only you can command the bot."
},
- "post_install_hint_md": "This enables the Discord channel — message your bot to talk to Jarvis. Outbound replies pass through the voice scrubber and your allowlist."
+ "post_install_hint_md": "This enables the Discord channel — message your bot to talk to Jarvis. Outbound replies pass through the voice scrubber and your allowlist.",
+ "logo_color": "5865F2"
},
{
"id": "telegram",
@@ -241,7 +250,8 @@
"validation_endpoint": "https://api.telegram.org/bot{token}/getMe",
"instruction_md": "1. Open @BotFather in Telegram (https://t.me/BotFather).\n2. Send /newbot, pick a name and a username ending in 'bot'.\n3. Copy the token BotFather gives you (looks like 123456789:AAH...).\n4. Paste it below, then send /start to your new bot so it can reach you."
},
- "post_install_hint_md": "This enables the Telegram channel — message your bot to talk to Jarvis. Outbound replies pass through the voice scrubber and your allowlist."
+ "post_install_hint_md": "This enables the Telegram channel — message your bot to talk to Jarvis. Outbound replies pass through the voice scrubber and your allowlist.",
+ "logo_color": "26A5E4"
},
{
"id": "asana",
@@ -270,7 +280,8 @@
"url": "https://mcp.asana.com/v2/mcp",
"auth_header_template": "Authorization: Bearer ${plugin_asana_access_token}"
},
- "post_install_hint_md": "Setup: register an OAuth app at https://app.asana.com/0/my-apps, add redirect URI http://127.0.0.1:3119/oauth/callback, and put its Client ID into data/plugin_catalog.json. If Asana rejects the 127.0.0.1 redirect, switch this plugin to pat_paste (token at app.asana.com/0/my-apps, validate https://app.asana.com/api/1.0/users/me)."
+ "post_install_hint_md": "Setup: register an OAuth app at https://app.asana.com/0/my-apps, add redirect URI http://127.0.0.1:3119/oauth/callback, and put its Client ID into data/plugin_catalog.json. If Asana rejects the 127.0.0.1 redirect, switch this plugin to pat_paste (token at app.asana.com/0/my-apps, validate https://app.asana.com/api/1.0/users/me).",
+ "logo_color": "F06A6A"
},
{
"id": "google_drive",
@@ -299,7 +310,8 @@
"offline_access": true
},
"native_tool": "google_drive",
- "post_install_hint_md": "Setup: see docs/marketplace/google-oauth-setup.md (shares the Google client with Gmail/Calendar). Talks to the Drive REST API v3 directly (Google's hosted Drive MCP is a Workspace-only Developer Preview that 403s consumer accounts). The full 'drive' scope grants read/write/delete over ALL your files and is a Google RESTRICTED scope: in 'Testing' status the refresh grant expires after 7 days, so publish the consent app to 'In production' and complete Google's restricted-scope (CASA) verification for uninterrupted offline access. A user, account, or administrator can still revoke the grant."
+ "post_install_hint_md": "Setup: see docs/marketplace/google-oauth-setup.md (shares the Google client with Gmail/Calendar). Talks to the Drive REST API v3 directly (Google's hosted Drive MCP is a Workspace-only Developer Preview that 403s consumer accounts). The full 'drive' scope grants read/write/delete over ALL your files and is a Google RESTRICTED scope: in 'Testing' status the refresh grant expires after 7 days, so publish the consent app to 'In production' and complete Google's restricted-scope (CASA) verification for uninterrupted offline access. A user, account, or administrator can still revoke the grant.",
+ "logo_color": "1FA463"
},
{
"id": "gmail",
@@ -328,7 +340,8 @@
"offline_access": true
},
"native_tool": "gmail",
- "post_install_hint_md": "Setup: see docs/marketplace/google-oauth-setup.md (shares the Google client with Drive). In Google 'Testing' status the refresh grant expires after 7 days. Publish the consent app to 'In production' and complete restricted-scope verification when Google requires it so Jarvis can refresh offline access automatically. A user, account, or administrator can still revoke the grant."
+ "post_install_hint_md": "Setup: see docs/marketplace/google-oauth-setup.md (shares the Google client with Drive). In Google 'Testing' status the refresh grant expires after 7 days. Publish the consent app to 'In production' and complete restricted-scope verification when Google requires it so Jarvis can refresh offline access automatically. A user, account, or administrator can still revoke the grant.",
+ "logo_color": "EA4335"
},
{
"id": "google_calendar",
@@ -357,7 +370,8 @@
"offline_access": true
},
"native_tool": "google_calendar",
- "post_install_hint_md": "Setup: shares the Google OAuth client with Gmail/Drive. Add the full 'calendar' scope to the OAuth consent screen (it reads events across ALL your calendars, not just the primary one). A 'Testing' refresh grant expires after 7 days; publish the consent app to 'In production' so Jarvis can refresh offline access automatically. A user, account, or administrator can still revoke the grant."
+ "post_install_hint_md": "Setup: shares the Google OAuth client with Gmail/Drive. Add the full 'calendar' scope to the OAuth consent screen (it reads events across ALL your calendars, not just the primary one). A 'Testing' refresh grant expires after 7 days; publish the consent app to 'In production' so Jarvis can refresh offline access automatically. A user, account, or administrator can still revoke the grant.",
+ "logo_color": "1A73E8"
}
]
}
diff --git a/jarvis/ui/web/frontend/src/assets/brands/LOGOS.md b/jarvis/ui/web/frontend/src/assets/brands/LOGOS.md
new file mode 100644
index 0000000000..199d2d7248
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/assets/brands/LOGOS.md
@@ -0,0 +1,45 @@
+# Bundled brand marks
+
+Full-colour brand marks for the Plugins store, bundled so a card renders
+offline, on a locked-down network, and on a headless host without calling any
+third party at render time.
+
+Every mark here belongs to its owner. They are used **solely to identify the
+service a plugin connects to** — nominative use — and never to imply that the
+owner endorses, sponsors or is affiliated with this project. If you own a mark
+listed here and want it removed, open an issue and it will be taken out.
+
+> A CC0 or MIT licence on an SVG settles the **copyright in the drawing**. It
+> does not grant **trademark** rights, and no entry below claims otherwise.
+> Where a vendor's guidelines forbid third-party use of their product icon, do
+> not add the file: leave it to the automatic fallback, which draws the vendor's
+> glyph or initial on their brand colour instead.
+
+## How the store picks a mark
+
+`PluginsView.tsx` resolves in three tiers, so a missing file is never a blank
+card:
+
+1. `<plugin-id>.svg` in this folder — a full-colour mark on a neutral tile.
+2. Otherwise the Simple Icons glyph on the plugin's `logo_color` brand tile.
+3. Otherwise a monogram on that same tile — also what appears if tier 2 cannot
+ load at all.
+
+Tier 2 is deliberately good enough to ship with: a coloured tile reads as a
+design decision, so the catalog never has to wait for a complete asset set.
+
+## Adding one
+
+1. Take the mark from the vendor's own brand/press page, or from a
+ permissively-licensed collection.
+2. Run it through `svgo`. Remove scripts, external references and embedded
+ raster images; keep a square `viewBox`.
+3. Save it as `<plugin-id>.svg` — the catalog id, so no wiring is needed.
+4. Add a row below. An entry without a row is a licence gap, not a shortcut.
+
+## Ledger
+
+| plugin_id | Source | Legal basis | Added |
+|---|---|---|---|
+
+*(empty — every card currently renders through tier 2 or 3)*
diff --git a/jarvis/ui/web/frontend/src/views/PluginsView.test.tsx b/jarvis/ui/web/frontend/src/views/PluginsView.test.tsx
index 1c91a1458a..2a9a28e78a 100644
--- a/jarvis/ui/web/frontend/src/views/PluginsView.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/PluginsView.test.tsx
@@ -378,3 +378,93 @@ describe("PluginsView keeps revoked plugins visible", () => {
).toBeDefined();
});
});
+
+describe("PluginsView category sections are data-driven", () => {
+ function catalogWith(plugins: unknown[], categoryOrder?: string[]) {
+ const fetchMock = vi.fn(async (input: RequestInfo | URL) => {
+ if (String(input) === "/api/marketplace/plugins") {
+ return {
+ ok: true,
+ status: 200,
+ json: async () => ({
+ version: 1,
+ schema_version: "t",
+ total: plugins.length,
+ connected: 0,
+ category_order: categoryOrder,
+ plugins,
+ }),
+ } as Response;
+ }
+ throw new Error(`unexpected fetch ${String(input)}`);
+ });
+ (globalThis as unknown as { fetch: typeof fetch }).fetch =
+ fetchMock as unknown as typeof fetch;
+ }
+
+ const row = (id: string, category: string, extra: Record<string, unknown> = {}) => ({
+ id,
+ display_name: id,
+ description: "d",
+ category,
+ logo_slug: id,
+ auth: { mode: "pat_paste" },
+ status: "not_connected",
+ live_callable: false,
+ ...extra,
+ });
+
+ it("renders a category the frontend has never heard of instead of crashing", async () => {
+ // The previous fixed record threw on `byCat[category].push(...)`, which
+ // blanked the entire view behind its error boundary. A backend-only
+ // taxonomy change must not be able to do that.
+ catalogWith([row("mystery", "Something Brand New")], ["Developer"]);
+
+ renderPluginsView();
+
+ await waitFor(() => {
+ expect(
+ screen.getByRole("heading", { name: "Something Brand New", level: 2 }),
+ ).toBeDefined();
+ });
+ expect(screen.getByText("mystery")).toBeDefined();
+ // The filter menu is fed by the same data, so it offers the new category too.
+ expect(
+ screen.getByRole("option", { name: "Something Brand New" }),
+ ).toBeDefined();
+ });
+
+ it("orders sections by the catalog's category_order", async () => {
+ catalogWith(
+ [row("b", "Second"), row("a", "First")],
+ ["First", "Second"],
+ );
+
+ renderPluginsView();
+
+ await waitFor(() => {
+ expect(screen.getByRole("heading", { name: "First", level: 2 })).toBeDefined();
+ });
+ const headings = screen
+ .getAllByRole("heading", { level: 2 })
+ .map((h) => h.textContent);
+ expect(headings.indexOf("First")).toBeLessThan(headings.indexOf("Second"));
+ });
+
+ it("states how long the connection lasts before the user connects", async () => {
+ catalogWith([
+ row("forever", "Developer", { longevity: "permanent" }),
+ row("limited", "Developer", {
+ longevity: "provider_limited",
+ longevity_note: "Google asks again every 7 days in Testing mode.",
+ }),
+ ]);
+
+ renderPluginsView();
+
+ await waitFor(() => {
+ expect(screen.getByText("Stays connected")).toBeDefined();
+ });
+ expect(screen.getByText("Sign in again periodically")).toBeDefined();
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/views/PluginsView.tsx b/jarvis/ui/web/frontend/src/views/PluginsView.tsx
index bc90ce1370..5821437a12 100644
--- a/jarvis/ui/web/frontend/src/views/PluginsView.tsx
+++ b/jarvis/ui/web/frontend/src/views/PluginsView.tsx
@@ -44,7 +44,13 @@ type AuthMode =
| "hosted_mcp_allowlist";
type PluginStatus = "not_connected" | "connected" | "needs_reauth" | "error";
-type Category = "Developer" | "Productivity" | "Communication";
+/** Deliberately a plain string, mirroring the backend. The catalog serves the
+ * section order (`category_order`), so adding a category is a backend-only
+ * change and an unknown one renders in its own section instead of crashing
+ * the view — the previous hardcoded record threw on any value it did not
+ * already know. */
+type Category = string;
+type Longevity = "permanent" | "self_renewing" | "provider_limited";
interface CatalogPlugin {
id: string;
@@ -55,6 +61,9 @@ interface CatalogPlugin {
logo_color?: string | null;
logo_url?: string | null;
featured?: boolean;
+ longevity?: Longevity;
+ longevity_note?: string | null;
+ oauth_client_family?: string | null;
auth: { mode: AuthMode; [key: string]: unknown };
status: PluginStatus;
live_callable?: boolean;
@@ -63,6 +72,7 @@ interface CatalogPlugin {
interface CatalogResponse {
version: number;
schema_version: string;
+ category_order?: string[];
plugins: CatalogPlugin[];
total: number;
connected: number;
@@ -90,6 +100,9 @@ interface Plugin {
status: PluginStatus;
featured?: boolean;
liveCallable?: boolean;
+ longevity: Longevity;
+ longevityNote?: string;
+ oauthClientFamily?: string;
}
function adapt(p: CatalogPlugin): Plugin {
@@ -106,14 +119,76 @@ function adapt(p: CatalogPlugin): Plugin {
status: p.status,
featured: p.featured ?? false,
liveCallable: p.live_callable ?? false,
+ longevity: p.longevity ?? "self_renewing",
+ longevityNote: p.longevity_note ?? undefined,
+ oauthClientFamily: p.oauth_client_family ?? undefined,
};
}
-function resolveLogoUrl(p: { logoUrl?: string; logoSlug: string; logoColor?: string }): string {
+// --- Brand marks -----------------------------------------------------------
+// Three tiers, tried in order, so a card is never blank and never a broken
+// image:
+// 1. a full-colour SVG bundled in the app (offline-safe, no third party)
+// 2. the Simple Icons glyph in white on the brand's own colour tile
+// 3. a monogram on the brand tile — used when tier 2 cannot load at all
+// (offline, locked-down network, or an icon the CDN has dropped)
+// Tier 2 is what makes the store look intentional before every brand mark has
+// been sourced: a coloured tile with a white glyph reads as a product decision,
+// a black glyph on a white square reads as a placeholder.
+const BUNDLED_BRAND_LOGOS = import.meta.glob("../assets/brands/*.svg", {
+ eager: true,
+ query: "?url",
+ import: "default",
+}) as Record<string, string>;
+
+function bundledLogo(pluginId: string): string | undefined {
+ return BUNDLED_BRAND_LOGOS[`../assets/brands/${pluginId}.svg`];
+}
+
+const DEFAULT_BRAND_TILE = "#3F3F46";
+
+function brandTile(p: { logoColor?: string }): string {
+ const raw = (p.logoColor ?? "").trim();
+ if (!raw) return DEFAULT_BRAND_TILE;
+ return raw.startsWith("#") ? raw : `#${raw}`;
+}
+
+/** Pick a glyph colour that stays legible on the brand tile. A few brand
+ * colours are near-white (and a couple are near-black), so a fixed white
+ * glyph would vanish on them. */
+function glyphColor(tileHex: string): string {
+ const hex = tileHex.replace("#", "");
+ if (hex.length !== 6) return "ffffff";
+ const [r, g, b] = [0, 2, 4].map((i) => parseInt(hex.slice(i, i + 2), 16) / 255);
+ const lin = (c: number) => (c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4);
+ const luminance = 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);
+ return luminance > 0.6 ? "111111" : "ffffff";
+}
+
+function resolveLogoUrl(p: {
+ id?: string;
+ logoUrl?: string;
+ logoSlug: string;
+ logoColor?: string;
+}): string {
+ const bundled = p.id ? bundledLogo(p.id) : undefined;
+ if (bundled) return bundled;
if (p.logoUrl) return p.logoUrl;
- return `https://cdn.simpleicons.org/${p.logoSlug}${p.logoColor ? `/${p.logoColor}` : ""}`;
+ return `https://cdn.simpleicons.org/${p.logoSlug}/${glyphColor(brandTile(p))}`;
}
+/** True when the mark is a full-colour asset that must sit on a neutral tile
+ * rather than on the brand colour (its own colours already carry the brand). */
+function isFullColourMark(p: { id?: string; logoUrl?: string }): boolean {
+ return Boolean((p.id && bundledLogo(p.id)) || p.logoUrl);
+}
+
+const LONGEVITY_LABEL: Record<Longevity, string> = {
+ permanent: "Stays connected",
+ self_renewing: "Renews itself",
+ provider_limited: "Sign in again periodically",
+};
+
async function fetchCatalog(): Promise<CatalogResponse> {
// `cache: "no-store"` forces the embedded WebView2 (desktop app) to bypass
// its HTTP cache on every fetch. The server already sends
@@ -150,15 +225,37 @@ const COMING_SOON = [
// OWN production client here (the durable fix for provider-side refresh-token
// expiry — e.g. Google revokes a "Testing" app's token after 7 days). The Google
// family shares ONE client pair; slack and asana each have their own. Mirrors
-// `marketplace.connect_helpers._OAUTH_CLIENT_FAMILY` — keep in sync.
-const OAUTH_CLIENT_FAMILY: Record<string, { family: string; label: string }> = {
- gmail: { family: "google", label: "Google" },
- google_drive: { family: "google", label: "Google" },
- google_calendar: { family: "google", label: "Google" },
- slack: { family: "slack", label: "Slack" },
- asana: { family: "asana", label: "Asana" },
+// The catalog now declares this per plugin (`oauth_client_family`), so a new
+// plugin no longer needs a frontend release to get the "use your own OAuth
+// client" affordance — the omission that silently removed it before. This table
+// only supplies the human label for a family and stays as the fallback for a
+// user's `data/` catalog written before the field existed.
+const OAUTH_CLIENT_FAMILY_FALLBACK: Record<string, string> = {
+ gmail: "google",
+ google_drive: "google",
+ google_calendar: "google",
+ slack: "slack",
+ asana: "asana",
+};
+
+const OAUTH_FAMILY_LABEL: Record<string, string> = {
+ google: "Google",
+ slack: "Slack",
+ asana: "Asana",
+ microsoft: "Microsoft",
};
+function oauthClientFamily(
+ plugin: Plugin,
+): { family: string; label: string } | undefined {
+ const family = plugin.oauthClientFamily ?? OAUTH_CLIENT_FAMILY_FALLBACK[plugin.id];
+ if (!family) return undefined;
+ return {
+ family,
+ label: OAUTH_FAMILY_LABEL[family] ?? family[0].toUpperCase() + family.slice(1),
+ };
+}
+
// Where the user creates/manages their own OAuth client per family.
const OAUTH_CLIENT_CONSOLE: Record<string, string> = {
google: "https://console.cloud.google.com/auth/clients",
@@ -169,12 +266,19 @@ const OAUTH_CLIENT_CONSOLE: Record<string, string> = {
type TabId = "browse" | "installed";
type FilterId = "all" | Category;
-const FILTERS: { id: FilterId; label: string }[] = [
- { id: "all", label: "All" },
- { id: "Developer", label: "Developer" },
- { id: "Productivity", label: "Productivity" },
- { id: "Communication", label: "Communication" },
-];
+/** Section order for the store, straight from the catalog. Any category the
+ * backend serves that the order does not mention is appended, so a new
+ * category needs no frontend release. */
+function orderedCategories(
+ catalog: CatalogResponse | undefined,
+ plugins: Plugin[],
+): string[] {
+ const declared = catalog?.category_order ?? [];
+ const present = new Set(plugins.map((p) => p.category));
+ const known = declared.filter((c) => present.has(c));
+ const extra = [...present].filter((c) => !declared.includes(c)).sort();
+ return [...known, ...extra];
+}
export function PluginsView() {
const qc = useQueryClient();
@@ -360,6 +464,10 @@ export function PluginsView() {
() => data?.plugins.map(adapt) ?? [],
[data],
);
+ const categoryOrder = useMemo(
+ () => orderedCategories(data, allPlugins),
+ [data, allPlugins],
+ );
// "Installed" keeps every plugin the user ever connected — including a revoked
// (needs_reauth) or errored one — so a dead token surfaces a Reconnect prompt
// here instead of silently dropping back into Browse as a plain "+".
@@ -486,6 +594,7 @@ export function PluginsView() {
<BrowseLayout
plugins={visible}
query={query}
+ categoryOrder={categoryOrder}
setQuery={setQuery}
filter={filter}
setFilter={setFilter}
@@ -499,6 +608,7 @@ export function PluginsView() {
plugins={visible}
totalAvailable={allPlugins.length}
query={query}
+ categoryOrder={categoryOrder}
setQuery={setQuery}
filter={filter}
setFilter={setFilter}
@@ -664,12 +774,14 @@ interface SearchControlsProps {
function BrowseLayout({
plugins,
query,
+ categoryOrder,
setQuery,
filter,
setFilter,
onConnect,
onDisconnect,
-}: { plugins: Plugin[] } & SearchControlsProps & ConnectHandlers) {
+}: { plugins: Plugin[]; categoryOrder: string[] } & SearchControlsProps &
+ ConnectHandlers) {
return (
<>
<Hero query={query} setQuery={setQuery} filter={filter} setFilter={setFilter} />
@@ -677,6 +789,7 @@ function BrowseLayout({
<CategorizedList
plugins={plugins}
query={query}
+ categoryOrder={categoryOrder}
onConnect={onConnect}
onDisconnect={onDisconnect}
/>
@@ -689,12 +802,18 @@ function InstalledLayout({
plugins,
totalAvailable,
query,
+ categoryOrder,
setQuery,
filter,
setFilter,
onConnect,
onDisconnect,
-}: { plugins: Plugin[]; totalAvailable: number } & SearchControlsProps & ConnectHandlers) {
+}: {
+ plugins: Plugin[];
+ totalAvailable: number;
+ categoryOrder: string[];
+} & SearchControlsProps &
+ ConnectHandlers) {
return (
<>
<Hero
@@ -711,6 +830,7 @@ function InstalledLayout({
<CategorizedList
plugins={plugins}
query={query}
+ categoryOrder={categoryOrder}
onConnect={onConnect}
onDisconnect={onDisconnect}
/>
@@ -759,6 +879,11 @@ function SearchInput({ value, onChange }: { value: string; onChange: (v: string)
}
function FilterMenu({ filter, setFilter }: { filter: FilterId; setFilter: (f: FilterId) => void }) {
+ // Reads the already-cached catalog rather than taking the categories through
+ // three intermediate components. React Query dedupes on the shared key, so
+ // this subscribes to existing data and issues no extra request.
+ const { data } = useQuery({ queryKey: ["marketplace-plugins"], queryFn: fetchCatalog });
+ const categories = orderedCategories(data, (data?.plugins ?? []).map(adapt));
return (
<div className="relative">
<select
@@ -766,9 +891,10 @@ function FilterMenu({ filter, setFilter }: { filter: FilterId; setFilter: (f: Fi
onChange={(e) => setFilter(e.target.value as FilterId)}
className="h-9 cursor-pointer appearance-none rounded-full border border-border bg-card/60 px-4 pr-7 text-xs font-medium text-foreground hover:border-primary/40 focus:border-primary/40 focus:outline-none"
>
- {FILTERS.map((f) => (
- <option key={f.id} value={f.id}>
- {f.label}
+ <option value="all">All</option>
+ {categories.map((c) => (
+ <option key={c} value={c}>
+ {c}
</option>
))}
</select>
@@ -981,24 +1107,35 @@ function CarouselSlideView({ slide, active }: { slide: CarouselSlide; active: bo
function CategorizedList({
plugins,
query,
+ categoryOrder,
onConnect,
onDisconnect,
-}: { plugins: Plugin[]; query: string } & ConnectHandlers) {
+}: {
+ plugins: Plugin[];
+ query: string;
+ categoryOrder: string[];
+} & ConnectHandlers) {
if (plugins.length === 0) {
if (!query.trim()) return null;
return <EmptyHits query={query} />;
}
const featured = plugins.filter((p) => p.featured);
- const byCat: Record<Category, Plugin[]> = {
- Developer: [],
- Productivity: [],
- Communication: [],
- };
+ // Built from the data, not from a fixed record. The previous fixed record
+ // meant a category the backend added but the UI did not know threw on
+ // `byCat[p.category].push(...)` and blanked the whole view behind its error
+ // boundary.
+ const byCat = new Map<string, Plugin[]>();
for (const p of plugins) {
if (p.featured) continue;
- byCat[p.category].push(p);
+ const bucket = byCat.get(p.category);
+ if (bucket) bucket.push(p);
+ else byCat.set(p.category, [p]);
}
+ const sections = [
+ ...categoryOrder.filter((c) => byCat.has(c)),
+ ...[...byCat.keys()].filter((c) => !categoryOrder.includes(c)).sort(),
+ ];
return (
<div className="space-y-10">
@@ -1014,20 +1151,18 @@ function CategorizedList({
))}
</Section>
)}
- {(Object.keys(byCat) as Category[])
- .filter((c) => byCat[c].length > 0)
- .map((c) => (
- <Section key={c} title={c}>
- {byCat[c].map((p) => (
- <PluginRow
- key={p.id}
- plugin={p}
- onConnect={onConnect}
- onDisconnect={onDisconnect}
- />
- ))}
- </Section>
- ))}
+ {sections.map((c) => (
+ <Section key={c} title={c}>
+ {(byCat.get(c) ?? []).map((p) => (
+ <PluginRow
+ key={p.id}
+ plugin={p}
+ onConnect={onConnect}
+ onDisconnect={onDisconnect}
+ />
+ ))}
+ </Section>
+ ))}
</div>
);
}
@@ -1043,8 +1178,77 @@ function Section({ title, children }: { title: string; children: React.ReactNode
);
}
+/** The card's brand mark.
+ *
+ * A full-colour asset carries the brand itself and sits on a neutral surface.
+ * A single-colour glyph sits ON the brand's own colour — that inversion is
+ * what makes the store read as a product catalog rather than a settings list;
+ * a dark glyph on a white square reads as a placeholder.
+ *
+ * When the mark cannot load at all — offline, a locked-down network, or an
+ * icon the CDN has dropped — the tile falls back to a monogram instead of a
+ * broken image, so a card is never blank.
+ */
+export function BrandTile({ plugin }: { plugin: Plugin }) {
+ const [failed, setFailed] = useState(false);
+ const tile = brandTile(plugin);
+ const fullColour = isFullColourMark(plugin);
+ const showMonogram = failed || !plugin.logoSlug;
+
+ return (
+ <div
+ className="grid h-10 w-10 shrink-0 place-items-center overflow-hidden rounded-lg border border-border/60"
+ style={
+ fullColour && !showMonogram
+ ? { backgroundColor: "#ffffff" }
+ : { backgroundColor: tile }
+ }
+ >
+ {showMonogram ? (
+ <span
+ className="text-sm font-semibold"
+ style={{ color: `#${glyphColor(tile)}` }}
+ >
+ {plugin.name.slice(0, 1).toUpperCase()}
+ </span>
+ ) : (
+ <img
+ src={resolveLogoUrl(plugin)}
+ alt=""
+ className={cn(fullColour ? "h-7 w-7" : "h-5 w-5")}
+ loading="lazy"
+ onError={() => setFailed(true)}
+ />
+ )}
+ </div>
+ );
+}
+
+/** How long the connection will last, stated BEFORE the user connects.
+ *
+ * Most providers keep a connection alive indefinitely; a few force a periodic
+ * re-login and no amount of engineering on our side can extend that. Saying so
+ * on the card is the difference between an informed choice and a connection
+ * that quietly dies weeks later. `provider_limited` carries a note explaining
+ * how often — a warning without an answer would be worse than none.
+ */
+export function LongevityBadge({ plugin }: { plugin: Plugin }) {
+ const limited = plugin.longevity === "provider_limited";
+ return (
+ <span
+ title={plugin.longevityNote ?? LONGEVITY_LABEL[plugin.longevity]}
+ className={cn(
+ "text-[9px] font-medium uppercase tracking-wider",
+ limited ? "text-amber-500/80" : "text-muted-foreground/45",
+ )}
+ >
+ {LONGEVITY_LABEL[plugin.longevity]}
+ </span>
+ );
+}
+
// ---------------------------------------------------------------------------
-// PluginRow — bigger tile + bigger icon for multicolor logos
+// PluginRow — brand tile + status and longevity badges
// ---------------------------------------------------------------------------
function PluginRow({
@@ -1055,7 +1259,6 @@ function PluginRow({
const isConnected = plugin.status === "connected";
const needsReauth = plugin.status === "needs_reauth";
const isError = plugin.status === "error";
- const isMulticolor = !!plugin.logoUrl;
return (
<article
@@ -1074,14 +1277,7 @@ function PluginRow({
"border-border hover:border-primary/40 hover:bg-card/70",
)}
>
- <div className="grid h-10 w-10 shrink-0 place-items-center rounded-md border border-border/60 bg-white">
- <img
- src={resolveLogoUrl(plugin)}
- alt=""
- className={cn(isMulticolor ? "h-7 w-7" : "h-5 w-5")}
- loading="lazy"
- />
- </div>
+ <BrandTile plugin={plugin} />
<div className="min-w-0 flex-1">
{/* `flex-wrap` + `shrink-0` badges: when a connected plugin's
@@ -1119,12 +1315,15 @@ function PluginRow({
<p className="truncate text-xs text-muted-foreground">{plugin.description}</p>
</div>
- <span
- className="hidden text-[9px] font-medium uppercase tracking-wider text-muted-foreground/70 sm:block"
- title={plugin.category}
- >
- {AUTH_LABELS[plugin.authMode]}
- </span>
+ <div className="hidden shrink-0 flex-col items-end gap-0.5 sm:flex">
+ <span
+ className="text-[9px] font-medium uppercase tracking-wider text-muted-foreground/70"
+ title={plugin.category}
+ >
+ {AUTH_LABELS[plugin.authMode]}
+ </span>
+ <LongevityBadge plugin={plugin} />
+ </div>
<ConnectIconButton
status={plugin.status}
@@ -1697,7 +1896,7 @@ export function PkceConnectDialog({
onClose: () => void;
onProceed: () => void | Promise<void>;
}) {
- const fam = OAUTH_CLIENT_FAMILY[plugin.id];
+ const fam = oauthClientFamily(plugin);
const isGoogle = fam?.family === "google";
const [showClient, setShowClient] = useState(false);
const [clientId, setClientId] = useState("");