fix(resources): add 'vector' to ResourceType — fixes missing connection_url + broken icon#154
Merged
Merged
Conversation
…on_url + broken icon When POST /vector/new shipped 2026-05-20, the dashboard's typed surface was not updated alongside it (rule 22 — contract changes touch all surfaces). Wire effect: a vector resource (pgvector-enabled postgres) came back with resource_type="vector" and the dashboard: 1. Skipped the GET /resources/:id/credentials fetch on the detail page (vector was missing from CREDENTIALED_RESOURCE_TYPES), so users provisioning a vector resource could never see their postgres:// connection URL through the dashboard. 2. Rendered the ResourceIcon as `undefined res-name-ico` — the icon class lookup returned undefined for the missing union member. Fix: - Add 'vector' to ResourceType (now exported as RESOURCE_TYPES const so tests can iterate the registry). - Add 'vector' to CREDENTIALED_RESOURCE_TYPES (and export it for the coverage test). - Add 'vector' to ResourceIcon map (reuses ico-pg — pgvector is a Postgres extension; wire distinction stays for audit/scan splits). - Registry-iterating regression tests: every RESOURCE_TYPES member must (a) yield a real ico-* class on ResourceIcon and (b) appear in exactly one of CREDENTIALED_RESOURCE_TYPES or the test's NON_CREDENTIALED list. A future POST /something/new addition will auto-fail until both decisions are wired. Local gate: `npm run build` (tsc + vite build + prerender) + `npm test` both green. 1101 passing tests (added 10).
size-limit report 📦
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When POST /vector/new shipped on 2026-05-20, the dashboard's typed surface was not updated alongside it (CLAUDE.md rule 22 — contract changes touch all surfaces). Result for any team that provisioned a vector resource:
getResource()gates the/api/v1/resources/:id/credentialscall onCREDENTIALED_RESOURCE_TYPES, which only listedpostgres / redis / mongodb.vectorwas silently dropped, so the "Connection string" panel rendered empty — users could provision a pgvector database but never see the URL through the dashboard.undefined res-name-ico. TheRecord<ResourceType, string>map didn't includevector; the lookup returnedundefined, producing a broken CSS class.Fix
'vector'toResourceType(now exported as runtime-iterableRESOURCE_TYPESconst so tests can sweep the registry).'vector'toCREDENTIALED_RESOURCE_TYPESand export it.vector: 'ico-pg'to theResourceIconmap — pgvector is a Postgres extension, so the visual family is the same. Wire distinction stays for audit + storage scans.RESOURCE_TYPESmember (a) must yield a realico-*class onResourceIconand (b) must appear in exactly one ofCREDENTIALED_RESOURCE_TYPESor a NON_CREDENTIALED list. A futurePOST /something/newaddition auto-fails the test until both decisions are wired.Test plan
npm run build— green (tsc strict + vite build + prerender)npm test— 1101 passed | 3 skipped (added 10 new tests, baseline was 1091)POST /vector/new, open it in the dashboard detail page, confirm the connection URL panel renders + icon shows the Postgres glyph.Diff: 96 lines across 4 files.