Commit Graph

865 Commits

Author SHA1 Message Date
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
wizardchen 5c0e97c12e fix(frontend): refresh batch reparse UI after async task enqueue
Optimistically mark submitted documents as pending and poll until the worker
updates the backend, preventing a stale completed state after list reload.
2026-06-25 23:57:54 +08:00
wizardchen 97b7bb9890 fix(knowledge): harden batch reparse UX and async processing
Move batch reparse work to an asynq task to avoid HTTP timeouts, add i18n
for all locales, guard in-flight documents, and prevent concurrent delete/reparse.
2026-06-25 23:57:54 +08:00
jw_mac a14c1d87aa feat(knowledge): add batch reparse capability
This commit introduces the Batch Reparse feature for the Knowledge Base.
Users can now select multiple documents and trigger a re-parsing pipeline in batches, streamlining the recovery from parse failures.
2026-06-25 23:43:27 +08:00
wizardchen 5f2ca6c975 fix(agent): reconcile agent stream mode and shared-agent readiness UX
Derive stream pipeline from selectedAgentId to fix quick-answer/isAgentEnabled drift, gate configure actions for shared agents, and polish selector detail panel positioning.
2026-06-25 23:33:39 +08:00
wizardchen 47478491c9 fix(agent): address readiness review findings
Tighten shared-agent readiness checks, surface not-ready toasts in the
selector, validate chat-model overrides in resolveChatModelID, and
improve configure deep-links for shared agents.
2026-06-25 23:33:39 +08:00
wizardchen 9ca4e1f23a feat(agent): enforce model readiness and polish selector UX
Block chat when agents lack an explicit chat or rerank model, guide users
through the selector and editor with field highlight, and align session QA
checks with the same readiness rules on backend and frontend.
2026-06-25 23:33:39 +08:00
wizardchen 1e16834d27 fix(frontend): reflect PDF scanned parsing in upload overview
Show the force-scanned mode in the parser summary line when enabled for
builtin PDF uploads, and add missing ko-KR/ru-RU i18n strings for the toggle.
2026-06-25 17:36:18 +08:00
杨聪聪 917feceb59 feat(docreader): support forcing PDF scanned-page OCR parsing 2026-06-25 17:30:22 +08:00
wizardchen 2c44a41f2a feat(models): add model test debugger for saved model configs
Let admins send real requests against configured chat, embedding, rerank,
VLM, and ASR models from settings, with thinking controls shown only when
the model supports them.
2026-06-25 17:05:33 +08:00
wizardchen 122408b283 feat(chat): unify resource chips and browse recent files in @ mention
Add recent=true to knowledge search so the mention picker can list recent
files without a keyword, and consolidate KB/FAQ/file chip styling across
chat input and message history.
2026-06-24 20:58:16 +08:00
wizardchen babe3f2315 fix(integrations): polish agent filter UX and embed session rebind
Add compact agent filter beside channel list titles with selected name
display, fix embed localStorage agentId read on rebind, add IM agent
rebind tests, and deep-link agent editor counts to the matching tab.
2026-06-24 20:09:19 +08:00
wizardchen ec5c3ac638 fix(frontend): polish integration channel card actions
Align add-card height with channel cards, show actions on hover,
and replace delete dialogs with in-place popconfirm like model settings.
2026-06-24 20:09:19 +08:00
wizardchen 635d7c9643 feat(integrations): polish embed/IM channel editors and agent rebind
Align embed channel setup with a step wizard, simplify deploy layout,
and allow changing bound agents on update for embed and IM channels.
2026-06-24 20:09:19 +08:00
wizardchen 2d6d1e3275 fix(frontend): correct integrations redirect tab and lazy-load panels
Map legacy section=integrations to tab=im instead of an invalid tab value,
and mount only the active IntegrationsModal tab to avoid duplicate API calls.
2026-06-24 20:09:19 +08:00
wizardchen 314b2a035c feat(frontend): add publish integrations center and streamline agent editor
Move IM and web embed channel management into a dedicated sidebar entry,
remove the user-menu IM overview submenu, and show a lightweight publish
channel status row in the agent editor basic settings instead of full panels.
2026-06-24 20:09:19 +08:00
wizardchen 8242b6f298 refactor(frontend): update WeCom icon and styles in IM components
Replaced the WeCom SVG icon with a new design and updated the associated styles in the IMChannelPanel and SessionSourceFilter components to reflect the new color scheme. Adjusted layout properties for better responsiveness and visual consistency across the application.
2026-06-24 11:01:56 +08:00
wizardchen ab3e472748 feat(frontend): implement session source filter component for improved session management
Added a new SessionSourceFilter component to allow users to filter session lists by source, enhancing the user experience. The component integrates with existing session management features and includes logic for displaying web and channel sources. Additionally, utility functions for managing session source options and visibility conditions have been introduced, along with corresponding unit tests to ensure functionality.
2026-06-24 10:30:10 +08:00
wizardchen 2cd1db859c fix(frontend): unify sidebar other-sources section typography
Channel folder headers and nested session rows now share 13px type,
consistent icon sizing, and aligned indentation so the menu no longer
mixes oversized session titles with undersized folder labels.
2026-06-24 10:30:10 +08:00
wizardchen 775cc9ef11 fix(frontend): auto-scroll capped thinking block during streaming
Keep scrolling the thinking detail panel to the bottom while reasoning
content streams, not only before the first chunk arrives.
2026-06-23 20:17:19 +08:00
wizardchen bc9ad3aca0 fix(qa): wire agent thinking toggle and show reasoning in RAG timeline
Default unset agent thinking to explicit false so thinking_type models
receive disabled/enabled wire params. Render reasoning inside the quick-answer
pipeline timeline only when thinking events arrive, avoiding a flash of the
thinking step when thinking mode is off.
2026-06-23 20:17:19 +08:00
wizardchen 3cb0e906a7 fix(datasource): harden RSS connector and editor UX after review
Scope auth headers to feed fetches, use feed-scoped external IDs and
content-based incremental fingerprints, tolerate partial feed failures,
store feed URLs in settings, and fix credential configured detection.
2026-06-23 17:30:38 +08:00
wizardchen e40ad802d7 feat(datasource): add RSS feed connector with full-text ingestion
Enable private RSS feeds as a knowledge base data source with custom
headers, article body fetching, and Markdown output for incremental sync.
2026-06-23 17:30:38 +08:00
wizardchen 94ce8fedb1 feat(mcp): add custom headers functionality to MCP service dialog
Introduce a new feature allowing users to add custom HTTP headers for MCP requests. This includes:

- A user interface for adding and managing custom headers within the MCP service dialog.
- Localization support for custom headers in English, Korean, Russian, and Chinese.
- Updates to the form submission process to include custom headers, ensuring they are serialized correctly.
- Removal of warnings for ignored headers, as all headers are now captured in the custom headers editor.

This enhancement improves the flexibility and usability of the MCP service configuration.
2026-06-22 21:08:06 +08:00
wizardchen 518add2641 feat(mcp): add code import functionality for MCP service configuration
Implement a new feature that allows users to import MCP service configurations via a standard JSON format. This includes:

- A toggle for importing from code with a user-friendly hint and placeholder.
- Error handling for various scenarios such as empty input, invalid JSON, and missing URLs.
- Toast notifications for successful imports and warnings about ignored headers.
- Updates to the MCP service dialog to support this new functionality, ensuring a seamless user experience during service creation and editing.
2026-06-22 20:45:50 +08:00
wizardchen 7f3f219f58 feat(mcp): add OAuth2 authorization for MCP services
Support connecting to MCP servers that require OAuth2, with a Cursor-like
zero-config flow: the user provides only a URL and the system performs
metadata discovery, dynamic client registration (DCR), and the
authorization code flow with PKCE on first connect.

- Persist per-user access/refresh tokens and per-service DCR client
  credentials, encrypted at rest (AES-256-GCM)
- Store the PKCE verifier/state during the flow via Redis with an
  in-memory fallback for Lite mode
- Cache MCP clients per (service, user) so tokens stay user-isolated
- Add endpoints for authorize-url, callback, status, and token revoke;
  the callback is allowlisted for unauthenticated access
- Surface a structured "authorization required" hint when a tool call
  hits an unauthorized MCP service
- Frontend: add an auth-type selector with OAuth config, inline
  authorization status/actions, and render the connection test result
  inline in the editor drawer instead of a stacked centered dialog
2026-06-22 20:19:31 +08:00
Binks Riverton c25d762ed1 fix(organization): invalidate fetch cache after creating org
Reset organizationsLoadedAt to 0 after orgStore.create() succeeds,
so that the subsequent fetchOrganizations() call from
handleSettingsSaved is not blocked by the 60-second TTL cache.
This ensures resource_counts and other aggregated fields are
refreshed immediately after creating a shared space.
2026-06-22 20:17:18 +08:00
wizardchen 5d0d317a36 feat(datasource): reveal pre-existing selections in lazily-loaded picker
When editing a data source whose tree loads one level at a time (Feishu
wiki), a saved deep-node selection was invisible: only top-level spaces
were listed, so the selected node could not be seen and its ancestor
space rendered as unchecked.

- Add Connector.ResolveResourceAncestors: given selected resource IDs,
  return the ancestor IDs that must be expanded to reveal them. Feishu
  walks up via GetWikiNode (O(depth) per selection, no full-tree walk);
  Notion/Yuque return empty.
- Fix wikiNode.ParentNodeID JSON tag: the Feishu API field is
  parent_node_token, not parent_node_id, so GetWikiNode can return the
  parent and the ancestor walk works in production.
- Expose POST /datasource/{id}/resource-ancestors (service + handler +
  route) and a matching frontend API client.
- Edit-mode picker reveals hidden selections by expanding and lazily
  loading each ancestor level, so selections are visible and checked.
- Gate child fetching on treeFullyLoaded instead of a partial-children
  heuristic, avoiding a redundant request for full-tree connectors.
2026-06-22 19:24:08 +08:00
wizardchen d8f13ada4a fix(datasource): lazy-load Feishu wiki resources to avoid listing timeout (#1672)
Listing resources for a Feishu data source eagerly walked the entire wiki
tree (one API call per node across every space), which exceeded the request
timeout for large knowledge bases. ListResources now takes a parentID and
returns a single level at a time: empty lists the wiki spaces, a space/node
ID lists only its direct children. The frontend fetches children on demand
when a node is expanded. Notion (full tree in one call) and Yuque (flat)
keep their existing behavior by ignoring non-empty parentID.

Refs: https://github.com/Tencent/WeKnora/issues/1672
2026-06-22 17:53:30 +08:00
wizardchen ddc5460988 fix(frontend): update UserMenu to use localized string for system management
Replace hardcoded "系统管理" text with the localized key for system management in UserMenu.vue, enhancing internationalization support.
2026-06-22 15:57:41 +08:00
wizardchen 5f7ed2ffe9 feat(i18n): add key descriptions for various settings in multiple languages
- Introduce detailed descriptions for authentication, SSRF protection, tenant management, and async task worker settings in English, Korean, Russian, and Chinese localization files.
- Enhance user understanding of configuration options by providing context-sensitive help directly within the settings interface.
- Update the Settings and SystemSettings components to utilize these new descriptions for improved user experience.
2026-06-22 15:21:50 +08:00
wizardchen 10e63b2227 feat(frontend): add MCP config section and unify modal navigation styles
- Add dedicated MCP service configuration section in AgentEditorModal (agent mode only)
- Unify sidebar nav hover/active states across settings and editor modals
- Refine tool card and tag chip colors to use design tokens and color-mix
- Tighten suggested questions button padding and border-radius
2026-06-22 14:33:54 +08:00
wizardchen 8ada130ee1 fix(frontend): enhance repairFlankingEmphasis to handle opening delimiters correctly
- Update regex patterns to account for opening delimiters preceded by letters/numbers and followed by punctuation, ensuring proper rendering of emphasis in markdown.
- Add tests to validate new behavior for various edge cases, including punctuation-adjacent emphasis and exponent markers.
- Improve overall markdown rendering consistency in chat components.
2026-06-22 12:31:34 +08:00
wizardchen 483f507104 feat(frontend): add wiki tool support and enhance agent tool icon mapping
- Implement `getWikiPageText` function to handle persisted slugs and JSON input for wiki page text retrieval.
- Update `getAgentToolIconName` to include mappings for `wiki_search` and `wiki_read_page` tools.
- Enhance tests to cover new functionality for wiki tools and ensure proper icon mapping in the agent stream display.
- Modify `AgentStreamDisplay` to utilize new wiki tool features and improve localization for wiki-related actions.
2026-06-22 12:25:28 +08:00
Binks Riverton 0c3c866f0b fix(frontend): prevent settings modal from overflowing viewport on small screens
Add max-height: calc(100vh - 40px) to .settings-modal so it never exceeds
the viewport height minus overlay padding, keeping the close button always
visible without requiring F11 fullscreen.
2026-06-22 12:03:40 +08:00
Binks Riverton 9739ebc2ee @
fix(frontend): lower UploadConfirmDialog z-index so Settings modal appears above it

Reduce the overlay z-index from 2500 to 1000 so that the global
Settings modal (z-index: 1100) opens on top of the upload confirm
dialog instead of behind it.

Previously, when a user uploaded image files without a multimodal
model configured, clicking "前往全局设置添加模型" would open the
Settings modal behind the upload confirm dialog, forcing the user
to close the dialog first. With the z-index lowered to the
project-wide modal convention (1000), the Settings modal now
displays correctly above this dialog.
@
2026-06-22 12:02:54 +08:00
wizardchen 31f05cf425 feat(frontend): add directory view toggle and improve localization
- Introduce a view mode toggle for directory display in the WikiBrowser component, allowing users to switch between tree and list views.
- Update localization files for English, Korean, Russian, and Chinese to include new strings for the view mode toggle and its associated labels.
- Enhance user experience by providing clear visual options for navigating directory structures.
2026-06-22 11:56:47 +08:00
wizardchen cc9de85c25 feat(frontend): enhance chat streaming visuals with shimmer effect and fade tail
- Introduce a shimmer effect for in-progress step titles in chat components, providing visual feedback during processing.
- Implement a trailing fade effect for the most recently streamed characters in chat markdown, enhancing the typing experience.
- Update CSS styles to support the new shimmer and fade effects, ensuring smooth transitions and visual coherence.
- Add tests to verify the functionality of the shimmer effect and the application of the fade tail in markdown rendering.
2026-06-22 10:48:53 +08:00
wizardchen 58461a5b68 feat(frontend): enhance chat markdown rendering and streaming behavior
- Introduce functions to stabilize rendering of dangling inline markers during streaming, preventing flickering and layout shifts.
- Implement tagging for standalone strong paragraphs to ensure consistent styling as subtitles.
- Update CSS for chat components to improve animation smoothness and visual feedback during typing.
- Add tests for new markdown rendering features, including handling of incomplete emphasis and citation tags.
2026-06-22 10:48:53 +08:00
wizardchen ae9038732a style(frontend): update ListSpaceSidebar styles for improved hover and active states
- Change background colors for hover and active states to enhance visual feedback.
- Adjust icon label colors and remove unnecessary font weight properties for better consistency.
- Refine item count background color to align with updated design standards.
2026-06-18 18:50:19 +08:00
wizardchen b5acb89b4d feat(frontend): enhance chat stream handling with assistant message management
- Introduce mechanisms to mark assistant messages as completed and handle in-flight messages during user queries.
- Implement functions to prepare for new outgoing messages and manage the stopping of assistant messages.
- Update chat stream handling to ensure proper message state management and prevent reuse of incomplete messages.
- Integrate new functionalities into existing composables for improved chat experience.
2026-06-18 18:42:16 +08:00
wizardchen c6b5d2e77b feat(frontend): enhance chat scroll handling for improved user experience
- Implement logic to accurately detect user scroll direction, preventing false positives during content loading.
- Update scroll handling in both `useEmbedChatSession` and chat view to maintain auto-follow functionality during streaming.
- Introduce a mechanism to differentiate between actual upward scrolls and content growth, enhancing chat usability.
2026-06-18 18:42:16 +08:00
wizardchen 80bcf200b6 feat(frontend): enhance chat image handling and typewriter effect
- Introduce a stable skeleton box for protected images during loading to prevent flickering.
- Implement a new composable `useStickyBottomOnResize` to maintain chat scroll position as content loads.
- Add `useTypewriter` for smoother text rendering in chat, improving user experience during streaming.
- Create a directive `vStableHtml` to efficiently update HTML content without losing image states.
- Enhance chat markdown rendering to handle incomplete citation tags and trailing horizontal rules during streaming.
- Add tests for new typewriter functionality and citation handling.
2026-06-18 18:42:16 +08:00
wizardchen 95b97dc379 style(frontend): update component styles for consistency and usability
- Change background colors in menu and user message components for better visual coherence
- Adjust text colors and font weights in UserMenu for improved readability
- Enhance suggested questions layout with updated spacing and alignment
- Refine chat message styles for better responsiveness and user experience
- Update hover effects and transitions for suggested question cards
2026-06-18 18:42:16 +08:00
wizardchen 4e2d568149 feat(frontend): polish chat suggestions, citations, and drawers
- unify suggested-question styling across chat entry points
- keep citation markers inline with their preceding list content
- prevent manual editor viewport shifts and synchronize drawer motion
- align embedded preview and editor drawers in the body stacking context
2026-06-18 18:42:16 +08:00
wizardchen e0d3c1dafd feat(frontend): improve manual knowledge editor and chat citation rendering
- Replace manual knowledge editor dialog with SettingDrawer and refine toolbar/footer layout
- Add draft status resolution for manual knowledge items in the knowledge base
- Fix citation placement near fenced code blocks and add regression tests
- Update ChatRequestInfoButton icon and chat message/citation styles
- Add i18n strings for manual knowledge editor features
2026-06-17 20:52:37 +08:00
wizardchen c3cd629da7 fix(tenant): purge memberships on delete and filter stale switcher rows
Cascade soft-delete tenant_members when a workspace is removed so the
tenant switcher no longer shows ghost entries as "#<id>". Also filter
orphaned memberships in /auth/me and switch to another workspace after
delete when one remains.
2026-06-17 10:31:53 +08:00
langcaiye fd5eecb4e3 feat: add tenant workspace deletion UI 2026-06-17 05:09:46 +08:00
wizardchen 16363623ab feat(wiki): enhance anchored form popups and internationalization updates
Add new styles for anchored form popups in the wiki browser, improving the user interface for folder actions and confirmations. Update internationalization strings for move confirmation titles in English, Korean, Russian, and Chinese locales to enhance user experience across multiple languages. Refactor existing components to integrate the new popup styles and ensure consistent behavior.
2026-06-17 00:28:30 +08:00
wizardchen e76738d054 feat(wiki): implement folder management features in wiki API
Add new API functions for managing wiki folders, including creating, updating, deleting, and listing folders. Introduce a new WikiFolder interface to represent folder structure and enhance the WikiBrowser component with folder actions. Update internationalization strings for folder-related actions in English, Korean, Russian, and Chinese locales. Refactor existing code to accommodate folder hierarchy and improve user experience in the wiki browser.
2026-06-16 23:51:29 +08:00