From ea31f73ed327bf99c6e655ec5d0878eeb6d09841 Mon Sep 17 00:00:00 2001 From: Guilhem Lemouel Date: Fri, 21 Aug 2026 15:29:43 +0200 Subject: [PATCH] refactor: draw the project card's icons from the ones we already ship MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The card fetched each integration icon from the hub as SVG markup, sanitized it and injected it with `{@html}`. The hub renders those icons out of `@windmill-labs/components` — this frontend's own package — so it was a cross-origin round trip to get our own assets back, and it made the card depend on a read that a hub with `API_SECRET` set refuses outright. `hubAppIcon` resolves them through `appIconComponent` instead, so they are components again: no fetch, no DOMPurify, no `{@html}`, and they paint on first render rather than after a round trip. Integration icons now show even against a gated hub; only the summary and the uploaded logo still need it. The one thing the hub was doing for us was resolving `postgres` to the `postgresql` mark, which its `aliasApp` bridges and our icon map does not — so that single alias comes along, next to a note pointing at its counterpart. `ImportProjectSummary.hub` goes with it: it existed to build icon URLs and nothing read it afterwards. Co-Authored-By: Claude Opus 5 (1M context) --- .../lib/components/ImportProjectCard.svelte | 43 ++++++++----------- frontend/src/lib/hubProject.ts | 34 ++++++++------- 2 files changed, 35 insertions(+), 42 deletions(-) diff --git a/frontend/src/lib/components/ImportProjectCard.svelte b/frontend/src/lib/components/ImportProjectCard.svelte index bf67c3be4a..26bb3f7b18 100644 --- a/frontend/src/lib/components/ImportProjectCard.svelte +++ b/frontend/src/lib/components/ImportProjectCard.svelte @@ -10,17 +10,14 @@ logoUrl?: string /** Integration slugs to draw, most representative first. */ iconApps: string[] - /** Where the icons and the logo are fetched from. */ - hub: string counts: { apps: number; flows: number; scripts: number; resources: number } }