Repository navigation
fix(ui): dashboard/sharings no longer fall back to mock data when logged in (v1.21.2) - #93
Merged
Merged
Conversation
…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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, soLive.sharingsstayed null andrenderDashboard()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 ->loadErrorHtmlempty state + retry button; mock (D.SHARINGS) kept for guest mode onlyrenderSharing(): same degradation principle (logged-in-only view, sameLive.sharings ? … : D.SHARINGSpattern)bindLiveRetry()wired once at startup for#dash-sharings/#share-bodyui/README.md: v1.21.2 convention section documenting the data source + degradation ruleRelated Issue
Host rant 2026-08-19T15:48:17 (dashboard 我的共享 shows mock data) — no GitHub issue number.
Changes
Tests
cargo test全部通过 (111/111)cargo fmt --check通过cargo clippy --all-targets -- -D warnings通过node --checkon modified JS filesChecklist