4 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
d02fb9850b pre-releas 2026-10-28 21:21:34 +08:00
Bingxi Zhao (Frank)
7cc213f24d fix(chat): end a stuck session load in a retryable state
#923 fixed the blank transcript in #912 — an orphaned message tree. The
same report's other screenshot is a different failure that survived it: the
overlay stuck on "Loading conversation / Still loading…" with the request
already answered in devtools.

Two paths led there, and both told the user their history was gone:

* The wait was unbounded ("the overlay stays until the API responds (no
  timeout)"). A fetch that never settled span forever, and the only exit was
  ✕ — which abandons the conversation. The wait is now bounded, and the 8s
  hint is no longer the last thing that ever happens.
* A cold open that *failed* ran router.replace("/home"), dropping the
  session id from the URL. A transient error was indistinguishable from a
  lost conversation, and the id needed to retry was gone.

Both now end in one terminal, retryable state with the id still in the URL:
the overlay shows the failure and a Retry, ✕ still means "leave". A failed
background revalidate is unchanged — the cached transcript stays on screen
rather than being replaced by an error.

Which of the three aborts counts as a failure is the whole subtlety (a
newer load and the user's ✕ own the state that replaces this one; a timeout
owns nothing), so that decision lives in a tested predicate rather than
inline in the component.
2026-08-20 00:56:34 +08:00
Bingxi Zhao (Frank)
98805b46db refactor(chat): honest indeterminate session-loading overlay
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) <noreply@anthropic.com>
2026-06-23 21:04:33 +08:00
LunaireReverie
ce188919d9 feat: 聊天历史加载动画支持
从聊天历史打开对话时添加加载过渡页:
- 模拟进度条(渐近99%,永久不停止,不设超时)
- 实时百分比显示
- 8秒后显示"仍在加载中…"提示
- 叉叉取消按钮(右上角)
- API 完成后跳转100%,400ms后淡出进入对话
- getSession / loadSession 支持 AbortSignal
- React Strict Mode 双挂载兼容

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-20 22:36:53 +08:00