WeKnora/internal
Anky c007a897cf
feat: support multi-tag for document knowledge (#1790)
* feat: support multi-tag for document knowledge

- Add knowledge_tag_relations join table for many-to-many tag-knowledge mapping
- Migrate existing single tag_id data to the new table
- Update Knowledge struct, filter, payload types (TagID -> Tags/TagIDs)
- Rewrite repository layer: SetKnowledgeTags, GetKnowledgeTags, ListIDsByTagIDs
- Update tag count references to query knowledge_tag_relations
- Update service/handler layers for multi-tag create/list/batch-update
- Frontend: multi-select tag sidebar, multi-tag chip display, tag toggle in popup
- FAQ tags remain single-tag model (unchanged)

* feat(knowledge): tag edit dialog with dynamic overflow and inline creation

- Add TagEditDialog component with search, multi-select, and confirm
- Replace inline t-popup tag selector with dialog-based editing
- Tags overflow with +N badge, visible count adapts to container width via ResizeObserver
- Date/card layout: fixed date width, tags flex to fill remaining space
- Add persistent new-tag input bar in dialog (Enter to create, auto-select)
- Tag creation emits callback to refresh parent tag list immediately
- Apply same overflow + dialog trigger to both card view and list view
- Add i18n keys: tagEditDialogTitle, tagEditSearch, tagSelectedCount, tagOverflowTip, tagNewPlaceholder

* fix: exclude soft-deleted knowledge from tag reference counts

CountReferences, BatchCountReferences, and DeleteUnusedTags now
JOIN with knowledges table to filter out soft-deleted records
when counting knowledge_tag_relations. Previously they queried
knowledge_tag_relations directly without the deleted_at check,
causing stale tag counts after knowledge deletion.

* fix: refresh tag counts after async knowledge deletion completes

Add a second delayed tag list refresh (2.5s) after tag deletion to capture
updated reference counts for remaining tags. The original immediate refresh
handles removing the deleted tag from the list, while this delayed refresh
ensures other tags' counts are correct after the async deletion finishes.

---------

Co-authored-by: lyingbug <xiayula2014@gmail.com>
2026-06-26 00:18:48 +08:00
..
agent feat(mcp): add OAuth2 authorization for MCP services 2026-06-22 20:19:31 +08:00
application feat: support multi-tag for document knowledge (#1790) 2026-06-26 00:18:48 +08:00
assets feat(assets): add ASR test audio file and embed it in the application 2026-04-02 21:27:27 +08:00
common perf(common): compile LLM-JSON code-fence regexp once 2026-06-16 19:52:00 +08:00
config test: add document process task options tests 2026-05-28 20:27:53 +08:00
container feat(datasource): add RSS feed connector with full-text ingestion 2026-06-23 17:30:38 +08:00
database feat(system-info): surface DB migration errors with troubleshooting links 2026-05-14 16:34:50 +08:00
datasource fix(datasource): optimize RSS incremental sync and surface partial failures 2026-06-23 17:30:38 +08:00
errors feat(knowledge): track per-stage parsing progress with /stages API 2026-05-28 15:14:45 +08:00
event fix(event): add panic recovery to async goroutines 2026-06-04 15:37:08 +08:00
handler feat: support multi-tag for document knowledge (#1790) 2026-06-26 00:18:48 +08:00
im feat: support multi-tag for document knowledge (#1790) 2026-06-26 00:18:48 +08:00
infrastructure fix(web-search): improve SearXNG test connection error messages 2026-06-24 14:28:49 +08:00
logger fix(agent): remove unused RunnableByViewer gate blocking viewer chat 2026-06-23 18:21:23 +08:00
mcp feat(mcp): add OAuth2 authorization for MCP services 2026-06-22 20:19:31 +08:00
middleware feat(mcp): add OAuth2 authorization for MCP services 2026-06-22 20:19:31 +08:00
models feat(models): add model test debugger for saved model configs 2026-06-25 17:05:33 +08:00
ratelimit feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
router fix(knowledge): harden batch reparse UX and async processing 2026-06-25 23:57:54 +08:00
runtime feat(system): add server startup time and uptime tracking 2026-06-04 15:48:04 +08:00
sandbox perf(sandbox): compile command-substitution regexps once 2026-06-16 19:51:32 +08:00
searchutil feat(backend): improve parent-child chunk merge and imageinfo matching 2026-06-16 01:09:07 +08:00
stream feat(redis): add REDIS_USERNAME support for Redis ACL 2026-02-04 19:38:40 +08:00
tracing/langfuse feat(observability): enhance Langfuse retrieve and rerank tracing 2026-06-16 01:09:23 +08:00
types feat: support multi-tag for document knowledge (#1790) 2026-06-26 00:18:48 +08:00
utils perf(utils): compile SQL-validation regexps once instead of per call 2026-06-17 14:17:17 +08:00