VectorsDB support for console#2923
Conversation
- Route delete/update/index operations through database-type-aware SDK (settings, indexes, activity, usage pages were hardcoding documentsDB) - Add updateEntity, deleteIndex methods to sdk.ts helper - Fix pagination and document loading to use correct SDK for vectorsdb - Fix realtime events to listen for both documentsdb and vectorsdb - Fix embeddings: pass number[] directly instead of JSON.stringify roundtrip - Auto-fold embeddings array in editor on document load
- Add !isVectorsDb guard to useMockSuggestions derivation - Use single sliceString for bracket matching instead of per-char rope traversal
Console (appwrite/console)Project ID: Tip Git integration provides automatic deployments with optional PR comments |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR adds full VectorsDB support to the console: SDK integration for collections/documents/indexes, a dimension field in the collection creation modal, HNSW index types, an embedding generation modal, and VectorsDB assets/empty states. The polymorph
Confidence Score: 4/5Safe to merge after fixing the HNSW→Key index type transition bug; remaining findings are P2. One confirmed P1 functional bug (stale fieldList after HNSW type switch blocks index creation) should be addressed before merge. The duplicate button issue is a UI defect worth fixing but not blocking. createIndex.svelte (P1 type-switch bug), collection/+page.svelte (duplicate Import/Export buttons) Important Files Changed
Reviews (4): Last reviewed commit: "Merge remote-tracking branch 'origin/fea..." | Re-trigger Greptile |
…preview, metadata defaults
…embeddings, Object/HNSW send empty orders
…ordb # Conflicts: # bun.lock # package.json # src/routes/(console)/project-[region]-[project]/databases/database-[database]/(entity)/views/field/activity.svelte # src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/activity/+page.ts
…ordb # Conflicts: # src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/usage/[[period]]/+page.ts
| $effect(() => { | ||
| if (isHnswType) { | ||
| fieldList = [{ value: 'embeddings', order: null, length: null }]; | ||
| } | ||
| }); |
There was a problem hiding this comment.
Stale
order: null after switching away from HNSW type
When the user selects an HNSW type, fieldList is set to [{ value: 'embeddings', order: null, length: null }]. If the user then switches to Key or Unique, this $effect doesn't run (since isHnswType is now false), so fieldList retains order: null. That makes addFieldDisabled = true (via !isObjectType && !fieldList.at(-1)?.order), which causes create() to throw "Selected attribute key or type invalid" — blocking index creation until the user manually picks an order.
| $effect(() => { | |
| if (isHnswType) { | |
| fieldList = [{ value: 'embeddings', order: null, length: null }]; | |
| } | |
| }); | |
| $effect(() => { | |
| if (isHnswType) { | |
| fieldList = [{ value: 'embeddings', order: null, length: null }]; | |
| } else if (!isObjectType) { | |
| // Reset stale HNSW state so order is never null for Key/Unique types | |
| if (fieldList.some((f) => f.order === null)) { | |
| fieldList = [{ value: '', order: OrderBy.Asc, length: null }]; | |
| } | |
| } | |
| }); |

Summary
Test plan