Skip to content

plan: Discord Channels 页面渐进式加载#129

Closed
dev01lay2 wants to merge 1 commit intodevelopfrom
plan/discord-channels-progressive-loading
Closed

plan: Discord Channels 页面渐进式加载#129
dev01lay2 wants to merge 1 commit intodevelopfrom
plan/discord-channels-progressive-loading

Conversation

@dev01lay2
Copy link
Collaborator

概述

优化 Channels 页面 Discord 区域的加载体验。当前用户进入页面后看到 Loading Discord... 等待 2-5s,优化后:

Stage 0 (无缓存) → 保持现有 Loading 提示
Stage 1 (<50ms) → 立刻展示 guild/channel 列表骨架,未解析的名称显示 ID + ⟳ spinner
Stage 2 (2-5s) → Discord REST 数据到达,补全所有名称,spinner 消失

关键改动

  1. Backend: 新增 list_discord_guild_channels_fast — 仅解析 config + 磁盘缓存,不调 Discord REST / CLI
  2. Frontend: App.tsx 进入 channels 路由时并发触发 fast + full 两条加载路径
  3. UI: Channels.tsx guild/channel 卡片对未解析名称显示 mono ID + Loader2 spinner

依赖

建议等 PR #118 (feat/recipe-import-library) 合入后实施,_fast 后端 + discordChannelsResolved context 已在该分支实现。

此 PR 仅包含计划文档,无代码改动,供 review 讨论方案。

详见 docs/plans/discord-channels-progressive-loading.md

Structured plan for optimizing the Discord section of the Channels page.
Current behavior shows 'Loading Discord...' for 2-5s while the backend
serially calls Discord REST + CLI. The plan proposes a 3-stage approach:

Stage 0: No cache → existing 'Loading' message (unchanged)
Stage 1: Fast config-parse data (<50ms) → show guild/channel IDs with spinners
Stage 2: Full Discord REST data (2-5s) → resolve all names, remove spinners

No code changes in this commit — plan only for review.
@github-actions
Copy link
Contributor

📊 Test Coverage Report

Metric Base (develop) PR (plan/discord-channels-progressive-loading) Delta
Lines 74.34% (6134/8251) 74.43% (6141/8251) 🟢 +0.09%
Functions 68.88% (704/1022) 68.88% (704/1022) ⚪ ±0.00%
Regions 75.86% (10156/13388) 75.96% (10169/13388) 🟢 +0.10%

Coverage measured by cargo llvm-cov (clawpal-core + clawpal-cli).

@dev01lay2
Copy link
Collaborator Author

改为基于 feat/recipe-import-library 分支开新 PR,复用已有的 _fast 后端实现。

@dev01lay2 dev01lay2 closed this Mar 16, 2026
@github-actions
Copy link
Contributor

📦 PR Build Artifacts

Platform Download Size
Windows-x64 📥 clawpal-Windows-x64 16.3 MB
Linux-x64 📥 clawpal-Linux-x64 103.8 MB
macOS-x64 📥 clawpal-macOS-x64 13.3 MB
macOS-ARM64 📥 clawpal-macOS-ARM64 12.6 MB

🔨 Built from 17184be · View workflow run
⚠️ Unsigned development builds — for testing only

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