Skip to content

fix(bots): virtualize chat history and load older messages - #961

Merged
nixuuu merged 1 commit into
devfrom
fix/bot-message-history-loading
Nov 18, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/bot-message-history-loading

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 18, 2026

Copy link
Copy Markdown
Member

Changes

  • Scope cached and live history to the selected bot or exchange. Switching from a long chat to a shorter one opens the latest messages immediately.
  • Render both bot chat views with the same virtual feed as threads. Approaching the oldest loaded message fetches up to 50 more messages and keeps the visible row anchored. A failed fetch offers a retry.
  • Resolve citations to virtual rows and preserve in-progress approval edits and free-text answers across row unmounts.
  • Make Home and End jump directly to the destination while the scroll area has focus. Rapid alternation can otherwise paint an empty window while Chromium animates across unmounted rows.

Verification

  • Rebased on current dev. Scoped web typecheck, lint, formatting and diff checks passed.
  • bun run check:tmp passed all 13 tests in bot-chat-history.test.ts, history-pages.test.ts and thread-scroll.test.ts.
  • Ran the web app with an isolated gateway and PostgreSQL in Chromium at 1280 px and 390 px in light and dark mode. Checked cold and warm switches, six automatically loaded pages, scroll anchoring, retry, exchange history, citation reveal and draft retention.
  • Built and ran Canopy Desktop in local mode on Linux using Electron 45.2.1. With 1,250 messages in the long chat, 37 of 351 loaded rows were mounted after six pages. Verified switching to a 14-message chat, returning to the latest message and resuming the saved history after restart.
  • Recorded rapid wheel scrolling, reversals and alternating Home and End in the Linux app. After the keyboard fix, none of 361 captured frames showed a blank message area. Packaged macOS verification remains open.
  • Repository-wide checks and CI builds remain with GitHub Actions.

Copy audit

Passed the checklist in docs/copy.md. Removed “Show earlier messages” because scrolling now loads the next page. Kept “Loading earlier messages…” as the progress announcement. Changed “Could not load earlier messages. Try again.” to the status “Could not load earlier messages.” with a separate “Try again” action. Reused “Jump to latest” from threads. Checked text, wrapping and truncation with short through long bot names at both widths.

Fixes: #289

Scope bot history to the selected conversation and use the shared virtual feed to fetch older pages while scrolling. Jump directly to the history boundaries on Home and End.

Fixes: #289
@nixuuu
nixuuu enabled auto-merge (squash) November 18, 2026 12:09
@nixuuu
nixuuu merged commit 1c7ff46 into dev Nov 18, 2026
15 checks passed
@nixuuu
nixuuu deleted the fix/bot-message-history-loading branch November 18, 2026 12:17
nixuuu added a commit that referenced this pull request Nov 27, 2026
## Changes

- The feed's top fade (under the header) and bottom fade (above the
composer) always used the thread surface colour. A bot chat sits on the
canvas, so in the dark theme both showed as lighter bands (`#20211c`
over `#171914`).
- `VirtualFeed` now takes the fade colour from `--feed-backdrop`,
falling back to the surface. Threads are unchanged.
- `ChatView` paints `bg-canvas` itself and sets `--feed-backdrop` to the
canvas, so the fades match the chat wherever it is mounted (the bot
page, the `/dev/bots` gallery frame).

Fixes: #961

## Verification

- Ran the web app against an isolated gateway and PostgreSQL in
Chromium. Checked the `/dev/bots` chat in light and dark mode with rows
scrolled under both fades: the fades now blend into the chat background.
Forcing the old colour reproduced the reported bands.
- `/dev/long-thread`: the feed fade still resolves to the surface
colour.
- oxlint and oxfmt on the two edited files. Everything else is left to
CI.
- No UI text changed, so no copy audit.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

1 participant