Skip to content

Make older chat conversations reachable through existing pagination - #855

Merged
WaylandYang merged 1 commit into
deeplethe:devfrom
Maya-Kid:fix/chat-conversation-pagination
Sep 23, 2026
Merged

WaylandYang merged 1 commit into
deeplethe:devfrom
Maya-Kid:fix/chat-conversation-pagination

Conversation

@Maya-Kid

@Maya-Kid Maya-Kid commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Review follow-up (2026-09-23)

Current head: 08728f53fe469292a6dfb78fabd974cd755df272. Comment-only follow-up to #854 review: document the new-conversation route/ownership/live-entry handoff, correct the old early-return comment, and provide a complete optional Playwright installation and browser-test invocation at the top of chat-view.test.mjs. These browser probes are explicitly separate from Vitest and CI; no new CI scope is introduced. The changes are carried through the #854 → #856 → #855 stack.

The documented command passed on #854 (11 subtests, 12 including the parent); the final stack passed all 27 browser subtests (29 including parents). Runtime code and assertions are unchanged. Prior validation below refers to its stated historical heads.


Post-merge synchronization (2026-09-22)

Rebased onto dev@7cfeedfeb11c3a1c42d5091c5941a51afaaeb161 after #848, #851, #849, #850 and #852 merged. Current head: a6737587017c740a172dd2fba21bf9d55ab5d497.

The UI dependency order remains #854 → #856 → #855. Retained upstream stream-interruption strings alongside the history/pagination keys when resolving i18n conflicts. The complete UI tree is byte-for-byte identical to the previous validated integration tree. Maintainer visual review remains outstanding.

Validation on combined tree d06f4ad0199a382635a6bbf94210b9421cbeba66 (675 tracked Linux inputs hash-matched):

Earlier evidence below refers to its stated historical heads.


The conversation rail only requests the first 30 records even though the existing list endpoint already provides limit, offset and total. Older conversations remain available by URL or search, but cannot be reached by browsing the rail.

Use the existing infinite-query support to load bounded 30-record pages, scoped by knowledge base and search term. Keep loaded rows on next-page failure and retry the same offset. Deduplicate by conversation ID, and let list invalidation refetch the loaded page range when updated conversations change the ordering. No API, database schema or dependency changes are introduced.

Validation on dev@ea0557b, fix 9ed91f7:

  • The 65-conversation browser regression fails on the original Chat component because there is no way to request the next page.
  • All 11 real-component browser subtests pass: 65 records; 0/30/31/60 boundaries; failure/retry; stale pages after search or KB changes; duplicate IDs with identical titles; multi-page search; and refetching loaded pages after reordering. These tests use controlled HTTP responses with the real router/query client/Chat component.
  • Frontend 116 module tests and build/typecheck/guard pass.
  • Chrome against the actual Linux server and PostgreSQL browsed 65 synthetic persisted conversations through the real list API and reached all 65.
  • Separately, integration tree f7bcd0878bf490d6efb122b71d6f13d379df4709 with Hand off exhausted tool runs to an evidence-only final answer #845 and the other scoped Chat fixes passes Rust fmt, strict workspace Clippy, 1,013 tests (one pre-existing external-HTTPS RSS test ignored), workspace build, 129 frontend module tests, 27 browser subtests and frontend build.

The browser test uses optional Playwright/Chromium, matching the existing browser-test pattern. Run node --test tests/chat-pagination.test.mjs from web; CHAT_PLAYWRIGHT_PATH and CHAT_CHROMIUM_PATH may specify local installations.

Offset pagination still does not provide a snapshot across concurrent updates. Deduplication prevents repeated rows; a later invalidation refreshes the loaded range. This patch does not claim stable traversal under arbitrary concurrent writes.

@Maya-Kid
Maya-Kid force-pushed the fix/chat-conversation-pagination branch from 9ed91f7 to 607d0af Compare September 21, 2026 09:28
@WaylandYang

Copy link
Copy Markdown
Contributor

Merge-order note for the three Chat view PRs, from trial merges onto 79caca04:

OK        #854
CONFLICT  #855   web/src/pages/Chat.tsx  web/src/i18n/en.ts  web/src/i18n/zh.ts
OK        #856   (clean on top of #854, as its stated dependency implies)

So the order is #854, then #856, then this one, and this is the one that needs the rebase. Nothing surprising — all three edit Chat.tsx and add adjacent i18n keys.

Two notes while I am here:

  • web/tests/ is an existing location (rss-default.test.mjs is already on dev), so the .test.mjs files land where they belong. No concern there.
  • These three change what a person sees, so per the convention in this repository they wait for a maintainer to look at the running interface before merging, separately from CI being green. I have flagged them for that.

@Maya-Kid

Copy link
Copy Markdown
Contributor Author

Completed the requested branch alignment: #854 → #856 → #855. Pagination is now replayed on #856 at d01cc796b9ad2e3911fd56cb8133763c2b121b8c, with the import/i18n conflicts resolved. All three contain current dev 474b904; the PR description now states the stacked dependency explicitly.

The stack passes 116 frontend module tests, 27 browser subtests and build/typecheck/guard. The combined tree also passes the actual Linux/PostgreSQL 65-conversation pagination scenario and the other four backend/browser scenarios. This does not replace your requested visual review. Full verification and historical evidence are in the updated descriptions.

@Maya-Kid

Copy link
Copy Markdown
Contributor Author

Completed the post-merge synchronization of the remaining UI stack onto dev@7cfeedf, preserving the requested #854 → #856 → #855 order. Current heads: #854 bd11c1d9ea61f5015d55ed8bc0f656c1bb2e2717, #856 ba964f3aaa94ae514f9e585c04329f642708299d, #855 a6737587017c740a172dd2fba21bf9d55ab5d497. The i18n conflict resolution retains the merged stream-interruption strings together with the history/pagination strings.

The complete UI tree is identical to the previously validated integration tree. Revalidation passes 129 frontend module tests, 27 browser subtests (29 including parent tests), typecheck/guard/build. Updated all three descriptions; maintainer visual review remains separate and outstanding.

@Maya-Kid
Maya-Kid force-pushed the fix/chat-conversation-pagination branch from a673758 to 08728f5 Compare September 23, 2026 05:40
WaylandYang
WaylandYang previously approved these changes Sep 23, 2026

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed as the top of the stack, so only the +564 on top of #856: the sidebar moves
to useInfiniteQuery over the existing limit/offset list endpoint (the server
already returns total; api.ts already typed it), dedupes by id, and adds a "load
earlier" control with an error/retry state. The query key gains convSearch and is
gated on kb?.id === kbId like the rest of the page after #854, and invalidateList's
prefix key still matches, so a rename or delete refetches the loaded page range
rather than appending a stale offset.

One property worth writing down where the dedupe comment is: offset pagination can
skip as well as duplicate. If a conversation moves to the top between two page
fetches (a new message in an old thread), everything below it shifts by one and the
item at the old boundary is never fetched. Dedupe handles the duplicate; only the
invalidation-driven refetch heals the skip, and only after something invalidates. For
a sidebar that is acceptable, and the fix (keyset on updated_at, id) is a server
change, not this PR's, but the comment currently reads as if dedupe covers both.

Three new i18n keys in both packs. The 530 test lines are on-demand browser probes,
not CI, as with the rest of the stack. LGTM; merge after #856.

Signed-off-by: dada-yan <BinjunYann@gmail.com>
@WaylandYang

Copy link
Copy Markdown
Contributor

Rebased onto dev as a maintainer edit, same as #856: #854 and #856 landed as squashes (9fa75e4, 315f46c), so the four earlier stack commits here conflicted with their own squashed copies. The branch is now exactly your pagination commit (08728f5 → e0e2f01) on current dev; authorship and sign-off unchanged; pnpm guard / typecheck / test (132) / build pass. If you have local work here, git fetch && git reset --hard origin/fix/chat-conversation-pagination first.

@WaylandYang
WaylandYang force-pushed the fix/chat-conversation-pagination branch from 08728f5 to e0e2f01 Compare September 23, 2026 18:50
@WaylandYang
WaylandYang merged commit 6f98ba6 into deeplethe:dev Sep 23, 2026
7 checks passed
@WaylandYang WaylandYang mentioned this pull request Sep 25, 2026
@Maya-Kid
Maya-Kid deleted the fix/chat-conversation-pagination branch September 26, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants