Skip to content

Knowledge table optimization - #2202

Merged
mfortman11 merged 30 commits into
langflow-ai:knowledge-table-paginationfrom
jason-dong03:knowledge-table-optimization
Aug 4, 2026
Merged

Knowledge table optimization#2202
mfortman11 merged 30 commits into
langflow-ai:knowledge-table-paginationfrom
jason-dong03:knowledge-table-optimization

Conversation

@jason-dong03

Copy link
Copy Markdown
Collaborator

No description provided.

Visvesh Jegadheesh and others added 29 commits July 23, 2026 11:05
- file size sort, added check for file_size and chunk_count
-10k limit -> 500 file limit
-changed hardcoded page size to be controlled by React State; removed client side pagination from AG Grid and wired up custom UI mimicing AG Grid UI
- Add sortBy/sortOrder state wired to useListFiles (T1-4)
- Map AG Grid colId to backend sort field names (size->file_size, etc.)
- onSortChanged resets to page 1 on sort change via paginationGoToFirstPage()
- Restore AG Grid native pagination UI with pageSize:10000 (T1-6)
- T1-2: le=100 backend cap already removed from files.py
Switched to composite aggregation pagination under v2
- file size sort, added check for file_size and chunk_count
-10k limit -> 500 file limit
-changed hardcoded page size to be controlled by React State; removed client side pagination from AG Grid and wired up custom UI mimicing AG Grid UI
- Add sortBy/sortOrder state wired to useListFiles (T1-4)
- Map AG Grid colId to backend sort field names (size->file_size, etc.)
- onSortChanged resets to page 1 on sort change via paginationGoToFirstPage()
- Restore AG Grid native pagination UI with pageSize:10000 (T1-6)
- T1-2: le=100 backend cap already removed from files.py
Switched to composite aggregation pagination under v2
…on-dong03/openrag into knowledge-table-optimization

# Conflicts:
#	frontend/app/api/queries/useListFiles.ts
#	frontend/app/knowledge/page.tsx
#	src/services/file_service_v2.py
Frontend: switch to /api/v2/files, include is_approximate in ListFilesResponse, and disable pagination buttons; removed a debug console.log. Backend API: add _parse_after_key helper to validate JSON-encoded after_key and return 400 for invalid values; use FastAPI Query pattern parameter. FileServiceV2: add embedding_model to composite sort fields, make _get_file_count return (count, is_approximate) and log on failure, use raw bucket count to detect final page, and propagate is_approximate in responses so the UI can display approximate totals.
-moved custom footer into its own component
-changed styling to match Tailwind
- footer is now always active, showing regardless of servertotal or wildcardquery
-global sort fix
…earch_files page_size cap, reset page on search change
@github-actions github-actions Bot added the frontend 🟨 Issues related to the UI/UX label Aug 4, 2026
@github-actions github-actions Bot added the backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) label Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d3194e30-82c1-4065-bd3c-5b9af9dab93b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mfortman11
mfortman11 merged commit b245948 into langflow-ai:knowledge-table-pagination Aug 4, 2026
15 of 29 checks passed
VisveshJ pushed a commit that referenced this pull request Aug 4, 2026
* Knowledge table optimization (#2202)

* fix: remove page_size cap and fetch all files to fix Knowledge table pagination past 100 files

* T1-1 to T1-3 deliverable

- file size sort, added check for file_size and chunk_count
-10k limit -> 500 file limit
-changed hardcoded page size to be controlled by React State; removed client side pagination from AG Grid and wired up custom UI mimicing AG Grid UI

* feat: T1-4 server-side sort + T1-6 native AG Grid pagination

- Add sortBy/sortOrder state wired to useListFiles (T1-4)
- Map AG Grid colId to backend sort field names (size->file_size, etc.)
- onSortChanged resets to page 1 on sort change via paginationGoToFirstPage()
- Restore AG Grid native pagination UI with pageSize:10000 (T1-6)
- T1-2: le=100 backend cap already removed from files.py

* v2 API Migration

Switched to composite aggregation pagination under v2

* Update page.tsx

* fix: remove page_size cap and fetch all files to fix Knowledge table pagination past 100 files

* T1-1 to T1-3 deliverable

- file size sort, added check for file_size and chunk_count
-10k limit -> 500 file limit
-changed hardcoded page size to be controlled by React State; removed client side pagination from AG Grid and wired up custom UI mimicing AG Grid UI

* feat: T1-4 server-side sort + T1-6 native AG Grid pagination

- Add sortBy/sortOrder state wired to useListFiles (T1-4)
- Map AG Grid colId to backend sort field names (size->file_size, etc.)
- onSortChanged resets to page 1 on sort change via paginationGoToFirstPage()
- Restore AG Grid native pagination UI with pageSize:10000 (T1-6)
- T1-2: le=100 backend cap already removed from files.py

* v2 API Migration

Switched to composite aggregation pagination under v2

* Address review feedback: log _get_file_count failures, restore search pagination, mark total as approximate

* Git merge fix issues

* fix git HEAD

* v2 files: add approximate counts & cursor parse

Frontend: switch to /api/v2/files, include is_approximate in ListFilesResponse, and disable pagination buttons; removed a debug console.log. Backend API: add _parse_after_key helper to validate JSON-encoded after_key and return 400 for invalid values; use FastAPI Query pattern parameter. FileServiceV2: add embedding_model to composite sort fields, make _get_file_count return (count, is_approximate) and log on failure, use raw bucket count to detect final page, and propagate is_approximate in responses so the UI can display approximate totals.

* Refactored component

-moved custom footer into its own component

* fix merge issues

* PR Fixes

-changed styling to match Tailwind
- footer is now always active, showing regardless of servertotal or wildcardquery
-global sort fix

* Fix search pagination: route all data through useListFiles, restore search_files page_size cap, reset page on search change

* Update page.tsx

* update page.tsx

* style: ruff autofix (auto)

* Lint backend fix

* Fix: remove exception detail from error responses to prevent information exposure (git advanced security fix)

---------

Co-authored-by: Visvesh Jegadheesh <visveshjega@ibm.com>
Co-authored-by: Mike Fortman <mfortman11@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Fix: missing_bucket for composite agg, is_approximate consistency, page guard, search_files page_size cap

* style: ruff autofix (auto)

* fixes: PR fixes

-Improved exception handling by chaining the original error.
-Refactored FileServiceV2 to use dependency injection instead of creating it in routes
-Optimized cursor cache initialization with lazy Map creation
-Fixed infinite re-render caused by search reset effect

* Update page.tsx

---------

Co-authored-by: Visvesh Jegadheesh <visveshjega@ibm.com>
Co-authored-by: Mike Fortman <mfortman11@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) frontend 🟨 Issues related to the UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants