Improve consistency for server-discovered documents

- Separate "Has Errors" section for erroneous server documents (already
  uploaded but have validation errors)
- "Ready to Upload" section now only shows truly local documents
- Erroneous server docs show only "Delete from server" button (no retry)
- Improved metadata display: show document ID for server docs, hide
  unknown file size
- Clean up verbose debug logging

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-16 22:49:07 +01:00
parent 327943bc18
commit 24daa4bf82
2 changed files with 42 additions and 32 deletions

View File

@@ -500,23 +500,17 @@ export async function listServerDocuments(
});
// Get shippable documents (status 2)
console.log('[Binect API] Fetching shippable documents...');
const shippableResponse = await client.documents.list();
console.log('[Binect API] Shippable response:', JSON.stringify(shippableResponse));
const shippable = shippableResponse.items || [];
console.log('[Binect API] Found', shippable.length, 'shippable documents');
// Get erroneous documents (status 7)
console.log('[Binect API] Fetching erroneous documents...');
const errorsResponse = await client.documents.listErrors();
console.log('[Binect API] Errors response:', JSON.stringify(errorsResponse));
const erroneous = errorsResponse.items || [];
console.log('[Binect API] Found', erroneous.length, 'erroneous documents');
// Combine and map to our format
const allDocs = [...shippable, ...erroneous];
console.log('[Binect API] Total documents on server:', allDocs.length);
console.log('[Binect API] Found', allDocs.length, 'documents on server (', shippable.length, 'shippable,', erroneous.length, 'erroneous)');
return allDocs.map(doc => {
let errorDetails: string | undefined;