Skip to content

fix(ui): dashboard/sharings no longer fall back to mock data when logged in (v1.21.2) - #93

Merged
argszero merged 1 commit into
mainfrom
feat/fix-dashboard-shares
Aug 19, 2026
Merged

argszero merged 1 commit into
mainfrom
feat/fix-dashboard-shares

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Fix host-reported bug (rant 2026-08-19T15:48:17): after login on a clean DB (0 listed keys), the dashboard "我的共享" section showed D.SHARINGS mock rows (GLM Coding Plan / deepseek-v4-flash) because loadDashboard() never fetched /api/sharings, so Live.sharings stayed null and renderDashboard() silently fell back to mock.

Changes:

  • loadDashboard(): fetch /api/sharings (failure -> Live.sharings = null)
  • renderDashboard(): logged-in + real data -> real rows; logged-in + empty ([]) -> empty state "还没有上架的 key"; logged-in + fetch failure -> loadErrorHtml empty state + retry button; mock (D.SHARINGS) kept for guest mode only
  • renderSharing(): same degradation principle (logged-in-only view, same Live.sharings ? … : D.SHARINGS pattern)
  • bindLiveRetry() wired once at startup for #dash-sharings / #share-body
  • ui/README.md: v1.21.2 convention section documenting the data source + degradation rule

Related Issue

Host rant 2026-08-19T15:48:17 (dashboard 我的共享 shows mock data) — no GitHub issue number.

Changes

  • 功能/修复说明
  • 涉及配置/数据结构的改动已同步示例文件 (none — UI only)

Tests

  • cargo test 全部通过 (111/111)
  • cargo fmt --check 通过
  • cargo clippy --all-targets -- -D warnings 通过
  • node --check on modified JS files
  • Node smoke test (DOM/fetch stubs, real code): 10/10 — guest keeps mock; logged-in empty -> empty state; logged-in failure -> retry button; retry recovers with real rows; sharing page same degradation

Checklist

  • 分支命名符合约定 (feat/fix-dashboard-shares per rant)
  • Commit message 使用 Conventional Commits 格式
  • 单一职责,改动最小化

…ged in (v1.21.2)

Host feedback (rant 2026-08-19T15:48:17): dashboard '我的共享' showed
D.SHARINGS mock rows (GLM Coding Plan / deepseek-v4-flash) for logged-in
users on a clean DB because loadDashboard() never fetched /api/sharings.

- loadDashboard(): fetch /api/sharings (failure -> Live.sharings = null)
- renderDashboard(): logged-in + no data -> empty state ('还没有上架的
  key'); logged-in + fetch failure -> loadErrorHtml empty state + retry
  button; mock (D.SHARINGS) kept for guest mode only
- renderSharing(): same degradation principle (logged-in-only view)
- bindLiveRetry() wired once at startup for #dash-sharings / #share-body
- ui/README.md: v1.21.2 convention section (data source + degradation)
@argszero
argszero merged commit 624dfba into main Aug 19, 2026
1 check passed
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