fix: use fileURL for static template logo index path#8539
fix: use fileURL for static template logo index path#8539christian-byrne merged 1 commit intomainfrom
Conversation
fetchLogoIndex() was incorrectly using api.fetchApi() which adds an '/api' prefix to URLs. Since /templates/index_logo.json is a static asset file (not an API endpoint), it should use api.fileURL() instead. Fixes COM-14279 Amp-Thread-ID: https://ampcode.com/threads/T-019c1c81-9495-719b-a096-e49eedd1c9ea
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 02/02/2026, 04:19:48 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Tests:
|
📝 WalkthroughWalkthroughThe PR modifies the logo index loading mechanism in the workflow templates store by replacing an API wrapper call with a direct fetch operation using the same underlying file URL, maintaining existing error handling and validation logic. Changes
Possibly related PRs
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 26 kB (baseline 26 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 978 kB (baseline 978 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 80.7 kB (baseline 80.7 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed Panels & Settings — 471 kB (baseline 471 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 12 added / 12 removed User & Accounts — 3.94 kB (baseline 3.94 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 3 added / 3 removed Editors & Dialogs — 2.89 kB (baseline 2.89 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 2 added / 2 removed UI Components — 33.7 kB (baseline 33.7 kB) • ⚪ 0 BReusable component library chunks
Status: 4 added / 4 removed Data & Services — 2.71 MB (baseline 2.71 MB) • 🔴 +6 BStores, services, APIs, and repositories
Status: 8 added / 8 removed Utilities & Hooks — 25.3 kB (baseline 25.3 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 7 added / 7 removed Vendor & Third-Party — 10.7 MB (baseline 10.7 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 7.17 MB (baseline 7.17 MB) • ⚪ 0 BBundles that do not match a named category
Status: 36 added / 36 removed |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/platform/workflow/templates/repositories/workflowTemplatesStore.ts (1)
507-514:⚠️ Potential issue | 🟡 MinorAdd a
response.okguard before reading headers.
fetch()won’t throw on non-2xx, so a 404/500 currently falls through to the content-type check and silently returns{}. Guarding onresponse.okmakes error handling explicit and aligns with the “proper error handling” guideline.🔧 Proposed fix
- const response = await fetch(api.fileURL('/templates/index_logo.json')) - const contentType = response.headers.get('content-type') - if (!contentType?.includes('application/json')) return {} + const response = await fetch(api.fileURL('/templates/index_logo.json')) + if (!response.ok) return {} + const contentType = response.headers.get('content-type') + if (!contentType?.includes('application/json')) return {}

Summary
Fix template logo loading by using
api.fileURL()instead ofapi.fetchApi()for the static logo index file.Problem
fetchLogoIndex()was usingapi.fetchApi('/templates/index_logo.json')which adds an/apiprefix to URLs, resulting in requests to/api/templates/index_logo.jsoninstead of/templates/index_logo.json.Since
/templates/index_logo.jsonis a static asset file (not an API endpoint), it should useapi.fileURL()which doesn't add the/apiprefix.Changes
api.fetchApi('/templates/index_logo.json')tofetch(api.fileURL('/templates/index_logo.json'))Testing
Fixes COM-14279
┆Issue is synchronized with this Notion page by Unito