WeKnora/frontend
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
..
packages chore: Update Dockerfile and package-lock.json for xlsx package management 2025-11-17 13:15:10 +08:00
public feat(embed): add widget, visitor chat, and management UI (#1657) 2026-06-12 23:10:39 +08:00
src feat: support multi-tag for document knowledge (#1790) 2026-06-26 00:18:48 +08:00
.dockerignore feat(docker): streamline frontend build process and update Docker configuration 2026-06-10 16:04:11 +08:00
.gitignore init commit 2025-08-05 15:08:07 +08:00
Dockerfile feat(docker): streamline frontend build process and update Docker configuration 2026-06-10 16:04:11 +08:00
docker-entrypoint.sh feat: support remote backend and HTTPS proxy 2026-02-09 17:58:35 +08:00
embed.html feat(embed): add widget, visitor chat, and management UI (#1657) 2026-06-12 23:10:39 +08:00
env.d.ts feat(frontend): inject commit ID into frontend build for version tracking 2026-06-09 18:08:57 +08:00
index.html fix(frontend): bundle tdesign-icons sprite locally for offline deploys 2026-04-23 18:21:49 +08:00
nginx.conf feat(embed): add widget, visitor chat, and management UI (#1657) 2026-06-12 23:10:39 +08:00
package-lock.json feat(release): update to version 0.6.2 with new features and improvements 2026-06-10 15:21:40 +08:00
package.json feat(release): update to version 0.6.2 with new features and improvements 2026-06-10 15:21:40 +08:00
package.json.md5 fix: update environment configuration for debugging and logging, enhance SQLite FTS5 table management, and improve API base URL handling 2026-04-11 18:51:16 +08:00
pnpm-workspace.yaml fix(frontend): configure pnpm v11 build approvals in workspace file 2026-05-08 16:34:33 +08:00
tsconfig.app.json init commit 2025-08-05 15:08:07 +08:00
tsconfig.json init commit 2025-08-05 15:08:07 +08:00
tsconfig.node.json init commit 2025-08-05 15:08:07 +08:00
vite.config.ts feat: add EPUB and MHTML document support 2026-06-16 11:25:27 +08:00