Merge pull request #2013 from danielaskdd/fix-file-order

fix(webui): resolve document status grouping issue in DocumentManager
This commit is contained in:
Daniel.y 2025-08-26 23:57:21 +08:00 committed by GitHub
commit c975263fbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 105 additions and 95 deletions

View file

@ -1 +1 @@
__api_version__ = "0207"
__api_version__ = "0208"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
import{j as o,Y as td,O as fg,k as dg,u as ad,Z as mg,c as hg,l as gg,g as pg,S as yg,T as vg,n as bg,m as nd,o as Sg,p as Tg,$ as ud,a0 as id,a1 as cd,a2 as xg}from"./ui-vendor-CeCm8EER.js";import{d as Ag,h as Dg,r as E,u as sd,H as Ng,i as Eg,j as kf}from"./react-vendor-DEwriMA6.js";import{N as we,c as Ve,ad as od,u as Bl,M as sl,ae as rd,af as fd,I as us,B as Cn,D as Mg,l as zg,m as Cg,n as Og,o as _g,ag as Rg,ah as jg,ai as Ug,aj as Hg,ak as ql,al as dd,am as ss,an as is,a0 as Lg,a1 as qg,a2 as Bg,a3 as Gg,ao as Yg,ap as Xg,aq as md,ar as wg,as as hd,at as Vg,au as gd,d as Qg,R as Kg,V as Zg,g as En,av as kg,aw as Jg,ax as Fg}from"./feature-graph-C6IuADHZ.js";import{S as Jf,a as Ff,b as Pf,c as $f,e as rt,D as Pg}from"./feature-documents-Di_Wt0BY.js";import{R as $g}from"./feature-retrieval-DVuOAaIQ.js";import{i as cs}from"./utils-vendor-BysuhMZA.js";import"./graph-vendor-B-X5JegA.js";import"./mermaid-vendor-CAxUo7Zk.js";import"./markdown-vendor-DmIvJdn7.js";(function(){const y=document.createElement("link").relList;if(y&&y.supports&&y.supports("modulepreload"))return;for(const N of document.querySelectorAll('link[rel="modulepreload"]'))d(N);new MutationObserver(N=>{for(const _ of N)if(_.type==="childList")for(const H of _.addedNodes)H.tagName==="LINK"&&H.rel==="modulepreload"&&d(H)}).observe(document,{childList:!0,subtree:!0});function x(N){const _={};return N.integrity&&(_.integrity=N.integrity),N.referrerPolicy&&(_.referrerPolicy=N.referrerPolicy),N.crossOrigin==="use-credentials"?_.credentials="include":N.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function d(N){if(N.ep)return;N.ep=!0;const _=x(N);fetch(N.href,_)}})();var ts={exports:{}},Mn={},as={exports:{}},ns={};/**
import{j as o,Y as td,O as fg,k as dg,u as ad,Z as mg,c as hg,l as gg,g as pg,S as yg,T as vg,n as bg,m as nd,o as Sg,p as Tg,$ as ud,a0 as id,a1 as cd,a2 as xg}from"./ui-vendor-CeCm8EER.js";import{d as Ag,h as Dg,r as E,u as sd,H as Ng,i as Eg,j as kf}from"./react-vendor-DEwriMA6.js";import{N as we,c as Ve,ad as od,u as Bl,M as sl,ae as rd,af as fd,I as us,B as Cn,D as Mg,l as zg,m as Cg,n as Og,o as _g,ag as Rg,ah as jg,ai as Ug,aj as Hg,ak as ql,al as dd,am as ss,an as is,a0 as Lg,a1 as qg,a2 as Bg,a3 as Gg,ao as Yg,ap as Xg,aq as md,ar as wg,as as hd,at as Vg,au as gd,d as Qg,R as Kg,V as Zg,g as En,av as kg,aw as Jg,ax as Fg}from"./feature-graph-C6IuADHZ.js";import{S as Jf,a as Ff,b as Pf,c as $f,e as rt,D as Pg}from"./feature-documents-DLarjU2a.js";import{R as $g}from"./feature-retrieval-P5Qspbob.js";import{i as cs}from"./utils-vendor-BysuhMZA.js";import"./graph-vendor-B-X5JegA.js";import"./mermaid-vendor-CAxUo7Zk.js";import"./markdown-vendor-DmIvJdn7.js";(function(){const y=document.createElement("link").relList;if(y&&y.supports&&y.supports("modulepreload"))return;for(const N of document.querySelectorAll('link[rel="modulepreload"]'))d(N);new MutationObserver(N=>{for(const _ of N)if(_.type==="childList")for(const H of _.addedNodes)H.tagName==="LINK"&&H.rel==="modulepreload"&&d(H)}).observe(document,{childList:!0,subtree:!0});function x(N){const _={};return N.integrity&&(_.integrity=N.integrity),N.referrerPolicy&&(_.referrerPolicy=N.referrerPolicy),N.crossOrigin==="use-credentials"?_.credentials="include":N.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function d(N){if(N.ep)return;N.ep=!0;const _=x(N);fetch(N.href,_)}})();var ts={exports:{}},Mn={},as={exports:{}},ns={};/**
* @license React
* scheduler.production.js
*

View file

@ -8,16 +8,16 @@
<link rel="icon" type="image/png" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lightrag</title>
<script type="module" crossorigin src="/webui/assets/index-B8PWUG__.js"></script>
<script type="module" crossorigin src="/webui/assets/index-DI6XUmEl.js"></script>
<link rel="modulepreload" crossorigin href="/webui/assets/react-vendor-DEwriMA6.js">
<link rel="modulepreload" crossorigin href="/webui/assets/ui-vendor-CeCm8EER.js">
<link rel="modulepreload" crossorigin href="/webui/assets/graph-vendor-B-X5JegA.js">
<link rel="modulepreload" crossorigin href="/webui/assets/utils-vendor-BysuhMZA.js">
<link rel="modulepreload" crossorigin href="/webui/assets/feature-graph-C6IuADHZ.js">
<link rel="modulepreload" crossorigin href="/webui/assets/feature-documents-Di_Wt0BY.js">
<link rel="modulepreload" crossorigin href="/webui/assets/feature-documents-DLarjU2a.js">
<link rel="modulepreload" crossorigin href="/webui/assets/mermaid-vendor-CAxUo7Zk.js">
<link rel="modulepreload" crossorigin href="/webui/assets/markdown-vendor-DmIvJdn7.js">
<link rel="modulepreload" crossorigin href="/webui/assets/feature-retrieval-DVuOAaIQ.js">
<link rel="modulepreload" crossorigin href="/webui/assets/feature-retrieval-P5Qspbob.js">
<link rel="stylesheet" crossorigin href="/webui/assets/feature-graph-BipNuM18.css">
<link rel="stylesheet" crossorigin href="/webui/assets/index-CafJWW1u.css">
</head>

View file

@ -183,7 +183,7 @@ export default function DocumentManager() {
const setDocumentsPageSize = useSettingsStore.use.setDocumentsPageSize()
// New pagination state
const [, setCurrentPageDocs] = useState<DocStatusResponse[]>([])
const [currentPageDocs, setCurrentPageDocs] = useState<DocStatusResponse[]>([])
const [pagination, setPagination] = useState<PaginationInfo>({
page: 1,
page_size: documentsPageSize,
@ -292,6 +292,16 @@ export default function DocumentManager() {
type DocStatusWithStatus = DocStatusResponse & { status: DocStatus };
const filteredAndSortedDocs = useMemo(() => {
// Use currentPageDocs directly if available (from paginated API)
// This preserves the backend's sort order and prevents status grouping
if (currentPageDocs && currentPageDocs.length > 0) {
return currentPageDocs.map(doc => ({
...doc,
status: doc.status as DocStatus
})) as DocStatusWithStatus[];
}
// Fallback to legacy docs structure for backward compatibility
if (!docs) return null;
// Create a flat array of documents with status information
@ -324,7 +334,7 @@ export default function DocumentManager() {
}
return allDocuments;
}, [docs, sortField, sortDirection, statusFilter, sortDocuments]);
}, [currentPageDocs, docs, sortField, sortDirection, statusFilter, sortDocuments]);
// Calculate current page selection state (after filteredAndSortedDocs is defined)
const currentPageDocIds = useMemo(() => {