Commit Graph

76 Commits

Author SHA1 Message Date
yangdx
484e441d0c Optimize Postgres retry logic for HA switchover
- Increase default retries and backoff
- Raise connection retry parameter caps
- Update env example with HA defaults
- Extend frontend timeouts for updates
- Update integration test limits
2025-12-31 16:03:46 +08:00
yangdx
9ed19695bb Remove separate retry button and merge functionality into scan button 2025-10-25 04:12:44 +08:00
yangdx
8dc23eeff2 Fix RayAnything compatible problem
• Use "preprocessed" to indicate multimodal processing is required
• Update DocProcessingStatus to process status convertion automatically
• Remove multimodal_processed from DocStatus enum value
• Update UI filter logic
2025-10-22 20:15:29 +08:00
yangdx
130b4959dc Add PREPROCESSED (multimodal_processed) status for multimodal document processing
• Add DocStatus.PREPROCESSED enum value
• Update API routes and response models
• Add preprocessed filter in web UI
• Update localization files
• Handle preprocessed status in deletion
2025-10-14 14:02:05 +08:00
yangdx
0c1cb7b731 Improve document tooltip display with track ID and better formatting
• Add track ID to tooltip display
• Remove JSON braces from metadata
• Reorder tooltip content layout
• Clean up metadata indentation
• Show track ID before metadata
2025-10-05 10:13:11 +08:00
Jon
cf2a024e37 feat: Add endpoint and UI to retry failed documents
Add a new `/documents/reprocess_failed` API endpoint and corresponding
UI button to retry processing of failed and pending documents. This
addresses a common recovery scenario when document processing fails due
to server crashes, network errors, or LLM service outages.

Backend changes:
- Add ReprocessResponse model with status, message, and track_id fields
- Add POST /documents/reprocess_failed endpoint that triggers background
  reprocessing of FAILED, PENDING, and interrupted PROCESSING documents
- Reuses existing apipeline_process_enqueue_documents for consistency
- Includes comprehensive docstring and logging for observability

Frontend changes:
- Add TypeScript types and API function for the new endpoint
- Add retry handler with intelligent polling (fast refresh → normal)
- Add "Retry Failed" button in Documents page toolbar
- Button disabled when pipeline is busy to prevent duplicate operations
- Complete i18n support (English and Chinese translations)

This feature provides a convenient way to recover from processing
failures without requiring a full filesystem rescan.
2025-10-04 16:46:29 -04:00
yangdx
13681a185f Fix tooltip text wrapping to preserve word boundaries
• Change break-all to break-word
• Add overflow-wrap: break-word
• Apply to tooltip and pre elements
2025-09-17 02:04:43 +08:00
yangdx
983fe31af5 Bump API version and improve tooltip text wrapping in DocumentManager
- Update API version to 0224
- Add word-break: break-all to tooltip
- Improve pre tag text wrapping
- Enhance tooltip readability
2025-09-17 01:47:40 +08:00
yangdx
ecdd8f17eb feat: add robust error handling and resilience to DocumentManager
• Circuit breaker pattern for failures
• Exponential backoff retry logic
• Request timeout wrapper
• Enhanced error classification
2025-09-16 17:14:10 +08:00
yangdx
e4dd83ee3d Change tooltips font to a smaller one 2025-09-05 22:14:28 +08:00
yangdx
1be7c53fcc Enhance document status display with metadata tooltips and better icons
- Add metadata formatting with timestamps
- Replace warning emoji with proper icons
- Show tooltips for errors and metadata
- Import AlertTriangle and Info icons
- Improve status cell layout and styling
2025-09-05 22:02:26 +08:00
yangdx
7db788aa66 fix(webui): resolve document status grouping issue in DocumentManager
- Fix documents being grouped by status after pagination and sorting
- Use backend-sorted data directly from currentPageDocs instead of re-grouping
- Preserve backend sort order to prevent status-based grouping
- Maintain backward compatibility with legacy docs structure
- Ensure all sorting fields (file name, dates, ID) work correctly without status grouping

The issue occurred because the frontend was re-grouping already-sorted data
from the backend by status, breaking the intended sort order. Now documents
are displayed in the exact order returned by the backend API.

Fixes: Document list sorting by file name was grouping by status instead of
maintaining proper sort order across all documents.
2025-08-26 23:03:41 +08:00
yangdx
ec1bf43667 fix(webui): preserve current page when pipeline status changes
- Add intelligent refresh function to handle boundary cases
- Replace manual refresh with smart page preservation logic
- Auto-redirect to last page when current page becomes invalid
- Maintain user's browsing position during pipeline start/stop
- Fix issue where document list would reset to first page after pipeline operations
2025-08-21 22:53:24 +08:00
yangdx
1af0803c62 fix(ui): fix selection state management in paginated views
- Replace DeselectDocumentsDialog with smart selection button
- Auto-reset selection on page/filter changes
- Remove deletion restrictions and update i18n
2025-08-17 10:38:12 +08:00
yangdx
e566267a20 Implement smart polling recovery after document scan completion
• Add 15-second recovery timer
• Restore intelligent intervals
2025-08-17 01:51:11 +08:00
yangdx
47002e645b fix: resolve quick refresh after clearing documents in DocumentManager
- Fix handleDocumentsCleared to use proper 30s idle interval instead of 500ms
- Update smart polling useEffect to depend on complete statusCounts object
- Reset status counts immediately when documents are cleared
2025-07-31 03:45:11 +08:00
yangdx
45f27fccc3 feat(webui): Implement intelligent polling and responsive health checks
- Relocate the health check functionality from aap.tsx to state.ts to enable initialization by other components.
- Replaced the fixed 5-second polling with a dynamic interval. The polling interval is extended to 30 seconds when the no files in pending an processing state.
- Data refresh is triggered instantly when  `pipelineBusy` state changed
- Health check is triggered  after clicking "Scan New Documents" or "Clear Documents"
2025-07-31 01:37:24 +08:00
yangdx
93dede163d feat: move document list reset button to right side with ghost style 2025-07-30 22:37:22 +08:00
yangdx
0eac1a883a Feat: add file path sorting for document manager
- Add file_path sorting support to all database backends (JSON, Redis, PostgreSQL, MongoDB)
- Implement smart column header switching between "ID" and "File Name" based on display mode
- Add automatic sort field switching when toggling between ID and file name display
- Create composite indexes for workspace+file_path in PostgreSQL and MongoDB for better query performance
- Update frontend to maintain sort state when switching display modes
- Add internationalization support for "fileName" in English and Chinese locales

This enhancement improves user experience by providing intuitive file-based sorting
while maintaining performance through optimized database indexes.
2025-07-30 18:46:55 +08:00
yangdx
e60c26ea77 feat: set default page size to 10 and persist in localStorage
- Change default documents page size from 20 to 10 rows
- Add documentsPageSize setting to settings store with persistence
- Update DocumentManager to use and save page size preference
- Include migration for existing users to get new default value
2025-07-30 18:07:38 +08:00
yangdx
74eecc46e5 feat(pagination): Implement document list pagination backends and frontend UI
- Add pagination support to BaseDocStatusStorage interface and all implementations (PostgreSQL, MongoDB, Redis, JSON)
- Implement RESTful API endpoints for paginated document queries and status counts
- Create reusable pagination UI components with internationalization support
- Optimize performance with database-level pagination and efficient in-memory processing
- Maintain backward compatibility while adding configurable page sizes (10-200 items)
2025-07-30 17:58:32 +08:00
yangdx
cbaede8455 Add ScanResponse type for scan endpoint in webui 2025-07-30 03:11:09 +08:00
yangdx
6f958d5aee feat: add metadata timestamps to document processing and update frontend compatibility
- Add metadata field to doc_status storage with Unix timestamps for processing start/end times
- Update frontend API types: error -> error_msg, add track_id and metadata support
- Add getTrackStatus API method for document tracking functionality
- Fix frontend DocumentManager to use error_msg field for proper error display
- Ensure full compatibility between backend metadata changes and frontend UI
2025-07-30 00:04:27 +08:00
yangdx
907a07d71e Allow to delete files with incomplete status 2025-07-07 18:14:14 +08:00
yangdx
0f392dfa78 Fix linting 2025-06-25 17:09:41 +08:00
yangdx
8ea7d7ad85 Feat: Add document deletion for WebUI 2025-06-25 17:09:10 +08:00
yangdx
13eeb9a52b Optimze document status change monitor 2025-04-16 00:51:09 +08:00
yangdx
6c90a919f0 Optimize health check 2025-04-15 21:23:29 +08:00
yangdx
67fafedf64 Fix document list sorting problem while filter is off 2025-04-09 23:35:53 +08:00
yangdx
6a0909ea32 Fix i18n direction problem 2025-04-07 20:24:51 +08:00
yangdx
56865816f1 Fix linting 2025-04-07 06:20:48 +08:00
yangdx
d2efc80fad fix: prevent promise errors in async operations after component unmount
This commit addresses the "Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received" error that occurs when async operations attempt to update state after component unmount.

Changes:

- Add component mount status tracking with useRef in App.tsx and DocumentManager.tsx
- Implement beforeunload event listeners to handle page reload scenarios
- Add mount status checks before and after async operations
- Add try-catch blocks to properly handle errors in async operations
- Ensure state updates only occur when components are still mounted
- Prevent health check and document polling from causing errors during unmount
2025-04-07 06:04:18 +08:00
yangdx
f33ff7f2c2 Fix linting 2025-04-07 05:23:28 +08:00
yangdx
46ffb6afa4 fix: improve form accessibility with proper label associations
Added missing htmlFor attributes to labels and corresponding IDs to form elements throughout the web UI to enhance accessibility. This ensures screen readers can correctly identify form controls and improves browser autofill functionality. Changes include:

- Fixed label associations in login form
- Added proper IDs to form elements in Settings component
- Replaced decorative labels with semantic headings in PropertiesView
- Added screen reader accessible labels in RetrievalTesting
- Improved checkbox accessibility in QuerySettings
2025-04-07 05:20:12 +08:00
yangdx
e86fda5894 Optimize document sorting with useCallback
- Memoize sortDocuments function
- Add dependencies to useCallback
- Improve performance
2025-04-04 14:49:47 +08:00
yangdx
4aeb562aa9 Enhanced status filter button styling
- Added active state styles for all buttons
- Improved visual feedback for selected filters
2025-04-04 14:48:51 +08:00
yangdx
ce0b8045f4 Merge branch 'feat-document-filter' 2025-04-04 14:11:41 +08:00
yangdx
4372024ad6 feat(ui): Add document list refresh to UploadDocumentsDialog
- Add callback pattern for document list refresh after upload
- Implement conditional refresh based on upload success
- Ensure backend state is updated after successful uploads
2025-04-01 14:55:27 +08:00
yangdx
0d93ed2f2c feat(ui): Improve document list refresh mechanism in ClearDocumentsDialog
- Replace direct API call with callback pattern for document list refresh
- Ensure document list updates regardless of operation success/failure
- Improve component decoupling between ClearDocumentsDialog and DocumentManager
2025-04-01 14:46:52 +08:00
yangdx
66d0b0322d Optimize layout 2025-03-29 01:55:46 +08:00
yangdx
0d315be8e6 Optima document TAB layout 2025-03-29 01:52:18 +08:00
yangdx
8cd7d418dc Fix: tooltip flickering problem 2025-03-28 12:03:30 +08:00
yangdx
f182cf4a09 Fix liting 2025-03-27 16:55:15 +08:00
yangdx
441d1b8ced Optime tooltips display 2025-03-27 16:50:27 +08:00
yangdx
4fae0fa54e Optimed table header 2025-03-27 15:38:57 +08:00
yangdx
73e5916f99 Fix linting 2025-03-27 13:38:36 +08:00
yangdx
fa5d39d8a2 feat: add sortable columns to document manager
- Add sorting capability for ID, created_at and updated_at columns
- Implement ascending/descending sort with visual indicators
- Handle special case for filename sorting in ID column
- Add hover effects on sortable column headers
2025-03-27 13:37:50 +08:00
yangdx
d149fd1bae Optimize tooltips and layout 2025-03-27 11:11:59 +08:00
yangdx
3f52c7985f Optimize collum width 2025-03-27 10:45:28 +08:00
yangdx
1cae6d77e7 Optimize tooltips 2025-03-27 10:41:21 +08:00