Enhanced Document Views for Source Explorer #150
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces new ways to view documents within our source explorer (
/sources
), making it easier to navigate through different types of content.Key Changes
Technical Details
An overview of Source Explorer's functionality from my notes to help you better review this change.
Entry Point (
pages/sources.tsx
):useSources
hook for data fetchingData Fetching Layer:
elasticSearchProxy/
:sources.ts
: Retrieves aggregated source data and metadata from ElasticsearchsourceDocuments.ts
: Fetches paginated documents with view mode supportgetDocumentContent.ts
: Retrieves full content of a specific documentCustom Hooks:
useSources.ts
: Manages source data and metadata fetchinguseSourceDocuments.ts
: Handles paginated document fetching with view modesuseDocumentContent.ts
: Manages individual document content retrievalUI Components:
Documents.tsx
: Main container component orchestrating the document viewsViewModeSelector.tsx
: Handles switching between view modes based on availabilityDocumentTable.tsx
: Renders flat/summary view of documentsThreadedDocumentTable.tsx
: Renders threaded view of documentsPaginationControls.tsx
: Handles pagination for all view modesDocumentModal.tsx
: Displays detailed document contentThe flow works as follows:
useSources
Documents
component initializes