feat(frontend): visualize document parsing pipeline with span timeline
Renders a five-segment timeline (DocReader → Chunking → Embedding →
Multimodal → PostProcess) above each document so users can see exactly
which stage a document is in and which one failed, instead of a flat
"Parsing..." spinner.
- New KnowledgeProcessingTimeline component (full + compact mode):
full mode lives at the top of doc-content for any document not yet
in `completed`; compact mode replaces the parsing/failed lines in
the card hover popover with a five-dot mini-progress.
- Polls GET /api/v1/knowledge/:id/spans every 2s while
parse_status in {pending, processing}; stops on terminal status or
unmount. Hover popover instances opt out of polling to avoid
amplifying requests on grid hover.
- Failed / cancelled steps expand into an error card with the raw
error_message, an error_code -> localized title + suggestion mapping
for the twelve canonical codes (DOCREADER_TIMEOUT, EMBEDDING_RATE_LIMIT,
...), and a "Copy details" button that pastes the failed span JSON
for support tickets.
- Attempt selector renders only when latest_attempt > 1 so reparse
history is browsable; the latest attempt is selected by default.
- Last-error block under the timeline includes a Retry button that
calls reparseKnowledge() and immediately re-fetches.
- i18n strings added under knowledgeStages for en-US, zh-CN, ko-KR,
ru-RU. ja-JP locale file does not exist in this repository.
This commit is contained in:
@@ -388,6 +388,57 @@ export default {
|
||||
chunkLoadFailed: 'Failed to load chunks',
|
||||
},
|
||||
|
||||
knowledgeStages: {
|
||||
title: 'Processing pipeline',
|
||||
attempt: 'Attempt {n}',
|
||||
attemptLatest: 'Attempt {n} (latest)',
|
||||
retry: 'Retry parsing',
|
||||
copyDetails: 'Copy details',
|
||||
copied: 'Copied to clipboard',
|
||||
noActivity: 'No parsing activity yet',
|
||||
stage: {
|
||||
docreader: 'Document parsing',
|
||||
chunking: 'Chunking',
|
||||
embedding: 'Vectorization',
|
||||
multimodal: 'Multimodal recognition',
|
||||
postprocess: 'Post-processing',
|
||||
},
|
||||
status: {
|
||||
pending: 'Pending',
|
||||
running: 'Running',
|
||||
done: 'Done',
|
||||
failed: 'Failed',
|
||||
skipped: 'Skipped',
|
||||
cancelled: 'Cancelled',
|
||||
},
|
||||
errorCode: {
|
||||
DOCREADER_TIMEOUT: 'Document parser timed out',
|
||||
DOCREADER_TIMEOUT_SUGGESTION: 'The file may be too large or the parser service is busy. Try again later or split the document.',
|
||||
DOCREADER_UNAVAILABLE: 'Document parser unavailable',
|
||||
DOCREADER_UNAVAILABLE_SUGGESTION: 'The parsing service is offline. Contact your administrator.',
|
||||
DOCREADER_PARSE_FAILED: 'Document parsing failed',
|
||||
DOCREADER_PARSE_FAILED_SUGGESTION: 'The file could not be parsed. Verify it is not corrupted.',
|
||||
CHUNKING_FAILED: 'Chunking failed',
|
||||
CHUNKING_FAILED_SUGGESTION: 'Try adjusting the chunking configuration of the knowledge base.',
|
||||
EMBEDDING_RATE_LIMIT: 'Embedding service rate-limited',
|
||||
EMBEDDING_RATE_LIMIT_SUGGESTION: 'The embedding provider is throttling requests. Retry shortly.',
|
||||
EMBEDDING_PROVIDER_FAIL: 'Embedding provider error',
|
||||
EMBEDDING_PROVIDER_FAIL_SUGGESTION: 'The embedding provider returned an error. Check provider configuration.',
|
||||
VECTORSTORE_WRITE_FAILED: 'Vector store write failed',
|
||||
VECTORSTORE_WRITE_FAILED_SUGGESTION: 'The vector store rejected the write. Check store availability.',
|
||||
MULTIMODAL_VLM_FAILED: 'Image understanding failed',
|
||||
MULTIMODAL_VLM_FAILED_SUGGESTION: 'A subset of images could not be processed. Document may still be usable.',
|
||||
MULTIMODAL_ALL_FAILED: 'All images failed multimodal processing',
|
||||
MULTIMODAL_ALL_FAILED_SUGGESTION: 'Verify the multimodal model configuration.',
|
||||
TASK_TIMEOUT: 'Task exceeded maximum runtime',
|
||||
TASK_TIMEOUT_SUGGESTION: 'The task ran longer than allowed. Retry or contact support.',
|
||||
UPSTREAM_FAILED: 'Stopped because an upstream stage failed',
|
||||
UPSTREAM_FAILED_SUGGESTION: 'A previous stage failed and prevented this step from running.',
|
||||
UNKNOWN: 'Unknown error',
|
||||
UNKNOWN_SUGGESTION: 'Check the application logs for details.',
|
||||
},
|
||||
},
|
||||
|
||||
agent: {
|
||||
taskLabel: 'Task:',
|
||||
think: 'Thinking',
|
||||
|
||||
Reference in New Issue
Block a user