Skip to content

feat: 聊天历史加载动画支持#578

Merged
pancacake merged 1 commit into
HKUDS:devfrom
emmett001:feat/session-loading-overlay
Jun 23, 2026
Merged

feat: 聊天历史加载动画支持#578
pancacake merged 1 commit into
HKUDS:devfrom
emmett001:feat/session-loading-overlay

Conversation

@emmett001

Copy link
Copy Markdown
Contributor

概述

从聊天历史点击对话时,添加加载过渡页,避免白屏等待。

改动

文件 说明
web/components/chat/home/SessionLoadingView.tsx 新建 加载界面组件
web/app/(workspace)/home/[[...sessionId]]/page.tsx 集成加载状态管理和覆盖层渲染
web/context/UnifiedChatContext.tsx loadSession 增加 AbortSignal 参数
web/lib/session-api.ts getSession 增加 AbortSignal 参数
web/locales/en/app.json 新增英文字段
web/locales/zh/app.json 新增中文字段

功能

  • 模拟进度条(渐近逼近99%,永不停止),实时百分比显示
  • 8 秒后显示 "仍在加载中…"
  • 右上角 ✕ 取消按钮
  • API 完成后跳转 100%,400ms 淡出进入对话
  • 兼容 React Strict Mode 双挂载
  • 不设加载时长上限

Screenshots

加载中

🤖 Generated with Claude Code

从聊天历史打开对话时添加加载过渡页:
- 模拟进度条(渐近99%,永久不停止,不设超时)
- 实时百分比显示
- 8秒后显示"仍在加载中…"提示
- 叉叉取消按钮(右上角)
- API 完成后跳转100%,400ms后淡出进入对话
- getSession / loadSession 支持 AbortSignal
- React Strict Mode 双挂载兼容

Co-Authored-By: Claude <[email protected]>
@pancacake
pancacake changed the base branch from main to dev June 23, 2026 13:04
pancacake added a commit that referenced this pull request Jun 23, 2026
Rework of the #578 loading overlay:
- Replace the simulated rAF percentage bar (which climbed to a fake 99%
  over ~24s, unrelated to real load progress) with an honest indeterminate
  spinner + 'Loading conversation…' message and an 8s 'Still loading…' hint.
- Collapse the null/loading/complete state machine to a single boolean and
  drop the artificial 400ms completion delay, so the conversation appears
  the moment the fetch resolves.
- Fix a stray ')' in the cancel button's className that voided its hover
  color, and remove the now-redundant width-transition/rAF conflict.
- Drop the dead 'server is taking too long' locale key (no timeout path
  uses it).

The AbortSignal plumbing (getSession/loadSession + cancel button) and the
Strict-Mode-safe initial-load ref are kept as-is.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@pancacake
pancacake merged commit 37283e9 into HKUDS:dev Jun 23, 2026
@pancacake

Copy link
Copy Markdown
Collaborator

Merged into dev with a rework: the simulated percentage progress bar (which climbed to a fake 99% over ~24s, unrelated to the real fetch) is replaced with an honest indeterminate spinner + "Loading conversation…"; the loading state machine is collapsed to a single boolean (no artificial 400ms completion delay); a stray ) in the cancel-button className that voided its hover color is fixed; and the unused "server is taking too long" locale key is removed. Your AbortSignal plumbing (getSession/loadSession + cancel button) and the Strict-Mode-safe initial-load ref are kept as-is — thanks for those! Also retargeted base main → dev (feature branch).

vaskoyudha added a commit to vaskoyudha/deeptutor-for-programmer-fork that referenced this pull request Jul 25, 2026
feat: loading overlay for chat-history navigation

Shows a clear loading indicator (with cancel) while a session is fetched
from chat history, replacing the misleading welcome-screen flash. Threads
an AbortSignal through getSession/loadSession so the load is cancelable.
Followed by a rework that swaps the simulated progress bar for an honest
indeterminate spinner and drops the artificial completion delay.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
vaskoyudha added a commit to vaskoyudha/deeptutor-for-programmer-fork that referenced this pull request Jul 25, 2026
Rework of the HKUDS#578 loading overlay:
- Replace the simulated rAF percentage bar (which climbed to a fake 99%
  over ~24s, unrelated to real load progress) with an honest indeterminate
  spinner + 'Loading conversation…' message and an 8s 'Still loading…' hint.
- Collapse the null/loading/complete state machine to a single boolean and
  drop the artificial 400ms completion delay, so the conversation appears
  the moment the fetch resolves.
- Fix a stray ')' in the cancel button's className that voided its hover
  color, and remove the now-redundant width-transition/rAF conflict.
- Drop the dead 'server is taking too long' locale key (no timeout path
  uses it).

The AbortSignal plumbing (getSession/loadSession + cancel button) and the
Strict-Mode-safe initial-load ref are kept as-is.

Co-Authored-By: Claude Opus 4.8 (1M context) <[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.

2 participants