Skip to content

feat: Discord Channels 页面渐进式加载#130

Merged
Keith-CY merged 2 commits intofeat/recipe-import-libraryfrom
feat/discord-channels-progressive-ui
Mar 16, 2026
Merged

feat: Discord Channels 页面渐进式加载#130
Keith-CY merged 2 commits intofeat/recipe-import-libraryfrom
feat/discord-channels-progressive-ui

Conversation

@dev01lay2
Copy link
Collaborator

@dev01lay2 dev01lay2 commented Mar 16, 2026

概述

优化 Channels 页面 Discord 区域的加载体验。

改动前

进入 Channels 页 → Loading Discord... 等待 2-5s → 数据一次性出现

改动后

阶段 时机 用户看到
Stage 0 无缓存 保持现有 Loading 提示
Stage 1 <50ms guild/channel 列表骨架,未解析名称显示 mono ID + ⟳ spinner
Stage 2 2-5s 名称全部补全,spinner 消失

改动文件

src/pages/Channels.tsx (+27/-3)

  • Guild 名称:名称 = ID 且未 resolved 时显示 spinner
  • Channel 名称:名称 = ID 且未 resolved 时显示 mono 字体 ID + spinner
  • Agent 下拉列表:从 readPersistedReadCache("listAgents") 初始化,无需等待 getChannelsRuntimeSnapshot
  • 使用 discordChannelsResolved from InstanceContext

docs/plans/discord-channels-progressive-loading.md — 设计文档

依赖(已在 base 分支实现)

  • list_discord_guild_channels_fast 后端命令
  • refreshDiscordChannelsCacheFast (App.tsx)
  • discordChannelsResolved (InstanceContext)

基于 feat/recipe-import-library (PR #118)

- Guild names show spinner when name equals ID and full data pending
- Channel names show mono ID + spinner when unresolved, normal text once resolved
- Agent dropdown initializes from persisted cache for instant population
- Uses discordChannelsResolved from InstanceContext (set by App.tsx fast/full loading)
@dev01lay2 dev01lay2 changed the title plan: Discord Channels 页面渐进式加载 feat: Discord Channels 页面渐进式加载 Mar 16, 2026
Copy link
Collaborator

@Keith-CY Keith-CY left a comment

Choose a reason for hiding this comment

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

Reviewed PR #130. Changes are clean and align with existing progressive-loading flow. No blocking issues found; loading/agent cache fallback behavior looks correct. Typecheck/tests pass locally (, 🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙).

@Keith-CY Keith-CY merged commit ea420df into feat/recipe-import-library Mar 16, 2026
1 check passed
@Keith-CY Keith-CY deleted the feat/discord-channels-progressive-ui branch March 16, 2026 16:40
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