Commit Graph
479 Commits
Author SHA1 Message Date
yiling dad60b4bca chore(db): regenerate prisma client after schema index additions 2026-05-29 15:31:34 +08:00
yiling b9e35512e5 fix(db): rename collation from 'numeric' to 'natural_sort'
'numeric' is a reserved keyword and built-in type in PostgreSQL, which
can cause syntax parsing issues and ORM compatibility problems when used
as a collation name. Renamed to 'natural_sort' to be unambiguous and
self-documenting.
2026-05-29 15:30:35 +08:00
yiling ddac22a12f fix(db): persist hnsw.iterative_scan via ALTER DATABASE instead of SET
SET only applies to the current migration session and is lost when the
connection closes. Use a DO block with current_database() to execute
ALTER DATABASE ... SET, which persists the GUC for all future connections.

The DO block with format('%I', current_database()) avoids hardcoding
the database name and works on PostgreSQL < 16 (which lacks ALTER DATABASE
CURRENT syntax).
2026-05-29 15:29:29 +08:00
yiling 048028007e feat(db): add HNSW index on asset_embeddings and natural sort collation on assets.name
- Add HNSW index on asset_embeddings.embedding using vector_cosine_ops (m=16,
  ef_construction=64) with hnsw.iterative_scan=relaxed_order for efficient
  filtered ANN queries
- Create ICU numeric collation and alter assets.name column to use it for
  natural sort (file2 < file10 instead of lexicographic ordering)
- Add B-tree index on assets.name with numeric collation for sort performance
- Add schema @@index annotations to match migration index names
- Add 7 tests verifying natural sort behaviour in both AssetService.listChildren
  and SearchService.search (Prisma ORM and raw-SQL paths)
2026-05-29 15:18:31 +08:00
Yiling-J 840cf87728 Merge pull request #35 from shumaiOne/squash-migrations
chore(db): squash migrations into a single initial migration
2026-05-29 14:56:17 +08:00
yiling 9da3d6e1ce fix(workflow): remove direct prisma database calls from query-embedding-for-search workflow
- Refactor queryEmbeddingForSearch workflow to use activities for DB updates

- Add generic updateWorkflowTaskActivity database activity to decouple workflows from prisma runtime

- Resolves webpack bundler scheme errors during docker build
2026-05-29 12:31:53 +08:00
yiling 67b50ab6f0 chore(db): squash all migrations into a single initial migration
- Delete 19 historical migration files and directories

- Generate a new squashed migration 000000000000_squashed_migrations using prisma migrate diff

- Verify that all tests pass cleanly using Testcontainers with the squashed migration
2026-05-29 12:22:58 +08:00
Yiling-J 030f3aa8e9 Merge pull request #34 from shumaiOne/refactor-search-query-builder
refactor(search): unify search and delegate condition building to SqlQueryBuilder
2026-05-29 12:17:27 +08:00
yiling d8ae99788d refactor(search): delegate condition building to SqlQueryBuilder 2026-05-29 12:11:05 +08:00
yiling bb437a8487 refactor(search): unify search logic under SqlQueryBuilder 2026-05-29 11:50:03 +08:00
Yiling-J df3c269dee Merge pull request #33 from shumaiOne/feat/semantic-search
feat(search): add semantic search with embeddings
2026-05-29 11:38:38 +08:00
yiling f1a44a5ba4 refactor(search-ui): add semantic search instructions to Ready to Search area 2026-05-29 11:35:34 +08:00
yiling ebfc512f17 refactor(search-ui): clear search state and prevent auto-search on toggling semantic search 2026-05-29 11:32:33 +08:00
yiling f05cb1350a refactor(search-ui): disable Save as Collection in semantic search and refine placeholder instructions 2026-05-29 11:25:11 +08:00
yiling ef1b327aa2 refactor(search-ui): align DialogHeader title vertically with top close button 2026-05-29 11:20:23 +08:00
yiling 2febd07bab refactor(search-ui): use DialogHeader and DialogTitle in SearchFilterDialog 2026-05-29 11:18:29 +08:00
yiling dd6ac86860 refactor(search-ui): remove auto-search and configure Close button for semantic search 2026-05-29 11:06:17 +08:00
yiling 4f9c4db9ce feat(search): implement multi-chunk semantic search with segment timestamps 2026-05-29 11:00:23 +08:00
yiling 1855ca1405 perf(search): optimize pgvector semantic search query to use HNSW index 2026-05-29 00:06:02 +08:00
yiling a341c6d131 test(team): update settings test to include semanticSearchEnabled 2026-05-28 23:54:00 +08:00
yiling 40cb1986f4 fix(search): add migration for query_embedding_for_search task type 2026-05-28 20:19:25 +08:00
yiling 2eb6ff6c0e feat(search): add semantic search with embeddings and search mode toggle 2026-05-28 20:14:11 +08:00
Yiling-J a39f793050 Merge pull request #32 from shumaiOne/remove-generic-ai-providers
refactor(ai): remove generic providers and hardcode gemini-embedding-2
2026-05-28 16:49:03 +08:00
yiling f1963e7bb9 refactor(ai): initialize GoogleGenAI with process.env.GEMINI_API_KEY directly for embedding 2026-05-28 15:21:44 +08:00
yiling 6bce76cf0a refactor(ai): remove legacy provider validations in embedding context activity 2026-05-28 15:17:10 +08:00
yiling 75e65a39b3 refactor(ai): pass outputDimensionality 1536 to gemini-embedding-2 2026-05-28 15:12:39 +08:00
yiling cf94738132 chore: remove unused dependencies from package.json 2026-05-28 15:02:21 +08:00
yiling a04392da41 refactor(ai): remove generic providers and hardcode gemini-embedding-2 in embedding activity 2026-05-28 14:55:59 +08:00
Yiling-J 5425f095fd Merge pull request #31 from shumaiOne/remove-ai-transcription
feat: remove AI transcription functionality
2026-05-28 14:30:39 +08:00
yiling 5173bb2a01 feat: remove all ai transcription related code and schema 2026-05-28 14:23:02 +08:00
Yiling-J 721a9c13d7 Merge pull request #30 from shumaiOne/feat/rename-metadata-field-key
refactor(metadata): rename field_id to field_key in AssetMetadataValue
2026-05-28 12:39:49 +08:00
yiling 89916a2950 refactor(metadata): rename field_id to field_key in AssetMetadataValue
Rename the database column from field_id to field_key and the Prisma
property from fieldId to fieldKey to better reflect that the column
stores human-readable metadata field keys, not internal database IDs.

This fixes a bug where AI autofill wrote internal DB IDs instead of
field keys, causing metadata values to not display in the UI.

- Add SQL migration to rename the column
- Update metadata, search, and asset services
- Fix agent-autofill workflow to map fields by key
- Update all related test suites
2026-05-28 12:38:07 +08:00
Yiling-J 2ad2542d5b Merge pull request #29 from shumaiOne/feat/strict-agent-context
refactor(agent): make AgentExecutionContext 100% type-safe
2026-05-28 12:37:10 +08:00
yiling 904d9d7eac refactor(agent): make AgentExecutionContext 100% type-safe
- Use generated Prisma types to precisely define AgentExecutionContext properties
- Make sessionId public in DatabaseSessionStorage and use instanceof type guard
- Explicitly type getAgentChatContextActivity and getAgentAutofillContextActivity returns
- Clean up all 'as any' casts and ESLint disable comments
- Refactor agent.test.ts to cast Session with DatabaseSessionMetadata
2026-05-28 11:43:42 +08:00
Yiling-J 5d5d631922 Merge pull request #28 from shumaiOne/refactor/split-db-agent-activities
refactor(workflow): split database and agent activities for strict database isolation
2026-05-28 11:02:54 +08:00
yiling 407b6359f2 fix(ui): optimize comment polling and remove unused comments endpoint 2026-05-28 10:59:08 +08:00
yiling 023f256e00 refactor(error): refactor standard throws to non-retryable ApplicationFailure in workflows and activities 2026-05-28 10:43:54 +08:00
yiling afeb5e9899 fix(transcode): fix missing thumbnail and sprite generation in transcoding workflow 2026-05-28 10:39:12 +08:00
yiling 6d19293ed0 fix(transcode): allow updating read-only metadata during transcoding 2026-05-28 10:17:25 +08:00
yiling 3b08ade55d refactor(workflow): throw non-retryable ApplicationFailure for validation errors 2026-05-28 09:57:30 +08:00
yiling 11d2e89a48 refactor(workflow): enforce strict nested type safety for WorkflowTaskPayload 2026-05-28 09:48:05 +08:00
yiling 911e369782 refactor(workflow): split database and agent activities for strict database isolation 2026-05-27 23:40:14 +08:00
Yiling-J 4ded573fde Merge pull request #27 from shumaiOne/fix/independent-sidebar-scroll
fix(ui): enable independent sidebar scroll, validate readonly fields, pin selection bar
2026-05-27 23:17:43 +08:00
yiling 7fc338e2e5 fix(ui): pin file selection bottom bar to list view bottom 2026-05-27 23:11:49 +08:00
yiling fa53ffab02 fix(ui): prevent edits and validate read-only metadata fields 2026-05-27 23:08:10 +08:00
yiling d4e681fcdc fix(ui): enable independent sidebar scrolling in file list page 2026-05-27 22:14:29 +08:00
Yiling-J 9f19e2f25d Merge pull request #26 from shumaiOne/feat/improve-drawing-annotations
feat(chat): improve annotation drawing, typing, and list badges
2026-05-27 22:05:40 +08:00
yiling aea79cd210 feat(chat): enable typing during annotation, increase line thickness, and add draw badge 2026-05-27 22:05:10 +08:00
Yiling-J 67cab62c02 Merge pull request #25 from shumaiOne/feat/auth-redesign-v2
feat(auth): redesign login and signup pages for premium visual aesthetics
2026-05-27 16:49:36 +08:00
yiling 03cc43ef30 feat(auth): redesign login and signup pages for premium visual aesthetics 2026-05-27 16:43:18 +08:00