Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a comprehensive workspace folders feature set for organizing and managing documents across personal, group, and public workspaces. The implementation includes four major features: a Document Tag System with full CRUD operations, a grid-based Folder View with drill-down navigation, Multi-Workspace Scope Management with automatic locking, and enhanced Chat Document/Tag Filtering. The PR also includes citation parsing improvements and automatic AI Search index field fixes.
Changes:
- Document Tag System: 15 API endpoints (5 per workspace type) for tag management with color-coded UI and AI Search integration
- Workspace Folder View: Toggle between list/grid views with tag-based folders, breadcrumb navigation, and sortable contents
- Multi-Workspace Scope Management: Hierarchical checkbox dropdown for selecting multiple workspaces with per-conversation scope locking
- Chat Document/Tag Filtering: Multi-select dropdowns for documents and tags with DOM-based filtering
- Citation improvements and auto-fix for Azure AI Search index fields
Reviewed changes
Copilot reviewed 43 out of 45 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| config.py | Version bump to 0.238.024 |
| docs/explanation/release_notes.md | Added comprehensive release notes for v0.238.024 |
| docs/explanation/features/v0.238.024/*.md | Four new feature documentation files |
| functions_documents.py | Added tag management functions (normalize, validate, get_workspace_tags, propagate_tags_to_chunks) |
| functions_search.py | Added build_tags_filter() and multi-group/multi-document support |
| route_backend_*.py | Added tag CRUD endpoints across all workspace types |
| route_backend_conversations.py | Added scope lock PATCH endpoint |
| route_backend_chats.py | Integrated tags_filter and active_group_ids parameters |
| functions_conversation_metadata.py | Implemented scope lock logic |
| utils_cache.py | Updated cache keys for multi-group and tags support |
| templates/*.html | Added grid view UI, scope dropdown, tag management modals |
| static/js/workspace/*.js | New modules for tag management and grid rendering |
| static/js/chat/*.js | Updated for multi-workspace scope and tag filtering |
| static/json/ai_search-index-*.json | Added document_tags field to all three index schemas |
| route_backend_settings.py | Added auto-fix functionality for missing index fields |
| CLAUDE.md | New project instructions document |
| return {'error': str(e)} | ||
|
|
||
|
|
There was a problem hiding this comment.
The auto_fix_index_fields function lacks proper error handling for several potential failure modes: JSON file read errors, invalid schema format, and Azure AI Search API failures. Consider adding specific try-except blocks around file operations and index operations with appropriate error messages and logging using log_event from functions_appinsights.py as per coding guidelines.
| return {'error': str(e)} | |
| # Log unexpected errors for observability and debugging | |
| error_message = f"auto_fix_index_fields failed for idx_type={idx_type}: {str(e)}" | |
| try: | |
| log_event( | |
| "auto_fix_index_fields_error", | |
| { | |
| "error": str(e), | |
| "index_type": idx_type, | |
| "user_id": user_id, | |
| "admin_email": admin_email or "", | |
| }, | |
| ) | |
| except Exception: | |
| # Avoid raising from logging failures; keep original exception context | |
| pass | |
| return {'status': 'error', 'error': error_message} |
| # ENFORCE_WORKSPACE_SCOPE_LOCK.md | ||
|
|
||
| **Feature**: Enforce Workspace Scope Lock | ||
| **Version**: v0.238.025 |
There was a problem hiding this comment.
The version mismatch between ENFORCE_WORKSPACE_SCOPE_LOCK.md (line 4) which states "Version: v0.238.025" and the actual version in config.py (line 91) which is "0.238.024" creates inconsistency. The documentation should match the actual release version.
| # BLOB_METADATA_TAG_PROPAGATION.md | ||
|
|
||
| **Feature**: Blob Metadata Tag Propagation | ||
| **Version**: v0.238.025 |
There was a problem hiding this comment.
The version mismatch between BLOB_METADATA_TAG_PROPAGATION.md (line 4) which states "Version: v0.238.025" and the actual version in config.py (line 91) which is "0.238.024" creates inconsistency. The documentation should match the actual release version.
(v0.238.024)
New Features
Blob Metadata Tag Propagation
document_tagsfield containing a comma-separated list of tags.enable_enhanced_citationsis enabled in admin settings; no blob metadata changes occur otherwise.functions_documents.py.BLOB_METADATA_TAG_PROPAGATION.md)Enforce Workspace Scope Lock
config.py,functions_settings.py,route_frontend_admin_settings.py,admin_settings.html,chats.html,chat-documents.js,route_backend_conversations.py.ENFORCE_WORKSPACE_SCOPE_LOCK.md)Document Tag System
/api/documents/tags,/api/group_documents/<id>/tags, and/api/public_workspace_documents/<id>/tags.propagate_tags_to_chunks(), enabling OData tag filtering during hybrid search with AND logic (document_tags/any(t: t eq 'tag')).functions_documents.py,functions_search.py,route_backend_documents.py,route_backend_group_documents.py,route_backend_public_documents.py.static/json/ai_search-index-user.json,static/json/ai_search-index-group.json,static/json/ai_search-index-public.json.DOCUMENT_TAG_SYSTEM.md)Workspace Folder View (Grid View)
workspace-tags.js(1257 lines),workspace-tag-management.js(732 lines).workspace.html,group_workspaces.html,public_workspaces.html,public_workspace.js.WORKSPACE_FOLDER_VIEW.md)Multi-Workspace Scope Management
null(auto-lockable) →true(locked) →false(user-unlocked) →true(re-lockable).PATCH /api/conversations/<id>/scope_lock.chat-documents.js,chat-messages.js,chats.html,route_backend_chats.py,route_backend_conversations.py.MULTI_WORKSPACE_SCOPE_MANAGEMENT.md)Chat Document and Tag Filtering
[Personal],[Group: Name], or[Public: Name].document_tags/any(t: t eq 'tag1') and document_tags/any(t: t eq 'tag2').chat-documents.js,chat-messages.js,functions_search.py,route_backend_chats.py,chats.html.CHAT_DOCUMENT_AND_TAG_FILTERING.md)Bug Fixes
parseCitations()function only generated links for pages with existing[doc_prefix_N]bracket references, leaving pages without explicit references as non-functional text.getDocPrefix()to extract the document ID prefix from known reference patterns and construct missing page references (e.g., if[doc_abc_1]exists, inferdoc_abc_2throughdoc_abc_5).chat-citations.js.CITATION_IMPROVEMENTS.md)User Interface Enhancements
Extended Document Dropdown Width
chat-documents.js.Enhanced Citation Links
chat-citations.js,chat-enhanced-citations.js.CITATION_IMPROVEMENTS.md)