mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-03 12:52:39 +02:00
feat: fixed issues of note management
Issues Fixed - Missing pagination fields in API response schemas (page, page_size, has_more) - NOTE enum missing from frontend Zod schema - Missing fields in DocumentRead response construction (content_hash, updated_at) - BlockNote slash menu clipped by overflow-hidden CSS - Sidebar click conflicts - hidden action buttons intercepting clicks - Rewrote All Notes sidebar - replaced fragile custom portal with shadcn Sheet - Missing translation keys for new UI strings - Missing NOTE retrieval logic in researcher agent - Added search to All Notes sidebar - Removed frontend logging - was causing toasters on every page refresh - Added backend logging to document reindex Celery task
This commit is contained in:
parent
3c3527d498
commit
c768730b8c
37 changed files with 758 additions and 740 deletions
|
|
@ -266,12 +266,27 @@ async def read_documents(
|
|||
document_type=doc.document_type,
|
||||
document_metadata=doc.document_metadata,
|
||||
content=doc.content,
|
||||
content_hash=doc.content_hash,
|
||||
unique_identifier_hash=doc.unique_identifier_hash,
|
||||
created_at=doc.created_at,
|
||||
updated_at=doc.updated_at,
|
||||
search_space_id=doc.search_space_id,
|
||||
)
|
||||
)
|
||||
|
||||
return PaginatedResponse(items=api_documents, total=total)
|
||||
# Calculate pagination info
|
||||
actual_page = (
|
||||
page if page is not None else (offset // page_size if page_size > 0 else 0)
|
||||
)
|
||||
has_more = (offset + len(api_documents)) < total if page_size > 0 else False
|
||||
|
||||
return PaginatedResponse(
|
||||
items=api_documents,
|
||||
total=total,
|
||||
page=actual_page,
|
||||
page_size=page_size,
|
||||
has_more=has_more,
|
||||
)
|
||||
except HTTPException:
|
||||
raise
|
||||
except Exception as e:
|
||||
|
|
@ -385,12 +400,27 @@ async def search_documents(
|
|||
document_type=doc.document_type,
|
||||
document_metadata=doc.document_metadata,
|
||||
content=doc.content,
|
||||
content_hash=doc.content_hash,
|
||||
unique_identifier_hash=doc.unique_identifier_hash,
|
||||
created_at=doc.created_at,
|
||||
updated_at=doc.updated_at,
|
||||
search_space_id=doc.search_space_id,
|
||||
)
|
||||
)
|
||||
|
||||
return PaginatedResponse(items=api_documents, total=total)
|
||||
# Calculate pagination info
|
||||
actual_page = (
|
||||
page if page is not None else (offset // page_size if page_size > 0 else 0)
|
||||
)
|
||||
has_more = (offset + len(api_documents)) < total if page_size > 0 else False
|
||||
|
||||
return PaginatedResponse(
|
||||
items=api_documents,
|
||||
total=total,
|
||||
page=actual_page,
|
||||
page_size=page_size,
|
||||
has_more=has_more,
|
||||
)
|
||||
except HTTPException:
|
||||
raise
|
||||
except Exception as e:
|
||||
|
|
@ -510,7 +540,10 @@ async def get_document_by_chunk_id(
|
|||
document_type=document.document_type,
|
||||
document_metadata=document.document_metadata,
|
||||
content=document.content,
|
||||
content_hash=document.content_hash,
|
||||
unique_identifier_hash=document.unique_identifier_hash,
|
||||
created_at=document.created_at,
|
||||
updated_at=document.updated_at,
|
||||
search_space_id=document.search_space_id,
|
||||
chunks=sorted_chunks,
|
||||
)
|
||||
|
|
@ -559,7 +592,10 @@ async def read_document(
|
|||
document_type=document.document_type,
|
||||
document_metadata=document.document_metadata,
|
||||
content=document.content,
|
||||
content_hash=document.content_hash,
|
||||
unique_identifier_hash=document.unique_identifier_hash,
|
||||
created_at=document.created_at,
|
||||
updated_at=document.updated_at,
|
||||
search_space_id=document.search_space_id,
|
||||
)
|
||||
except HTTPException:
|
||||
|
|
@ -614,7 +650,10 @@ async def update_document(
|
|||
document_type=db_document.document_type,
|
||||
document_metadata=db_document.document_metadata,
|
||||
content=db_document.content,
|
||||
content_hash=db_document.content_hash,
|
||||
unique_identifier_hash=db_document.unique_identifier_hash,
|
||||
created_at=db_document.created_at,
|
||||
updated_at=db_document.updated_at,
|
||||
search_space_id=db_document.search_space_id,
|
||||
)
|
||||
except HTTPException:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue